[Gambas-user] About the origin of Stock Icons

Jorge Carrión shordi at gmail.com
Mon Feb 20 18:11:11 CET 2023


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 ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230220/d0b52e5c/attachment.htm>


More information about the User mailing list