X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0122b7e3fcfd78f879470053c91a60e3c66537a3..c7206e642459697310df2051e76068307584aa14:/wxPython/src/windows.i?ds=sidebyside diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 950fd65844..133605331c 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -63,6 +63,14 @@ public: (wxObjectEventFunction) &wxPyCallback::EventThunker, new wxPyCallback(func)); } + else if (func == Py_None) { + self->Disconnect(id, lastId, eventType, + (wxObjectEventFunction) + &wxPyCallback::EventThunker); + } + else { + PyErr_SetString(PyExc_TypeError, "Expected callable object or None."); + } } bool Disconnect(int id, int lastId = -1, @@ -115,7 +123,7 @@ public: wxPyValidator* ptr = NULL; wxPyValidator* self = (wxPyValidator*)this; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if (self->m_myInst.findCallback("Clone")) { PyObject* ro; ro = self->m_myInst.callCallbackObj(Py_BuildValue("()")); @@ -124,7 +132,7 @@ public: Py_DECREF(ro); } } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); // This is very dangerous!!! But is the only way I could find // to squash a memory leak. Currently it is okay, but if the @@ -180,7 +188,7 @@ public: char* name = "panel"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreWindow:val._setOORInfo(val)" void CaptureMouse(); @@ -226,7 +234,7 @@ public: wxLayoutConstraints * GetConstraints(); wxEvtHandler* GetEventHandler(); - wxFont& GetFont(); + wxFont GetFont(); wxColour GetForegroundColour(); wxWindow * GetGrandParent(); %addmethods { @@ -324,11 +332,11 @@ public: %name(SetClientSizeWH)void SetClientSize(int width, int height); void SetClientSize(const wxSize& size); //void SetPalette(wxPalette* palette); - void SetCursor(const wxCursor&cursor); + void SetCursor(const wxCursor& cursor); void SetEventHandler(wxEvtHandler* handler); void SetExtraStyle(long exStyle); void SetTitle(const wxString& title); - bool Show(bool show); + bool Show(bool show=TRUE); bool TransferDataFromWindow(); bool TransferDataToWindow(); bool Validate(); @@ -353,9 +361,11 @@ public: wxValidator* GetValidator(); void SetValidator(const wxValidator& validator); +#ifndef __WXMAC__ void SetDropTarget(wxDropTarget* target); wxDropTarget* GetDropTarget(); %pragma(python) addtomethod = "SetDropTarget:_args[0].thisown = 0" +#endif wxSize GetBestSize(); @@ -390,6 +400,14 @@ public: void SetAcceleratorTable(const wxAcceleratorTable& accel); wxAcceleratorTable *GetAcceleratorTable(); + +#ifdef __WXMSW__ + // A way to do the native draw first... Too bad it isn't in wxGTK too. + void OnPaint(wxPaintEvent& event); +#endif + + wxButton* GetDefaultItem(); + void SetDefaultItem(wxButton *btn); }; @@ -442,11 +460,9 @@ public: const char* name = "panel"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "XXX:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPrePanel:val._setOORInfo(val)" void InitDialog(); - wxButton* GetDefaultItem(); - void SetDefaultItem(wxButton *btn); }; @@ -475,7 +491,7 @@ public: char* name = "scrolledWindow"); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreScrolledWindow:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreScrolledWindow:val._setOORInfo(val)" void EnableScrolling(bool xScrolling, bool yScrolling); int GetScrollPageSize(int orient); @@ -646,7 +662,7 @@ public: // wxOwnerDrawn methods #ifdef __WXMSW__ void SetFont(const wxFont& font); - wxFont& GetFont(); + wxFont GetFont(); void SetTextColour(const wxColour& colText); wxColour GetTextColour(); void SetBackgroundColour(const wxColour& colBack); @@ -654,7 +670,7 @@ public: void SetBitmaps(const wxBitmap& bmpChecked, const wxBitmap& bmpUnchecked = wxNullBitmap); void SetBitmap(const wxBitmap& bmpChecked); - const wxBitmap& GetBitmap(bool bChecked = TRUE); + wxBitmap GetBitmap(bool bChecked = TRUE); void SetMarginWidth(int nWidth); int GetMarginWidth(); static int GetDefaultMarginWidth();