Jason McKesson avatar Jason McKesson committed 476c1c1

Added more documentation for LuaGUI.
Added "pane"s for sizers you need windows for.

Comments (0)

Files changed (3)

                 <para>You cannot use box and grid sizing attributes on the same element.</para>
             </section>
             <section>
+                <title>Sizer</title>
+                <para>A sizer, defined by the <classname>sizer</classname> element, is the simplest
+                    of all containers. It offers no visual notation about its contents whatsoever,
+                    and it takes up no space. Sizers are used as layout tools, to change layout
+                    among a certain set of controls within a larger set.</para>
+                <para>Sizers have no special, unique attributes, other than the standard ones for
+                    containers. Sizers are not windows however, so they cannot have the
+                        <literal>id</literal> or <literal>tooltip</literal> attributes.</para>
+            </section>
+            <section>
+                <title>Pane</title>
+                <para>A pane, defined by the <classname>pane</classname> element, is effectively
+                    like a sizer. However, unlike a sizer, it is an actual window. It does not take
+                    up space, but it does have standard container and window attributes. Therefore,
+                    you can query it by <literal>id</literal> and give it tooltips and so
+                    forth.</para>
+                <para>The wxWidgets object type created is <classname>wxPanel.</classname></para>
+            </section>
+            <section>
+                <title>ScrollPane</title>
+                <para>A scrollable pane, defined by the <classname>scrollpane</classname> element,
+                    is a window who's contents can be scrolled. The size of the window can be
+                    controlled through the usual mechanism, but if its contents would extend beyond
+                    the control's size, appropriate scrollbars will appear to allow you to scroll
+                    them.</para>
+                <glosslist>
+                    <title>Scroll Pane Attributes</title>
+                    <glossentry>
+                        <glossterm>hscroll, vscroll</glossterm>
+                        <glossdef>
+                            <para>The horizontal and vertical base scrolling size. This specifies
+                                how far a single press of the up or down arrow will scroll. If a
+                                particular scroll size is zero, then no scrolling will be allowed in
+                                that direction. Optional.</para>
+                            <para>Both default to zero.</para>
+                        </glossdef>
+                    </glossentry>
+                </glosslist>
+                <para>The wxWidgets object type created is
+                    <classname>wxScrollWindow.</classname></para>
+            </section>
+            <section>
                 <title>Tabs</title>
                 <para>Tabs containers are defined by the <classname>tabs</classname> element. These
                     represent a series of windows, all of the same size, that take up the same area
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created by <classname>tabs</classname> is
+                        <classname>wxNotebook.</classname> The type created by
+                        <classname>tab</classname> is <classname>wxPanel.</classname></para>
             </section>
             <section>
                 <title>Collapsible Pane</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is
+                    <classname>wxCollapsiblePane.</classname></para>
             </section>
             <section>
                 <title>Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
-            </section>
-            <section>
-                <title>Sizer</title>
-                <para>A sizer, defined by the <classname>sizer</classname> element, is the simplest
-                    of all containers. It offers no visual notation about its contents whatsoever,
-                    and it takes up no space. Sizers are mostly used as layout tools, to change
-                    layout among a certain set of controls within a larger set.</para>
-                <para>Sizers have no special, unique attributes, other than the standard ones for
-                    containers and windows.</para>
+                <para>The wxWidgets object type created is <classname>wxStaticBox.</classname> Note
+                    that, while wxWidgets only allows box sizers (horizontal and vertical) inside
+                        <classname>wxStaticBox</classname>, LuaGUI allows you to use any sizer you
+                    want. This is done by internally creating a new sizer within the box's sizer. So
+                    controls will be underneath two sizers, not just one.</para>
             </section>
         </section>
         <section>
                 <para>Spacer controls, created by the <classname>spacer</classname> attribute,
                     simply takes up space. It's used primarily to help organize controls into
                     logical groups.</para>
-                <para>Spacers are special, as they are not technically windows. They have none of
-                    the standard window or layout attributes. Instead, they have only these
-                    attributes.</para>
+                <para>Spacers are special, as they are not windows. They have none of the standard
+                    window or layout attributes. Instead, they have only these attributes.</para>
                 <glosslist>
                     <title>Spacer Attributes</title>
                     <glossentry>
                         <glossterm>size</glossterm>
                         <glossdef>
                             <para>The quantity of space that the spacer takes up, in pixels. This
-                                room is always added in the direction of the current layout.</para>
+                                room is always added in the direction of the current layout.
+                                Optional.</para>
                         </glossdef>
                     </glossentry>
                     <glossentry>
                         <glossterm>proportion</glossterm>
                         <glossdef>
-                            <para>Identical to the standard layout attribute.</para>
+                            <para>Identical to the standard layout attribute. Optional.</para>
                         </glossdef>
                     </glossentry>
                 </glosslist>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxButton.</classname></para>
             </section>
             <section>
                 <title>Static Text</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is
+                    <classname>wxStaticText.</classname></para>
             </section>
             <section>
                 <title>Check Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxCheckBox.</classname></para>
             </section>
             <section>
                 <title>3-State Check Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxCheckBox.</classname></para>
             </section>
             <section>
                 <title>Radio Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxRadioBox.</classname></para>
             </section>
             <section>
                 <title>Edit Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxTextCtrl.</classname></para>
             </section>
             <section>
                 <title>List Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxListBox.</classname></para>
             </section>
             <section>
                 <title>Dropdown Box</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxComboBox.</classname></para>
             </section>
             <section>
                 <title>Spinner</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxSpinCtrl.</classname></para>
             </section>
             <section>
                 <title>Slider</title>
                         </glossdef>
                     </glossentry>
                 </glosslist>
+                <para>The wxWidgets object type created is <classname>wxSlider.</classname></para>
             </section>
             <section xml:id="labeled_control">
                 <title>Labeled Controls</title>
         ## Creates a top-level panel. Panels can be centered or anchored to a side of the frame.
         ## Panels are always tear-away.
         element panel { lg.panel.attlist, lg.windows* }
-    
+        
     lg.windows =
         lg.containers | lg.controls
         
     lg.containers =
-        lg.tabs | lg.collpane | lg.scrollpane | lg.box | lg.sizer
+        lg.tabs | lg.collpane | lg.scrollpane | lg.pane | lg.box | lg.sizer
         
     lg.dialog.containers =
-        lg.tabs | lg.collpane | lg.box | lg.sizer
+        lg.tabs | lg.collpane | lg.scrollpane | lg.pane | lg.box | lg.sizer
         
     lg.tabs =
         ## Create a series of tab pages. Each tab can contain arbitrary controls.
         element collpane { lg.collpane.attlist, lg.windows* }
         
     lg.scrollpane =
-        ## A container that can be collapsed.
+        ## A container that can be scrolled to see all of its contents.
         element scrollpane { lg.scrollpane.attlist, lg.windows* }
         
+    lg.pane =
+        ## A window container that can be referenced by id.
+        element pane { lg.pane.attlist, lg.windows* }
+        
     lg.sizer =
-        ## A container for controls that has no visuals for it.
+        ## A non-window container for controls that has no visuals for it.
         element sizer { lg.sizer.elem.attlist, lg.windows* }
         
     lg.box =
         lg.sizer.attlist,
         lg.scrollpane.hscroll.attribute?,
         lg.scrollpane.vscroll.attribute?
-        
+    
+    lg.pane.attlist =
+        lg.std.window.attlist,
+        lg.size,
+        lg.positioning.attlist,
+        lg.sizer.attlist
     
     lg.sizer.elem.attlist =
         lg.size,
         
     lg.sizer.attlist =
         (
-            (
-                lg.gridsizer.numCols.attribute |
-                lg.gridsizer.numRows.attribute |
-                (lg.gridsizer.numCols.attribute, lg.gridsizer.numRows.attribute)),
-            lg.gridsizer.hGap.attribute?,
-            lg.gridsizer.vGap.attribute?,
-            lg.gridsizer.fixedGrid.attribute?,
-            lg.gridsizer.colProportion.attribute?,
-            lg.gridsizer.rowProportion.attribute?)  |
-        (lg.box.orient.attribute?)
+            lg.sizer.grid.attlist,
+            lg.sizer.grid.other.attlist
+        ) |
+        lg.sizer.box.attlist?
+        
+    lg.sizer.box.attlist =
+        lg.box.orient.attribute
+        
+    lg.sizer.grid.attlist =
+        lg.gridsizer.numCols.attribute |
+        lg.gridsizer.numRows.attribute |
+        (lg.gridsizer.numCols.attribute, lg.gridsizer.numRows.attribute)
+        
+    lg.sizer.grid.other.attlist =
+        lg.gridsizer.hGap.attribute?,
+        lg.gridsizer.vGap.attribute?,
+        lg.gridsizer.fixedGrid.attribute?,
+        lg.gridsizer.colProportion.attribute?,
+        lg.gridsizer.rowProportion.attribute?
     
     lg.aui.attlist =
         lg.aui.title.attribute?,
 	bHasProp, prop = currNode:GetPropVal("proportion");
 	if(bHasProp) then proportioned = tonumber(prop) end;
 	
-	bHasProp, prop = currNode:GetPropVal("border");
-	if(bHasProp) then border = tonumber(prop); flags = flags + wx.wxALL end;
-	
 	bHasProp, prop = currNode:GetPropVal("vborder");
 	if(bHasProp) then border = tonumber(prop); flags = flags + (wx.wxTOP + wx.wxBOTTOM) end;
 	
 	bHasProp, prop = currNode:GetPropVal("hborder");
 	if(bHasProp) then border = tonumber(prop); flags = flags + (wx.wxLEFT + wx.wxRIGHT) end;
 	
+	bHasProp, prop = currNode:GetPropVal("border");
+	if(bHasProp) then border = tonumber(prop); flags = flags + wx.wxALL end;
+	
 	return proportioned, flags, border;
 end
 
 	return collpane;
 end
 
+function elementJumpTable.pane(parWnd, sizer, currNode, notebook, auiNotebook)
+	local size = GetNodeSize(currNode);
+	
+	local pane = wx.wxPanel(parWnd, wx.wxID_ANY, wx.wxDefaultPosition, size,
+		wx.wxTAB_TRAVERSAL + wx.wxNO_BORDER);
+		
+	local mySizer = CreateStandardSizer(currNode);
+	pane:SetSizer(mySizer);
+	
+	ParseChildrenWithCallback(pane, mySizer, currNode, notebook, auiNotebook, nil);
+	
+	AddToSizer(currNode, pane, sizer);
+	FinalizeControl(currNode, pane);
+	
+	return pane;
+end
+
 function elementJumpTable.scrollpane(parWnd, sizer, currNode, notebook, auiNotebook)
 	local size = GetNodeSize(currNode);
 	
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.