Commits

Jason McKesson committed 4c1f39f

Added menues to the frame window.

  • Participants
  • Parent commits 9bbdecd

Comments (0)

Files changed (5)

File Docs/Docs.xpr

 <?xml version="1.0" encoding="UTF-8"?>
-<project version="11.2">
+<project version="12.0">
     <meta>
         <filters directoryPatterns="" filePatterns=""
             positiveFilePatterns="" showHiddenFiles="false"/>
         <options>
-            <serialized version="11.2">
+            <serialized version="12.0">
                 <map>
                     <entry>
                         <String xml:space="preserve">scenario.associations</String>
                                     <String xml:space="preserve">XSL</String>
                                 </field>
                                 <field name="url">
-                                    <String xml:space="preserve">XmlWriter.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook PDF Printable</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Writing/KotoRII/Adventures%20of%20Bastila%20and%20Mira/Chapter%202.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook PDF Printable</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Writing/KotoRII/Adventures%20of%20Bastila%20and%20Mira/Chapter%201.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook PDF Printable</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Design/RenderToDo.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook PDF</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Programming/InternalExes/FoMaker/design/FoLoadCodeGen.xml</String>
+                                    <String xml:space="preserve">LuaGUI.xml</String>
                                 </field>
                             </scenarioAssociation>
                             <scenarioAssociation>
                                     <String xml:space="preserve">XSL</String>
                                 </field>
                                 <field name="url">
-                                    <String xml:space="preserve">file:/D:/Programming/ExternalExes/doxygen%20development/Design/ProgDocSchema.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Writing/KotoRII/Novelization/Episode%20II/Chapter1.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Programming/ExternalExes/doxygen%20development/Design/OldData/DoxyFormat.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Programming/ExternalExes/doxygen%20development/Design/DoxyFormat.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook PDF</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Projects/DuelingCircle/DC21.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Critiques/Past%20Mistakes%20Prologue.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/Critiques/Past%20Mistakes%201%20Trouble.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/D:/WritingDesign/TacticalD20/Anime_d20_SRD_v1.0_-_Chap01-12/DocBook/CharacterCreation.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/H:/SM/KotoRII/BasicOutline.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook XHTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Chapter1.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook PDF</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Chapter3.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Episode%20I.xml</String>
-                                </field>
-                            </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="name">
-                                    <String xml:space="preserve">Docbook HTML</String>
-                                </field>
-                                <field name="type">
-                                    <String xml:space="preserve">XSL</String>
-                                </field>
-                                <field name="url">
-                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Chapter2.xml</String>
+                                    <String xml:space="preserve">file:/G:/Program%20Files/XMLmind_XML_Editor/demo/docbook-modular-book/chapter.xml</String>
                                 </field>
                             </scenarioAssociation>
                             <scenarioAssociation>
                                     <String xml:space="preserve">XSL</String>
                                 </field>
                                 <field name="url">
-                                    <String xml:space="preserve">file:/G:/Program%20Files/XMLmind_XML_Editor/demo/docbook-modular-book/chapter.xml</String>
+                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Chapter2.xml</String>
                                 </field>
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="name">
-                                    <String xml:space="preserve">internal/My DocBook 5/Docbook HTML</String>
+                                    <String xml:space="preserve">Docbook HTML</String>
                                 </field>
                                 <field name="type">
                                     <String xml:space="preserve">XSL</String>
                                 </field>
                                 <field name="url">
-                                    <String xml:space="preserve">LuaGUI.xml</String>
+                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Episode%20I.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook PDF</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Chapter3.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook XHTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">file:/H:/SM/KotoRII/Episode%20I/Chapter1.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">file:/H:/SM/KotoRII/BasicOutline.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../WritingDesign/TacticalD20/Anime_d20_SRD_v1.0_-_Chap01-12/DocBook/CharacterCreation.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Critiques/Past%20Mistakes%201%20Trouble.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Critiques/Past%20Mistakes%20Prologue.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook PDF</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../DuelingCircle/DC21.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Programming/ExternalExes/doxygen%20development/Design/DoxyFormat.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Programming/ExternalExes/doxygen%20development/Design/OldData/DoxyFormat.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Writing/KotoRII/Novelization/Episode%20II/Chapter1.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Programming/ExternalExes/doxygen%20development/Design/ProgDocSchema.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook PDF</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Programming/InternalExes/FoMaker/design/FoLoadCodeGen.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook PDF Printable</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Design/RenderToDo.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook PDF Printable</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Writing/KotoRII/Adventures%20of%20Bastila%20and%20Mira/Chapter%201.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook PDF Printable</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">../../../Writing/KotoRII/Adventures%20of%20Bastila%20and%20Mira/Chapter%202.xml</String>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="name">
+                                    <String xml:space="preserve">Docbook HTML</String>
+                                </field>
+                                <field name="type">
+                                    <String xml:space="preserve">XSL</String>
+                                </field>
+                                <field name="url">
+                                    <String xml:space="preserve">XmlWriter.xml</String>
                                 </field>
                             </scenarioAssociation>
                         </scenarioAssociation-array>

File Docs/LuaGUI.xml

         </section>
         <section>
             <title>Frame Containers</title>
-            <para>The frame window, defined by the <classname>frame</classname> element, must have
-                at least one child element. The direct children of the frame element are
-                collectively referred to as <glossterm>frame containers.</glossterm> There are two
-                kinds of frame container elements: <classname>panel</classname> and
-                    <classname>toolbar</classname>.</para>
+            <para>The frame window, defined by the <classname>frame</classname> element, represents
+                the main application window. It may have a <classname>menubar</classname> element as
+                a child; if so, this menubar element must come <emphasis>first</emphasis>. This
+                element defines the window's menus.</para>
+            <para>Outside of the optional <classname>menubar</classname> element, the direct
+                children of the frame element are collectively referred to as <glossterm>frame
+                    containers.</glossterm> There are two kinds of frame container elements:
+                    <classname>panel</classname> and <classname>toolbar</classname>.</para>
             <para>A toolbar is what it sounds like, though it is not as limited as it sounds. A
                 toolbar is a window that is anchored to a side of the frame window that contains
                 controls. You are generally familiar with toolbars containing buttons, and perhaps
                 regular containers do as well.</para>
         </section>
         <section>
+            <title>Menus</title>
+            <para>Frame windows can have a set of menus. This is defined by the
+                    <classname>menubar</classname> element that is a child of the
+                    <classname>frame</classname>. Only the frame window can have menus. If a frame
+                window has a <classname>menubar</classname> element, then it must be the
+                    <emphasis>first</emphasis> child of the frame. It may only have one
+                menubar.</para>
+            <para>The <classname>menubar</classname> element has no attributes. It has a number of
+                    <classname>menu</classname> elements as children. These represent top-level
+                menus. Menubars must have at least one <classname>menu</classname> element.</para>
+            <para>The <classname>menu</classname> element must have a name, given with the
+                    <literal>name</literal> attribute. Menus have a series of child elements. Menu
+                children can be <classname>menuitem</classname>, <classname>menuspacer</classname>,
+                or a nested <classname>menu</classname>, which acts as a submenu. Menus must have at
+                least one child.</para>
+            <para>The <classname>menuitem</classname> element represents a single entry in the menu
+                that the user can click on to expect something to happen. This element has no
+                children, but it may have the following attributes:</para>
+            <glosslist>
+                <title>Menuitem Attributes</title>
+                <glossentry>
+                    <glossterm>name</glossterm>
+                    <glossdef>
+                        <para>The name of the item, as shown to the user. Required.</para>
+                    </glossdef>
+                </glossentry>
+                <glossentry>
+                    <glossterm>tip</glossterm>
+                    <glossdef>
+                        <para>Tooltip text to show the user if he hovers over the item.
+                            Optional.</para>
+                    </glossdef>
+                </glossentry>
+                <glossentry>
+                    <glossterm>action</glossterm>
+                    <glossdef>
+                        <para>A Lua chuck that will be called when the user presses this menu item.
+                            It is given no parameters. Optional.</para>
+                    </glossdef>
+                </glossentry>
+            </glosslist>
+            <para>The <classname>menuspacer</classname> element represents a separator between menu
+                items. This is useful for grouping. It has no attributes or child elements.</para>
+        </section>
+        <section>
             <title>Containers</title>
             <para>Container windows are windows that contain other windows. Containers can be nested
                 within other containers. Frame containers are container windows, but they cannot be

File Docs/luagui.rnc

     
     lg.frame =
         ## The primary window of the application.
-        element frame { lg.frame.attlist, lg.frame.containers+ }
+        element frame { lg.frame.attlist, lg.frame.menubar?, lg.frame.containers+ }
+        
+    lg.frame.menubar =
+        element menubar { lg.frame.menubar.attlist, lg.menubar.menu+}
+        
+    lg.menubar.menu =
+        element menu { lg.menubar.menu.attlist,  (lg.menuitem | lg.menuspacer | lg.menubar.menu)+ }
+        
+    lg.menuitem =
+        element menuitem { lg.menuitem.attlist }
+        
+    lg.menuspacer =
+        element menuspacer { lg.menuspacer.attlist }
         
     lg.frame.containers =
         lg.toolbar | lg.panel
         lg.orient.attribute?,
         lg.appWnd.title.attribute,
         lg.size
+        
+    lg.frame.menubar.attlist = empty
+    
+    lg.menubar.menu.attlist =
+        lg.menu.name.attribute
+        lg.tip.attribute?,
+    
+    lg.menuitem.attlist =
+        lg.menuitem.name.attribute,
+        lg.tip.attribute?,
+        lg.menuitem.action.attribute?
+    
+    lg.menuspacer.attlist = empty
     
     lg.collpane.attlist =
         lg.std.window.attlist,
         ## show it.
         [ a:defaultValue = "true"]
         attribute show {lg.data.boolean}
+        
+    lg.menu.name.attribute =
+        attribute name { text }
+        
+    lg.menuitem.name.attribute =
+        attribute name { text }
+        
+    lg.menuitem.action.attribute =
+        attribute action { lg.luafunction }
 
     lg.label.attribute =
         ## The label for this control. It will be offset to the left of the control.

File Testing/LuaGuiTest.xml

     <accelerator key="CTRL+A" action="DisplayDialog()"/>
     <accelerator key="CTRL+Q" action="CloseWindow()"/>
     <frame width="740" height="550" orient="horizontal" title="SomeName">
+        <menubar>
+            <menu name="&amp;File">
+                <menuitem name="&amp;Open" action='print("goomba")' tip="SomeTip"/>
+                <menuspacer/>
+                <menuitem name="&amp;Close" action='CloseWindow()'/>
+                <menu name="Submenu...">
+                    <menuitem name="Foo"/>
+                </menu>
+            </menu>
+        </menubar>
         <panel title="Left" width="175" direction="left" orient="vertical" >
             <collpane orient="vertical" text="somethingCute" collapsed="true">
                 <button text="Page1a" align="left" tip="Page 1 Tooltip"/>

File Tools/LuaGUI.lua

 --List of all accelerators for the application.
 local accelList = {};
 
+--List of all menu actions for the application, indexed by the id.
+local menuActions = {};
+
 --List of main window children by ID.
 local idWnds = {};
 
 		frameWnd:Connect(1200 + i, wx.wxEVT_COMMAND_MENU_SELECTED, accel.func);
 	end
 	
+	for id, menuFunc in pairs(menuActions) do
+		frameWnd:Connect(id, wx.wxEVT_COMMAND_MENU_SELECTED, menuFunc)
+	end
+	
 	if(#accelTable ~= 0) then
 		frameWnd:SetAcceleratorTable(wx.wxAcceleratorTable(accelTable));
 	end
 	return nil;
 end
 
+local menubarJumpTable = {}
+
+local function ProcessMenues(parMenu, currNode, ChildFunc)
+	local nextNode = currNode:GetChildren();
+	while(nextNode) do
+		ProcFunc = menubarJumpTable[nextNode:GetName()];
+		assert(ProcFunc, "Bad menu node: " .. nextNode:GetName());
+		local ret = ProcFunc(parMenu, nextNode);
+		if(ChildFunc) then
+			ChildFunc(ret);
+		end
+	
+		nextNode = nextNode:GetNext();
+	end
+end
+
+function menubarJumpTable.menu(parMenu, currNode)
+	local name = currNode:GetPropVal("name", "Unnamed Menu")
+	local menuName = "";
+	if(not parMenu) then menuName = name end;
+	local theMenu = wx.wxMenu(menuName, wx.wxMB_DOCKABLE);
+	
+	ProcessMenues(theMenu, currNode);
+	
+	if(parMenu) then
+		--Must add the menu to this one.
+		local menuItem = wx.wxMenuItem(parMenu, wx.wxID_ANY, name,
+			"", wx.wxITEM_NORMAL, theMenu);
+		parMenu:Append(menuItem);
+	end
+	
+	return theMenu;
+end
+
+function menubarJumpTable.menuitem(parMenu, currNode)
+	assert(parMenu, "Menu items cannot be top-level.");
+	
+	local id = wx.wxNewId();
+	parMenu:Append(id,
+		currNode:GetPropVal("name", "Unnamed Menu Item"),
+		currNode:GetPropVal("tip", ""),
+		wx.wxITEM_NORMAL);
+		
+	local bHasAction, actionCode = currNode:GetPropVal("action");
+	if(bHasAction) then
+		menuActions[id] = loadstring(actionCode);
+	end
+
+	return nil;
+end
+
+function menubarJumpTable.menuspacer(parMenu, currNode)
+	assert(parMenu, "Menu Spacers cannot be top-level.");
+	parMenu:AppendSeparator();
+end
+
+function elementJumpTable.menubar(parWnd, sizer, currNode, notebook, auiNotebook)
+	local topMenus = {};
+	
+	function AddChild(child)
+		topMenus[#topMenus + 1] = child
+	end
+	
+	ProcessMenues(nil, currNode, AddChild);
+	
+	local menuBar = wx.wxMenuBar();
+	for i, menu in ipairs(topMenus) do
+		menuBar:Append(menu, menu:GetTitle());
+		menu:SetTitle("");
+	end
+	
+	parWnd:SetMenuBar(menuBar);
+	
+	return nil;
+end
+
 function elementJumpTable.toolbar(parWnd, sizer, currNode, notebook, auiNotebook)
 	local size = GetNodeSize(currNode);
 	local mySizer = CreateDefaultSizer(currNode);