|
Post by davidk64 on Jun 10, 2022 10:55:28 GMT
menu #mainWnd, "&Mode", "&Normal", enterNormalMode, "&Trial", enterTrialMode
I'd like the program to start in normal mode with "Normal" menu choice grayed out. When user selects "Trial" the program enters trial mode and "Normal" menu choice becomes available and "Trial" menu choice is grayed out.
|
|
|
Post by tsh73 on Jun 10, 2022 12:33:55 GMT
I don't know nice way of doing this. This definitely could be done with Windows API in Liberty BASIC, though.
You can reopen window with new set of menu (but probably API would look easier compared to it)
nomainwin global trial trial = 1
call openWindow wait
[quit] close #mainWnd end
sub enterNormalMode trial = 0 close #mainWnd call openWindow end sub
sub enterTrialMode trial = 1 close #mainWnd call openWindow end sub
sub openWindow if trial then menu #mainWnd, "&Mode", "&Normal", enterNormalMode else menu #mainWnd, "&Mode", "&Trial", enterTrialMode end if
statictext #mainWnd.st1 "", 20, 20, 250, 50
UpperLeftX =10 UpperLeftY =10 open "Just reload window" for window as #mainWnd #mainWnd "trapclose [quit]" 'write current mode to statictext #mainWnd.st1 word$("Normal Trial", trial+1);" mode" end sub
|
|
|
Post by davidk64 on Jun 12, 2022 4:23:02 GMT
I'm impressed with your ingenuity! If I move the window I'd have to have a way of storing the new position so it doesn't leap across the screen. I think I'd rather live without the access to graying menu items though than use this workaround Thanks for the suggestion!!!
|
|
|
Post by tsh73 on Jun 12, 2022 6:02:15 GMT
The problem is, you just CAN'T get that new position in JB :(
|
|