]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/windows.i
Fixed OOR related problem in OGL
[wxWidgets.git] / wxPython / src / windows.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: windows.i
3 // Purpose: SWIG definitions of various window classes
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 6/24/97
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13
14 %module windows
15
16 %{
17 #include "helpers.h"
18 #include <wx/menuitem.h>
19 #include <wx/tooltip.h>
20 %}
21
22 //----------------------------------------------------------------------
23
24 %include typemaps.i
25 %include my_typemaps.i
26
27 // Import some definitions of other classes, etc.
28 %import _defs.i
29 %import misc.i
30 %import gdi.i
31 %import clip_dnd.i
32
33 %pragma(python) code = "import wx"
34
35
36 %{
37 static wxString wxPyEmptyStr("");
38 %}
39
40 //---------------------------------------------------------------------------
41
42 class wxEvtHandler : public wxObject {
43 public:
44 wxEvtHandler();
45
46 bool ProcessEvent(wxEvent& event);
47 void AddPendingEvent(wxEvent& event);
48 //bool SearchEventTable(wxEventTable& table, wxEvent& event);
49
50 bool GetEvtHandlerEnabled();
51 void SetEvtHandlerEnabled(bool enabled);
52
53 wxEvtHandler* GetNextHandler();
54 wxEvtHandler* GetPreviousHandler();
55 void SetNextHandler(wxEvtHandler* handler);
56 void SetPreviousHandler(wxEvtHandler* handler);
57
58
59 %addmethods {
60 void Connect( int id, int lastId, int eventType, PyObject* func) {
61 if (PyCallable_Check(func)) {
62 self->Connect(id, lastId, eventType,
63 (wxObjectEventFunction) &wxPyCallback::EventThunker,
64 new wxPyCallback(func));
65 }
66 }
67
68 bool Disconnect(int id, int lastId = -1,
69 wxEventType eventType = wxEVT_NULL) {
70 return self->Disconnect(id, lastId, eventType,
71 (wxObjectEventFunction)
72 &wxPyCallback::EventThunker);
73 }
74 }
75
76 // %pragma(python) addtoclass = "
77 // _prop_list_ = {}
78 // "
79 // %pragma(python) addtoclass = "
80 // def __getattr__(self, name):
81 // pl = self._prop_list_
82 // if pl.has_key(name):
83 // getFunc, setFunc = pl[name]
84 // if getFunc:
85 // return getattr(self, getFunc)()
86 // else:
87 // raise TypeError, '%s property is write-only' % name
88 // raise AttributeError, name
89
90 // def __setattr__(self, name, value):
91 // pl = self._prop_list_
92 // if pl.has_key(name):
93 // getFunc, setFunc = pl[name]
94 // if setFunc:
95 // return getattr(self, setFunc)(value)
96 // else:
97 // raise TypeError, '%s property is read-only' % name
98 // self.__dict__[name] = value
99 // "
100 };
101
102
103 //----------------------------------------------------------------------
104
105 class wxValidator : public wxEvtHandler {
106 public:
107 wxValidator();
108 //~wxValidator();
109
110 wxValidator* Clone();
111 wxWindow* GetWindow();
112 void SetWindow(wxWindow* window);
113
114 static bool IsSilent();
115 static void SetBellOnError(int doIt = TRUE);
116
117 // // Properties list
118 // %pragma(python) addtoclass = "
119 // _prop_list_ = {
120 // 'window' : ('GetWindow', 'SetWindow'),
121 // }
122 // _prop_list_.update(wxEvtHandler._prop_list_)
123 // "
124 };
125
126
127 //----------------------------------------------------------------------
128 %{
129 class wxPyValidator : public wxValidator {
130 DECLARE_DYNAMIC_CLASS(wxPyValidator);
131 public:
132 wxPyValidator() {
133 }
134
135 ~wxPyValidator() {
136 }
137
138 wxObject* wxPyValidator::Clone() const {
139 wxPyValidator* ptr = NULL;
140 wxPyValidator* self = (wxPyValidator*)this;
141
142 bool doSave = wxPyRestoreThread();
143 if (self->m_myInst.findCallback("Clone")) {
144 PyObject* ro;
145 ro = self->m_myInst.callCallbackObj(Py_BuildValue("()"));
146 if (ro) {
147 SWIG_GetPtrObj(ro, (void **)&ptr, "_wxPyValidator_p");
148 Py_DECREF(ro);
149 }
150 }
151 // This is very dangerous!!! But is the only way I could find
152 // to squash a memory leak. Currently it is okay, but if the
153 // validator architecture in wxWindows ever changes, problems
154 // could arise.
155 delete self;
156
157 wxPySaveThread(doSave);
158 return ptr;
159 }
160
161
162 DEC_PYCALLBACK_BOOL_WXWIN(Validate);
163 DEC_PYCALLBACK_BOOL_(TransferToWindow);
164 DEC_PYCALLBACK_BOOL_(TransferFromWindow);
165
166 PYPRIVATE;
167 };
168
169 IMP_PYCALLBACK_BOOL_WXWIN(wxPyValidator, wxValidator, Validate);
170 IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferToWindow);
171 IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferFromWindow);
172
173 IMPLEMENT_DYNAMIC_CLASS(wxPyValidator, wxValidator);
174
175 %}
176
177 class wxPyValidator : public wxValidator {
178 public:
179 wxPyValidator();
180
181 void _setSelf(PyObject* self, PyObject* _class, int incref=TRUE);
182 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyValidator, 1)"
183
184 };
185
186 //----------------------------------------------------------------------
187
188 %apply int * INOUT { int* x, int* y };
189
190 class wxWindow : public wxEvtHandler {
191 public:
192
193 wxWindow(wxWindow* parent, const wxWindowID id,
194 const wxPoint& pos = wxDefaultPosition,
195 const wxSize& size = wxDefaultSize,
196 long style = 0,
197 char* name = "panel");
198
199 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
200
201 void CaptureMouse();
202 void Center(int direction = wxBOTH);
203 void Centre(int direction = wxBOTH);
204 void CentreOnParent(int direction = wxBOTH );
205 void CenterOnParent(int direction = wxBOTH );
206 void CentreOnScreen(int direction = wxBOTH );
207 void CenterOnScreen(int direction = wxBOTH );
208
209 // (uses apply'ed INOUT typemap, see above)
210 %name(ClientToScreenXY)void ClientToScreen(int* x, int* y);
211 wxPoint ClientToScreen(const wxPoint& pt);
212
213 bool Close(int force = FALSE);
214 bool Destroy();
215 void DestroyChildren();
216 #ifdef __WXMSW__
217 void DragAcceptFiles(bool accept);
218 #endif
219 void Enable(bool enable);
220 //bool FakePopupMenu(wxMenu* menu, int x, int y);
221 %name(FindWindowById) wxWindow* FindWindow(long id);
222 %name(FindWindowByName) wxWindow* FindWindow(const wxString& name);
223 void Fit();
224 wxColour GetBackgroundColour();
225
226 //wxList& GetChildren();
227 %addmethods {
228 PyObject* GetChildren() {
229 wxWindowList& list = self->GetChildren();
230 return wxPy_ConvertList(&list, "wxWindow");
231 }
232 }
233
234 int GetCharHeight();
235 int GetCharWidth();
236 %name(GetClientSizeTuple) void GetClientSize(int *OUTPUT, int *OUTPUT);
237 wxSize GetClientSize();
238 wxLayoutConstraints * GetConstraints();
239 wxEvtHandler* GetEventHandler();
240
241 wxFont& GetFont();
242 wxColour GetForegroundColour();
243 wxWindow * GetGrandParent();
244 %addmethods {
245 long GetHandle() {
246 return wxPyGetWinHandle(self); //(long)self->GetHandle();
247 }
248 }
249 int GetId();
250 wxString GetLabel();
251 void SetLabel(const wxString& label);
252 wxString GetName();
253 wxWindow * GetParent();
254 %name(GetPositionTuple) void GetPosition(int *OUTPUT, int *OUTPUT);
255 wxPoint GetPosition();
256 wxRect GetRect();
257 int GetScrollThumb(int orientation);
258 int GetScrollPos(int orientation);
259 int GetScrollRange(int orientation);
260 %name(GetSizeTuple) void GetSize(int *OUTPUT, int *OUTPUT);
261 wxSize GetSize();
262 void GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT);
263 %name(GetFullTextExtent)void GetTextExtent(const wxString& string,
264 int *OUTPUT, int *OUTPUT, int *OUTPUT, int* OUTPUT,
265 const wxFont* font = NULL); //, bool use16 = FALSE)
266 wxString GetTitle();
267 wxRegion GetUpdateRegion();
268 long GetWindowStyleFlag();
269 void SetWindowStyleFlag(long style);
270 void SetWindowStyle(long style);
271 bool Hide();
272 void InitDialog();
273 bool IsEnabled();
274 bool IsExposed( int x, int y, int w=0, int h=0 );
275 %name(IsExposedPoint) bool IsExposed( const wxPoint& pt );
276 %name(IsExposedRect) bool IsExposed( const wxRect& rect );
277 bool IsRetained();
278 bool IsShown();
279 bool IsTopLevel();
280 void Layout();
281 bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL);
282 void Lower();
283 void MakeModal(bool flag);
284 %name(MoveXY)void Move(int x, int y);
285 void Move(const wxPoint& point);
286
287 wxEvtHandler* PopEventHandler(bool deleteHandler = FALSE);
288 void PushEventHandler(wxEvtHandler* handler);
289
290 %name(PopupMenuXY)bool PopupMenu(wxMenu *menu, int x, int y);
291 bool PopupMenu(wxMenu *menu, const wxPoint& pos);
292
293 void Raise();
294 void Refresh(bool eraseBackground = TRUE, const wxRect* rect = NULL);
295 void ReleaseMouse();
296 void RemoveChild(wxWindow* child);
297 bool Reparent( wxWindow* newParent );
298
299 // (uses apply'ed INOUT typemap, see above)
300 %name(ScreenToClientXY)void ScreenToClient(int *x, int *y);
301 wxPoint ScreenToClient(const wxPoint& pt);
302
303 void ScrollWindow(int dx, int dy, const wxRect* rect = NULL);
304 void SetAcceleratorTable(const wxAcceleratorTable& accel);
305 void SetAutoLayout(bool autoLayout);
306 bool GetAutoLayout();
307 void SetBackgroundColour(const wxColour& colour);
308 void SetConstraints(wxLayoutConstraints *constraints);
309 void UnsetConstraints(wxLayoutConstraints *constraints);
310 void SetFocus();
311 bool AcceptsFocus();
312 void SetFont(const wxFont& font);
313 void SetForegroundColour(const wxColour& colour);
314 void SetId(int id);
315 void SetName(const wxString& name);
316 void SetScrollbar(int orientation, int position, int thumbSize, int range, int refresh = TRUE);
317 void SetScrollPos(int orientation, int pos, bool refresh = TRUE);
318
319 %name(SetDimensions) void SetSize(int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO);
320 %addmethods {
321 void SetSize(const wxSize& size) {
322 self->SetSize(size);
323 }
324
325 void SetPosition(const wxPoint& pos) {
326 self->Move(pos);
327 }
328
329 void SetRect(const wxRect& rect, int sizeFlags=wxSIZE_AUTO) {
330 self->SetSize(rect, sizeFlags);
331 }
332 }
333
334 void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1);
335 %name(SetClientSizeWH)void SetClientSize(int width, int height);
336 void SetClientSize(const wxSize& size);
337 //void SetPalette(wxPalette* palette);
338 void SetCursor(const wxCursor&cursor);
339 void SetEventHandler(wxEvtHandler* handler);
340 void SetExtraStyle(long exStyle);
341 void SetTitle(const wxString& title);
342 bool Show(bool show);
343 bool TransferDataFromWindow();
344 bool TransferDataToWindow();
345 bool Validate();
346 void WarpPointer(int x, int y);
347
348 %name(ConvertDialogPointToPixels) wxPoint ConvertDialogToPixels(const wxPoint& pt);
349 %name(ConvertDialogSizeToPixels) wxSize ConvertDialogToPixels(const wxSize& sz);
350
351 %name(DLG_PNT) wxPoint ConvertDialogToPixels(const wxPoint& pt);
352 %name(DLG_SZE) wxSize ConvertDialogToPixels(const wxSize& sz);
353
354 %name(ConvertPixelPointToDialog) wxPoint ConvertPixelsToDialog(const wxPoint& pt);
355 %name(ConvertPixelSizeToDialog) wxSize ConvertPixelsToDialog(const wxSize& sz);
356
357 %name(SetToolTipString)void SetToolTip(const wxString &tip);
358 void SetToolTip(wxToolTip *tooltip);
359 wxToolTip* GetToolTip();
360
361 void SetSizer(wxSizer* sizer);
362 wxSizer* GetSizer();
363
364 wxValidator* GetValidator();
365 void SetValidator(const wxValidator& validator);
366
367 void SetDropTarget(wxDropTarget* target);
368 wxDropTarget* GetDropTarget();
369 %pragma(python) addtomethod = "SetDropTarget:_args[0].thisown = 0"
370
371 wxSize GetBestSize();
372
373 void SetCaret(wxCaret *caret);
374 wxCaret *GetCaret();
375 %pragma(python) addtoclass = "# replaces broken shadow method
376 def GetCaret(self, *_args, **_kwargs):
377 from misc2 import wxCaretPtr
378 val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
379 if val: val = wxCaretPtr(val)
380 return val
381 "
382
383
384 // // Properties list
385 // %pragma(python) addtoclass = "
386 // _prop_list_ = {
387 // 'size' : ('GetSize', 'SetSize'),
388 // 'enabled' : ('IsEnabled', 'Enable'),
389 // 'background' : ('GetBackgroundColour', 'SetBackgroundColour'),
390 // 'foreground' : ('GetForegroundColour', 'SetForegroundColour'),
391 // 'children' : ('GetChildren', None),
392 // 'charHeight' : ('GetCharHeight', None),
393 // 'charWidth' : ('GetCharWidth', None),
394 // 'clientSize' : ('GetClientSize', 'SetClientSize'),
395 // 'font' : ('GetFont', 'SetFont'),
396 // 'grandParent' : ('GetGrandParent', None),
397 // 'handle' : ('GetHandle', None),
398 // 'label' : ('GetLabel', 'SetLabel'),
399 // 'name' : ('GetName', 'SetName'),
400 // 'parent' : ('GetParent', None),
401 // 'position' : ('GetPosition', 'SetPosition'),
402 // 'title' : ('GetTitle', 'SetTitle'),
403 // 'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'),
404 // 'visible' : ('IsShown', 'Show'),
405 // 'toolTip' : ('GetToolTip', 'SetToolTip'),
406 // 'sizer' : ('GetSizer', 'SetSizer'),
407 // 'validator' : ('GetValidator', 'SetValidator'),
408 // 'dropTarget' : ('GetDropTarget', 'SetDropTarget'),
409 // 'caret' : ('GetCaret', 'SetCaret'),
410 // 'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'),
411 // 'constraints' : ('GetConstraints', 'SetConstraints'),
412
413 // }
414 // _prop_list_.update(wxEvtHandler._prop_list_)
415 // "
416 };
417
418
419
420
421 %pragma(python) code = "
422 def wxDLG_PNT(win, point_or_x, y=None):
423 if y is None:
424 return win.ConvertDialogPointToPixels(point_or_x)
425 else:
426 return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y))
427
428 def wxDLG_SZE(win, size_width, height=None):
429 if height is None:
430 return win.ConvertDialogSizeToPixels(size_width)
431 else:
432 return win.ConvertDialogSizeToPixels(wxSize(size_width, height))
433 "
434
435 %inline %{
436 wxWindow* wxWindow_FindFocus() {
437 return wxWindow::FindFocus();
438 }
439 %}
440
441
442 #ifdef __WXMSW__
443 %inline %{
444 wxWindow* wxWindow_FromHWND(unsigned long hWnd) {
445 wxWindow* win = new wxWindow;
446 win->SetHWND(hWnd);
447 win->SubclassWin(hWnd);
448 return win;
449 }
450 %}
451 #endif
452
453 %inline %{
454 int wxWindow_NewControlId() {
455 return wxWindow::NewControlId();
456 }
457 int wxWindow_NextControlId(int id) {
458 return wxWindow::NextControlId(id);
459 }
460 int wxWindow_PrevControlId(int id) {
461 return wxWindow::PrevControlId(id);
462 }
463 %}
464
465
466 //---------------------------------------------------------------------------
467
468 class wxPanel : public wxWindow {
469 public:
470 wxPanel(wxWindow* parent,
471 const wxWindowID id,
472 const wxPoint& pos = wxDefaultPosition,
473 const wxSize& size = wxDefaultSize,
474 long style = wxTAB_TRAVERSAL,
475 const char* name = "panel");
476
477 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
478
479 void InitDialog();
480 wxButton* GetDefaultItem();
481 void SetDefaultItem(wxButton *btn);
482
483 };
484
485 //---------------------------------------------------------------------------
486
487 class wxDialog : public wxPanel {
488 public:
489 wxDialog(wxWindow* parent,
490 const wxWindowID id,
491 const wxString& title,
492 const wxPoint& pos = wxDefaultPosition,
493 const wxSize& size = wxDefaultSize,
494 long style = wxDEFAULT_DIALOG_STYLE,
495 const char* name = "dialogBox");
496
497 %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
498
499 void Centre(int direction = wxBOTH);
500 void EndModal(int retCode);
501 wxString GetTitle();
502 void Iconize(bool iconize);
503 bool IsIconized();
504 void SetModal(bool flag);
505 bool IsModal();
506 void SetTitle(const wxString& title);
507 bool Show(bool show);
508 int ShowModal();
509
510 int GetReturnCode();
511 void SetReturnCode(int retCode);
512
513 wxSizer* CreateTextSizer( const wxString &message );
514 wxSizer* CreateButtonSizer( long flags );
515
516 };
517
518 //---------------------------------------------------------------------------
519
520 class wxScrolledWindow : public wxPanel {
521 public:
522 wxScrolledWindow(wxWindow* parent,
523 const wxWindowID id = -1,
524 const wxPoint& pos = wxDefaultPosition,
525 const wxSize& size = wxDefaultSize,
526 long style = wxHSCROLL | wxVSCROLL,
527 char* name = "scrolledWindow");
528
529 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
530 %pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
531
532 void EnableScrolling(bool xScrolling, bool yScrolling);
533 int GetScrollPageSize(int orient);
534 void GetScrollPixelsPerUnit(int* OUTPUT, int* OUTPUT);
535 wxWindow* GetTargetWindow();
536 void GetVirtualSize(int* OUTPUT, int* OUTPUT);
537 bool IsRetained();
538 void PrepareDC(wxDC& dc);
539 void Scroll(int x, int y);
540 void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
541 int noUnitsX, int noUnitsY,
542 int xPos = 0, int yPos = 0, int noRefresh=FALSE);
543 void SetScrollPageSize(int orient, int pageSize);
544 void SetTargetWindow(wxWindow* window);
545 void GetViewStart(int* OUTPUT, int* OUTPUT);
546 void ViewStart(int* OUTPUT, int* OUTPUT);
547
548 void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
549 void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
550
551 void SetScale(double xs, double ys);
552 double GetScaleX();
553 double GetScaleY();
554
555 void AdjustScrollbars();
556 };
557
558 //----------------------------------------------------------------------
559
560
561 class wxMenu : public wxEvtHandler {
562 public:
563 wxMenu(const wxString& title = wxPyEmptyStr, long style = 0);
564
565 void Append(int id, const wxString& item,
566 const wxString& helpString = wxPyEmptyStr,
567 int checkable = FALSE);
568 %name(AppendMenu)void Append(int id, const wxString& item, wxMenu *subMenu,
569 const wxString& helpString = wxPyEmptyStr);
570 %name(AppendItem)void Append(const wxMenuItem* item);
571
572 void AppendSeparator();
573 void Break();
574 void Check(int id, bool flag);
575 bool IsChecked(int id);
576 void Enable(int id, bool enable);
577 bool IsEnabled(int id);
578
579 int FindItem(const wxString& itemString);
580 %name(FindItemById)wxMenuItem* FindItem(int id/*, wxMenu **menu = NULL*/);
581
582 wxString GetTitle();
583 void SetTitle(const wxString& title);
584
585 wxString GetLabel(int id);
586 void SetLabel(int id, const wxString& label);
587
588 wxString GetHelpString(int id);
589 void SetHelpString(int id, const wxString& helpString);
590 void UpdateUI(wxEvtHandler* source = NULL);
591
592 bool Delete(int id);
593 %name(DeleteItem)bool Delete(wxMenuItem *item);
594 bool Insert(size_t pos, wxMenuItem *item);
595 wxMenuItem *Remove(int id);
596 %name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item);
597
598 %addmethods {
599 void Destroy() { delete self; }
600 }
601 %name(DestroyId)bool Destroy(int id);
602 %name(DestroyItem)bool Destroy(wxMenuItem *item);
603
604 size_t GetMenuItemCount();
605 //wxMenuItemList& GetMenuItems();
606 %addmethods {
607 PyObject* GetMenuItems() {
608 wxMenuItemList& list = self->GetMenuItems();
609 return wxPy_ConvertList(&list, "wxMenuItem");
610 }
611 }
612
613 void SetEventHandler(wxEvtHandler *handler);
614 wxEvtHandler *GetEventHandler();
615
616 void SetInvokingWindow(wxWindow *win);
617 wxWindow *GetInvokingWindow();
618
619 long GetStyle();
620
621 bool IsAttached();
622
623 void SetParent(wxMenu *parent);
624 wxMenu *GetParent();
625 };
626
627
628 //----------------------------------------------------------------------
629
630 class wxMenuBar : public wxWindow {
631 public:
632 wxMenuBar(long style = 0);
633
634 bool Append(wxMenu *menu, const wxString& title);
635 bool Insert(size_t pos, wxMenu *menu, const wxString& title);
636 size_t GetMenuCount();
637 wxMenu *GetMenu(size_t pos);
638 wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
639 wxMenu *Remove(size_t pos);
640 void EnableTop(size_t pos, bool enable);
641 void SetLabelTop(size_t pos, const wxString& label);
642 wxString GetLabelTop(size_t pos);
643 int FindMenuItem(const wxString& menuString, const wxString& itemString);
644 %name(FindItemById)wxMenuItem* FindItem(int id/*, wxMenu **menu = NULL*/);
645 void Enable(int id, bool enable);
646 void Check(int id, bool check);
647 bool IsChecked(int id);
648 bool IsEnabled(int id);
649
650 void SetLabel(int id, const wxString &label);
651 wxString GetLabel(int id);
652
653 void SetHelpString(int id, const wxString& helpString);
654 wxString GetHelpString(int id);
655
656 };
657
658
659 //----------------------------------------------------------------------
660
661 class wxMenuItem : public wxObject {
662 public:
663 wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR,
664 const wxString& text = wxPyEmptyStr,
665 const wxString& help = wxPyEmptyStr,
666 bool isCheckable = FALSE, wxMenu* subMenu = NULL);
667
668
669 wxMenu *GetMenu();
670 void SetId(int id);
671 int GetId();
672 bool IsSeparator();
673 void SetText(const wxString& str);
674 wxString GetLabel();
675 const wxString& GetText();
676 void SetCheckable(bool checkable);
677 bool IsCheckable();
678 bool IsSubMenu();
679 void SetSubMenu(wxMenu *menu);
680 wxMenu *GetSubMenu();
681 void Enable(bool enable = TRUE);
682 bool IsEnabled();
683 void Check(bool check = TRUE);
684 bool IsChecked();
685 void Toggle();
686 void SetHelp(const wxString& str);
687 const wxString& GetHelp();
688 wxAcceleratorEntry *GetAccel();
689 void SetAccel(wxAcceleratorEntry *accel);
690
691 static wxString GetLabelFromText(const wxString& text);
692
693 // wxOwnerDrawn methods
694 #ifdef __WXMSW__
695 void SetFont(const wxFont& font);
696 wxFont& GetFont();
697 void SetTextColour(const wxColour& colText);
698 wxColour& GetTextColour();
699 void SetBackgroundColour(const wxColour& colBack);
700 wxColour& GetBackgroundColour();
701 void SetBitmaps(const wxBitmap& bmpChecked,
702 const wxBitmap& bmpUnchecked = wxNullBitmap);
703 void SetBitmap(const wxBitmap& bmpChecked);
704 const wxBitmap& GetBitmap(bool bChecked = TRUE);
705 void SetMarginWidth(int nWidth);
706 int GetMarginWidth();
707 static int GetDefaultMarginWidth();
708 //void SetName(const wxString& strName);
709 //const wxString& GetName();
710 //void SetCheckable(bool checkable);
711 //bool IsCheckable();
712 bool IsOwnerDrawn();
713 void ResetOwnerDrawn();
714 #endif
715 };
716
717 //---------------------------------------------------------------------------
718
719
720