Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Easy way to toggle menus or whole sets of macros ON/OFF?
#1
Hi All,

Is there an easy way for a user to turn on/off the display of a toolbar (by a keyboard stroke or other mechanism) or even better a whole set of macros& functions (running together as a mini-application), preferably by a (by a keyboard stroke or other mechanism). In this way, the associated toolbars will come down and the triggers will be turned off).

I set a global variable to toggle through the global manager technique:

int+ g_xxx
int toggle
sel g_xxx
,case 0; toggle=0
,case 1; toggle=1
...

g_xxx+1
if(g_xxx>=numberofmacros) g_xxx=0


Then placed

if toggle=0; ret

into the beginning of the macro. Is there a more elegant reliable way of doing this?
Is there a best way to change the menu text (e.g. faded), if the toggle=0 (off).

I can use my QM skills to get this to work, but sometimes there is a much simpler way out there for this seemingly common task.
Thanks!!
Stuart
#2
try this....create a toolbar named "Toolbar-test".


Code:
Copy      Help
ifi win("TOOLBAR-TEST" "QM_toolbar")
,clo win("TOOLBAR-TEST" "QM_toolbar")
else
,mac "Toolbar-test"
An old blog on QM coding and automation.

The Macro Hook
#3
There is no easy way. All must be programmed - mac "toolbar", clo "toolbar", dis "folder", dis- "folder", etc.

Easily changing menu/tb item states currently is not possible. An item/button is disabled if the associated macro does not exist. You can create menus/tb at run time...
#4
Dis was the command I needed and ken your toggle worked better than mine. Thanks to you both!!!
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)