Page 1 of 1

Ability to allow plugins to query the filenames of current ButtonBars from TC

Posted: 2018-09-17, 04:30 UTC
by diopter
To extend the ButtonBar functionality of the TC, it would be nice if plugins or external programs and scripts could find out the file names of the current ButtonBars.
That should be very easy for Mr. Ghisler to realize:
Just insert a Windows API call in the right place in ButtonBar code:
SetWindowText(ButtonBarWnd, ButtonBarFileName);

Zur Erweiterung der ButtonBar-Funktionalität des TC wäre es schön, wenn Plugins oder auch externe Programme und Scripts die Dateinamen der aktuellen ButtonBars in Erfahrung bringen könnten.
Das sollte für Herrn Ghisler sehr leicht zu realisieren sein:
Einfach an der richtigen Stelle im ButtonBar-Code einen Windows-API-Aufruf einfügen:
SetWindowText(ButtonBarWnd, ButtonBarFileName);

Re: Ability to allow plugins to query the filenames of current ButtonBars from TC

Posted: 2018-09-17, 12:19 UTC
by Dalai
diopter wrote: 2018-09-17, 04:30 UTCTo extend the ButtonBar functionality of the TC, it would be nice if plugins or external programs and scripts could find out the file names of the current ButtonBars.
To do what exactly? Can you please elaborate more on what you intend to do with this information? What's your use case?

Regards
Dalai

Re: Ability to allow plugins to query the filenames of current ButtonBars from TC

Posted: 2018-09-17, 19:01 UTC
by ts4242
diopter wrote: 2018-09-17, 04:30 UTCit would be nice if plugins or external programs and scripts could find out the file names of the current ButtonBars.
Button Bar Editor can do, all it needs is knowing the main bar file by reading this value Buttonbar under Buttonbar section. All sub-bars file names are stored in the main bar file.

Re: Ability to allow plugins to query the filenames of current ButtonBars from TC

Posted: 2018-09-17, 20:01 UTC
by diopter
...is knowing the main bar file by reading this value Buttonbar under Buttonbar section.
You are right when TC starts, but then user can load other buttonbars and a plugin don't know their file names.
If a plugin could request the filenames of the current active buttonbars, it could change the icon of a button to show different states, for example.

Re: Ability to allow plugins to query the filenames of current ButtonBars from TC

Posted: 2018-09-18, 09:54 UTC
by MVV
If a plugin could request the filenames of the current active buttonbars, it could change the icon of a button to show different states, for example.
But TC caches icons so you have to delete cache file and open/apply buttonbar dialog after changing an icon in BAR file...

Re: Ability to allow plugins to query the filenames of current ButtonBars from TC

Posted: 2018-09-18, 13:58 UTC
by diopter
What do think how I would change an icon ?
I know the file format of .br2 and can change the icon in the cache file, but therefor i must know the filename...
Open/apply buttonbar is not needed, cm_ReloadBarIcons reloads the icons.