1 # 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
4 # o Issues exist that will probably need to be addressed in the 2.5 build.
6 # 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net)
8 # o Had to do a bit of rework for the demo; there was no panel attached
9 # to the demo window, so all buttons were showing as dark gray on
10 # dark gray. I have no idea why this didn't break before. Robin,
11 # please examine my changes to ensure you approve. It's rather
15 #----------------------------------------------------------------------
17 #----------------------------------------------------------------------
21 #----------------------------------------------------------------------
23 def makeSimpleBox1(win
):
24 box
= wx
.BoxSizer(wx
.HORIZONTAL
)
25 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
26 box
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
27 box
.Add(wx
.Button(win
, -1, "three"), 0, wx
.EXPAND
)
28 box
.Add(wx
.Button(win
, -1, "four"), 0, wx
.EXPAND
)
32 #----------------------------------------------------------------------
34 def makeSimpleBox2(win
):
35 box
= wx
.BoxSizer(wx
.VERTICAL
)
36 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
37 box
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
38 box
.Add(wx
.Button(win
, -1, "three"), 0, wx
.EXPAND
)
39 box
.Add(wx
.Button(win
, -1, "four"), 0, wx
.EXPAND
)
43 #----------------------------------------------------------------------
45 def makeSimpleBox3(win
):
46 box
= wx
.BoxSizer(wx
.HORIZONTAL
)
47 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
48 box
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
49 box
.Add(wx
.Button(win
, -1, "three"), 0, wx
.EXPAND
)
50 box
.Add(wx
.Button(win
, -1, "four"), 0, wx
.EXPAND
)
51 box
.Add(wx
.Button(win
, -1, "five"), 1, wx
.EXPAND
)
55 #----------------------------------------------------------------------
57 def makeSimpleBox4(win
):
58 box
= wx
.BoxSizer(wx
.HORIZONTAL
)
59 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
60 box
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
61 box
.Add(wx
.Button(win
, -1, "three"), 1, wx
.EXPAND
)
62 box
.Add(wx
.Button(win
, -1, "four"), 1, wx
.EXPAND
)
63 box
.Add(wx
.Button(win
, -1, "five"), 1, wx
.EXPAND
)
67 #----------------------------------------------------------------------
69 def makeSimpleBox5(win
):
70 box
= wx
.BoxSizer(wx
.HORIZONTAL
)
71 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
72 box
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
73 box
.Add(wx
.Button(win
, -1, "three"), 3, wx
.EXPAND
)
74 box
.Add(wx
.Button(win
, -1, "four"), 1, wx
.EXPAND
)
75 box
.Add(wx
.Button(win
, -1, "five"), 1, wx
.EXPAND
)
79 #----------------------------------------------------------------------
81 def makeSimpleBox6(win
):
82 box
= wx
.BoxSizer(wx
.HORIZONTAL
)
83 box
.Add(wx
.Button(win
, -1, "one"), 1, wx
.ALIGN_TOP
)
84 box
.Add(wx
.Button(win
, -1, "two"), 1, wx
.EXPAND
)
85 box
.Add(wx
.Button(win
, -1, "three"), 1, wx
.ALIGN_CENTER
)
86 box
.Add(wx
.Button(win
, -1, "four"), 1, wx
.EXPAND
)
87 box
.Add(wx
.Button(win
, -1, "five"), 1, wx
.ALIGN_BOTTOM
)
91 #----------------------------------------------------------------------
93 def makeSimpleBox7(win
):
94 box
= wxBoxSizer(wxHORIZONTAL
)
95 box
.Add(wxButton(win
, 1010, "one"), 0, wxEXPAND
)
96 box
.Add(wxButton(win
, 1010, "two"), 0, wxEXPAND
)
97 box
.Add(wxButton(win
, 1010, "three"), 0, wxEXPAND
)
98 box
.Add((60, 20), 0, wxEXPAND
)
99 box
.Add(wxButton(win
, 1010, "five"), 1, wxEXPAND
)
103 #----------------------------------------------------------------------
105 def makeSimpleBox8(win
):
106 box
= wxBoxSizer(wxVERTICAL
)
107 box
.Add(wxButton(win
, 1010, "one"), 0, wxEXPAND
)
109 box
.Add(wxButton(win
, 1010, "two"), 0, wxALIGN_CENTER
)
111 box
.Add(wxButton(win
, 1010, "three"), 0, wxEXPAND
)
112 box
.Add(wxButton(win
, 1010, "four"), 0, wxEXPAND
)
113 # box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND)
117 #----------------------------------------------------------------------
118 #----------------------------------------------------------------------
120 def makeSimpleBorder1(win
):
121 bdr
= wx
.BoxSizer(wx
.HORIZONTAL
)
122 btn
= wx
.Button(win
, -1, "border")
123 btn
.SetSize((80, 80))
124 bdr
.Add(btn
, 1, wx
.EXPAND|wx
.ALL
, 15)
128 #----------------------------------------------------------------------
130 def makeSimpleBorder2(win
):
131 bdr
= wx
.BoxSizer(wx
.HORIZONTAL
)
132 btn
= wx
.Button(win
, -1, "border")
133 btn
.SetSize((80, 80))
134 bdr
.Add(btn
, 1, wx
.EXPAND | wx
.EAST | wx
.WEST
, 15)
138 #----------------------------------------------------------------------
140 def makeSimpleBorder3(win
):
141 bdr
= wx
.BoxSizer(wx
.HORIZONTAL
)
142 btn
= wx
.Button(win
, -1, "border")
143 btn
.SetSize((80, 80))
144 bdr
.Add(btn
, 1, wx
.EXPAND | wx
.NORTH | wx
.WEST
, 15)
148 #----------------------------------------------------------------------
149 #----------------------------------------------------------------------
151 def makeBoxInBox(win
):
152 box
= wx
.BoxSizer(wx
.VERTICAL
)
154 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
156 box2
= wx
.BoxSizer(wx
.HORIZONTAL
)
157 box2
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
158 btn3
= wx
.Button(win
, -1, "three")
159 box2
.Add(btn3
, 0, wx
.EXPAND
)
160 box2
.Add(wx
.Button(win
, -1, "four"), 0, wx
.EXPAND
)
161 box2
.Add(wx
.Button(win
, -1, "five"), 0, wx
.EXPAND
)
163 box3
= wx
.BoxSizer(wx
.VERTICAL
)
164 box3
.AddMany([ (wx
.Button(win
, -1, "six"), 0, wx
.EXPAND
),
165 (wx
.Button(win
, -1, "seven"), 2, wx
.EXPAND
),
166 (wx
.Button(win
, -1, "eight"), 1, wx
.EXPAND
),
167 (wx
.Button(win
, -1, "nine"), 1, wx
.EXPAND
),
170 box2
.Add(box3
, 1, wx
.EXPAND
)
171 box
.Add(box2
, 1, wx
.EXPAND
)
173 box
.Add(wx
.Button(win
, -1, "ten"), 0, wx
.EXPAND
)
179 #----------------------------------------------------------------------
181 def makeBoxInBorder(win
):
182 bdr
= wx
.BoxSizer(wx
.HORIZONTAL
)
183 box
= makeSimpleBox3(win
)
184 bdr
.Add(box
, 1, wx
.EXPAND | wx
.ALL
, 15)
188 #----------------------------------------------------------------------
190 def makeBorderInBox(win
):
191 insideBox
= wx
.BoxSizer(wx
.HORIZONTAL
)
193 box2
= wx
.BoxSizer(wx
.HORIZONTAL
)
194 box2
.AddMany([ (wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
),
195 (wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
),
196 (wx
.Button(win
, -1, "three"), 0, wx
.EXPAND
),
197 (wx
.Button(win
, -1, "four"), 0, wx
.EXPAND
),
198 (wx
.Button(win
, -1, "five"), 0, wx
.EXPAND
),
201 insideBox
.Add(box2
, 0, wx
.EXPAND
)
203 bdr
= wx
.BoxSizer(wx
.HORIZONTAL
)
204 bdr
.Add(wx
.Button(win
, -1, "border"), 1, wx
.EXPAND | wx
.ALL
)
205 insideBox
.Add(bdr
, 1, wx
.EXPAND | wx
.ALL
, 20)
207 box3
= wx
.BoxSizer(wx
.VERTICAL
)
208 box3
.AddMany([ (wx
.Button(win
, -1, "six"), 0, wx
.EXPAND
),
209 (wx
.Button(win
, -1, "seven"), 2, wx
.EXPAND
),
210 (wx
.Button(win
, -1, "eight"), 1, wx
.EXPAND
),
211 (wx
.Button(win
, -1, "nine"), 1, wx
.EXPAND
),
213 insideBox
.Add(box3
, 1, wx
.EXPAND
)
215 outsideBox
= wx
.BoxSizer(wx
.VERTICAL
)
216 outsideBox
.Add(wx
.Button(win
, -1, "top"), 0, wx
.EXPAND
)
217 outsideBox
.Add(insideBox
, 1, wx
.EXPAND
)
218 outsideBox
.Add(wx
.Button(win
, -1, "bottom"), 0, wx
.EXPAND
)
223 #----------------------------------------------------------------------
226 gs
= wx
.GridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
228 gs
.AddMany([ (wx
.Button(win
, -1, 'one'), 0, wx
.EXPAND
),
229 (wx
.Button(win
, -1, 'two'), 0, wx
.EXPAND
),
230 (wx
.Button(win
, -1, 'three'), 0, wx
.EXPAND
),
231 (wx
.Button(win
, -1, 'four'), 0, wx
.EXPAND
),
232 (wx
.Button(win
, -1, 'five'), 0, wx
.EXPAND
),
234 (wx
.Button(win
, -1, 'six'), 0, wx
.EXPAND
),
235 (wx
.Button(win
, -1, 'seven'), 0, wx
.EXPAND
),
236 (wx
.Button(win
, -1, 'eight'), 0, wx
.EXPAND
),
237 (wx
.Button(win
, -1, 'nine'), 0, wx
.EXPAND
),
242 #----------------------------------------------------------------------
245 gs
= wx
.GridSizer(3, 3) # rows, cols, hgap, vgap
247 box
= wx
.BoxSizer(wx
.VERTICAL
)
248 box
.Add(wx
.Button(win
, -1, 'A'), 0, wx
.EXPAND
)
249 box
.Add(wx
.Button(win
, -1, 'B'), 1, wx
.EXPAND
)
251 gs2
= wx
.GridSizer(2,2, 4, 4)
252 gs2
.AddMany([ (wx
.Button(win
, -1, 'C'), 0, wx
.EXPAND
),
253 (wx
.Button(win
, -1, 'E'), 0, wx
.EXPAND
),
254 (wx
.Button(win
, -1, 'F'), 0, wx
.EXPAND
),
255 (wx
.Button(win
, -1, 'G'), 0, wx
.EXPAND
)])
257 gs
.AddMany([ (wx
.Button(win
, -1, 'one'), 0, wx
.ALIGN_RIGHT | wx
.ALIGN_BOTTOM
),
258 (wx
.Button(win
, -1, 'two'), 0, wx
.EXPAND
),
259 (wx
.Button(win
, -1, 'three'), 0, wx
.ALIGN_LEFT | wx
.ALIGN_BOTTOM
),
260 (wx
.Button(win
, -1, 'four'), 0, wx
.EXPAND
),
261 (wx
.Button(win
, -1, 'five'), 0, wx
.ALIGN_CENTER
),
262 (wx
.Button(win
, -1, 'six'), 0, wx
.EXPAND
),
263 (box
, 0, wx
.EXPAND | wx
.ALL
, 10),
264 (wx
.Button(win
, -1, 'eight'), 0, wx
.EXPAND
),
265 (gs2
, 0, wx
.EXPAND | wx
.ALL
, 4),
270 #----------------------------------------------------------------------
273 gs
= wx
.FlexGridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
275 gs
.AddMany([ (wx
.Button(win
, -1, 'one'), 0, wx
.EXPAND
),
276 (wx
.Button(win
, -1, 'two'), 0, wx
.EXPAND
),
277 (wx
.Button(win
, -1, 'three'), 0, wx
.EXPAND
),
278 (wx
.Button(win
, -1, 'four'), 0, wx
.EXPAND
),
279 #(wxButton(win, 1010, 'five'), 0, wxEXPAND),
281 (wx
.Button(win
, -1, 'six'), 0, wx
.EXPAND
),
282 (wx
.Button(win
, -1, 'seven'), 0, wx
.EXPAND
),
283 (wx
.Button(win
, -1, 'eight'), 0, wx
.EXPAND
),
284 (wx
.Button(win
, -1, 'nine'), 0, wx
.EXPAND
),
292 #----------------------------------------------------------------------
295 bpos
= wx
.DefaultPosition
296 bsize
= wx
.Size(100, 50)
297 gs
= wx
.GridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
299 gs
.AddMany([ (wx
.Button(win
, -1, 'one', bpos
, bsize
),
300 0, wx
.ALIGN_TOP | wx
.ALIGN_LEFT
),
301 (wx
.Button(win
, -1, 'two', bpos
, bsize
),
302 0, wx
.ALIGN_TOP | wx
.ALIGN_CENTER_HORIZONTAL
),
303 (wx
.Button(win
, -1, 'three', bpos
, bsize
),
304 0, wx
.ALIGN_TOP | wx
.ALIGN_RIGHT
),
305 (wx
.Button(win
, -1, 'four', bpos
, bsize
),
306 0, wx
.ALIGN_CENTER_VERTICAL | wx
.ALIGN_LEFT
),
307 (wx
.Button(win
, -1, 'five', bpos
, bsize
),
308 0, wx
.ALIGN_CENTER
),
309 (wx
.Button(win
, -1, 'six', bpos
, bsize
),
310 0, wx
.ALIGN_CENTER_VERTICAL | wx
.ALIGN_RIGHT
),
311 (wx
.Button(win
, -1, 'seven', bpos
, bsize
),
312 0, wx
.ALIGN_BOTTOM | wx
.ALIGN_LEFT
),
313 (wx
.Button(win
, -1, 'eight', bpos
, bsize
),
314 0, wx
.ALIGN_BOTTOM | wx
.ALIGN_CENTER_HORIZONTAL
),
315 (wx
.Button(win
, -1, 'nine', bpos
, bsize
),
316 0, wx
.ALIGN_BOTTOM | wx
.ALIGN_RIGHT
),
321 #----------------------------------------------------------------------
324 bpos
= wx
.DefaultPosition
325 bsize
= wx
.Size(100, 50)
326 gs
= wx
.GridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
328 gs
.AddMany([ (wx
.Button(win
, -1, 'one', bpos
, bsize
),
329 0, wx
.SHAPED | wx
.ALIGN_TOP | wx
.ALIGN_LEFT
),
330 (wx
.Button(win
, -1, 'two', bpos
, bsize
),
331 0, wx
.SHAPED | wx
.ALIGN_TOP | wx
.ALIGN_CENTER_HORIZONTAL
),
332 (wx
.Button(win
, -1, 'three', bpos
, bsize
),
333 0, wx
.SHAPED | wx
.ALIGN_TOP | wx
.ALIGN_RIGHT
),
334 (wx
.Button(win
, -1, 'four', bpos
, bsize
),
335 0, wx
.SHAPED | wx
.ALIGN_CENTER_VERTICAL | wx
.ALIGN_LEFT
),
336 (wx
.Button(win
, -1, 'five', bpos
, bsize
),
337 0, wx
.SHAPED | wx
.ALIGN_CENTER
),
338 (wx
.Button(win
, -1, 'six', bpos
, bsize
),
339 0, wx
.SHAPED | wx
.ALIGN_CENTER_VERTICAL | wx
.ALIGN_RIGHT
),
340 (wx
.Button(win
, -1, 'seven', bpos
, bsize
),
341 0, wx
.SHAPED | wx
.ALIGN_BOTTOM | wx
.ALIGN_LEFT
),
342 (wx
.Button(win
, -1, 'eight', bpos
, bsize
),
343 0, wx
.SHAPED | wx
.ALIGN_BOTTOM | wx
.ALIGN_CENTER_HORIZONTAL
),
344 (wx
.Button(win
, -1, 'nine', bpos
, bsize
),
345 0, wx
.SHAPED | wx
.ALIGN_BOTTOM | wx
.ALIGN_RIGHT
),
350 #----------------------------------------------------------------------
352 def makeSimpleBoxShaped(win
):
353 box
= wx
.BoxSizer(wx
.HORIZONTAL
)
354 box
.Add(wx
.Button(win
, -1, "one"), 0, wx
.EXPAND
)
355 box
.Add(wx
.Button(win
, -1, "two"), 0, wx
.EXPAND
)
356 box
.Add(wx
.Button(win
, -1, "three"), 0, wx
.EXPAND
)
357 box
.Add(wx
.Button(win
, -1, "four"), 0, wx
.EXPAND
)
358 box
.Add(wx
.Button(win
, -1, "five"), 1, wx
.SHAPED
)
362 #----------------------------------------------------------------------
365 ("Simple horizontal boxes", makeSimpleBox1
,
366 "This is a HORIZONTAL box sizer with four non-stretchable buttons held "
367 "within it. Notice that the buttons are added and aligned in the horizontal "
368 "dimension. Also notice that they are fixed size in the horizontal dimension, "
369 "but will stretch vertically."
372 ("Simple vertical boxes", makeSimpleBox2
,
373 "Exactly the same as the previous sample but using a VERTICAL box sizer "
374 "instead of a HORIZONTAL one."
377 ("Add a stretchable", makeSimpleBox3
,
378 "We've added one more button with the stretchable flag turned on. Notice "
379 "how it grows to fill the extra space in the otherwise fixed dimension."
382 ("More than one stretchable", makeSimpleBox4
,
383 "Here there are several items that are stretchable, they all divide up the "
384 "extra space evenly."
387 ("Weighting factor", makeSimpleBox5
,
388 "This one shows more than one stretchable, but one of them has a weighting "
389 "factor so it gets more of the free space."
392 ("Edge Affinity", makeSimpleBox6
,
393 "For items that don't completly fill their allotted space, and don't "
394 "stretch, you can specify which side (or the center) they should stay "
398 ("Spacer", makeSimpleBox7
,
399 "You can add empty space to be managed by a Sizer just as if it were a "
400 "window or another Sizer."
403 ("Centering in available space", makeSimpleBox8
,
404 "This one shows an item that does not expand to fill it's space, but rather"
405 "stays centered within it."
408 # ("Percent Sizer", makeSimpleBox6,
409 # "You can use the wx.BoxSizer like a Percent Sizer. Just make sure that all "
410 # "the weighting factors add up to 100!"
415 ("Simple border sizer", makeSimpleBorder1
,
416 "The wx.BoxSizer can leave empty space around its contents. This one "
417 "gives a border all the way around."
420 ("East and West border", makeSimpleBorder2
,
421 "You can pick and choose which sides have borders."
424 ("North and West border", makeSimpleBorder3
,
425 "You can pick and choose which sides have borders."
430 ("Boxes inside of boxes", makeBoxInBox
,
431 "This one shows nesting of boxes within boxes within boxes, using both "
432 "orientations. Notice also that button seven has a greater weighting "
433 "factor than its siblings."
436 ("Boxes inside a Border", makeBoxInBorder
,
437 "Sizers of different types can be nested within each other as well. "
438 "Here is a box sizer with several buttons embedded within a border sizer."
441 ("Border in a Box", makeBorderInBox
,
442 "Another nesting example. This one has Boxes and a Border inside another Box."
447 ("Simple Grid", makeGrid1
,
448 "This is an example of the wxGridSizer. In this case all row heights "
449 "and column widths are kept the same as all the others and all items "
450 "fill their available space. The horizontal and vertical gaps are set to "
454 ("More Grid Features", makeGrid2
,
455 "This is another example of the wxGridSizer. This one has no gaps in the grid, "
456 "but various cells are given different alignment options and some of them "
457 "hold nested sizers."
460 ("Flexible Grid", makeGrid3
,
461 "This grid allows the rows to have different heights and the columns to have "
462 "different widths. You can also specify rows and columns that are growable, "
463 "which we have done for the first and last row and the middle column for "
465 "\nThere is also a spacer in the middle cell instead of an actual window."
468 ("Grid with Alignment", makeGrid4
,
469 "New alignment flags allow for the positioning of items in any corner or centered "
475 ("Proportional resize", makeSimpleBoxShaped
,
476 "Managed items can preserve their original aspect ratio. The last item has the "
477 "wxSHAPED flag set and will resize proportional to its original size."
480 ("Proportional resize with Alignments", makeShapes
,
481 "This one shows various alignments as well as proportional resizing for all items."
485 #----------------------------------------------------------------------
487 class TestFrame(wx
.Frame
):
488 def __init__(self
, parent
, title
, sizerFunc
):
489 wx
.Frame
.__init
__(self
, parent
, -1, title
)
490 self
.Bind(wx
.EVT_BUTTON
, self
.OnButton
)
492 p
= wx
.Panel(self
, -1)
494 self
.sizer
= sizerFunc(p
)
495 self
.CreateStatusBar()
496 self
.SetStatusText("Resize this frame to see how the sizers respond...")
499 p
.SetAutoLayout(True)
500 p
.SetSizer(self
.sizer
)
501 self
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
504 def OnCloseWindow(self
, event
):
505 self
.MakeModal(False)
508 def OnButton(self
, event
):
511 #----------------------------------------------------------------------
515 class TestSelectionPanel(wx
.Panel
):
516 def __init__(self
, parent
, frame
):
517 wx
.Panel
.__init
__(self
, parent
, -1)
520 self
.list = wx
.ListBox(self
, -1,
521 wx
.DLG_PNT(self
, 10, 10), wx
.DLG_SZE(self
, 100, 100),
523 self
.Bind(wx
.EVT_LISTBOX
, self
.OnSelect
, id=self
.list.GetId())
524 self
.Bind(wx
.EVT_LISTBOX_DCLICK
, self
.OnDClick
, id=self
.list.GetId())
526 self
.btn
= wx
.Button(self
, -1, "Try it!", wx
.DLG_PNT(self
, 120, 10)).SetDefault()
527 self
.Bind(wx
.EVT_BUTTON
, self
.OnDClick
)
529 self
.text
= wx
.TextCtrl(self
, -1, "",
530 wx
.DLG_PNT(self
, 10, 115),
531 wx
.DLG_SZE(self
, 200, 50),
532 wx
.TE_MULTILINE | wx
.TE_READONLY
)
534 for item
in theTests
:
535 self
.list.Append(item
[0])
538 def OnSelect(self
, event
):
539 pos
= self
.list.GetSelection()
540 self
.text
.SetValue(theTests
[pos
][2])
543 def OnDClick(self
, event
):
544 pos
= self
.list.GetSelection()
545 title
= theTests
[pos
][0]
546 func
= theTests
[pos
][1]
549 win
= TestFrame(self
, title
, func
)
550 win
.CentreOnParent(wx
.BOTH
)
554 #----------------------------------------------------------------------
556 def runTest(frame
, nb
, log
):
557 win
= TestSelectionPanel(nb
, frame
)
561 #wxSizer.__doc__ + '\n' + '-' * 80 + '\n' + \
562 #wxBoxSizer.__doc__ + '\n' + '-' * 80 + '\n' + \
563 #wxBorderSizer.__doc__
565 #----------------------------------------------------------------------
567 if __name__
== '__main__':
569 class MainFrame(wx
.Frame
):
571 wx
.Frame
.__init
__(self
, None, -1, "Testing...")
573 self
.CreateStatusBar()
574 mainmenu
= wx
.MenuBar()
576 menu
.Append(200, 'E&xit', 'Get the heck outta here!')
577 mainmenu
.Append(menu
, "&File")
578 self
.SetMenuBar(mainmenu
)
579 self
.Bind(wx
.EVT_MENU
, self
.OnExit
, id=200)
580 self
.panel
= TestSelectionPanel(self
, self
)
581 self
.SetSize((400, 380))
582 self
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
584 def OnCloseWindow(self
, event
):
587 def OnExit(self
, event
):
591 class TestApp(wx
.App
):
595 self
.SetTopWindow(frame
)
602 #----------------------------------------------------------------------