X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17c0e08c61c69b77e58b3e9ffc78d58fcf105940..8dba8632c5bcd64724e2e9e2d40e295555a0cb86:/wxPython/src/controls2.i?ds=sidebyside diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 9ace925b79..2e6b36ab84 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -64,7 +64,7 @@ enum { wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, wxEVT_COMMAND_LIST_COL_DRAGGING, wxEVT_COMMAND_LIST_COL_END_DRAG, - + wxEVT_COMMAND_LIST_ITEM_FOCUSED, }; @@ -131,6 +131,9 @@ def EVT_LIST_ITEM_ACTIVATED(win, id, func): def EVT_LIST_CACHE_HINT(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_LIST_CACHE_HINT, func) + +def EVT_LIST_ITEM_FOCUSED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_FOCUSED, func) " @@ -256,9 +259,9 @@ public: bool HasBackgroundColour(); bool HasFont(); - const wxColour& GetTextColour(); - const wxColour& GetBackgroundColour(); - const wxFont& GetFont(); + wxColour GetTextColour(); + wxColour GetBackgroundColour(); + wxFont GetFont(); }; @@ -329,19 +332,15 @@ public: wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); int m_code; - long m_itemIndex; long m_oldItemIndex; + long m_itemIndex; int m_col; - bool m_cancelled; wxPoint m_pointDrag; wxListItem m_item; int GetCode(); long GetIndex(); - long GetOldIndex(); - long GetOldItem(); int GetColumn(); - bool Cancelled(); wxPoint GetPoint(); const wxString& GetLabel(); const wxString& GetText(); @@ -695,7 +694,7 @@ public: int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) { int retval = 0; PyObject* func = (PyObject*)funcPtr; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); PyObject* args = Py_BuildValue("(ii)", item1, item2); PyObject* result = PyEval_CallObject(func, args); @@ -705,7 +704,7 @@ public: Py_DECREF(result); } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); return retval; } @@ -909,9 +908,9 @@ public: bool HasBackgroundColour(); bool HasFont(); - const wxColour& GetTextColour(); - const wxColour& GetBackgroundColour(); - const wxFont& GetFont(); + wxColour GetTextColour(); + wxColour GetBackgroundColour(); + wxFont GetFont(); }; @@ -920,6 +919,7 @@ public: wxTreeItemId(); ~wxTreeItemId(); bool IsOk(); + %pragma(python) addtoclass = "Ok = IsOk" %addmethods { int __cmp__(wxTreeItemId* other) { @@ -942,9 +942,9 @@ public: } ~wxPyTreeItemData() { - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); Py_DECREF(m_obj); - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); } PyObject* GetData() { @@ -953,9 +953,9 @@ public: } void SetData(PyObject* obj) { - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); Py_DECREF(m_obj); - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); m_obj = obj; Py_INCREF(obj); } @@ -1020,13 +1020,13 @@ public: const wxTreeItemId& item2) { int rval = 0; bool found; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if ((found = m_myInst.findCallback("OnCompareItems"))) rval = m_myInst.callCallback(Py_BuildValue( "(OO)", wxPyConstructObject((void*)&item1, "wxTreeItemId"), wxPyConstructObject((void*)&item2, "wxTreeItemId"))); - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); if (! found) rval = wxTreeCtrl::OnCompareItems(item1, item2); return rval; @@ -1145,7 +1145,7 @@ public: //size_t GetSelections(wxArrayTreeItemIds& selection); %addmethods { PyObject* GetSelections() { - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); PyObject* rval = PyList_New(0); wxArrayTreeItemIds array; size_t num, x; @@ -1155,7 +1155,7 @@ public: PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE); PyList_Append(rval, item); } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); return rval; } } @@ -1234,16 +1234,17 @@ public: #ifdef __WXMSW__ void SetItemDropHighlight(const wxTreeItemId& item, int highlight = TRUE); +#endif //bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, int textOnly = FALSE) %addmethods { PyObject* GetBoundingRect(const wxTreeItemId& item, int textOnly = FALSE) { wxRect rect; if (self->GetBoundingRect(item, rect, textOnly)) { - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); wxRect* r = new wxRect(rect); PyObject* val = wxPyConstructObject((void*)r, "wxRect"); - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); return val; } else { @@ -1252,7 +1253,7 @@ public: } } } -#endif + %pragma(python) addtoclass = " # Redefine some methods that SWIG gets a bit confused on... @@ -1272,6 +1273,7 @@ public: val1.thisown = 1 return (val1,val2) " + };