X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83b18bab391d242907d18b4b040720eae6202f76..9cf99fc093f9c45b6b5d8d8b357699d826c9916a:/wxPython/src/windows.i diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index c3818aa5eb..d5a7222622 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -16,6 +16,7 @@ %{ #include "helpers.h" #include +#include %} //---------------------------------------------------------------------- @@ -38,7 +39,7 @@ //--------------------------------------------------------------------------- -class wxEvtHandler { +class wxEvtHandler : public wxObject { public: wxEvtHandler(); @@ -70,13 +71,11 @@ public: (wxObjectEventFunction) &wxPyCallback::EventThunker); } - } - %pragma(python) addtoclass = " - _prop_list_ = {} - " - +// %pragma(python) addtoclass = " +// _prop_list_ = {} +// " // %pragma(python) addtoclass = " // def __getattr__(self, name): // pl = self._prop_list_ @@ -112,6 +111,9 @@ public: wxWindow* GetWindow(); void SetWindow(wxWindow* window); + static bool IsSilent(); + static void SetBellOnError(int doIt = TRUE); + // // Properties list // %pragma(python) addtoclass = " // _prop_list_ = { @@ -121,15 +123,6 @@ public: // " }; -%inline %{ - bool wxValidator_IsSilent() { - return wxValidator::IsSilent(); - } - - void wxValidator_SetBellOnError(int doIt = TRUE) { - wxValidator::SetBellOnError(doIt); - } -%} //---------------------------------------------------------------------- %{ @@ -138,7 +131,6 @@ class wxPyValidator : public wxValidator { public: wxPyValidator() { } -// wxPyValidator(const wxPyValidator& other); ~wxPyValidator() { } @@ -166,12 +158,12 @@ public: return ptr; } + DEC_PYCALLBACK_BOOL_WXWIN(Validate); DEC_PYCALLBACK_BOOL_(TransferToWindow); DEC_PYCALLBACK_BOOL_(TransferFromWindow); PYPRIVATE; -// PyObject* m_data; }; IMP_PYCALLBACK_BOOL_WXWIN(wxPyValidator, wxValidator, Validate); @@ -185,12 +177,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxPyValidator, wxValidator); class wxPyValidator : public wxValidator { public: wxPyValidator(); -// ~wxPyValidator(); - - %addmethods { void Destroy() { delete self; } } void _setSelf(PyObject* self, PyObject* _class, int incref=TRUE); - %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyValidator, 0)" + %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyValidator, 1)" }; @@ -217,6 +206,8 @@ public: void CentreOnScreen(int direction = wxBOTH ); void CenterOnScreen(int direction = wxBOTH ); + void Clear(); + // (uses apply'ed INOUT typemap, see above) %name(ClientToScreenXY)void ClientToScreen(int* x, int* y); wxPoint ClientToScreen(const wxPoint& pt); @@ -224,6 +215,7 @@ public: bool Close(int force = FALSE); bool Destroy(); void DestroyChildren(); + bool IsBeingDeleted(); #ifdef __WXMSW__ void DragAcceptFiles(bool accept); #endif @@ -383,25 +375,27 @@ public: void SetCaret(wxCaret *caret); wxCaret *GetCaret(); - %pragma(python) addtoclass = "# replaces broken shadow methods + %pragma(python) addtoclass = "# replaces broken shadow method def GetCaret(self, *_args, **_kwargs): from misc2 import wxCaretPtr val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) if val: val = wxCaretPtr(val) return val + " - def GetSizer(self, *_args, **_kwargs): - from sizers import wxSizerPtr - val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs) - if val: val = wxSizerPtr(val) - return val + void Freeze(); + void Thaw(); + + wxString GetHelpText(); + void SetHelpText(const wxString& helpText); + + bool ScrollLines(int lines); + bool ScrollPages(int pages); + bool LineUp(); + bool LineDown(); + bool PageUp(); + bool PageDown(); - 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 @@ -503,14 +497,6 @@ public: wxButton* GetDefaultItem(); void SetDefaultItem(wxButton *btn); - // fix some SWIG trouble... - %pragma(python) addtoclass = " - def GetDefaultItem(self): - import controls - val = windowsc.wxPanel_GetDefaultItem(self.this) - val = controls.wxButtonPtr(val) - return val -" }; //--------------------------------------------------------------------------- @@ -540,10 +526,19 @@ public: int GetReturnCode(); void SetReturnCode(int retCode); + + wxSizer* CreateTextSizer( const wxString &message ); + wxSizer* CreateButtonSizer( long flags ); + }; //--------------------------------------------------------------------------- + +// TODO: Add wrappers for the wxScrollHelper class, make wxScrolledWindow +// derive from it and wxPanel. + + class wxScrolledWindow : public wxPanel { public: wxScrolledWindow(wxWindow* parent, @@ -570,11 +565,16 @@ public: void SetScrollPageSize(int orient, int pageSize); void SetTargetWindow(wxWindow* window); void GetViewStart(int* OUTPUT, int* OUTPUT); - void ViewStart(int* OUTPUT, int* OUTPUT); + %pragma(python) addtoclass = "ViewStart = GetViewStart" void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); + void SetScale(double xs, double ys); + double GetScaleX(); + double GetScaleY(); + + void AdjustScrollbars(); }; //---------------------------------------------------------------------- @@ -662,6 +662,7 @@ public: void EnableTop(size_t pos, bool enable); void SetLabelTop(size_t pos, const wxString& label); wxString GetLabelTop(size_t pos); + int FindMenu(const wxString& title); int FindMenuItem(const wxString& menuString, const wxString& itemString); %name(FindItemById)wxMenuItem* FindItem(int id/*, wxMenu **menu = NULL*/); void Enable(int id, bool enable); @@ -680,7 +681,7 @@ public: //---------------------------------------------------------------------- -class wxMenuItem { +class wxMenuItem : public wxObject { public: wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR, const wxString& text = wxPyEmptyStr, @@ -712,8 +713,28 @@ public: static wxString GetLabelFromText(const wxString& text); - // TODO: Add wxOwnerDrawn methods, also look at other ownerdrawn classes... - + // wxOwnerDrawn methods +#ifdef __WXMSW__ + void SetFont(const wxFont& font); + wxFont& GetFont(); + void SetTextColour(const wxColour& colText); + wxColour GetTextColour(); + void SetBackgroundColour(const wxColour& colBack); + wxColour GetBackgroundColour(); + void SetBitmaps(const wxBitmap& bmpChecked, + const wxBitmap& bmpUnchecked = wxNullBitmap); + void SetBitmap(const wxBitmap& bmpChecked); + const wxBitmap& GetBitmap(bool bChecked = TRUE); + void SetMarginWidth(int nWidth); + int GetMarginWidth(); + static int GetDefaultMarginWidth(); + //void SetName(const wxString& strName); + //const wxString& GetName(); + //void SetCheckable(bool checkable); + //bool IsCheckable(); + bool IsOwnerDrawn(); + void ResetOwnerDrawn(); +#endif }; //---------------------------------------------------------------------------