[PyCrust-cvs] PyCrust/wxd Frames.py,1.3,1.4 Tree.py,1.2,1.3 wxPython.html,1.1,1.2 wxPython.txt,1.2,1
Brought to you by:
pobrien
From: <po...@us...> - 2003-03-31 02:35:20
|
Update of /cvsroot/pycrust/PyCrust/wxd In directory sc8-pr-cvs1:/tmp/cvs-serv4442/wxd Modified Files: Frames.py Tree.py wxPython.html wxPython.txt Log Message: Moved to frame.py Index: Frames.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/wxd/Frames.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Frames.py 18 Mar 2003 04:10:44 -0000 1.3 --- Frames.py 31 Mar 2003 02:35:16 -0000 1.4 *************** *** 38,44 **** """Create a Frame instance. ! parent - The window parent. This may be NULL. If it is ! non-NULL, the frame will always be displayed on top of the ! parent window on Windows. id - The window identifier. It may take a value of -1 to --- 38,44 ---- """Create a Frame instance. ! parent - The window parent. This may be None. If it is not ! None, the frame will always be displayed on top of the parent ! window on Windows. id - The window identifier. It may take a value of -1 to *************** *** 94,99 **** pass ! def CreateToolBar(self, style=wx.NO_BORDER|wx.TB_HORIZONTAL, id=-1, ! name=wx.PyToolBarNameStr): """Create a toolbar at the top or left of frame. --- 94,99 ---- pass ! def CreateToolBar(self, style=wx.NO_BORDER | wx.TB_HORIZONTAL, ! id=-1, name=wx.PyToolBarNameStr): """Create a toolbar at the top or left of frame. *************** *** 142,147 **** def GetStatusBarPane(self): ! """Return status bar pane used to display menu and toolbar ! help.""" pass --- 142,146 ---- def GetStatusBarPane(self): ! """Return status bar pane used to display menu/toolbar help.""" pass *************** *** 238,257 **** class LayoutAlgorithm(Object): ! """""" def __init__(self): ! """""" pass ! def LayoutFrame(self): ! """""" pass ! def LayoutMDIFrame(self): ! """""" pass ! def LayoutWindow(self): ! """""" pass --- 237,336 ---- class LayoutAlgorithm(Object): ! """LayoutAlgorithm implements layout of subwindows in MDI or SDI ! frames. It sends a wx.CalculateLayoutEvent event to children of ! the frame, asking them for information about their size. For MDI ! parent frames, the algorithm allocates the remaining space to the ! MDI client window (which contains the MDI child frames). For SDI ! (normal) frames, a 'main' window is specified as taking up the ! remaining space. ! ! Because the event system is used, this technique can be applied to ! any windows, which are not necessarily 'aware' of the layout ! classes. However, you may wish to use wx.SashLayoutWindow for ! your subwindows since this class provides handlers for the ! required events, and accessors to specify the desired size of the ! window. The sash behaviour in the base class can be used, ! optionally, to make the windows user-resizable. ! ! LayoutAlgorithm is typically used in IDE (integrated development ! environment) applications, where there are several resizable ! windows in addition to the MDI client window, or other primary ! editing window. Resizable windows might include toolbars, a ! project window, and a window for displaying error and warning ! messages. ! ! When a window receives an OnCalculateLayout event, it should call ! SetRect in the given event object, to be the old supplied ! rectangle minus whatever space the window takes up. It should ! also set its own size accordingly. ! SashLayoutWindow.OnCalculateLayout generates an OnQueryLayoutInfo ! event which it sends to itself to determine the orientation, ! alignment and size of the window, which it gets from internal ! member variables set by the application. ! ! The algorithm works by starting off with a rectangle equal to the ! whole frame client area. It iterates through the frame children, ! generating OnCalculateLayout events which subtract the window size ! and return the remaining rectangle for the next window to process. ! It is assumed (by SashLayoutWindow.OnCalculateLayout) that a ! window stretches the full dimension of the frame client, according ! to the orientation it specifies. For example, a horizontal window ! will stretch the full width of the remaining portion of the frame ! client area. In the other orientation, the window will be fixed ! to whatever size was specified by OnQueryLayoutInfo. An alignment ! setting will make the window 'stick' to the left, top, right or ! bottom of the remaining client area. This scheme implies that ! order of window creation is important. Say you wish to have an ! extra toolbar at the top of the frame, a project window to the ! left of the MDI client window, and an output window above the ! status bar. You should therefore create the windows in this ! order: toolbar, output window, project window. This ensures that ! the toolbar and output window take up space at the top and bottom, ! and then the remaining height in-between is used for the project ! window. ! ! LayoutAlgorithm is quite independent of the way in which ! OnCalculateLayout chooses to interpret a window's size and ! alignment. Therefore you could implement a different window class ! with a new OnCalculateLayout event handler, that has a more ! sophisticated way of laying out the windows. It might allow ! specification of whether stretching occurs in the specified ! orientation, for example, rather than always assuming ! stretching. (This could, and probably should, be added to the ! existing implementation). ! ! The algorithm object does not respond to events, but itself ! generates the following events in order to calculate window sizes: ! EVT_QUERY_LAYOUT_INFO(func), EVT_CALCULATE_LAYOUT(func).""" def __init__(self): ! """Create a LayoutAlgorithm instance.""" pass ! def LayoutFrame(self, frame, mainWindow=wx.NULL): ! """Lay out the children of a normal frame. ! ! mainWindow is set to occupy the remaining space. This ! function simply calls LayoutWindow().""" pass ! def LayoutMDIFrame(self, frame, rect=wx.NULL): ! """Lay out the children of an MDI parent frame. ! ! If rect is non-NULL, the given rectangle will be used as a ! starting point instead of the frame's client area. ! ! The MDI client window is set to occupy the remaining space.""" pass ! def LayoutWindow(self, parent, mainWindow=wx.NULL): ! """Lay out the children of a normal frame or other window. ! ! mainWindow is set to occupy the remaining space. If this is ! not specified, then the last window that responds to a ! calculate layout event in query mode will get the remaining ! space (that is, a non-query OnCalculateLayout event will not ! be sent to this window and the window will be set to the ! remaining size).""" pass Index: Tree.py =================================================================== RCS file: /cvsroot/pycrust/PyCrust/wxd/Tree.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Tree.py 7 Mar 2003 04:36:03 -0000 1.2 --- Tree.py 31 Mar 2003 02:35:17 -0000 1.3 *************** *** 19,23 **** class TreeCtrl(Control): ! """""" def AddRoot(self): --- 19,26 ---- class TreeCtrl(Control): ! """A tree control presents information as a hierarchy, with items ! that may be expanded to show further items. Items in a tree ! control are referenced by wx.TreeItemId handles, which may be ! tested for validity by calling TreeItemId.IsOk().""" def AddRoot(self): *************** *** 355,402 **** class TreeItemData(Object): ! """""" ! def GetData(self): ! """""" pass ! def GetId(self): ! """""" pass ! def SetData(self): ! """""" pass ! def SetId(self): ! """""" pass ! def __init__(self): ! """""" pass class TreeItemId: ! """""" ! ! def IsOk(self): ! """""" ! pass ! def Ok(self): ! """""" ! pass ! def __cmp__(self): ! """""" ! pass ! def __del__(self): ! """""" pass ! def __init__(self): ! """""" pass - --- 358,403 ---- class TreeItemData(Object): ! """TreeItemData is some (arbitrary) user class associated with ! some item. The main advantage of having this class is that ! TreeItemData objects are destroyed automatically by the tree and ! the memory and any other resources associated with a tree item ! will be automatically freed when it is deleted.""" ! def __init__(self, obj=wx.NULL): ! """Associate any Python object with tree item using ! wxTreeItemData as container.""" pass ! def GetData(self): ! """Return the Python object.""" pass ! def GetId(self): ! """Return the item associated with this node.""" pass ! def SetData(self, obj): ! """Associate Python object with tree item.""" pass ! def SetId(self, id): ! """Set the item associated with this node.""" pass class TreeItemId: ! """Item in a TreeCtrl.""" ! ## You wouldn't create these directly. ! ## def __init__(self): ! ## """""" ! ## pass ! def IsOk(self): ! """Return True if item is valid.""" pass ! def Ok(self): ! """Synonym for IsOk.""" pass Index: wxPython.html =================================================================== RCS file: /cvsroot/pycrust/PyCrust/wxd/wxPython.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxPython.html 22 Mar 2003 16:06:44 -0000 1.1 --- wxPython.html 31 Mar 2003 02:35:17 -0000 1.2 *************** *** 70,74 **** <li><a class="reference" href="#programming-with-notebooksizer" id="id30" name="id30">Programming with NotebookSizer</a></li> <li><a class="reference" href="#programming-with-staticboxsizer" id="id31" name="id31">Programming with StaticBoxSizer</a></li> ! <li><a class="reference" href="#createbuttonsizer" id="id32" name="id32">CreateButtonSizer</a></li> </ul> </li> --- 70,74 ---- <li><a class="reference" href="#programming-with-notebooksizer" id="id30" name="id30">Programming with NotebookSizer</a></li> <li><a class="reference" href="#programming-with-staticboxsizer" id="id31" name="id31">Programming with StaticBoxSizer</a></li> ! <li><a class="reference" href="#dialog-createbuttonsizer" id="id32" name="id32">Dialog.CreateButtonSizer</a></li> </ul> </li> *************** *** 385,388 **** --- 385,415 ---- <p>Classes: wx.Sizer, wx.GridSizer, wx.FlexGridSizer, wx.BoxSizer, wx.StaticBoxSizer, wx.NotebookSizer, wx.CreateButtonSizer</p> + <table class="table" frame="border" rules="all"> + <colgroup> + <col width="21%" /> + <col width="79%" /> + </colgroup> + <tbody valign="top"> + <tr><td>Sizer</td> + <td>Abstract base class.</td> + </tr> + <tr><td>GridSizer</td> + <td>A sizer for laying out windows in a grid with all + fields having the same size.</td> + </tr> + <tr><td>FlexGridSizer</td> + <td>A sizer for laying out windows in a flexible grid.</td> + </tr> + <tr><td>BoxSizer</td> + <td>A sizer for laying out windows in a row or column.</td> + </tr> + <tr><td>StaticBoxSizer</td> + <td>Same as BoxSizer, but with a surrounding static box.</td> + </tr> + <tr><td>NotebookSizer</td> + <td>Sizer to use with the Notebook control.</td> + </tr> + </tbody> + </table> <p>Sizers, as represented by the wx.Sizer class and its descendants in the wxPython class hierarchy, have become the method of choice to *************** *** 624,647 **** <p>[Show code and graphic here.]</p> </div> ! <div class="section" id="createbuttonsizer"> ! <h2><a class="toc-backref" href="#id32" name="createbuttonsizer">CreateButtonSizer</a></h2> ! <p>As a convenience, wx.CreateButtonSizer(flags) can be used to create a ! standard button sizer in which standard buttons are displayed. The ! following flags can be passed to this function:</p> ! <pre class="literal-block"> ! wxYES_NO // Add Yes/No subpanel ! wxYES // return wxID_YES ! wxNO // return wxID_NO ! wxNO_DEFAULT // make the wxNO button the default, otherwise wxYES or wxOK button will be default ! ! wxOK // return wxID_OK ! wxCANCEL // return wxID_CANCEL ! wxHELP // return wxID_HELP ! ! wxFORWARD // return wxID_FORWARD ! wxBACKWARD // return wxID_BACKWARD ! wxSETUP // return wxID_SETUP ! wxMORE // return wxID_MORE ! </pre> </div> </div> --- 651,702 ---- <p>[Show code and graphic here.]</p> </div> ! <div class="section" id="dialog-createbuttonsizer"> ! <h2><a class="toc-backref" href="#id32" name="dialog-createbuttonsizer">Dialog.CreateButtonSizer</a></h2> ! <p>As a convenience, the Dialog class has a CreateButtonSizer(flags) ! method that can be used to create a standard button sizer in which ! standard buttons are displayed. The following flags can be passed to ! this method:</p> ! <table class="table" frame="border" rules="all"> ! <colgroup> ! <col width="19%" /> ! <col width="81%" /> ! </colgroup> ! <tbody valign="top"> ! <tr><td>wx.YES_NO</td> ! <td>add Yes/No subpanel</td> ! </tr> ! <tr><td>wx.YES</td> ! <td>return wx.ID_YES</td> ! </tr> ! <tr><td>wx.NO</td> ! <td>return wx.ID_NO</td> ! </tr> ! <tr><td>wx.NO_DEFAULT</td> ! <td>make the wx.NO button the default, otherwise wx.YES or ! wx.OK button will be default</td> ! </tr> ! <tr><td>wx.OK</td> ! <td>return wx.ID_OK</td> ! </tr> ! <tr><td>wx.CANCEL</td> ! <td>return wx.ID_CANCEL</td> ! </tr> ! <tr><td>wx.HELP</td> ! <td>return wx.ID_HELP</td> ! </tr> ! <tr><td>wx.FORWARD</td> ! <td>return wx.ID_FORWARD</td> ! </tr> ! <tr><td>wx.BACKWARD</td> ! <td>return wx.ID_BACKWARD</td> ! </tr> ! <tr><td>wx.SETUP</td> ! <td>return wx.ID_SETUP</td> ! </tr> ! <tr><td>wx.MORE</td> ! <td>return wx.ID_MORE</td> ! </tr> ! </tbody> ! </table> </div> </div> Index: wxPython.txt =================================================================== RCS file: /cvsroot/pycrust/PyCrust/wxd/wxPython.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxPython.txt 22 Mar 2003 16:03:47 -0000 1.2 --- wxPython.txt 31 Mar 2003 02:35:17 -0000 1.3 *************** *** 364,367 **** --- 364,384 ---- wx.StaticBoxSizer, wx.NotebookSizer, wx.CreateButtonSizer + ============== ====================================================== + + Sizer Abstract base class. + + GridSizer A sizer for laying out windows in a grid with all + fields having the same size. + + FlexGridSizer A sizer for laying out windows in a flexible grid. + + BoxSizer A sizer for laying out windows in a row or column. + + StaticBoxSizer Same as BoxSizer, but with a surrounding static box. + + NotebookSizer Sizer to use with the Notebook control. + + ============== ====================================================== + Sizers, as represented by the wx.Sizer class and its descendants in the wxPython class hierarchy, have become the method of choice to *************** *** 659,682 **** ! CreateButtonSizer ! ----------------- ! As a convenience, wx.CreateButtonSizer(flags) can be used to create a ! standard button sizer in which standard buttons are displayed. The ! following flags can be passed to this function:: ! wxYES_NO // Add Yes/No subpanel ! wxYES // return wxID_YES ! wxNO // return wxID_NO ! wxNO_DEFAULT // make the wxNO button the default, otherwise wxYES or wxOK button will be default ! ! wxOK // return wxID_OK ! wxCANCEL // return wxID_CANCEL ! wxHELP // return wxID_HELP ! ! wxFORWARD // return wxID_FORWARD ! wxBACKWARD // return wxID_BACKWARD ! wxSETUP // return wxID_SETUP ! wxMORE // return wxID_MORE --- 676,701 ---- ! Dialog.CreateButtonSizer ! ------------------------ ! As a convenience, the Dialog class has a CreateButtonSizer(flags) ! method that can be used to create a standard button sizer in which ! standard buttons are displayed. The following flags can be passed to ! this method: ! ============= ======================================================= ! wx.YES_NO add Yes/No subpanel ! wx.YES return wx.ID_YES ! wx.NO return wx.ID_NO ! wx.NO_DEFAULT make the wx.NO button the default, otherwise wx.YES or ! wx.OK button will be default ! wx.OK return wx.ID_OK ! wx.CANCEL return wx.ID_CANCEL ! wx.HELP return wx.ID_HELP ! wx.FORWARD return wx.ID_FORWARD ! wx.BACKWARD return wx.ID_BACKWARD ! wx.SETUP return wx.ID_SETUP ! wx.MORE return wx.ID_MORE ! ============= ======================================================= *************** *** 899,902 **** --- 918,985 ---- Not done yet. + + + ID constants + ============ + + wxPython provides the following predefined ID constants: + + ID_ABORT + ID_ABOUT + ID_ANY + ID_APPLY + ID_BACKWARD + ID_CANCEL + ID_CLEAR + ID_CLOSE + ID_CLOSE_ALL + ID_CONTEXT_HELP + ID_COPY + ID_CUT + ID_DEFAULT + ID_DUPLICATE + ID_EXIT + ID_FILE1 + ID_FILE2 + ID_FILE3 + ID_FILE4 + ID_FILE5 + ID_FILE6 + ID_FILE7 + ID_FILE8 + ID_FILE9 + ID_FILTERLISTCTRL + ID_FIND + ID_FORWARD + ID_HELP + ID_HELP_COMMANDS + ID_HELP_CONTENTS + ID_HELP_CONTEXT + ID_HELP_PROCEDURES + ID_IGNORE + ID_MORE + ID_NEW + ID_NO + ID_NOTOALL + ID_OK + ID_OPEN + ID_PASTE + ID_PREVIEW + ID_PRINT + ID_PRINT_SETUP + ID_REDO + ID_RESET + ID_RETRY + ID_REVERT + ID_SAVE + ID_SAVEAS + ID_SELECTALL + ID_SEPARATOR + ID_SETUP + ID_STATIC + ID_TREECTRL + ID_UNDO + ID_YES + ID_YESTOALL |