1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the new wxGrid and related classes
7 // Created: 17-March-2000
9 // Copyright: (c) 2000 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
14 "Classes for implementing a spreadsheet-like control."
17 %module(package="wx", docstring=DOCSTRING) grid
21 #include "wx/wxPython/wxPython.h"
22 #include "wx/wxPython/pyclasses.h"
23 #include "wx/wxPython/printfw.h"
26 #include <wx/generic/gridctrl.h>
31 //---------------------------------------------------------------------------
34 %pythoncode { wx = _core }
35 %pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
38 %include _grid_rename.i
40 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
41 MAKE_CONST_WXSTRING_NOSWIG(PanelNameStr);
42 MAKE_CONST_WXSTRING2(DateTimeFormatStr, wxT("%c"));
45 //---------------------------------------------------------------------------
46 // OOR related typemaps and helper functions
48 %typemap(out) wxGridCellRenderer* { $result = wxPyMake_wxGridCellRenderer($1); }
49 %typemap(out) wxGridCellEditor* { $result = wxPyMake_wxGridCellEditor($1); }
50 %typemap(out) wxGridCellAttr* { $result = wxPyMake_wxGridCellAttr($1); }
51 %typemap(out) wxGridCellAttrProvider* { $result = wxPyMake_wxGridCellAttrProvider($1); }
52 %typemap(out) wxGridTableBase* { $result = wxPyMake_wxGridTableBase($1); }
57 #define wxPyMake_TEMPLATE(TYPE) \
58 PyObject* wxPyMake_##TYPE(TYPE* source) { \
59 PyObject* target = NULL; \
61 /* Check if there is already a pointer to a Python object in the \
62 OOR data that we can use. */ \
63 wxPyOORClientData* data = (wxPyOORClientData*)source->GetClientObject(); \
65 target = data->m_obj; \
68 /* Otherwise make a new wrapper for it the old fashioned way and \
69 give it the OOR treatment */ \
71 target = wxPyConstructObject(source, wxT(#TYPE), False); \
73 source->SetClientObject(new wxPyOORClientData(target)); \
75 } else { /* source was NULL so return None. */ \
76 Py_INCREF(Py_None); target = Py_None; \
82 wxPyMake_TEMPLATE(wxGridCellRenderer)
83 wxPyMake_TEMPLATE(wxGridCellEditor)
84 wxPyMake_TEMPLATE(wxGridCellAttr)
85 wxPyMake_TEMPLATE(wxGridCellAttrProvider)
86 wxPyMake_TEMPLATE(wxGridTableBase)
90 //---------------------------------------------------------------------------
91 // Macros, similar to what's in helpers.h, to aid in the creation of
92 // virtual methods that are able to make callbacks to Python. Many of these
93 // are specific to wxGrid and so are kept here to reduce the mess in helpers.h
98 #define PYCALLBACK_GCA_INTINTKIND(PCLASS, CBNAME) \
99 wxGridCellAttr* CBNAME(int a, int b, wxGridCellAttr::wxAttrKind c) { \
100 wxGridCellAttr* rval = NULL; \
102 bool blocked = wxPyBeginBlockThreads(); \
103 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
105 wxGridCellAttr* ptr; \
106 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(iii)", a, b, c)); \
108 if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxGridCellAttr"))) \
113 wxPyEndBlockThreads(blocked); \
115 rval = PCLASS::CBNAME(a, b, c); \
118 wxGridCellAttr *base_##CBNAME(int a, int b, wxGridCellAttr::wxAttrKind c) { \
119 return PCLASS::CBNAME(a, b, c); \
124 #define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \
125 void CBNAME(wxGridCellAttr *attr, int a, int b) { \
126 bool blocked = wxPyBeginBlockThreads(); \
128 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
129 PyObject* obj = wxPyMake_wxGridCellAttr(attr); \
130 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oii)", obj, a, b)); \
133 wxPyEndBlockThreads(blocked); \
135 PCLASS::CBNAME(attr, a, b); \
137 void base_##CBNAME(wxGridCellAttr *attr, int a, int b) { \
138 PCLASS::CBNAME(attr, a, b); \
143 #define PYCALLBACK__GCAINT(PCLASS, CBNAME) \
144 void CBNAME(wxGridCellAttr *attr, int val) { \
145 bool blocked = wxPyBeginBlockThreads(); \
147 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
148 PyObject* obj = wxPyMake_wxGridCellAttr(attr); \
149 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, val)); \
152 wxPyEndBlockThreads(blocked); \
154 PCLASS::CBNAME(attr, val); \
156 void base_##CBNAME(wxGridCellAttr *attr, int val) { \
157 PCLASS::CBNAME(attr, val); \
162 #define PYCALLBACK_INT__pure(CBNAME) \
164 bool blocked = wxPyBeginBlockThreads(); \
166 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
167 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
168 wxPyEndBlockThreads(blocked); \
174 #define PYCALLBACK_BOOL_INTINT_pure(CBNAME) \
175 bool CBNAME(int a, int b) { \
176 bool blocked = wxPyBeginBlockThreads(); \
178 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
179 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \
180 wxPyEndBlockThreads(blocked); \
185 #define PYCALLBACK_STRING_INTINT_pure(CBNAME) \
186 wxString CBNAME(int a, int b) { \
187 bool blocked = wxPyBeginBlockThreads(); \
189 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
191 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \
193 rval = Py2wxString(ro); \
197 wxPyEndBlockThreads(blocked); \
202 #define PYCALLBACK__INTINTSTRING_pure(CBNAME) \
203 void CBNAME(int a, int b, const wxString& c) { \
204 bool blocked = wxPyBeginBlockThreads(); \
205 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
206 PyObject* s = wx2PyString(c); \
207 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",a,b,s));\
210 wxPyEndBlockThreads(blocked); \
214 #define PYCALLBACK_STRING_INTINT(PCLASS, CBNAME) \
215 wxString CBNAME(int a, int b) { \
217 bool blocked = wxPyBeginBlockThreads(); \
219 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
221 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \
223 rval = Py2wxString(ro); \
227 wxPyEndBlockThreads(blocked); \
229 rval = PCLASS::CBNAME(a, b); \
232 wxString base_##CBNAME(int a, int b) { \
233 return PCLASS::CBNAME(a, b); \
237 #define PYCALLBACK_BOOL_INTINTSTRING(PCLASS, CBNAME) \
238 bool CBNAME(int a, int b, const wxString& c) { \
241 bool blocked = wxPyBeginBlockThreads(); \
242 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
243 PyObject* s = wx2PyString(c); \
244 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",a,b,s));\
247 wxPyEndBlockThreads(blocked); \
249 rval = PCLASS::CBNAME(a,b,c); \
252 bool base_##CBNAME(int a, int b, const wxString& c) { \
253 return PCLASS::CBNAME(a,b,c); \
259 #define PYCALLBACK_LONG_INTINT(PCLASS, CBNAME) \
260 long CBNAME(int a, int b) { \
263 bool blocked = wxPyBeginBlockThreads(); \
264 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
265 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \
266 wxPyEndBlockThreads(blocked); \
268 rval = PCLASS::CBNAME(a,b); \
271 long base_##CBNAME(int a, int b) { \
272 return PCLASS::CBNAME(a,b); \
277 #define PYCALLBACK_BOOL_INTINT(PCLASS, CBNAME) \
278 bool CBNAME(int a, int b) { \
281 bool blocked = wxPyBeginBlockThreads(); \
282 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
283 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \
284 wxPyEndBlockThreads(blocked); \
286 rval = PCLASS::CBNAME(a,b); \
289 bool base_##CBNAME(int a, int b) { \
290 return PCLASS::CBNAME(a,b); \
295 #define PYCALLBACK_DOUBLE_INTINT(PCLASS, CBNAME) \
296 double CBNAME(int a, int b) { \
298 bool blocked = wxPyBeginBlockThreads(); \
300 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
302 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \
304 PyObject* str = PyObject_Str(ro); \
305 rval = PyFloat_AsDouble(str); \
306 Py_DECREF(ro); Py_DECREF(str); \
309 wxPyEndBlockThreads(blocked); \
311 rval = PCLASS::CBNAME(a, b); \
314 double base_##CBNAME(int a, int b) { \
315 return PCLASS::CBNAME(a, b); \
320 #define PYCALLBACK__(PCLASS, CBNAME) \
323 bool blocked = wxPyBeginBlockThreads(); \
324 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
325 wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
326 wxPyEndBlockThreads(blocked); \
330 void base_##CBNAME() { \
337 #define PYCALLBACK_BOOL_SIZETSIZET(PCLASS, CBNAME) \
338 bool CBNAME(size_t a, size_t b) { \
341 bool blocked = wxPyBeginBlockThreads(); \
342 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
343 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \
344 wxPyEndBlockThreads(blocked); \
346 rval = PCLASS::CBNAME(a,b); \
349 bool base_##CBNAME(size_t a, size_t b) { \
350 return PCLASS::CBNAME(a,b); \
355 #define PYCALLBACK_BOOL_SIZET(PCLASS, CBNAME) \
356 bool CBNAME(size_t a) { \
359 bool blocked = wxPyBeginBlockThreads(); \
360 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
361 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a)); \
362 wxPyEndBlockThreads(blocked); \
364 rval = PCLASS::CBNAME(a); \
367 bool base_##CBNAME(size_t a) { \
368 return PCLASS::CBNAME(a); \
372 #define PYCALLBACK_STRING_INT(PCLASS, CBNAME) \
373 wxString CBNAME(int a) { \
375 bool blocked = wxPyBeginBlockThreads(); \
377 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
379 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)",a)); \
381 rval = Py2wxString(ro); \
385 wxPyEndBlockThreads(blocked); \
387 rval = PCLASS::CBNAME(a); \
390 wxString base_##CBNAME(int a) { \
391 return PCLASS::CBNAME(a); \
395 #define PYCALLBACK__INTSTRING(PCLASS, CBNAME) \
396 void CBNAME(int a, const wxString& c) { \
398 bool blocked = wxPyBeginBlockThreads(); \
399 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
400 PyObject* s = wx2PyString(c); \
401 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iO)",a,s)); \
404 wxPyEndBlockThreads(blocked); \
406 PCLASS::CBNAME(a,c); \
408 void base_##CBNAME(int a, const wxString& c) { \
409 PCLASS::CBNAME(a,c); \
415 #define PYCALLBACK_BOOL_(PCLASS, CBNAME) \
419 bool blocked = wxPyBeginBlockThreads(); \
420 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
421 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
422 wxPyEndBlockThreads(blocked); \
424 rval = PCLASS::CBNAME(); \
427 bool base_##CBNAME() { \
428 return PCLASS::CBNAME(); \
433 #define PYCALLBACK__SIZETINT(PCLASS, CBNAME) \
434 void CBNAME(size_t a, int b) { \
436 bool blocked = wxPyBeginBlockThreads(); \
437 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
438 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \
439 wxPyEndBlockThreads(blocked); \
441 PCLASS::CBNAME(a,b); \
443 void base_##CBNAME(size_t a, int b) { \
444 PCLASS::CBNAME(a,b); \
450 #define PYCALLBACK__INTINTLONG(PCLASS, CBNAME) \
451 void CBNAME(int a, int b, long c) { \
453 bool blocked = wxPyBeginBlockThreads(); \
454 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
455 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c)); \
456 wxPyEndBlockThreads(blocked); \
458 PCLASS::CBNAME(a,b,c); \
460 void base_##CBNAME(int a, int b, long c) { \
461 PCLASS::CBNAME(a,b,c); \
467 #define PYCALLBACK__INTINTDOUBLE(PCLASS, CBNAME) \
468 void CBNAME(int a, int b, double c) { \
470 bool blocked = wxPyBeginBlockThreads(); \
471 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
472 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iif)", a,b,c)); \
473 wxPyEndBlockThreads(blocked); \
475 PCLASS::CBNAME(a,b,c); \
477 void base_##CBNAME(int a, int b, double c) { \
478 PCLASS::CBNAME(a,b,c); \
483 #define PYCALLBACK__INTINTBOOL(PCLASS, CBNAME) \
484 void CBNAME(int a, int b, bool c) { \
486 bool blocked = wxPyBeginBlockThreads(); \
487 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
488 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c)); \
489 wxPyEndBlockThreads(blocked); \
491 PCLASS::CBNAME(a,b,c); \
493 void base_##CBNAME(int a, int b, bool c) { \
494 PCLASS::CBNAME(a,b,c); \
502 //---------------------------------------------------------------------------
504 class wxGridCellCoords;
505 class wxGridCellAttr;
507 #define wxGRID_VALUE_STRING "string"
508 #define wxGRID_VALUE_BOOL "bool"
509 #define wxGRID_VALUE_NUMBER "long"
510 #define wxGRID_VALUE_FLOAT "double"
511 #define wxGRID_VALUE_CHOICE "choice"
512 #define wxGRID_VALUE_TEXT "string"
513 #define wxGRID_VALUE_LONG "long"
514 #define wxGRID_VALUE_CHOICEINT "choiceint"
515 #define wxGRID_VALUE_DATETIME "datetime"
519 const wxGridCellCoords wxGridNoCellCoords;
520 const wxRect wxGridNoCellRect;
524 //---------------------------------------------------------------------------
525 // wxGridCellRenderer is an ABC, and several derived classes are available.
526 // Classes implemented in Python should be derived from wxPyGridCellRenderer.
529 class wxGridCellRenderer
533 void _setOORInfo(PyObject* _self) {
534 self->SetClientObject(new wxPyOORClientData(_self));
538 void SetParameters(const wxString& params);
542 virtual void Draw(wxGrid& grid,
543 wxGridCellAttr& attr,
548 virtual wxSize GetBestSize(wxGrid& grid,
549 wxGridCellAttr& attr,
552 virtual wxGridCellRenderer *Clone() const;
556 // The C++ version of wxPyGridCellRenderer
558 class wxPyGridCellRenderer : public wxGridCellRenderer
561 wxPyGridCellRenderer() : wxGridCellRenderer() {};
563 // Implement Python callback aware virtual methods
564 void Draw(wxGrid& grid, wxGridCellAttr& attr,
565 wxDC& dc, const wxRect& rect,
566 int row, int col, bool isSelected) {
567 bool blocked = wxPyBeginBlockThreads();
568 if (wxPyCBH_findCallback(m_myInst, "Draw")) {
569 PyObject* go = wxPyMake_wxObject(&grid);
570 PyObject* dco = wxPyMake_wxObject(&dc);
571 PyObject* ao = wxPyMake_wxGridCellAttr(&attr);
572 PyObject* ro = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
574 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOiii)", go, ao, dco, ro,
575 row, col, isSelected));
581 wxPyEndBlockThreads(blocked);
584 wxSize GetBestSize(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
587 bool blocked = wxPyBeginBlockThreads();
588 if (wxPyCBH_findCallback(m_myInst, "GetBestSize")) {
591 PyObject* go = wxPyMake_wxObject(&grid);
592 PyObject* dco = wxPyMake_wxObject(&dc);
593 PyObject* ao = wxPyMake_wxGridCellAttr(&attr);
595 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OOOii)",
603 const char* errmsg = "GetBestSize should return a 2-tuple of integers or a wxSize object.";
604 if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxSize"))) {
607 else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
608 PyObject* o1 = PySequence_GetItem(ro, 0);
609 PyObject* o2 = PySequence_GetItem(ro, 1);
610 if (PyNumber_Check(o1) && PyNumber_Check(o2))
611 rval = wxSize(PyInt_AsLong(o1), PyInt_AsLong(o2));
613 PyErr_SetString(PyExc_TypeError, errmsg);
618 PyErr_SetString(PyExc_TypeError, errmsg);
623 wxPyEndBlockThreads(blocked);
628 wxGridCellRenderer *Clone() const {
629 wxGridCellRenderer* rval = NULL;
630 bool blocked = wxPyBeginBlockThreads();
631 if (wxPyCBH_findCallback(m_myInst, "Clone")) {
633 wxGridCellRenderer* ptr;
634 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
636 if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxGridCellRenderer")))
641 wxPyEndBlockThreads(blocked);
645 DEC_PYCALLBACK__STRING(SetParameters);
650 IMP_PYCALLBACK__STRING( wxPyGridCellRenderer, wxGridCellRenderer, SetParameters);
655 // Let SWIG know about it so it can create the Python version
656 class wxPyGridCellRenderer : public wxGridCellRenderer {
658 %pythonAppend wxPyGridCellRenderer "self._setCallbackInfo(self, PyGridCellRenderer);self._setOORInfo(self)"
660 wxPyGridCellRenderer();
661 void _setCallbackInfo(PyObject* self, PyObject* _class);
663 void base_SetParameters(const wxString& params);
666 //---------------------------------------------------------------------------
667 // Predefined Renderers
669 class wxGridCellStringRenderer : public wxGridCellRenderer
672 %pythonAppend wxGridCellStringRenderer "self._setOORInfo(self)"
673 wxGridCellStringRenderer();
677 class wxGridCellNumberRenderer : public wxGridCellStringRenderer
680 %pythonAppend wxGridCellNumberRenderer "self._setOORInfo(self)"
681 wxGridCellNumberRenderer();
685 class wxGridCellFloatRenderer : public wxGridCellStringRenderer
688 %pythonAppend wxGridCellFloatRenderer "self._setOORInfo(self)"
689 wxGridCellFloatRenderer(int width = -1, int precision = -1);
691 int GetWidth() const;
692 void SetWidth(int width);
693 int GetPrecision() const;
694 void SetPrecision(int precision);
698 class wxGridCellBoolRenderer : public wxGridCellRenderer
701 %pythonAppend wxGridCellBoolRenderer "self._setOORInfo(self)"
702 wxGridCellBoolRenderer();
706 class wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
709 %pythonAppend wxGridCellDateTimeRenderer "self._setOORInfo(self)"
710 wxGridCellDateTimeRenderer(wxString outformat = wxPyDateTimeFormatStr,
711 wxString informat = wxPyDateTimeFormatStr);
715 class wxGridCellEnumRenderer : public wxGridCellStringRenderer
718 %pythonAppend wxGridCellEnumRenderer "self._setOORInfo(self)"
719 wxGridCellEnumRenderer( const wxString& choices = wxPyEmptyString );
723 class wxGridCellAutoWrapStringRenderer : public wxGridCellStringRenderer
726 %pythonAppend wxGridCellAutoWrapStringRenderer "self._setOORInfo(self)"
727 wxGridCellAutoWrapStringRenderer();
731 //---------------------------------------------------------------------------
732 // wxGridCellEditor is an ABC, and several derived classes are available.
733 // Classes implemented in Python should be derived from wxPyGridCellEditor.
735 class wxGridCellEditor
739 void _setOORInfo(PyObject* _self) {
740 self->SetClientObject(new wxPyOORClientData(_self));
745 wxControl* GetControl();
746 void SetControl(wxControl* control);
748 wxGridCellAttr* GetCellAttr();
749 void SetCellAttr(wxGridCellAttr* attr);
751 void SetParameters(const wxString& params);
755 virtual void Create(wxWindow* parent,
757 wxEvtHandler* evtHandler);
758 virtual void BeginEdit(int row, int col, wxGrid* grid);
759 virtual bool EndEdit(int row, int col, wxGrid* grid);
760 virtual void Reset();
761 virtual wxGridCellEditor *Clone() const;
763 virtual void SetSize(const wxRect& rect);
764 virtual void Show(bool show, wxGridCellAttr *attr = NULL);
765 virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
766 virtual bool IsAcceptedKey(wxKeyEvent& event);
767 virtual void StartingKey(wxKeyEvent& event);
768 virtual void StartingClick();
769 virtual void HandleReturn(wxKeyEvent& event);
770 virtual void Destroy();
775 // The C++ version of wxPyGridCellEditor
777 class wxPyGridCellEditor : public wxGridCellEditor
780 wxPyGridCellEditor() : wxGridCellEditor() {}
782 void Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler) {
783 bool blocked = wxPyBeginBlockThreads();
784 if (wxPyCBH_findCallback(m_myInst, "Create")) {
785 PyObject* po = wxPyMake_wxObject(parent);
786 PyObject* eo = wxPyMake_wxObject(evtHandler);
788 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)", po, id, eo));
792 wxPyEndBlockThreads(blocked);
796 void BeginEdit(int row, int col, wxGrid* grid) {
797 bool blocked = wxPyBeginBlockThreads();
798 if (wxPyCBH_findCallback(m_myInst, "BeginEdit")) {
799 PyObject* go = wxPyMake_wxObject(grid);
800 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)", row, col, go));
803 wxPyEndBlockThreads(blocked);
807 bool EndEdit(int row, int col, wxGrid* grid) {
809 bool blocked = wxPyBeginBlockThreads();
810 if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
811 PyObject* go = wxPyMake_wxObject(grid);
812 rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)", row, col, go));
815 wxPyEndBlockThreads(blocked);
820 wxGridCellEditor* Clone() const {
821 wxGridCellEditor* rval = NULL;
822 bool blocked = wxPyBeginBlockThreads();
823 if (wxPyCBH_findCallback(m_myInst, "Clone")) {
825 wxGridCellEditor* ptr;
826 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
828 if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxGridCellEditor")))
833 wxPyEndBlockThreads(blocked);
838 void Show(bool show, wxGridCellAttr *attr) {
840 bool blocked = wxPyBeginBlockThreads();
841 if ((found = wxPyCBH_findCallback(m_myInst, "Show"))) {
842 PyObject* ao = wxPyMake_wxGridCellAttr(attr);
843 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iO)", show, ao));
846 wxPyEndBlockThreads(blocked);
848 wxGridCellEditor::Show(show, attr);
850 void base_Show(bool show, wxGridCellAttr *attr) {
851 wxGridCellEditor::Show(show, attr);
855 void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr) {
857 bool blocked = wxPyBeginBlockThreads();
858 if ((found = wxPyCBH_findCallback(m_myInst, "PaintBackground)"))) {
859 PyObject* ao = wxPyMake_wxGridCellAttr(attr);
860 PyObject* ro = wxPyConstructObject((void*)&rectCell, wxT("wxRect"), 0);
862 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", ro, ao));
867 wxPyEndBlockThreads(blocked);
869 wxGridCellEditor::PaintBackground(rectCell, attr);
871 void base_PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr) {
872 wxGridCellEditor::PaintBackground(rectCell, attr);
876 DEC_PYCALLBACK___pure(Reset);
877 DEC_PYCALLBACK__constany(SetSize, wxRect);
878 DEC_PYCALLBACK_bool_any(IsAcceptedKey, wxKeyEvent);
879 DEC_PYCALLBACK__any(StartingKey, wxKeyEvent);
880 DEC_PYCALLBACK__any(HandleReturn, wxKeyEvent);
881 DEC_PYCALLBACK__(StartingClick);
882 DEC_PYCALLBACK__(Destroy);
883 DEC_PYCALLBACK__STRING(SetParameters);
884 DEC_PYCALLBACK_STRING__constpure(GetValue);
890 IMP_PYCALLBACK__STRING( wxPyGridCellEditor, wxGridCellEditor, SetParameters);
891 IMP_PYCALLBACK___pure(wxPyGridCellEditor, wxGridCellEditor, Reset);
892 IMP_PYCALLBACK__constany(wxPyGridCellEditor, wxGridCellEditor, SetSize, wxRect);
893 IMP_PYCALLBACK_bool_any(wxPyGridCellEditor, wxGridCellEditor, IsAcceptedKey, wxKeyEvent);
894 IMP_PYCALLBACK__any(wxPyGridCellEditor, wxGridCellEditor, StartingKey, wxKeyEvent);
895 IMP_PYCALLBACK__any(wxPyGridCellEditor, wxGridCellEditor, HandleReturn, wxKeyEvent);
896 IMP_PYCALLBACK__(wxPyGridCellEditor, wxGridCellEditor, StartingClick);
897 IMP_PYCALLBACK__(wxPyGridCellEditor, wxGridCellEditor, Destroy);
898 IMP_PYCALLBACK_STRING__constpure(wxPyGridCellEditor, wxGridCellEditor, GetValue);
903 // Let SWIG know about it so it can create the Python version
904 class wxPyGridCellEditor : public wxGridCellEditor {
906 %pythonAppend wxPyGridCellEditor "self._setCallbackInfo(self, PyGridCellEditor);self._setOORInfo(self)"
908 wxPyGridCellEditor();
909 void _setCallbackInfo(PyObject* self, PyObject* _class);
911 void base_SetSize(const wxRect& rect);
912 void base_Show(bool show, wxGridCellAttr *attr = NULL);
913 void base_PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
914 bool base_IsAcceptedKey(wxKeyEvent& event);
915 void base_StartingKey(wxKeyEvent& event);
916 void base_StartingClick();
917 void base_HandleReturn(wxKeyEvent& event);
919 void base_SetParameters(const wxString& params);
922 //---------------------------------------------------------------------------
923 // Predefined Editors
925 class wxGridCellTextEditor : public wxGridCellEditor
928 %pythonAppend wxGridCellTextEditor "self._setOORInfo(self)"
929 wxGridCellTextEditor();
930 virtual wxString GetValue();
934 class wxGridCellNumberEditor : public wxGridCellTextEditor
937 %pythonAppend wxGridCellNumberEditor "self._setOORInfo(self)"
938 wxGridCellNumberEditor(int min = -1, int max = -1);
939 virtual wxString GetValue();
943 class wxGridCellFloatEditor : public wxGridCellTextEditor
946 %pythonAppend wxGridCellFloatEditor "self._setOORInfo(self)"
947 wxGridCellFloatEditor(int width = -1, int precision = -1);
948 virtual wxString GetValue();
952 class wxGridCellBoolEditor : public wxGridCellEditor
955 %pythonAppend wxGridCellBoolEditor "self._setOORInfo(self)"
956 wxGridCellBoolEditor();
957 virtual wxString GetValue();
960 class wxGridCellChoiceEditor : public wxGridCellEditor
963 %pythonAppend wxGridCellChoiceEditor "self._setOORInfo(self)"
964 wxGridCellChoiceEditor(int choices = 0,
965 const wxString* choices_array = NULL,
966 bool allowOthers = False);
967 virtual wxString GetValue();
971 class wxGridCellEnumEditor : public wxGridCellChoiceEditor
974 %pythonAppend wxGridCellEnumEditor "self._setOORInfo(self)"
975 wxGridCellEnumEditor( const wxString& choices = wxPyEmptyString );
976 virtual wxString GetValue();
980 class wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor
983 %pythonAppend wxGridCellAutoWrapStringEditor "self._setOORInfo(self)"
984 wxGridCellAutoWrapStringEditor();
985 virtual wxString GetValue();
990 //---------------------------------------------------------------------------
1007 void _setOORInfo(PyObject* _self) {
1008 self->SetClientObject(new wxPyOORClientData(_self));
1012 %pythonAppend wxGridCellAttr "self._setOORInfo(self)"
1014 wxGridCellAttr(wxGridCellAttr *attrDefault = NULL);
1016 wxGridCellAttr *Clone() const;
1017 void MergeWith(wxGridCellAttr *mergefrom);
1020 void SetTextColour(const wxColour& colText);
1021 void SetBackgroundColour(const wxColour& colBack);
1022 void SetFont(const wxFont& font);
1023 void SetAlignment(int hAlign, int vAlign);
1024 void SetSize(int num_rows, int num_cols);
1025 void SetOverflow( bool allow = True );
1026 void SetReadOnly(bool isReadOnly = True);
1028 void SetRenderer(wxGridCellRenderer *renderer);
1029 void SetEditor(wxGridCellEditor* editor);
1030 void SetKind(wxAttrKind kind);
1032 bool HasTextColour() const;
1033 bool HasBackgroundColour() const;
1034 bool HasFont() const;
1035 bool HasAlignment() const;
1036 bool HasRenderer() const;
1037 bool HasEditor() const;
1038 bool HasReadWriteMode() const;
1039 bool HasOverflowMode() const;
1041 wxColour GetTextColour() const;
1042 wxColour GetBackgroundColour() const;
1043 wxFont GetFont() const;
1046 void, GetAlignment(int *OUTPUT, int *OUTPUT) const,
1047 "GetAlignment() -> (hAlign, vAlign)");
1050 void, GetSize(int *OUTPUT, int *OUTPUT) const,
1051 "GetSize() -> (num_rows, num_cols)");
1053 bool GetOverflow() const;
1054 wxGridCellRenderer *GetRenderer(wxGrid* grid, int row, int col) const;
1055 wxGridCellEditor *GetEditor(wxGrid* grid, int row, int col) const;
1057 bool IsReadOnly() const;
1058 wxAttrKind GetKind();
1059 void SetDefAttr(wxGridCellAttr* defAttr);
1062 //---------------------------------------------------------------------------
1064 class wxGridCellAttrProvider
1067 %pythonAppend wxGridCellAttrProvider "self._setOORInfo(self)"
1068 wxGridCellAttrProvider();
1069 // ???? virtual ~wxGridCellAttrProvider();
1072 void _setOORInfo(PyObject* _self) {
1073 self->SetClientObject(new wxPyOORClientData(_self));
1077 wxGridCellAttr *GetAttr(int row, int col,
1078 wxGridCellAttr::wxAttrKind kind) const;
1079 void SetAttr(wxGridCellAttr *attr, int row, int col);
1080 void SetRowAttr(wxGridCellAttr *attr, int row);
1081 void SetColAttr(wxGridCellAttr *attr, int col);
1083 void UpdateAttrRows( size_t pos, int numRows );
1084 void UpdateAttrCols( size_t pos, int numCols );
1089 // A Python-aware version
1091 class wxPyGridCellAttrProvider : public wxGridCellAttrProvider
1094 wxPyGridCellAttrProvider() : wxGridCellAttrProvider() {};
1096 PYCALLBACK_GCA_INTINTKIND(wxGridCellAttrProvider, GetAttr);
1097 PYCALLBACK__GCAINTINT(wxGridCellAttrProvider, SetAttr);
1098 PYCALLBACK__GCAINT(wxGridCellAttrProvider, SetRowAttr);
1099 PYCALLBACK__GCAINT(wxGridCellAttrProvider, SetColAttr);
1106 // The python-aware version get's SWIGified
1107 class wxPyGridCellAttrProvider : public wxGridCellAttrProvider
1110 %pythonAppend wxPyGridCellAttrProvider "self._setCallbackInfo(self, PyGridCellAttrProvider)"
1111 wxPyGridCellAttrProvider();
1112 void _setCallbackInfo(PyObject* self, PyObject* _class);
1114 wxGridCellAttr *base_GetAttr(int row, int col,
1115 wxGridCellAttr::wxAttrKind kind);
1116 void base_SetAttr(wxGridCellAttr *attr, int row, int col);
1117 void base_SetRowAttr(wxGridCellAttr *attr, int row);
1118 void base_SetColAttr(wxGridCellAttr *attr, int col);
1122 //---------------------------------------------------------------------------
1123 // Grid Table Base class and Python aware version
1126 class wxGridTableBase : public wxObject
1129 // wxGridTableBase(); This is an ABC
1130 //~wxGridTableBase();
1133 void _setOORInfo(PyObject* _self) {
1134 self->SetClientObject(new wxPyOORClientData(_self));
1138 void SetAttrProvider(wxGridCellAttrProvider *attrProvider);
1139 wxGridCellAttrProvider *GetAttrProvider() const;
1140 void SetView( wxGrid *grid );
1141 wxGrid * GetView() const;
1145 virtual int GetNumberRows();
1146 virtual int GetNumberCols();
1147 virtual bool IsEmptyCell( int row, int col );
1148 virtual wxString GetValue( int row, int col );
1149 virtual void SetValue( int row, int col, const wxString& value );
1151 // virtuals overridable in wxPyGridTableBase
1152 virtual wxString GetTypeName( int row, int col );
1153 virtual bool CanGetValueAs( int row, int col, const wxString& typeName );
1154 virtual bool CanSetValueAs( int row, int col, const wxString& typeName );
1155 virtual long GetValueAsLong( int row, int col );
1156 virtual double GetValueAsDouble( int row, int col );
1157 virtual bool GetValueAsBool( int row, int col );
1158 virtual void SetValueAsLong( int row, int col, long value );
1159 virtual void SetValueAsDouble( int row, int col, double value );
1160 virtual void SetValueAsBool( int row, int col, bool value );
1162 //virtual void* GetValueAsCustom( int row, int col, const wxString& typeName );
1163 //virtual void SetValueAsCustom( int row, int col, const wxString& typeName, void* value );
1166 virtual void Clear();
1167 virtual bool InsertRows( size_t pos = 0, size_t numRows = 1 );
1168 virtual bool AppendRows( size_t numRows = 1 );
1169 virtual bool DeleteRows( size_t pos = 0, size_t numRows = 1 );
1170 virtual bool InsertCols( size_t pos = 0, size_t numCols = 1 );
1171 virtual bool AppendCols( size_t numCols = 1 );
1172 virtual bool DeleteCols( size_t pos = 0, size_t numCols = 1 );
1174 virtual wxString GetRowLabelValue( int row );
1175 virtual wxString GetColLabelValue( int col );
1176 virtual void SetRowLabelValue( int row, const wxString& value );
1177 virtual void SetColLabelValue( int col, const wxString& value );
1179 virtual bool CanHaveAttributes();
1181 virtual wxGridCellAttr *GetAttr( int row, int col,
1182 wxGridCellAttr::wxAttrKind kind);
1183 virtual void SetAttr(wxGridCellAttr* attr, int row, int col);
1184 virtual void SetRowAttr(wxGridCellAttr *attr, int row);
1185 virtual void SetColAttr(wxGridCellAttr *attr, int col);
1191 // Python-aware version
1193 class wxPyGridTableBase : public wxGridTableBase
1196 wxPyGridTableBase() : wxGridTableBase() {}
1198 PYCALLBACK_INT__pure(GetNumberRows);
1199 PYCALLBACK_INT__pure(GetNumberCols);
1200 PYCALLBACK_BOOL_INTINT_pure(IsEmptyCell);
1201 PYCALLBACK_STRING_INTINT(wxGridTableBase, GetTypeName);
1202 PYCALLBACK_BOOL_INTINTSTRING(wxGridTableBase, CanGetValueAs);
1203 PYCALLBACK_BOOL_INTINTSTRING(wxGridTableBase, CanSetValueAs);
1204 PYCALLBACK__(wxGridTableBase, Clear);
1205 PYCALLBACK_BOOL_SIZETSIZET(wxGridTableBase, InsertRows);
1206 PYCALLBACK_BOOL_SIZETSIZET(wxGridTableBase, DeleteRows);
1207 PYCALLBACK_BOOL_SIZETSIZET(wxGridTableBase, InsertCols);
1208 PYCALLBACK_BOOL_SIZETSIZET(wxGridTableBase, DeleteCols);
1209 PYCALLBACK_BOOL_SIZET(wxGridTableBase, AppendRows);
1210 PYCALLBACK_BOOL_SIZET(wxGridTableBase, AppendCols);
1211 PYCALLBACK_STRING_INT(wxGridTableBase, GetRowLabelValue);
1212 PYCALLBACK_STRING_INT(wxGridTableBase, GetColLabelValue);
1213 PYCALLBACK__INTSTRING(wxGridTableBase, SetRowLabelValue);
1214 PYCALLBACK__INTSTRING(wxGridTableBase, SetColLabelValue);
1215 PYCALLBACK_BOOL_(wxGridTableBase, CanHaveAttributes);
1216 PYCALLBACK_GCA_INTINTKIND(wxGridTableBase, GetAttr);
1217 PYCALLBACK__GCAINTINT(wxGridTableBase, SetAttr);
1218 PYCALLBACK__GCAINT(wxGridTableBase, SetRowAttr);
1219 PYCALLBACK__GCAINT(wxGridTableBase, SetColAttr);
1222 wxString GetValue(int row, int col) {
1223 bool blocked = wxPyBeginBlockThreads();
1225 if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
1227 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",row,col));
1229 if (!PyString_Check(ro) && !PyUnicode_Check(ro)) {
1231 ro = PyObject_Str(ro);
1234 rval = Py2wxString(ro);
1238 wxPyEndBlockThreads(blocked);
1242 void SetValue(int row, int col, const wxString& val) {
1243 bool blocked = wxPyBeginBlockThreads();
1244 if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
1245 PyObject* s = wx2PyString(val);
1246 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",row,col,s));
1249 wxPyEndBlockThreads(blocked);
1253 // Map the Get/Set methods for the standard non-string types to
1254 // the GetValue and SetValue python methods.
1255 long GetValueAsLong( int row, int col ) {
1257 bool blocked = wxPyBeginBlockThreads();
1258 if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
1261 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", row, col));
1262 if (ro && PyNumber_Check(ro)) {
1263 num = PyNumber_Int(ro);
1265 rval = PyInt_AsLong(num);
1271 wxPyEndBlockThreads(blocked);
1275 double GetValueAsDouble( int row, int col ) {
1277 bool blocked = wxPyBeginBlockThreads();
1278 if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
1281 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", row, col));
1282 if (ro && PyNumber_Check(ro)) {
1283 num = PyNumber_Float(ro);
1285 rval = PyFloat_AsDouble(num);
1291 wxPyEndBlockThreads(blocked);
1295 bool GetValueAsBool( int row, int col ) {
1296 return (bool)GetValueAsLong(row, col);
1299 void SetValueAsLong( int row, int col, long value ) {
1300 bool blocked = wxPyBeginBlockThreads();
1301 if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
1302 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", row, col, value));
1304 wxPyEndBlockThreads(blocked);
1307 void SetValueAsDouble( int row, int col, double value ) {
1308 bool blocked = wxPyBeginBlockThreads();
1309 if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
1310 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iid)", row, col, value));
1312 wxPyEndBlockThreads(blocked);
1315 void SetValueAsBool( int row, int col, bool value ) {
1316 SetValueAsLong( row, col, (long)value );
1325 // The python-aware version get's SWIGified
1326 class wxPyGridTableBase : public wxGridTableBase
1329 %pythonAppend wxPyGridTableBase "self._setCallbackInfo(self, PyGridTableBase);self._setOORInfo(self)"
1330 wxPyGridTableBase();
1331 void _setCallbackInfo(PyObject* self, PyObject* _class);
1333 %extend { void Destroy() { delete self; } }
1335 wxString base_GetTypeName( int row, int col );
1336 bool base_CanGetValueAs( int row, int col, const wxString& typeName );
1337 bool base_CanSetValueAs( int row, int col, const wxString& typeName );
1339 bool base_InsertRows( size_t pos = 0, size_t numRows = 1 );
1340 bool base_AppendRows( size_t numRows = 1 );
1341 bool base_DeleteRows( size_t pos = 0, size_t numRows = 1 );
1342 bool base_InsertCols( size_t pos = 0, size_t numCols = 1 );
1343 bool base_AppendCols( size_t numCols = 1 );
1344 bool base_DeleteCols( size_t pos = 0, size_t numCols = 1 );
1345 wxString base_GetRowLabelValue( int row );
1346 wxString base_GetColLabelValue( int col );
1347 void base_SetRowLabelValue( int row, const wxString& value );
1348 void base_SetColLabelValue( int col, const wxString& value );
1349 bool base_CanHaveAttributes();
1350 wxGridCellAttr *base_GetAttr( int row, int col,
1351 wxGridCellAttr::wxAttrKind kind );
1352 void base_SetAttr(wxGridCellAttr* attr, int row, int col);
1353 void base_SetRowAttr(wxGridCellAttr *attr, int row);
1354 void base_SetColAttr(wxGridCellAttr *attr, int col);
1358 //---------------------------------------------------------------------------
1359 // Predefined Tables
1361 class wxGridStringTable : public wxGridTableBase
1364 %pythonAppend wxGridStringTable "self._setOORInfo(self)"
1365 wxGridStringTable( int numRows=0, int numCols=0 );
1368 //---------------------------------------------------------------------------
1369 // The Table can pass messages to the grid to tell it to update itself if
1370 // something has changed.
1372 enum wxGridTableRequest
1374 wxGRIDTABLE_REQUEST_VIEW_GET_VALUES = 2000,
1375 wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES,
1376 wxGRIDTABLE_NOTIFY_ROWS_INSERTED,
1377 wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
1378 wxGRIDTABLE_NOTIFY_ROWS_DELETED,
1379 wxGRIDTABLE_NOTIFY_COLS_INSERTED,
1380 wxGRIDTABLE_NOTIFY_COLS_APPENDED,
1381 wxGRIDTABLE_NOTIFY_COLS_DELETED
1385 class wxGridTableMessage
1388 wxGridTableMessage( wxGridTableBase *table, int id,
1391 ~wxGridTableMessage();
1393 void SetTableObject( wxGridTableBase *table );
1394 wxGridTableBase * GetTableObject() const;
1395 void SetId( int id );
1397 void SetCommandInt( int comInt1 );
1398 int GetCommandInt();
1399 void SetCommandInt2( int comInt2 );
1400 int GetCommandInt2();
1404 //---------------------------------------------------------------------------
1407 // Typemap to allow conversion of sequence objects to wxGridCellCoords...
1408 %typemap(in) wxGridCellCoords& (wxGridCellCoords temp) {
1410 if (! wxGridCellCoords_helper($input, &$1)) SWIG_fail;
1412 %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) wxGridCellCoords& {
1413 $1 = wxGridCellCoords_typecheck($input);
1417 // ...and here is the associated helper.
1419 bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) {
1421 if (source == Py_None) {
1422 **obj = wxGridCellCoords(-1,-1);
1426 // If source is an object instance then it may already be the right type
1427 if (wxPySwigInstance_Check(source)) {
1428 wxGridCellCoords* ptr;
1429 if (! wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
1434 // otherwise a 2-tuple of integers is expected
1435 else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
1436 PyObject* o1 = PySequence_GetItem(source, 0);
1437 PyObject* o2 = PySequence_GetItem(source, 1);
1438 if (!PyNumber_Check(o1) || !PyNumber_Check(o2)) {
1443 **obj = wxGridCellCoords(PyInt_AsLong(o1), PyInt_AsLong(o2));
1450 PyErr_SetString(PyExc_TypeError, "Expected a 2-tuple of integers or a wxGridCellCoords object.");
1455 bool wxGridCellCoords_typecheck(PyObject* source) {
1458 if (wxPySwigInstance_Check(source) &&
1459 wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
1463 if (PySequence_Check(source) && PySequence_Length(source) == 2)
1471 // Typemap to convert an array of cells coords to a list of tuples...
1472 %typemap(out) wxGridCellCoordsArray {
1473 $result = wxGridCellCoordsArray_helper($1);
1476 // %typemap(ret) wxGridCellCoordsArray {
1481 // ...and the helper function for the above typemap.
1483 PyObject* wxGridCellCoordsArray_helper(const wxGridCellCoordsArray& source)
1485 PyObject* list = PyList_New(0);
1487 for (idx = 0; idx < source.GetCount(); idx += 1) {
1488 wxGridCellCoords& coord = source.Item(idx);
1489 PyObject* tup = PyTuple_New(2);
1490 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(coord.GetRow()));
1491 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(coord.GetCol()));
1492 PyList_Append(list, tup);
1503 class wxGridCellCoords
1506 wxGridCellCoords( int r=-1, int c=-1 );
1507 ~wxGridCellCoords();
1510 void SetRow( int n );
1512 void SetCol( int n );
1513 void Set( int row, int col );
1515 bool operator==( const wxGridCellCoords& other ) const;
1516 bool operator!=( const wxGridCellCoords& other ) const;
1520 PyObject* tup = PyTuple_New(2);
1521 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRow()));
1522 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->GetCol()));
1527 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1528 def __str__(self): return str(self.Get())
1529 def __repr__(self): return 'wxGridCellCoords'+str(self.Get())
1530 def __len__(self): return len(self.Get())
1531 def __getitem__(self, index): return self.asTuple()[index]
1532 def __setitem__(self, index, val):
1533 if index == 0: self.SetRow(val)
1534 elif index == 1: self.SetCol(val)
1535 else: raise IndexError
1541 //---------------------------------------------------------------------------
1542 //---------------------------------------------------------------------------
1546 // Fool SWIG into treating this enum as an int
1547 typedef int WXGRIDSELECTIONMODES;
1549 // but let the C++ code know what it really is.
1551 typedef wxGrid::wxGridSelectionModes WXGRIDSELECTIONMODES;
1556 MustHaveApp(wxGrid);
1558 class wxGrid : public wxScrolledWindow
1561 %pythonAppend wxGrid "self._setOORInfo(self)"
1563 wxGrid( wxWindow *parent,
1565 const wxPoint& pos = wxDefaultPosition,
1566 const wxSize& size = wxDefaultSize,
1567 long style = wxWANTS_CHARS,
1568 const wxString& name = wxPyPanelNameStr);
1570 %name(PreGrid) wxGrid();
1573 bool Create( wxWindow *parent,
1575 const wxPoint& pos = wxDefaultPosition,
1576 const wxSize& size = wxDefaultSize,
1577 long style = wxWANTS_CHARS,
1578 const wxString& name = wxPyPanelNameStr );
1581 enum wxGridSelectionModes {
1587 SelectCells = wxGridSelectCells
1588 SelectRows = wxGridSelectRows
1589 SelectColumns = wxGridSelectColumns
1592 bool CreateGrid( int numRows, int numCols,
1593 WXGRIDSELECTIONMODES selmode = wxGrid::wxGridSelectCells );
1594 void SetSelectionMode(WXGRIDSELECTIONMODES selmode);
1595 WXGRIDSELECTIONMODES GetSelectionMode();
1598 // ------ grid dimensions
1600 int GetNumberRows();
1601 int GetNumberCols();
1604 bool ProcessTableMessage( wxGridTableMessage& );
1607 wxGridTableBase * GetTable() const;
1608 bool SetTable( wxGridTableBase *table, bool takeOwnership=False,
1609 WXGRIDSELECTIONMODES selmode =
1610 wxGrid::wxGridSelectCells );
1613 bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=True );
1614 bool AppendRows( int numRows = 1, bool updateLabels=True );
1615 bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=True );
1616 bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=True );
1617 bool AppendCols( int numCols = 1, bool updateLabels=True );
1618 bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=True );
1621 // this function is called when the current cell highlight must be redrawn
1622 // and may be overridden by the user
1623 virtual void DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr );
1626 // ------ Cell text drawing functions
1628 void DrawTextRectangle( wxDC& dc, const wxString&, const wxRect&,
1629 int horizontalAlignment = wxLEFT,
1630 int verticalAlignment = wxTOP,
1631 int textOrientation = wxHORIZONTAL );
1633 // // Split a string containing newline chararcters into an array of
1634 // // strings and return the number of lines
1636 // void StringToLines( const wxString& value, wxArrayString& lines );
1639 void, GetTextBoxSize( wxDC& dc, wxArrayString& lines,
1640 long *OUTPUT, long *OUTPUT ),
1641 "GetTextBoxSize(DC dc, list lines) -> (width, height)");
1645 // Code that does a lot of grid modification can be enclosed
1646 // between BeginBatch() and EndBatch() calls to avoid screen
1651 int GetBatchCount();
1652 void ForceRefresh();
1655 // ------ edit control functions
1658 void EnableEditing( bool edit );
1660 void EnableCellEditControl( bool enable = True );
1661 void DisableCellEditControl();
1662 bool CanEnableCellControl() const;
1663 bool IsCellEditControlEnabled() const;
1664 bool IsCellEditControlShown() const;
1666 bool IsCurrentCellReadOnly() const;
1668 void ShowCellEditControl();
1669 void HideCellEditControl();
1670 void SaveEditControlValue();
1673 // ------ grid location functions
1674 // Note that all of these functions work with the logical coordinates of
1675 // grid cells and labels so you will need to convert from device
1676 // coordinates for mouse events etc.
1679 //void XYToCell( int x, int y, wxGridCellCoords& );
1681 wxGridCellCoords XYToCell(int x, int y) {
1682 wxGridCellCoords rv;
1683 self->XYToCell(x, y, rv);
1688 int YToRow( int y );
1689 int XToCol( int x );
1691 int YToEdgeOfRow( int y );
1692 int XToEdgeOfCol( int x );
1694 wxRect CellToRect( int row, int col );
1695 // TODO: ??? wxRect CellToRect( const wxGridCellCoords& coords );
1698 int GetGridCursorRow();
1699 int GetGridCursorCol();
1701 // check to see if a cell is either wholly visible (the default arg) or
1702 // at least partially visible in the grid window
1704 bool IsVisible( int row, int col, bool wholeCellVisible = True );
1705 // TODO: ??? bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = True );
1706 void MakeCellVisible( int row, int col );
1707 // TODO: ??? void MakeCellVisible( const wxGridCellCoords& coords );
1710 // ------ grid cursor movement functions
1712 void SetGridCursor( int row, int col );
1713 bool MoveCursorUp( bool expandSelection );
1714 bool MoveCursorDown( bool expandSelection );
1715 bool MoveCursorLeft( bool expandSelection );
1716 bool MoveCursorRight( bool expandSelection );
1717 bool MovePageDown();
1719 bool MoveCursorUpBlock( bool expandSelection );
1720 bool MoveCursorDownBlock( bool expandSelection );
1721 bool MoveCursorLeftBlock( bool expandSelection );
1722 bool MoveCursorRightBlock( bool expandSelection );
1725 // ------ label and gridline formatting
1727 int GetDefaultRowLabelSize();
1728 int GetRowLabelSize();
1729 int GetDefaultColLabelSize();
1730 int GetColLabelSize();
1731 wxColour GetLabelBackgroundColour();
1732 wxColour GetLabelTextColour();
1733 wxFont GetLabelFont();
1736 void, GetRowLabelAlignment( int *OUTPUT, int *OUTPUT ),
1737 "GetRowLabelAlignment() -> (horiz, vert)");
1740 void, GetColLabelAlignment( int *OUTPUT, int *OUTPUT ),
1741 "GetColLabelAlignment() -> (horiz, vert)");
1743 int GetColLabelTextOrientation();
1744 wxString GetRowLabelValue( int row );
1745 wxString GetColLabelValue( int col );
1746 wxColour GetGridLineColour();
1747 wxColour GetCellHighlightColour();
1748 int GetCellHighlightPenWidth();
1749 int GetCellHighlightROPenWidth();
1751 void SetRowLabelSize( int width );
1752 void SetColLabelSize( int height );
1753 void SetLabelBackgroundColour( const wxColour& );
1754 void SetLabelTextColour( const wxColour& );
1755 void SetLabelFont( const wxFont& );
1756 void SetRowLabelAlignment( int horiz, int vert );
1757 void SetColLabelAlignment( int horiz, int vert );
1758 void SetColLabelTextOrientation( int textOrientation );
1759 void SetRowLabelValue( int row, const wxString& );
1760 void SetColLabelValue( int col, const wxString& );
1761 void SetGridLineColour( const wxColour& );
1762 void SetCellHighlightColour( const wxColour& );
1763 void SetCellHighlightPenWidth(int width);
1764 void SetCellHighlightROPenWidth(int width);
1766 void EnableDragRowSize( bool enable = True );
1767 void DisableDragRowSize();
1768 bool CanDragRowSize();
1769 void EnableDragColSize( bool enable = True );
1770 void DisableDragColSize();
1771 bool CanDragColSize();
1772 void EnableDragGridSize(bool enable = True);
1773 void DisableDragGridSize();
1774 bool CanDragGridSize();
1776 // this sets the specified attribute for all cells in this row/col
1777 void SetAttr(int row, int col, wxGridCellAttr *attr);
1778 void SetRowAttr(int row, wxGridCellAttr *attr);
1779 void SetColAttr(int col, wxGridCellAttr *attr);
1781 // shortcuts for setting the column parameters
1783 // set the format for the data in the column: default is string
1784 void SetColFormatBool(int col);
1785 void SetColFormatNumber(int col);
1786 void SetColFormatFloat(int col, int width = -1, int precision = -1);
1787 void SetColFormatCustom(int col, const wxString& typeName);
1789 void EnableGridLines( bool enable = True );
1790 bool GridLinesEnabled();
1792 // ------ row and col formatting
1794 int GetDefaultRowSize();
1795 int GetRowSize( int row );
1796 int GetDefaultColSize();
1797 int GetColSize( int col );
1798 wxColour GetDefaultCellBackgroundColour();
1799 wxColour GetCellBackgroundColour( int row, int col );
1800 wxColour GetDefaultCellTextColour();
1801 wxColour GetCellTextColour( int row, int col );
1802 wxFont GetDefaultCellFont();
1803 wxFont GetCellFont( int row, int col );
1806 void, GetDefaultCellAlignment( int *OUTPUT, int *OUTPUT ),
1807 "GetDefaultCellAlignment() -> (horiz, vert)");
1810 void, GetCellAlignment( int row, int col, int *OUTPUT, int *OUTPUT ),
1811 "GetCellAlignment() -> (horiz, vert)");
1813 bool GetDefaultCellOverflow();
1814 bool GetCellOverflow( int row, int col );
1817 void, GetCellSize( int row, int col, int *OUTPUT, int *OUTPUT ),
1818 "GetCellSize(int row, int col) -> (num_rows, num_cols)");
1820 void SetDefaultRowSize( int height, bool resizeExistingRows = False );
1821 void SetRowSize( int row, int height );
1822 void SetDefaultColSize( int width, bool resizeExistingCols = False );
1824 void SetColSize( int col, int width );
1826 // automatically size the column or row to fit to its contents, if
1827 // setAsMin is True, this optimal width will also be set as minimal width
1829 void AutoSizeColumn( int col, bool setAsMin = True );
1830 void AutoSizeRow( int row, bool setAsMin = True );
1833 // auto size all columns (very ineffective for big grids!)
1834 void AutoSizeColumns( bool setAsMin = True );
1835 void AutoSizeRows( bool setAsMin = True );
1837 // auto size the grid, that is make the columns/rows of the "right" size
1838 // and also set the grid size to just fit its contents
1841 // autosize row height depending on label text
1842 void AutoSizeRowLabelSize( int row );
1844 // autosize column width depending on label text
1845 void AutoSizeColLabelSize( int col );
1848 // column won't be resized to be lesser width - this must be called during
1849 // the grid creation because it won't resize the column if it's already
1850 // narrower than the minimal width
1851 void SetColMinimalWidth( int col, int width );
1852 void SetRowMinimalHeight( int row, int width );
1854 void SetColMinimalAcceptableWidth( int width );
1855 void SetRowMinimalAcceptableHeight( int width );
1856 int GetColMinimalAcceptableWidth() const;
1857 int GetRowMinimalAcceptableHeight() const;
1859 void SetDefaultCellBackgroundColour( const wxColour& );
1860 void SetCellBackgroundColour( int row, int col, const wxColour& );
1861 void SetDefaultCellTextColour( const wxColour& );
1863 void SetCellTextColour( int row, int col, const wxColour& );
1864 void SetDefaultCellFont( const wxFont& );
1865 void SetCellFont( int row, int col, const wxFont& );
1866 void SetDefaultCellAlignment( int horiz, int vert );
1867 void SetCellAlignment( int row, int col, int horiz, int vert );
1868 void SetDefaultCellOverflow( bool allow );
1869 void SetCellOverflow( int row, int col, bool allow );
1870 void SetCellSize( int row, int col, int num_rows, int num_cols );
1872 // takes ownership of the pointer
1873 void SetDefaultRenderer(wxGridCellRenderer *renderer);
1874 void SetCellRenderer(int row, int col, wxGridCellRenderer *renderer);
1875 wxGridCellRenderer *GetDefaultRenderer() const;
1876 wxGridCellRenderer* GetCellRenderer(int row, int col);
1878 // takes ownership of the pointer
1879 void SetDefaultEditor(wxGridCellEditor *editor);
1880 void SetCellEditor(int row, int col, wxGridCellEditor *editor);
1881 wxGridCellEditor *GetDefaultEditor() const;
1882 wxGridCellEditor* GetCellEditor(int row, int col);
1886 // ------ cell value accessors
1888 wxString GetCellValue( int row, int col );
1889 // TODO: ??? wxString GetCellValue( const wxGridCellCoords& coords )
1891 void SetCellValue( int row, int col, const wxString& s );
1892 // TODO: ??? void SetCellValue( const wxGridCellCoords& coords, const wxString& s )
1894 // returns True if the cell can't be edited
1895 bool IsReadOnly(int row, int col) const;
1897 // make the cell editable/readonly
1898 void SetReadOnly(int row, int col, bool isReadOnly = True);
1900 // ------ selections of blocks of cells
1902 void SelectRow( int row, bool addToSelected = False );
1903 void SelectCol( int col, bool addToSelected = False );
1905 void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
1906 bool addToSelected = False );
1907 // TODO: ??? void SelectBlock( const wxGridCellCoords& topLeft,
1908 // TODO: ??? const wxGridCellCoords& bottomRight )
1912 void ClearSelection();
1913 bool IsInSelection( int row, int col );
1914 // TODO: ??? bool IsInSelection( const wxGridCellCoords& coords )
1916 const wxGridCellCoordsArray GetSelectedCells() const;
1917 const wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
1918 const wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
1919 const wxArrayInt GetSelectedRows() const;
1920 const wxArrayInt GetSelectedCols() const;
1922 void DeselectRow( int row );
1923 void DeselectCol( int col );
1924 void DeselectCell( int row, int col );
1927 // This function returns the rectangle that encloses the block of cells
1928 // limited by TopLeft and BottomRight cell in device coords and clipped
1929 // to the client size of the grid window.
1931 wxRect BlockToDeviceRect( const wxGridCellCoords & topLeft,
1932 const wxGridCellCoords & bottomRight );
1935 // Access or update the selection fore/back colours
1936 wxColour GetSelectionBackground() const;
1937 wxColour GetSelectionForeground() const;
1939 void SetSelectionBackground(const wxColour& c);
1940 void SetSelectionForeground(const wxColour& c);
1943 // Methods for a registry for mapping data types to Renderers/Editors
1944 void RegisterDataType(const wxString& typeName,
1945 wxGridCellRenderer* renderer,
1946 wxGridCellEditor* editor);
1947 wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const;
1948 // TODO: ??? wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c) const
1949 wxGridCellRenderer* GetDefaultRendererForCell(int row, int col) const;
1950 wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName) const;
1951 wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const;
1953 // grid may occupy more space than needed for its rows/columns, this
1954 // function allows to set how big this extra space is
1955 void SetMargins(int extraWidth, int extraHeight);
1958 // Accessors for component windows
1959 wxWindow* GetGridWindow();
1960 wxWindow* GetGridRowLabelWindow();
1961 wxWindow* GetGridColLabelWindow();
1962 wxWindow* GetGridCornerLabelWindow();
1965 static wxVisualAttributes
1966 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
1970 //---------------------------------------------------------------------------
1971 //---------------------------------------------------------------------------
1972 // Grid events and stuff
1976 class wxGridEvent : public wxNotifyEvent
1979 wxGridEvent(int id, wxEventType type, wxGrid* obj,
1980 int row=-1, int col=-1, int x=-1, int y=-1, bool sel = True,
1981 bool control=False, bool shift=False, bool alt=False, bool meta=False);
1983 virtual int GetRow();
1984 virtual int GetCol();
1985 wxPoint GetPosition();
1995 class wxGridSizeEvent : public wxNotifyEvent
1998 wxGridSizeEvent(int id, wxEventType type, wxGrid* obj,
1999 int rowOrCol=-1, int x=-1, int y=-1,
2000 bool control=False, bool shift=False, bool alt=False, bool meta=False);
2003 wxPoint GetPosition();
2012 class wxGridRangeSelectEvent : public wxNotifyEvent
2015 wxGridRangeSelectEvent(int id, wxEventType type, wxGrid* obj,
2016 const wxGridCellCoords& topLeft,
2017 const wxGridCellCoords& bottomRight,
2019 bool control=False, bool shift=False,
2020 bool alt=False, bool meta=False);
2022 wxGridCellCoords GetTopLeftCoords();
2023 wxGridCellCoords GetBottomRightCoords();
2036 class wxGridEditorCreatedEvent : public wxCommandEvent {
2038 wxGridEditorCreatedEvent(int id, wxEventType type, wxObject* obj,
2039 int row, int col, wxControl* ctrl);
2043 wxControl* GetControl();
2044 void SetRow(int row);
2045 void SetCol(int col);
2046 void SetControl(wxControl* ctrl);
2051 %constant wxEventType wxEVT_GRID_CELL_LEFT_CLICK;
2052 %constant wxEventType wxEVT_GRID_CELL_RIGHT_CLICK;
2053 %constant wxEventType wxEVT_GRID_CELL_LEFT_DCLICK;
2054 %constant wxEventType wxEVT_GRID_CELL_RIGHT_DCLICK;
2055 %constant wxEventType wxEVT_GRID_LABEL_LEFT_CLICK;
2056 %constant wxEventType wxEVT_GRID_LABEL_RIGHT_CLICK;
2057 %constant wxEventType wxEVT_GRID_LABEL_LEFT_DCLICK;
2058 %constant wxEventType wxEVT_GRID_LABEL_RIGHT_DCLICK;
2059 %constant wxEventType wxEVT_GRID_ROW_SIZE;
2060 %constant wxEventType wxEVT_GRID_COL_SIZE;
2061 %constant wxEventType wxEVT_GRID_RANGE_SELECT;
2062 %constant wxEventType wxEVT_GRID_CELL_CHANGE;
2063 %constant wxEventType wxEVT_GRID_SELECT_CELL;
2064 %constant wxEventType wxEVT_GRID_EDITOR_SHOWN;
2065 %constant wxEventType wxEVT_GRID_EDITOR_HIDDEN;
2066 %constant wxEventType wxEVT_GRID_EDITOR_CREATED;
2071 EVT_GRID_CELL_LEFT_CLICK = wx.PyEventBinder( wxEVT_GRID_CELL_LEFT_CLICK )
2072 EVT_GRID_CELL_RIGHT_CLICK = wx.PyEventBinder( wxEVT_GRID_CELL_RIGHT_CLICK )
2073 EVT_GRID_CELL_LEFT_DCLICK = wx.PyEventBinder( wxEVT_GRID_CELL_LEFT_DCLICK )
2074 EVT_GRID_CELL_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_GRID_CELL_RIGHT_DCLICK )
2075 EVT_GRID_LABEL_LEFT_CLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_LEFT_CLICK )
2076 EVT_GRID_LABEL_RIGHT_CLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_RIGHT_CLICK )
2077 EVT_GRID_LABEL_LEFT_DCLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_LEFT_DCLICK )
2078 EVT_GRID_LABEL_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_RIGHT_DCLICK )
2079 EVT_GRID_ROW_SIZE = wx.PyEventBinder( wxEVT_GRID_ROW_SIZE )
2080 EVT_GRID_COL_SIZE = wx.PyEventBinder( wxEVT_GRID_COL_SIZE )
2081 EVT_GRID_RANGE_SELECT = wx.PyEventBinder( wxEVT_GRID_RANGE_SELECT )
2082 EVT_GRID_CELL_CHANGE = wx.PyEventBinder( wxEVT_GRID_CELL_CHANGE )
2083 EVT_GRID_SELECT_CELL = wx.PyEventBinder( wxEVT_GRID_SELECT_CELL )
2084 EVT_GRID_EDITOR_SHOWN = wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN )
2085 EVT_GRID_EDITOR_HIDDEN = wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN )
2086 EVT_GRID_EDITOR_CREATED = wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED )
2089 %# The same as above but with the ability to specify an identifier
2090 EVT_GRID_CMD_CELL_LEFT_CLICK = wx.PyEventBinder( wxEVT_GRID_CELL_LEFT_CLICK, 1 )
2091 EVT_GRID_CMD_CELL_RIGHT_CLICK = wx.PyEventBinder( wxEVT_GRID_CELL_RIGHT_CLICK, 1 )
2092 EVT_GRID_CMD_CELL_LEFT_DCLICK = wx.PyEventBinder( wxEVT_GRID_CELL_LEFT_DCLICK, 1 )
2093 EVT_GRID_CMD_CELL_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_GRID_CELL_RIGHT_DCLICK, 1 )
2094 EVT_GRID_CMD_LABEL_LEFT_CLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_LEFT_CLICK, 1 )
2095 EVT_GRID_CMD_LABEL_RIGHT_CLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_RIGHT_CLICK, 1 )
2096 EVT_GRID_CMD_LABEL_LEFT_DCLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_LEFT_DCLICK, 1 )
2097 EVT_GRID_CMD_LABEL_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_GRID_LABEL_RIGHT_DCLICK, 1 )
2098 EVT_GRID_CMD_ROW_SIZE = wx.PyEventBinder( wxEVT_GRID_ROW_SIZE, 1 )
2099 EVT_GRID_CMD_COL_SIZE = wx.PyEventBinder( wxEVT_GRID_COL_SIZE, 1 )
2100 EVT_GRID_CMD_RANGE_SELECT = wx.PyEventBinder( wxEVT_GRID_RANGE_SELECT, 1 )
2101 EVT_GRID_CMD_CELL_CHANGE = wx.PyEventBinder( wxEVT_GRID_CELL_CHANGE, 1 )
2102 EVT_GRID_CMD_SELECT_CELL = wx.PyEventBinder( wxEVT_GRID_SELECT_CELL, 1 )
2103 EVT_GRID_CMD_EDITOR_SHOWN = wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN, 1 )
2104 EVT_GRID_CMD_EDITOR_HIDDEN = wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN, 1 )
2105 EVT_GRID_CMD_EDITOR_CREATED = wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED, 1 )
2108 //---------------------------------------------------------------------------
2113 //---------------------------------------------------------------------------
2114 //---------------------------------------------------------------------------