Search for IconID use
I’ll upvote Henk’s request. I just gave this a spin and it works like a charm.
We have a window we built for our find and replace that displays results, including a preview of the icon, and lets you jump to the code location. I’ll merge that in and put it up on GitHub a bit later today.
Alex
> On Oct 19, 2017, at 10:43, Rudolf Bargholz <rudolf@bargholz.ch> wrote:
>
> Hi Henk,
>
> You can if you want. We don’t use Studio 8.1, so I cannot do this.
>
> Regards
>
> Rudolf
>
> —–Ursprüngliche Nachricht—–
> Von: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Im Auftrag von H.P. Noppe
> Gesendet: Donnerstag, 19. Oktober 2017 08:48
> An: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
> Betreff: Re: Search for IconID use
>
> Hi Rudolf,
>
> Thank you for sharing this little gem. Is it an idea to convert this library to Omnis 8.1, export it to JSON and upload it to an Github repository ?
>
> Grtz Henk
>
>> On 18 Oct 2017, at 18:21, Rudolf Bargholz <rudolf@bargholz.ch> wrote:
>>
>> And just in case someone else asks for the library:
>>
>> www.sugarsync.com/pf/D6405663_06260637_9525892
>>
>> Studio 4.3.2.1 non-unicode lib . Hope the code helps. Won’t win any beauty contests, but it works.
>>
>> Open cTest.
>>
>> 1) GetIconList1 – Returns a list of all libraries, all classes that have iconid objects, the objects themselves, even if they are embedded in other group objects like a tab pane, group box, or paged pane. The code, within limits, finds and returns deeply nested objects.
>> 2) FifaIconLoopThroughAllClasses – we use this to change specific iconids in our app from one iconid to another, in our case to change all icons with an Italian flag to a Spanish one, and change the tooltip appropriately.
>>
>> Regards
>>
>> Rudolf
>>
>> —–Ursprüngliche Nachricht—–
>> Von: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Im
>> Auftrag von Rudolf Bargholz
>> Gesendet: Mittwoch, 18. Oktober 2017 18:13
>> An: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
>> Betreff: AW: Search for IconID use
>>
>> Hi Mike,
>>
>> You’re welcome.
>>
>> Just as an explanation for others: Studio stores the iconid as a number, summing the iconid number and iconid size constant number. The trick is to find out what size the iconid could be, based on the numeric $iconid value, and then subtract the constant size value to get the iconid number.
>>
>> Here this important code to extract the information. Everything else in the library is code that allows you to loop through all the objects in a library, window classes in that library, objects in the window class (recursively, so that you find the icons in buttons in a tabpane with tab panes, for example).
>>
>> For ChildList.$line from 1 to ChildList.$linecount step 1 If
>> ChildList.0.$selected
>> Set reference ItemRef to ParentRef.$objs.[ChildList.C1]
>> If ItemRef.$iconid.$cando
>> Calculate lIconId as ItemRef.$iconid
>> If lIconId<>0&lIconId<>k16x16&lIconId<>k32x32&lIconId<>k48x48
>> If lIconId>k16x16&lIconId
>> Do #L1.$add(LibName,ClassName,ItemRef.$name,’k16x16′,lIconId)
>> Else If lIconId>k32x32&lIconId
>> Do #L1.$add(LibName,ClassName,ItemRef.$name,’k32x32′,lIconId)
>> Else If lIconId>k48x48&lIconId<0
>> Calculate lIconId as lIconId-k48x48
>> Do #L1.$add(LibName,ClassName,ItemRef.$name,’k48x48′,lIconId)
>> Else
>> Do #L1.$add(LibName,ClassName,ItemRef.$name,”,lIconId)
>> End If
>> End If
>> End If
>> End If
>> End For
>>
>> Regards
>>
>> Rudolf
>>
>> —–Ursprüngliche Nachricht—–
>> Von: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Im
>> Auftrag von Michael Mantkowski
>> Gesendet: Mittwoch, 18. Oktober 2017 17:43
>> An: ‘OmnisDev List – English’ <omnisdev-en@lists.omnis-dev.com>
>> Betreff: RE: Search for IconID use
>>
>> Thanks Rudolf,
>>
>> I just tried it. Pretty Slick!!
>>
>> *********************************************************************
>> Michael Mantkowski
>> ClienTrax Software
>> 1-614-875-2245
>> *********************************************************************
>>
>>
>> —–Original Message—–
>> From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On
>> Behalf Of Rudolf Bargholz
>> Sent: Wednesday, October 18, 2017 11:37 AM
>> To: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
>> Subject: AW: Search for IconID use
>>
>> Hi Mike,
>>
>> Will send you a lib off list. It is not find and replace, but it is code that loops through all libs and windows and builds a list of all libraries, all window class names, objects and their iconid (size and number). I also have code that loops through all windows and changes objects with a specific iconid to another iconid.
>>
>> Regards
>>
>> Rudolf Bargholz
>>
>> —–Ursprüngliche Nachricht—–
>> Von: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Im
>> Auftrag von Michael Mantkowski
>> Gesendet: Mittwoch, 18. Oktober 2017 15:59
>> An: ‘OmnisDev List – English’ <omnisdev-en@lists.omnis-dev.com>
>> Betreff: Search for IconID use
>>
>> Does anyone know if it is possible to get the Studio Find and Replace utility to work with IconId’s.
>>
>> I have a ton of icons in my system and want to retire / reuse the IDs of ones that are no longer used. But with 315 window classes and who know how many objects on them that could be using the icon it is not always easy to know if the one I want to get rid of is still being used somewhere.
>>
>> I will probably have to write something to do this but wanted to ask first.
>>
>> *********************************************************************
>> Michael Mantkowski
>> ClienTrax Software
>> 1-614-875-2245
>> *********************************************************************
>>
>>
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com
>>
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com