Disabling MenuBar in SyteLine

Chris Kelleher

Administrator
Staff member
Hi,
I have a need to Disable ALL menuing in SyteLine so that no navigation is
possible at all. I know that a Modal window will handle this but I don't
have that luxury at this time. The main reason is that I have an
application that is procedural rather than event-driven and I'm trying to
mix the two at a high level. (I don't want to re-write my application just
yet).

I've already figured out what SyteLine does when you are in UPDATE-MODE on a
report options screen, but this only disables just some menu options.....

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
/* turn on update mode, disable mainmenu options */

if valid-handle(MainMenubar-proc-handle) then
RUN able-Stack-commands IN MainMenubar-proc-handle (NO). /* sensitive
*/
[/code]

I've also figured out how to Disable the "WINDOW" menu in MainMenubar so
that you cannot switch windows or choose 'close-all'. But this only
disables the WINDOW menu in MainMenu, it does not disable the WINDOW menu on
other active SyteLine windows....

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
/* disable WINDOW in Main Menu */
if valid-handle(MainMenubar-proc-handle) then
RUN disable-menu-widgets IN MainMenubar-proc-handle ("WINDOW").
[/code]

If I had the source to menubar.p, menubar.i, I'd be able to figure this all
out, but those routines are encrypted. I want to disable all menubars in
all active windows of SyteLine, and then re-enable them again when I'm done.

Any help in this area would be greatly appreciated.
Thanks,
Rob Jeanquart
Sr. Systems Analyst
The Lake Companies, Inc.
Phone: (920) 406-3030
mailto:rjeanquart@lakeco.com http://www.lakeco.com
 
This works in SL4002. It will turn off all menus and then
re-enable them.

Patrick T. Gordon
Senior Software Engineer
Software Solutions
Symix Computer Systems, Inc.
Columbus, OH 43231
Phone: 614/523-7000
Fax: 614/895-1195

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
define var t-window as handle.
create window t-window.

assign
THIS-PROCEDURE:current-window = t-window.

run DisableMenus in THIS-PROCEDURE.
pause.
run EnableMenus in THIS-PROCEDURE.

procedure EnableMenus:
define variable h-widget as handle no-undo.

assign
h-widget = session:first-procedure.

repeat while valid-handle(h-widget):

if h-widget:file-name = 'menu/menubar.p' then
RUN enable-menubar IN h-widget.
assign
h-widget = h-widget:next-sibling.

end.

end procedure. /* end procedure */

procedure DisableMenus:
define variable h-widget as handle no-undo.

assign
h-widget = session:first-procedure.

repeat while valid-handle(h-widget):

if h-widget:file-name = 'menu/menubar.p' then
RUN disable-menubar IN h-widget.
assign
h-widget = h-widget:next-sibling.

end.

end procedure. /* end procedure */

[/code]
 
Back
Top