]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/wxd/Frames.py
94c0e72074ce4c6f134c1255e1e52ee071e42080
1 """Decorator classes for documentation and shell scripting.
4 __author__
= "Patrick K. O'Brien <pobrien@orbtech.com>"
6 __revision__
= "$Revision$"[11:-2]
9 # These are not the real wxPython classes. These are Python versions
10 # for documentation purposes. They are also used to apply docstrings
11 # to the real wxPython classes, which are SWIG-generated wrappers for
15 from Base
import Object
16 import Parameters
as wx
17 from Window
import TopLevelWindow
, Window
20 class Frame(TopLevelWindow
):
21 """A frame is a window whose size and position can (usually) be
22 changed by the user. It usually has thick borders and a title bar,
23 and can optionally contain a menu bar, toolbar and status bar. A
24 frame can contain any window that is not a frame or dialog.
26 A frame that has a status bar and toolbar created via the
27 CreateStatusBar/CreateToolBar functions manages these windows, and
28 adjusts the value returned by GetClientSize to reflect the
29 remaining size available to application windows.
31 An application should normally define a CloseEvent handler for the
32 frame to respond to system close events, for example so that
33 related data and subwindows can be cleaned up."""
35 def __init__(self
, parent
, id, title
, pos
=wx
.DefaultPosition
,
36 size
=wx
.DefaultSize
, style
=wx
.DEFAULT_FRAME_STYLE
,
37 name
=wx
.PyFrameNameStr
):
38 """Create a Frame instance.
40 parent - The window parent. This may be NULL. If it is
41 non-NULL, the frame will always be displayed on top of the
42 parent window on Windows.
44 id - The window identifier. It may take a value of -1 to
45 indicate a default value.
47 title - The caption to be displayed on the frame's title bar.
49 pos - The window position. A value of (-1, -1) indicates a
50 default position, chosen by either the windowing system or
51 wxWindows, depending on platform.
53 size - The window size. A value of (-1, -1) indicates a
54 default size, chosen by either the windowing system or
55 wxWindows, depending on platform.
57 style - The window style.
59 name - The name of the window. This parameter is used to
60 associate a name with the item, allowing the application user
61 to set Motif resource values for individual windows."""
64 def Create(self
, parent
, id, title
, pos
=wx
.DefaultPosition
,
65 size
=wx
.DefaultSize
, style
=wx
.DEFAULT_FRAME_STYLE
,
66 name
=wx
.PyFrameNameStr
):
67 """Create a Frame instance."""
70 def Command(self
, id):
71 """Simulate a menu command; id is a menu item identifier."""
74 def CreateStatusBar(self
, number
=1, style
=wx
.ST_SIZEGRIP
, id=-1,
75 name
=wx
.PyStatusLineNameStr
):
76 """Create a status bar at the bottom of frame.
78 number - The number of fields to create. Specify a value
79 greater than 1 to create a multi-field status bar.
81 style - The status bar style. See wx.StatusBar for a list of
84 id - The status bar window identifier. If -1, an identifier
85 will be chosen by wxWindows.
87 name - The status bar window name.
89 The width of the status bar is the whole width of the frame
90 (adjusted automatically when resizing), and the height and
91 text size are chosen by the host windowing system.
93 By default, the status bar is an instance of wx.StatusBar."""
96 def CreateToolBar(self
, style
=wx
.NO_BORDER|wx
.TB_HORIZONTAL
, id=-1,
97 name
=wx
.PyToolBarNameStr
):
98 """Create a toolbar at the top or left of frame.
100 style - The toolbar style. See wxToolBar for a list of valid
103 id - The toolbar window identifier. If -1, an identifier will
104 be chosen by wxWindows.
106 name - The toolbar window name.
108 By default, the toolbar is an instance of wx.ToolBar (which is
109 defined to be a suitable toolbar class on each platform, such
112 When a toolbar has been created with this function, or made
113 known to the frame with wx.Frame.SetToolBar, the frame will
114 manage the toolbar position and adjust the return value from
115 wx.Window.GetClientSize to reflect the available space for
116 application windows."""
119 def DoGiveHelp(self
, text
, show
):
120 """Show help text (typically in the statusbar).
122 show is False if you are hiding the help, True otherwise.
124 Meant to be overridden if a derived frame wants to do
125 something else with help text from menus and etc. The default
126 implementation simply calls Frame.SetStatusText."""
129 def GetClientAreaOrigin(self
):
130 """Return origin of frame client area (in client coordinates).
132 It may be different from (0, 0) if the frame has a toolbar."""
135 def GetMenuBar(self
):
136 """Return menubar currently associated with frame (if any)."""
139 def GetStatusBar(self
):
140 """Return status bar currently associated with frame (if any)."""
143 def GetStatusBarPane(self
):
144 """Return status bar pane used to display menu and toolbar
148 def GetToolBar(self
):
149 """Return toolbar currently associated with frame (if any)."""
152 def PopStatusText(self
, number
=0):
153 """Redraw status bar with previous status text.
155 number - The status field (starting from zero)."""
158 def ProcessCommand(self
, id):
159 """Process menu command; return True if processed.
161 id is the menu command identifier."""
164 def PushStatusText(self
, text
, number
=0):
165 """Set status bar text and redraw status bar, remembering
168 text - The text for the status field.
170 number - The status field (starting from zero).
172 Use an empty string to clear the status bar."""
175 def SendSizeEvent(self
):
176 """Send a dummy size event to the frame forcing it to
177 reevaluate its children positions. It is sometimes useful to
178 call this function after adding or deleting a children after
179 the frame creation or if a child size changes.
181 Note that if the frame is using either sizers or constraints
182 for the children layout, it is enough to call Frame.Layout()
183 directly and this function should not be used in this case."""
186 def SetMenuBar(self
, menubar
):
187 """Show the menu bar in the frame.
189 menuBar - The menu bar to associate with the frame.
191 If the frame is destroyed, the menu bar and its menus will be
192 destroyed also, so do not delete the menu bar explicitly
193 (except by resetting the frame's menu bar to another frame or
196 Under Windows, a call to Frame.OnSize is generated, so be sure
197 to initialize data members properly before calling SetMenuBar.
199 Note that it is not possible to call this function twice for
200 the same frame object."""
203 def SetStatusBar(self
, statBar
):
204 """Associate a status bar with the frame."""
207 def SetStatusBarPane(self
, n
):
208 """Set the status bar pane used to display menu and toolbar
209 help. Using -1 disables help display."""
212 def SetStatusText(self
, text
, number
=0):
213 """Set status bar text and redraw status bar.
215 text - The text for the status field.
217 number - The status field (starting from zero).
219 Use an empty string to clear the status bar."""
222 def SetStatusWidths(self
, choices
):
223 """Sets the widths of the fields in the status bar.
225 choices - a Python list of integers, each of which is a status
226 field width in pixels. A value of -1 indicates that the field
227 is variable width; at least one field must be -1.
229 The widths of the variable fields are calculated from the
230 total width of all fields, minus the sum of widths of the
231 non-variable fields, divided by the number of variable fields."""
234 def SetToolBar(self
, toolbar
):
235 """Associate a toolbar with the frame."""
239 class LayoutAlgorithm(Object
):
246 def LayoutFrame(self
):
250 def LayoutMDIFrame(self
):
254 def LayoutWindow(self
):
259 class MDIChildFrame(Frame
):
283 class MDIClientWindow(Window
):
295 class MDIParentFrame(Frame
):
306 def ActivateNext(self
):
310 def ActivatePrevious(self
):
314 def ArrangeIcons(self
):
322 def GetActiveChild(self
):
326 def GetClientWindow(self
):
330 def GetToolBar(self
):
339 class MiniFrame(Frame
):
351 class SplashScreen(Frame
):
358 def GetSplashStyle(self
):
362 def GetSplashWindow(self
):
366 def GetTimeout(self
):
371 class SplashScreenWindow(Window
):
387 class StatusBar(Window
):
398 def GetBorderX(self
):
402 def GetBorderY(self
):
406 def GetFieldRect(self
):
410 def GetFieldsCount(self
):
414 def GetStatusText(self
):
418 def PopStatusText(self
):
422 def PushStatusText(self
):
426 def SetFieldsCount(self
):
430 def SetMinHeight(self
):
434 def SetStatusText(self
):
438 def SetStatusWidths(self
):