1 #----------------------------------------------------------------------------
3 # Purpose: This file is appended to the shadow class file generated
4 # by SWIG. We add some unSWIGable things here.
10 # Copyright: (c) 1998 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------------
16 #----------------------------------------------------------------------
17 # This gives this module's dictionary to the C++ extension code...
19 _wxSetDictionary(vars())
22 #----------------------------------------------------------------------
23 #----------------------------------------------------------------------
24 # Helper function to link python methods to wxWindows virtual
27 def _checkForCallback(obj
, name
, event
, theID
=-1):
28 try: cb
= getattr(obj
, name
)
30 else: obj
.Connect(theID
, -1, event
, cb
)
32 def _StdWindowCallbacks(win
):
33 _checkForCallback(win
, "OnChar", wxEVT_CHAR
)
34 _checkForCallback(win
, "OnSize", wxEVT_SIZE
)
35 _checkForCallback(win
, "OnEraseBackground", wxEVT_ERASE_BACKGROUND
)
36 _checkForCallback(win
, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED
)
37 _checkForCallback(win
, "OnInitDialog", wxEVT_INIT_DIALOG
)
38 _checkForCallback(win
, "OnIdle", wxEVT_IDLE
)
39 _checkForCallback(win
, "OnPaint", wxEVT_PAINT
)
41 def _StdFrameCallbacks(win
):
42 _StdWindowCallbacks(win
)
43 _checkForCallback(win
, "OnActivate", wxEVT_ACTIVATE
)
44 _checkForCallback(win
, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT
)
45 _checkForCallback(win
, "OnCloseWindow", wxEVT_CLOSE_WINDOW
)
48 def _StdOnScrollCallback(win
):
49 try: cb
= getattr(win
, "OnScroll")
51 else: EVT_SCROLL(win
, cb
)
55 #----------------------------------------------------------------------
56 #----------------------------------------------------------------------
57 # functions that look and act like the C++ Macros of the same name
61 def EVT_SIZE(win
, func
):
62 win
.Connect(-1, -1, wxEVT_SIZE
, func
)
64 def EVT_MOVE(win
, func
):
65 win
.Connect(-1, -1, wxEVT_MOVE
, func
)
67 def EVT_CLOSE(win
, func
):
68 win
.Connect(-1, -1, wxEVT_CLOSE_WINDOW
, func
)
70 def EVT_PAINT(win
, func
):
71 win
.Connect(-1, -1, wxEVT_PAINT
, func
)
73 def EVT_ERASE_BACKGROUND(win
, func
):
74 win
.Connect(-1, -1, wxEVT_ERASE_BACKGROUND
, func
)
76 def EVT_CHAR(win
, func
):
77 win
.Connect(-1, -1, wxEVT_CHAR
, func
)
79 def EVT_CHAR_HOOK(win
, func
):
80 win
.Connect(-1, -1, wxEVT_CHAR_HOOK
, func
)
82 def EVT_MENU_HIGHLIGHT(win
, id, func
):
83 win
.Connect(id, -1, wxEVT_MENU_HIGHLIGHT
, func
)
85 def EVT_MENU_HIGHLIGHT_ALL(win
, func
):
86 win
.Connect(-1, -1, wxEVT_MENU_HIGHLIGHT
, func
)
88 def EVT_SET_FOCUS(win
, func
):
89 win
.Connect(-1, -1, wxEVT_SET_FOCUS
, func
)
91 def EVT_KILL_FOCUS(win
, func
):
92 win
.Connect(-1, -1, wxEVT_KILL_FOCUS
, func
)
94 def EVT_ACTIVATE(win
, func
):
95 win
.Connect(-1, -1, wxEVT_ACTIVATE
, func
)
97 def EVT_ACTIVATE_APP(win
, func
):
98 win
.Connect(-1, -1, wxEVT_ACTIVATE_APP
, func
)
100 def EVT_END_SESSION(win
, func
):
101 win
.Connect(-1, -1, wxEVT_END_SESSION
, func
)
103 def EVT_QUERY_END_SESSION(win
, func
):
104 win
.Connect(-1, -1, wxEVT_QUERY_END_SESSION
, func
)
106 def EVT_DROP_FILES(win
, func
):
107 win
.Connect(-1, -1, wxEVT_DROP_FILES
, func
)
109 def EVT_INIT_DIALOG(win
, func
):
110 win
.Connect(-1, -1, wxEVT_INIT_DIALOG
, func
)
112 def EVT_SYS_COLOUR_CHANGED(win
, func
):
113 win
.Connect(-1, -1, wxEVT_SYS_COLOUR_CHANGED
, func
)
115 def EVT_SHOW(win
, func
):
116 win
.Connect(-1, -1, wxEVT_SHOW
, func
)
118 def EVT_MAXIMIZE(win
, func
):
119 win
.Connect(-1, -1, wxEVT_MAXIMIZE
, func
)
121 def EVT_ICONIZE(win
, func
):
122 win
.Connect(-1, -1, wxEVT_ICONIZE
, func
)
124 def EVT_NAVIGATION_KEY(win
, func
):
125 win
.Connect(-1, -1, wxEVT_NAVIGATION_KEY
, func
)
129 def EVT_LEFT_DOWN(win
, func
):
130 win
.Connect(-1, -1, wxEVT_LEFT_DOWN
, func
)
132 def EVT_LEFT_UP(win
, func
):
133 win
.Connect(-1, -1, wxEVT_LEFT_UP
, func
)
135 def EVT_MIDDLE_DOWN(win
, func
):
136 win
.Connect(-1, -1, wxEVT_MIDDLE_DOWN
, func
)
138 def EVT_MIDDLE_UP(win
, func
):
139 win
.Connect(-1, -1, wxEVT_MIDDLE_UP
, func
)
141 def EVT_RIGHT_DOWN(win
, func
):
142 win
.Connect(-1, -1, wxEVT_RIGHT_DOWN
, func
)
144 def EVT_RIGHT_UP(win
, func
):
145 win
.Connect(-1, -1, wxEVT_RIGHT_UP
, func
)
147 def EVT_MOTION(win
, func
):
148 win
.Connect(-1, -1, wxEVT_MOTION
, func
)
150 def EVT_LEFT_DCLICK(win
, func
):
151 win
.Connect(-1, -1, wxEVT_LEFT_DCLICK
, func
)
153 def EVT_MIDDLE_DCLICK(win
, func
):
154 win
.Connect(-1, -1, wxEVT_MIDDLE_DCLICK
, func
)
156 def EVT_RIGHT_DCLICK(win
, func
):
157 win
.Connect(-1, -1, wxEVT_RIGHT_DCLICK
, func
)
159 def EVT_LEAVE_WINDOW(win
, func
):
160 win
.Connect(-1, -1, wxEVT_LEAVE_WINDOW
, func
)
162 def EVT_ENTER_WINDOW(win
, func
):
163 win
.Connect(-1, -1, wxEVT_ENTER_WINDOW
, func
)
167 def EVT_MOUSE_EVENTS(win
, func
):
168 win
.Connect(-1, -1, wxEVT_LEFT_DOWN
, func
)
169 win
.Connect(-1, -1, wxEVT_LEFT_UP
, func
)
170 win
.Connect(-1, -1, wxEVT_MIDDLE_DOWN
, func
)
171 win
.Connect(-1, -1, wxEVT_MIDDLE_UP
, func
)
172 win
.Connect(-1, -1, wxEVT_RIGHT_DOWN
, func
)
173 win
.Connect(-1, -1, wxEVT_RIGHT_UP
, func
)
174 win
.Connect(-1, -1, wxEVT_MOTION
, func
)
175 win
.Connect(-1, -1, wxEVT_LEFT_DCLICK
, func
)
176 win
.Connect(-1, -1, wxEVT_MIDDLE_DCLICK
, func
)
177 win
.Connect(-1, -1, wxEVT_RIGHT_DCLICK
, func
)
178 win
.Connect(-1, -1, wxEVT_LEAVE_WINDOW
, func
)
179 win
.Connect(-1, -1, wxEVT_ENTER_WINDOW
, func
)
182 def EVT_COMMAND(win
, id, cmd
, func
):
183 win
.Connect(id, -1, cmd
, func
)
185 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
186 win
.Connect(id1
, id2
, cmd
, func
)
189 def EVT_SCROLL(win
, func
):
190 win
.Connect(-1, -1, wxEVT_SCROLL_TOP
, func
)
191 win
.Connect(-1, -1, wxEVT_SCROLL_BOTTOM
, func
)
192 win
.Connect(-1, -1, wxEVT_SCROLL_LINEUP
, func
)
193 win
.Connect(-1, -1, wxEVT_SCROLL_LINEDOWN
, func
)
194 win
.Connect(-1, -1, wxEVT_SCROLL_PAGEUP
, func
)
195 win
.Connect(-1, -1, wxEVT_SCROLL_PAGEDOWN
, func
)
196 win
.Connect(-1, -1, wxEVT_SCROLL_THUMBTRACK
,func
)
198 def EVT_SCROLL_TOP(win
, func
):
199 win
.Connect(-1, -1, wxEVT_SCROLL_TOP
, func
)
201 def EVT_SCROLL_BOTTOM(win
, func
):
202 win
.Connect(-1, -1, wxEVT_SCROLL_BOTTOM
, func
)
204 def EVT_SCROLL_LINEUP(win
, func
):
205 win
.Connect(-1, -1, wxEVT_SCROLL_LINEUP
, func
)
207 def EVT_SCROLL_LINEDOWN(win
, func
):
208 win
.Connect(-1, -1, wxEVT_SCROLL_LINEDOWN
, func
)
210 def EVT_SCROLL_PAGEUP(win
, func
):
211 win
.Connect(-1, -1, wxEVT_SCROLL_PAGEUP
, func
)
213 def EVT_SCROLL_PAGEDOWN(win
, func
):
214 win
.Connect(-1, -1, wxEVT_SCROLL_PAGEDOWN
, func
)
216 def EVT_SCROLL_THUMBTRACK(win
, func
):
217 win
.Connect(-1, -1, wxEVT_SCROLL_THUMBTRACK
, func
)
221 # Scrolling, with an id
222 def EVT_COMMAND_SCROLL(win
, id, func
):
223 win
.Connect(id, -1, wxEVT_SCROLL_TOP
, func
)
224 win
.Connect(id, -1, wxEVT_SCROLL_BOTTOM
, func
)
225 win
.Connect(id, -1, wxEVT_SCROLL_LINEUP
, func
)
226 win
.Connect(id, -1, wxEVT_SCROLL_LINEDOWN
, func
)
227 win
.Connect(id, -1, wxEVT_SCROLL_PAGEUP
, func
)
228 win
.Connect(id, -1, wxEVT_SCROLL_PAGEDOWN
, func
)
229 win
.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK
,func
)
231 def EVT_COMMAND_SCROLL_TOP(win
, id, func
):
232 win
.Connect(id, -1, wxEVT_SCROLL_TOP
, func
)
234 def EVT_COMMAND_SCROLL_BOTTOM(win
, id, func
):
235 win
.Connect(id, -1, wxEVT_SCROLL_BOTTOM
, func
)
237 def EVT_COMMAND_SCROLL_LINEUP(win
, id, func
):
238 win
.Connect(id, -1, wxEVT_SCROLL_LINEUP
, func
)
240 def EVT_COMMAND_SCROLL_LINEDOWN(win
, id, func
):
241 win
.Connect(id, -1, wxEVT_SCROLL_LINEDOWN
, func
)
243 def EVT_COMMAND_SCROLL_PAGEUP(win
, id, func
):
244 win
.Connect(id, -1, wxEVT_SCROLL_PAGEUP
, func
)
246 def EVT_COMMAND_SCROLL_PAGEDOWN(win
, id, func
):
247 win
.Connect(id, -1, wxEVT_SCROLL_PAGEDOWN
, func
)
249 def EVT_COMMAND_SCROLL_THUMBTRACK(win
, id, func
):
250 win
.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK
, func
)
253 # Convenience commands
254 def EVT_BUTTON(win
, id, func
):
255 win
.Connect(id, -1, wxEVT_COMMAND_BUTTON_CLICKED
, func
)
257 def EVT_CHECKBOX(win
, id, func
):
258 win
.Connect(id, -1, wxEVT_COMMAND_CHECKBOX_CLICKED
, func
)
260 def EVT_CHOICE(win
, id, func
):
261 win
.Connect(id, -1, wxEVT_COMMAND_CHOICE_SELECTED
, func
)
263 def EVT_LISTBOX(win
, id, func
):
264 win
.Connect(id, -1, wxEVT_COMMAND_LISTBOX_SELECTED
, func
)
266 def EVT_LISTBOX_DCLICK(win
, id, func
):
267 win
.Connect(id, -1, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, func
)
269 def EVT_TEXT(win
, id, func
):
270 win
.Connect(id, -1, wxEVT_COMMAND_TEXT_UPDATED
, func
)
272 def EVT_TEXT_ENTER(win
, id, func
):
273 win
.Connect(id, -1, wxEVT_COMMAND_TEXT_ENTER
, func
)
275 def EVT_MENU(win
, id, func
):
276 win
.Connect(id, -1, wxEVT_COMMAND_MENU_SELECTED
, func
)
278 def EVT_MENU_RANGE(win
, id1
, id2
, func
):
279 win
.Connect(id1
, id2
, wxEVT_COMMAND_MENU_SELECTED
, func
)
281 def EVT_SLIDER(win
, id, func
):
282 win
.Connect(id, -1, wxEVT_COMMAND_SLIDER_UPDATED
, func
)
284 def EVT_RADIOBOX(win
, id, func
):
285 win
.Connect(id, -1, wxEVT_COMMAND_RADIOBOX_SELECTED
, func
)
287 def EVT_RADIOBUTTON(win
, id, func
):
288 win
.Connect(id, -1, wxEVT_COMMAND_RADIOBUTTON_SELECTED
, func
)
290 def EVT_VLBOX(win
, id, func
):
291 win
.Connect(id, -1, wxEVT_COMMAND_VLBOX_SELECTED
, func
)
293 def EVT_COMBOBOX(win
, id, func
):
294 win
.Connect(id, -1, wxEVT_COMMAND_COMBOBOX_SELECTED
, func
)
296 def EVT_TOOL(win
, id, func
):
297 win
.Connect(id, -1, wxEVT_COMMAND_TOOL_CLICKED
, func
)
299 def EVT_TOOL_RCLICKED(win
, id, func
):
300 win
.Connect(id, -1, wxEVT_COMMAND_TOOL_RCLICKED
, func
)
302 def EVT_TOOL_ENTER(win
, id, func
):
303 win
.Connect(id, -1, wxEVT_COMMAND_TOOL_ENTER
, func
)
305 def EVT_CHECKLISTBOX(win
, id, func
):
306 win
.Connect(id, -1, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, func
)
309 # Generic command events
311 def EVT_COMMAND_LEFT_CLICK(win
, id, func
):
312 win
.Connect(id, -1, wxEVT_COMMAND_LEFT_CLICK
, func
)
314 def EVT_COMMAND_LEFT_DCLICK(win
, id, func
):
315 win
.Connect(id, -1, wxEVT_COMMAND_LEFT_DCLICK
, func
)
317 def EVT_COMMAND_RIGHT_CLICK(win
, id, func
):
318 win
.Connect(id, -1, wxEVT_COMMAND_RIGHT_CLICK
, func
)
320 def EVT_COMMAND_RIGHT_DCLICK(win
, id, func
):
321 win
.Connect(id, -1, wxEVT_COMMAND_RIGHT_DCLICK
, func
)
323 def EVT_COMMAND_SET_FOCUS(win
, id, func
):
324 win
.Connect(id, -1, wxEVT_COMMAND_SET_FOCUS
, func
)
326 def EVT_COMMAND_KILL_FOCUS(win
, id, func
):
327 win
.Connect(id, -1, wxEVT_COMMAND_KILL_FOCUS
, func
)
329 def EVT_COMMAND_ENTER(win
, id, func
):
330 win
.Connect(id, -1, wxEVT_COMMAND_ENTER
, func
)
334 def EVT_NOTEBOOK_PAGE_CHANGED(win
, id, func
):
335 win
.Connect(id, -1, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
, func
)
337 def EVT_NOTEBOOK_PAGE_CHANGING(win
, id, func
):
338 win
.Connect(id, -1, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
, func
)
342 #----------------------------------------------------------------------
343 #----------------------------------------------------------------------
344 # We need to add to the shadow classes a bit to facilitate callbacks via
345 # virtual functions. These classes replace the shadows generated by SWIG.
347 class wxWindow(wxWindowPtr
):
348 def __init__(self
,arg0
,arg1
,*args
) :
349 argl
= map(None,args
)
350 try: argl
[0] = argl
[0].this
352 try: argl
[1] = argl
[1].this
355 self
.this
= apply(windowsc
.new_wxWindow
,(arg0
.this
,arg1
,)+args
)
357 _StdWindowCallbacks(self
)
360 class wxFrame(wxFramePtr
):
361 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
362 argl
= map(None,args
)
363 try: argl
[0] = argl
[0].this
365 try: argl
[1] = argl
[1].this
368 self
.this
= apply(windowsc
.new_wxFrame
,(arg0
.this
,arg1
,arg2
,)+args
)
370 _StdFrameCallbacks(self
)
373 if wxPlatform
== '__WXMSW__':
374 class wxMiniFrame(wxMiniFramePtr
):
375 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
376 argl
= map(None,args
)
377 try: argl
[0] = argl
[0].this
379 try: argl
[1] = argl
[1].this
382 self
.this
= apply(windowsc
.new_wxMiniFrame
,(arg0
.this
,arg1
,arg2
,)+args
)
384 _StdFrameCallbacks(self
)
387 class wxPanel(wxPanelPtr
):
388 def __init__(self
,arg0
,arg1
,*args
) :
389 argl
= map(None,args
)
390 try: argl
[0] = argl
[0].this
392 try: argl
[1] = argl
[1].this
395 self
.this
= apply(windowsc
.new_wxPanel
,(arg0
.this
,arg1
,)+args
)
397 _StdWindowCallbacks(self
)
400 class wxDialog(wxDialogPtr
):
401 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
402 argl
= map(None,args
)
403 try: argl
[0] = argl
[0].this
405 try: argl
[1] = argl
[1].this
408 self
.this
= apply(windowsc
.new_wxDialog
,(arg0
.this
,arg1
,arg2
,)+args
)
410 _StdWindowCallbacks(self
)
411 _checkForCallback(self
, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED
, wxID_OK
)
412 _checkForCallback(self
, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED
, wxID_APPLY
)
413 _checkForCallback(self
, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED
, wxID_CANCEL
)
414 _checkForCallback(self
, "OnCloseWindow", wxEVT_CLOSE_WINDOW
)
415 _checkForCallback(self
, "OnCharHook", wxEVT_CHAR_HOOK
)
418 class wxScrolledWindow(wxScrolledWindowPtr
):
419 def __init__(self
,arg0
,*args
) :
420 argl
= map(None,args
)
421 try: argl
[1] = argl
[1].this
423 try: argl
[2] = argl
[2].this
426 self
.this
= apply(windowsc
.new_wxScrolledWindow
,(arg0
.this
,)+args
)
428 _StdWindowCallbacks(self
)
429 _StdOnScrollCallback(self
)
433 class wxMDIParentFrame(wxMDIParentFramePtr
):
434 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
435 argl
= map(None,args
)
436 try: argl
[0] = argl
[0].this
438 try: argl
[1] = argl
[1].this
441 self
.this
= apply(mdic
.new_wxMDIParentFrame
,(arg0
.this
,arg1
,arg2
,)+args
)
443 _StdFrameCallbacks(self
)
446 class wxMDIChildFrame(wxMDIChildFramePtr
):
447 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
448 argl
= map(None,args
)
449 try: argl
[0] = argl
[0].this
451 try: argl
[1] = argl
[1].this
454 self
.this
= apply(mdic
.new_wxMDIChildFrame
,(arg0
.this
,arg1
,arg2
,)+args
)
456 _StdFrameCallbacks(self
)
459 class wxMDIClientWindow(wxMDIClientWindowPtr
):
460 def __init__(self
,arg0
,*args
) :
461 self
.this
= apply(mdic
.new_wxMDIClientWindow
,(arg0
.this
,)+args
)
463 _StdWindowCallbacks(self
)
464 _StdOnScrollCallback(self
)
468 class wxControl(wxControlPtr
):
469 def __init__(self
,this
):
471 _StdWindowCallbacks(self
)
473 class wxButton(wxButtonPtr
):
474 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
475 argl
= map(None,args
)
476 try: argl
[0] = argl
[0].this
478 try: argl
[1] = argl
[1].this
481 self
.this
= apply(controlsc
.new_wxButton
,(arg0
.this
,arg1
,arg2
,)+args
)
483 _StdWindowCallbacks(self
)
485 class wxBitmapButton(wxBitmapButtonPtr
):
486 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
487 argl
= map(None,args
)
488 try: argl
[0] = argl
[0].this
490 try: argl
[1] = argl
[1].this
493 self
.this
= apply(controlsc
.new_wxBitmapButton
,(arg0
.this
,arg1
,arg2
.this
,)+args
)
495 _StdWindowCallbacks(self
)
497 class wxCheckBox(wxCheckBoxPtr
):
498 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
499 argl
= map(None,args
)
500 try: argl
[0] = argl
[0].this
502 try: argl
[1] = argl
[1].this
505 self
.this
= apply(controlsc
.new_wxCheckBox
,(arg0
.this
,arg1
,arg2
,)+args
)
507 _StdWindowCallbacks(self
)
511 class wxChoice(wxChoicePtr
):
512 def __init__(self
,arg0
,arg1
,*args
) :
513 argl
= map(None,args
)
514 try: argl
[0] = argl
[0].this
516 try: argl
[1] = argl
[1].this
519 self
.this
= apply(controlsc
.new_wxChoice
,(arg0
.this
,arg1
,)+args
)
521 _StdWindowCallbacks(self
)
523 class wxComboBox(wxComboBoxPtr
):
524 def __init__(self
,arg0
,arg1
,*args
) :
525 argl
= map(None,args
)
526 try: argl
[1] = argl
[1].this
528 try: argl
[2] = argl
[2].this
531 self
.this
= apply(controlsc
.new_wxComboBox
,(arg0
.this
,arg1
,)+args
)
533 _StdWindowCallbacks(self
)
535 class wxGauge(wxGaugePtr
):
536 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
537 argl
= map(None,args
)
538 try: argl
[0] = argl
[0].this
540 try: argl
[1] = argl
[1].this
543 self
.this
= apply(controlsc
.new_wxGauge
,(arg0
.this
,arg1
,arg2
,)+args
)
545 _StdWindowCallbacks(self
)
547 class wxStaticBox(wxStaticBoxPtr
):
548 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
549 argl
= map(None,args
)
550 try: argl
[0] = argl
[0].this
552 try: argl
[1] = argl
[1].this
555 self
.this
= apply(controlsc
.new_wxStaticBox
,(arg0
.this
,arg1
,arg2
,)+args
)
557 _StdWindowCallbacks(self
)
559 class wxStaticText(wxStaticTextPtr
):
560 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
561 argl
= map(None,args
)
562 try: argl
[0] = argl
[0].this
564 try: argl
[1] = argl
[1].this
567 self
.this
= apply(controlsc
.new_wxStaticText
,(arg0
.this
,arg1
,arg2
,)+args
)
569 _StdWindowCallbacks(self
)
571 class wxListBox(wxListBoxPtr
):
572 def __init__(self
,arg0
,arg1
,*args
) :
573 argl
= map(None,args
)
574 try: argl
[0] = argl
[0].this
576 try: argl
[1] = argl
[1].this
579 self
.this
= apply(controlsc
.new_wxListBox
,(arg0
.this
,arg1
,)+args
)
581 _StdWindowCallbacks(self
)
583 class wxTextCtrl(wxTextCtrlPtr
):
584 def __init__(self
,arg0
,arg1
,*args
) :
585 argl
= map(None,args
)
586 try: argl
[1] = argl
[1].this
588 try: argl
[2] = argl
[2].this
591 self
.this
= apply(controlsc
.new_wxTextCtrl
,(arg0
.this
,arg1
,)+args
)
593 _StdWindowCallbacks(self
)
595 class wxScrollBar(wxScrollBarPtr
):
596 def __init__(self
,arg0
,*args
) :
597 argl
= map(None,args
)
598 try: argl
[1] = argl
[1].this
600 try: argl
[2] = argl
[2].this
603 self
.this
= apply(controlsc
.new_wxScrollBar
,(arg0
.this
,)+args
)
605 _StdWindowCallbacks(self
)
607 if wxPlatform
== '__WXMSW__':
608 class wxSpinButton(wxSpinButtonPtr
):
609 def __init__(self
,arg0
,*args
) :
610 argl
= map(None,args
)
611 try: argl
[1] = argl
[1].this
613 try: argl
[2] = argl
[2].this
616 self
.this
= apply(controlsc
.new_wxSpinButton
,(arg0
.this
,)+args
)
618 _StdWindowCallbacks(self
)
620 class wxStaticBitmap(wxStaticBitmapPtr
):
621 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
622 argl
= map(None,args
)
623 try: argl
[0] = argl
[0].this
625 try: argl
[1] = argl
[1].this
628 self
.this
= apply(controlsc
.new_wxStaticBitmap
,(arg0
.this
,arg1
,arg2
.this
,)+args
)
630 _StdWindowCallbacks(self
)
632 class wxRadioBox(wxRadioBoxPtr
):
633 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
634 argl
= map(None,args
)
635 try: argl
[0] = argl
[0].this
637 try: argl
[1] = argl
[1].this
640 self
.this
= apply(controlsc
.new_wxRadioBox
,(arg0
.this
,arg1
,arg2
,)+args
)
642 _StdWindowCallbacks(self
)
644 class wxRadioButton(wxRadioButtonPtr
):
645 def __init__(self
,arg0
,arg1
,arg2
,*args
) :
646 argl
= map(None,args
)
647 try: argl
[0] = argl
[0].this
649 try: argl
[1] = argl
[1].this
652 self
.this
= apply(controlsc
.new_wxRadioButton
,(arg0
.this
,arg1
,arg2
,)+args
)
654 _StdWindowCallbacks(self
)
656 class wxSlider(wxSliderPtr
):
657 def __init__(self
,arg0
,arg1
,arg2
,arg3
,arg4
,*args
) :
658 argl
= map(None,args
)
659 try: argl
[0] = argl
[0].this
661 try: argl
[1] = argl
[1].this
664 self
.this
= apply(controlsc
.new_wxSlider
,(arg0
.this
,arg1
,arg2
,arg3
,arg4
,)+args
)
666 _StdWindowCallbacks(self
)
673 class wxTimer(wxPyTimer
):
675 wxPyTimer
.__init
__(self
, self
.Notify
) # derived class must provide
676 # Notify(self) method.
678 #----------------------------------------------------------------------
679 # Some wxWin methods can take "NULL" as parameters, but the shadow classes
680 # expect an object with the SWIG pointer as a 'this' member. This class
681 # and instance fools the shadow into passing the NULL pointer.
684 this
= 'NULL' # SWIG converts this to (void*)0
689 #----------------------------------------------------------------------
693 wxNamedColor
= wxNamedColour
695 wxPyDefaultPosition
.Set(-1,-1)
696 wxPyDefaultSize
.Set(-1,-1)
698 #----------------------------------------------------------------------
700 ## class wxPyStdOutWindow(wxFrame):
701 ## def __init__(self, title = "wxPython: stdout/stderr"):
702 ## wxFrame.__init__(self, NULL, title)
703 ## self.title = title
704 ## self.text = wxTextWindow(self)
705 ## self.text.SetFont(wxFont(10, wxMODERN, wxNORMAL, wxBOLD))
706 ## self.SetSize(-1,-1,400,200)
708 ## self.isShown = false
710 ## def write(self, str): # with this method,
711 ## if not self.isShown:
713 ## self.isShown = true
714 ## self.text.WriteText(str)
716 ## def OnCloseWindow(self, event): # doesn't allow the window to close, just hides it
718 ## self.isShown = false
721 _defRedirect
= (wxPlatform
== '__WXMSW__')
723 #----------------------------------------------------------------------
724 # The main application class. Derive from this and implement an OnInit
725 # method that creates a frame and then calls self.SetTopWindow(frame)
727 class wxApp(wxPyApp
):
728 error
= 'wxApp.error'
730 def __init__(self
, redirect
=_defRedirect
, filename
=None):
731 wxPyApp
.__init
__(self
)
733 self
.saveStdio
= (sys
.stdout
, sys
.stderr
)
735 self
.RedirectStdio(filename
)
737 # this initializes wxWindows and then calls our OnInit
738 _wxStart(self
.OnInit
)
747 def RedirectStdio(self
, filename
):
749 sys
.stdout
= sys
.stderr
= open(filename
, 'a')
751 raise self
.error
, 'wxPyStdOutWindow not yet implemented.'
752 #self.stdioWin = sys.stdout = sys.stderr = wxPyStdOutWindow()
754 def RestoreStdio(self
):
755 sys
.stdout
, sys
.stderr
= self
.saveStdio
756 if self
.stdioWin
!= None:
757 self
.stdioWin
.Show(false
)
758 self
.stdioWin
.Destroy()
762 #----------------------------------------------------------------------------
765 # Revision 1.2 1998/08/18 19:48:12 RD
766 # more wxGTK compatibility things.
768 # It builds now but there are serious runtime problems...
770 # Revision 1.1 1998/08/09 08:25:49 RD