X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/611dc22ceee63fcfd8b6af38f7f74ba9f3c5a268..a81c3c2383f9096ef5e96b708a0f1c1ffe7cc6a8:/wxPython/contrib/gizmos/gizmos.i diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index e607fd129b..239a195b03 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -18,6 +18,7 @@ #include #include #include +#include %} //--------------------------------------------------------------------------- @@ -34,6 +35,14 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyDynamicSashNameStr(wxT("dynamicSashWindow")); + static const wxString wxPyEditableListBoxNameStr(wxT("editableListBox")); +%} + +///---------------------------------------------------------------------- + enum { wxEVT_DYNAMIC_SASH_SPLIT, wxEVT_DYNAMIC_SASH_UNIFY, @@ -123,13 +132,13 @@ public: wxDynamicSashWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const char* name = "dynamicSashWindow"); + const wxString& name = wxPyDynamicSashNameStr); %name(wxPreDynamicSashWindow)wxDynamicSashWindow(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const char* name = "dynamicSashWindow"); + const wxString& name = wxPyDynamicSashNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreDynamicSashWindow:val._setOORInfo(val)" @@ -154,6 +163,11 @@ def EVT_DYNAMIC_SASH_UNIFY(win, id, func): //---------------------------------------------------------------------- //---------------------------------------------------------------------- +enum { + wxEL_ALLOW_NEW, + wxEL_ALLOW_EDIT, + wxEL_ALLOW_DELETE, +}; // This class provides a composite control that lets the // user easily enter list of strings @@ -164,7 +178,8 @@ public: const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const char* name = "editableListBox"); + long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE, + const wxString& name = wxPyEditableListBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" @@ -246,7 +261,7 @@ public: virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect) { bool found; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) { PyObject* dcobj = wxPyMake_wxObject(&dc); PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE); @@ -256,7 +271,7 @@ public: Py_DECREF(idobj); Py_DECREF(recobj); } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); if (! found) wxTreeCompanionWindow::DrawItem(dc, id, rect); } @@ -322,6 +337,52 @@ public: }; +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + + +enum wxLEDValueAlign +{ + wxLED_ALIGN_LEFT, + wxLED_ALIGN_RIGHT, + wxLED_ALIGN_CENTER, + + wxLED_ALIGN_MASK, + + wxLED_DRAW_FADED, +}; + + +class wxLEDNumberCtrl : public wxControl +{ +public: + // Constructors. + wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED); + %name(wxPreLEDNumberCtrl) wxLEDNumberCtrl(); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreLEDNumberCtrl:val._setOORInfo(val)" + + // Create functions. + bool Create(wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED); + + wxLEDValueAlign GetAlignment() const { return m_Alignment; } + bool GetDrawFaded() const { return m_DrawFaded; } + const wxString &GetValue() const { return m_Value; } + + void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = true); + void SetDrawFaded(bool DrawFaded, bool Redraw = true); + void SetValue(const wxString &Value, bool Redraw = true); + +}; + +//---------------------------------------------------------------------- //---------------------------------------------------------------------- %init %{