22 November 2021, 19:05 | #1 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Top menu - toggle selection
Hi,
I will be doing this in blitz but the question is about intuition so here it goes: How to change the state of MENUTOGGLE item without using top menu? I have few windows in my program and I have a top menu with a list of these windows (with a checkmark indicating if the window is open or not). I want the checkmark to be gone when I close the window with CLOSE GADGET. So far the only idea that came to my mind is to reproduce the whole menu: ClearMenuStrip() FreeMenus() ..here I edit the toggle state of the entry I want in my menu CreateMenusA() LayoutMenusA() Is there a simpler way? Thanks |
23 November 2021, 08:47 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
Normally you would maintain the flags of the MenuItem. The NewMenu array is only needed for the initial creation of the menu strip. After that you can throw it away.
Attached is a full example. One challenge is to find the address of the item you want to manipulate in the menu strip. The example uses ItemAddress with a fixed menu number. In a more complex example I would rather write a function which traverses the menu strip and finds the item with the corresponding code in the user data field. This way I am independent of menu changes in later versions. |
23 November 2021, 10:18 | #3 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Thanks thomas - all is clear now, will apply this in the afternoon.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WinUAE 4.3.0 - Toggle fullscreen problem | thyslo | support.WinUAE | 4 | 29 December 2019 13:52 |
Toggle between screen formats | pushead | support.FS-UAE | 1 | 08 August 2019 12:21 |
fullscreen toggle on mac | crashdog | support.FS-UAE | 11 | 09 April 2016 12:06 |
scalos/wb top menu | _psy | project.ClassicWB | 3 | 03 January 2011 13:32 |
Toggle Magic Mouse | smoorke | support.WinUAE | 1 | 14 June 2009 10:04 |
|
|