TI-994A wrote:Hope it helps.
Not really (sorry). When clicking the Main Menu, the Common Menu Item doesn't appear in the drop-down menu; and clicking the button would need to show both menus, too. That's what I'm trying to do -- have both menus show at once, no matter which way is chosen. But the second menu must show the first menu as a sub-menu of the second menu.
See in this example, how I've got 2 x Cut/Copy/Paste menus? How can I have those menu definitions created ONCE in my code, instead of DUPLICATED like this? Both sets of menus will call the same procedure when selected.
Reason for this help: I'm applying the DRY coding principle (
https://en.wikipedia.org/wiki/Don't_repeat_yourself).
Code: Select all
OpenWindow(0, 100, 150, 195, 200, "PureBasic - Menu")
If CreateMenu(0, WindowID(0))
MenuTitle("File")
MenuItem( 1, "&Load...")
MenuItem( 2, "Save")
MenuItem( 3, "Save As...")
MenuBar()
OpenSubMenu("Recents")
MenuItem( 4, "Pure.png")
MenuItem( 5, "Basic.jpg")
OpenSubMenu("Even more !")
MenuItem( 6, "Cut")
MenuItem( 7, "Copy")
MenuItem(8, "Paste")
CloseSubMenu()
MenuItem(9, "Rocks.tga")
CloseSubMenu()
MenuBar()
MenuItem(10, "&Quit")
MenuTitle("Clipboard")
MenuItem(11, "Cut")
MenuItem(12, "Copy")
MenuItem(13, "Paste")
MenuTitle("?")
MenuItem(14, "About")
EndIf
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow