X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..341366c67a9af796d39e1f0af92635d47af5308f:/wxPython/src/windows.i diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 1867774874..40a07a1517 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -35,6 +35,8 @@ class wxEvtHandler { public: + wxEvtHandler(); + bool ProcessEvent(wxEvent& event); void AddPendingEvent(wxEvent& event); //bool SearchEventTable(wxEventTable& table, wxEvent& event); @@ -105,13 +107,13 @@ public: wxWindow* GetWindow(); void SetWindow(wxWindow* window); - // Properties list - %pragma(python) addtoclass = " - _prop_list_ = { - 'window' : ('GetWindow', 'SetWindow'), - } - _prop_list_.update(wxEvtHandler._prop_list_) - " +// // Properties list +// %pragma(python) addtoclass = " +// _prop_list_ = { +// 'window' : ('GetWindow', 'SetWindow'), +// } +// _prop_list_.update(wxEvtHandler._prop_list_) +// " }; %inline %{ @@ -207,6 +209,8 @@ public: void Centre(int direction = wxBOTH); void CentreOnParent(int direction = wxBOTH ); void CenterOnParent(int direction = wxBOTH ); + void CentreOnScreen(int direction = wxBOTH ); + void CenterOnScreen(int direction = wxBOTH ); // (uses apply'ed INOUT typemap, see above) %name(ClientToScreenXY)void ClientToScreen(int* x, int* y); @@ -327,6 +331,10 @@ public: void SetPosition(const wxPoint& pos) { self->Move(pos); } + + void SetRect(const wxRect& rect, int sizeFlags=wxSIZE_AUTO) { + self->SetSize(rect, sizeFlags); + } } void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1); @@ -369,50 +377,61 @@ public: void SetCaret(wxCaret *caret); wxCaret *GetCaret(); - %pragma(python) addtoclass = "# replaces broken shadow method + %pragma(python) addtoclass = "# replaces broken shadow methods def GetCaret(self, *_args, **_kwargs): from misc2 import wxCaretPtr val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) if val: val = wxCaretPtr(val) return val - " - - // Properties list - %pragma(python) addtoclass = " - _prop_list_ = { - 'size' : ('GetSize', 'SetSize'), - 'enabled' : ('IsEnabled', 'Enable'), - 'background' : ('GetBackgroundColour', 'SetBackgroundColour'), - 'foreground' : ('GetForegroundColour', 'SetForegroundColour'), - 'children' : ('GetChildren', None), - 'charHeight' : ('GetCharHeight', None), - 'charWidth' : ('GetCharWidth', None), - 'clientSize' : ('GetClientSize', 'SetClientSize'), - 'font' : ('GetFont', 'SetFont'), - 'grandParent' : ('GetGrandParent', None), - 'handle' : ('GetHandle', None), - 'label' : ('GetLabel', 'SetLabel'), - 'name' : ('GetName', 'SetName'), - 'parent' : ('GetParent', None), - 'position' : ('GetPosition', 'SetPosition'), - 'title' : ('GetTitle', 'SetTitle'), - 'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'), - 'visible' : ('IsShown', 'Show'), - 'toolTip' : ('GetToolTip', 'SetToolTip'), - 'sizer' : ('GetSizer', 'SetSizer'), - 'validator' : ('GetValidator', 'SetValidator'), - 'dropTarget' : ('GetDropTarget', 'SetDropTarget'), - 'caret' : ('GetCaret', 'SetCaret'), - 'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'), - 'constraints' : ('GetConstraints', 'SetConstraints'), + def GetSizer(self, *_args, **_kwargs): + from sizers import wxSizerPtr + val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs) + if val: val = wxSizerPtr(val) + return val - } - _prop_list_.update(wxEvtHandler._prop_list_) + def GetToolTip(self, *_args, **_kwargs): + from misc2 import wxToolTipPtr + val = apply(windowsc.wxWindow_GetToolTip,(self,) + _args, _kwargs) + if val: val = wxToolTipPtr(val) + return val " + + +// // Properties list +// %pragma(python) addtoclass = " +// _prop_list_ = { +// 'size' : ('GetSize', 'SetSize'), +// 'enabled' : ('IsEnabled', 'Enable'), +// 'background' : ('GetBackgroundColour', 'SetBackgroundColour'), +// 'foreground' : ('GetForegroundColour', 'SetForegroundColour'), +// 'children' : ('GetChildren', None), +// 'charHeight' : ('GetCharHeight', None), +// 'charWidth' : ('GetCharWidth', None), +// 'clientSize' : ('GetClientSize', 'SetClientSize'), +// 'font' : ('GetFont', 'SetFont'), +// 'grandParent' : ('GetGrandParent', None), +// 'handle' : ('GetHandle', None), +// 'label' : ('GetLabel', 'SetLabel'), +// 'name' : ('GetName', 'SetName'), +// 'parent' : ('GetParent', None), +// 'position' : ('GetPosition', 'SetPosition'), +// 'title' : ('GetTitle', 'SetTitle'), +// 'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'), +// 'visible' : ('IsShown', 'Show'), +// 'toolTip' : ('GetToolTip', 'SetToolTip'), +// 'sizer' : ('GetSizer', 'SetSizer'), +// 'validator' : ('GetValidator', 'SetValidator'), +// 'dropTarget' : ('GetDropTarget', 'SetDropTarget'), +// 'caret' : ('GetCaret', 'SetCaret'), +// 'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'), +// 'constraints' : ('GetConstraints', 'SetConstraints'), + +// } +// _prop_list_.update(wxEvtHandler._prop_list_) +// " }; -//%clear int* x, int* y; @@ -430,7 +449,6 @@ def wxDLG_SZE(win, size_width, height=None): return win.ConvertDialogSizeToPixels(wxSize(size_width, height)) " -#ifdef __WXMSW__ %inline %{ wxWindow* wxWindow_FindFocus() { return wxWindow::FindFocus(); @@ -438,6 +456,7 @@ def wxDLG_SZE(win, size_width, height=None): %} +#ifdef __WXMSW__ %inline %{ wxWindow* wxWindow_FromHWND(unsigned long hWnd) { wxWindow* win = new wxWindow; @@ -626,7 +645,7 @@ public: class wxMenuBar : public wxWindow { public: - wxMenuBar(); + wxMenuBar(long style = 0); bool Append(wxMenu *menu, const wxString& title); bool Insert(size_t pos, wxMenu *menu, const wxString& title);