[Gambas-user] About the origin of Stock Icons

Fabien Bodard gambas.fr at gmail.com
Mon Feb 20 18:19:58 CET 2023


The other way :

Store the pictures in an array of picture
private  $aPicture as new picture[]
private $aNames as new string[]
for each s...

  $aPicture.Add(...)
  $aNames.Add(s)
next

then fill the listview with the array

for i = 0 to $aPicture.max

  listview.add( $aNames[i], $aNames[i], $apicture[i])


next

to get the item from the picture ?

$aNames[$aPicture.Find(ListView1.Item.Picture)]


Well it is not really useful :)
synonym of
ListView1.Item.Key



Le lun. 20 févr. 2023 à 18:12, Jorge Carrión <shordi at gmail.com> a écrit :

> Yes, I (sadly) know that. I've been traying compare the control's picture
> (or the image inside or the Data pointer inside de image) of the control
> with the all the stock's pictures... but the comparison no seem reliable...
>
> El lun, 20 feb 2023 a las 18:07, Fabien Bodard (<gambas.fr at gmail.com>)
> escribió:
>
>>
>>
>> Le lun. 20 févr. 2023 à 17:58, Jorge Carrión <shordi at gmail.com> a écrit :
>>
>>> And I have a question that originates all this problem about icons: Is
>>> it possible to know the name of the icon assigned to a control, say a
>>> Button?
>>> I've tried some ways... but all failed.
>>>
>>
>> No because it's not a string name that is assigned to the control but a
>> 'Link' to a picture object.
>>
>> the name is just used at the form initiation time for loading the picture
>> object... which is next linked to the .picture property
>>
>>
>>
>>
>>
>>>
>>> Best regards
>>>
>>> El lun, 20 feb 2023 a las 17:11, Gianluigi (<gradobag at gradobag.it>)
>>> escribió:
>>>
>>>> Il 20/02/23 14:47, Gianluigi ha scritto:
>>>> > Il 20/02/23 14:44, Gianluigi ha scritto:
>>>> >> Il 20/02/23 14:29, Fabien Bodard ha scritto:
>>>> >>> because Stock["24" &/ sIcon return a null picture ? so a null Image
>>>> >>
>>>> >>
>>>> >> :-D
>>>> >>
>>>> >> I think I have it figured out, at least partially.
>>>> >>
>>>> >> I have deleted the old, messy IconsStockTest project and overwritten
>>>> >> it with a fresh one and the project works even on the dark theme,
>>>> see
>>>> >> attached image.
>>>> >>
>>>> >> So if you change the theme you need to overwrite the project.
>>>> >>
>>>> >> What do you guys think?
>>>> >>
>>>> >> Regards
>>>> >>
>>>> >> Gianluigi
>>>> >>
>>>> >>
>>>> >> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>> >
>>>> > The forgotten image
>>>>
>>>>
>>>> Hi Fabien,
>>>>
>>>> so It Works:
>>>>
>>>> Public Sub Form_Open()
>>>>
>>>>    Dim sIcon As String
>>>>
>>>>    '-- loads system icons if they exist
>>>>    For Each sIcon In Stock.Icons
>>>>      If Application.DarkTheme Then
>>>>        IconView1.Add(sIcon, sIcon, Stock["24" &/
>>>> sIcon].Image.Invert().Picture)
>>>>      Else
>>>>        IconView1.Add(sIcon, sIcon, Stock["24" &/ sIcon])
>>>>      Endif
>>>>    Next
>>>>    ' '-- load only stock icons without mixing them with system icons
>>>> (from a post by Fabien)
>>>>    For Each sIcon In Stock.Icons
>>>>      If Application.DarkTheme Then
>>>>        IconView2.Add(sIcon, sIcon, Stock["24/$(mime)" &/
>>>> sIcon].Image.Invert().Picture)
>>>>      Else
>>>>        IconView2.Add(sIcon, sIcon, Stock["24/$(mime)" &/ sIcon])
>>>>      Endif
>>>>    Next
>>>>
>>>> End
>>>>
>>>> But the result is horrible :-(
>>>>
>>>> Gianluigi
>>>>
>>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>>
>>>
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>
>>
>>
>> --
>> Fabien Bodard
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>


-- 
Fabien Bodard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230220/01585c0a/attachment.htm>


More information about the User mailing list