How is the enabled state of a command button handled?
Some buttons on toolbars disable themselves. For example the delete is disabled when no button is selected.
I want to set the enabled state of my custom buttons that run DOS commands.
Is this possible?
Hi Leo, thanks. Do you have any more details of how it currently works. Is there perhaps a way we could hijack an existing command and use it for setting the enabled flag but then perform some other command after it, perhaps a user command written correctly would work?
Not a good example is putting Clipboard COPY at the start of a dos command gives a button that enables only when any file or folder is selected.
What details do you want about how it works? I can't think of anything relevant. The buttons are enabled/disabled automatically for certain internal commands based on file selection etc.
What commands support the feature, and what they enable and disable on.
ones I found are:
GetSizes, Must in be a folder
Clipboard COPY, enables for any selected item.
Is there a way to write a user function that could return the enabled flag? Then we could support some form of regexp matching.
Maybe it would be better to wait and see if the Devs would consider adding the feature.
This is a user to user forum. You can request a new feature from the GP Software support page. Just select Program Suggestion from the Support Issue drop down.
There isn't a list of them, but the ones on the default toolbars/menus are a good guide. Most of the commands which go disabled do so based on whether or not anything is selected. (I had never noticed GetSizes was different until you mentioned it.)
If a user function could be used to trigger the enable / disable then we could write a function that could check file name of the selected item.
This could then be used to have buttons only enable when the correct type of file is selected.
Leo you mentioned that you added this to the wish list. Thanks