%rename(GRID_VALUE_DATETIME) wxGRID_VALUE_DATETIME;
%rename(GridNoCellCoords) wxGridNoCellCoords;
%rename(GridNoCellRect) wxGridNoCellRect;
+%rename(GRID_DEFAULT_NUMBER_ROWS) wxGRID_DEFAULT_NUMBER_ROWS;
+%rename(GRID_DEFAULT_NUMBER_COLS) wxGRID_DEFAULT_NUMBER_COLS;
+%rename(GRID_DEFAULT_ROW_HEIGHT) wxGRID_DEFAULT_ROW_HEIGHT;
+%rename(GRID_DEFAULT_COL_WIDTH) wxGRID_DEFAULT_COL_WIDTH;
+%rename(GRID_DEFAULT_COL_LABEL_HEIGHT) wxGRID_DEFAULT_COL_LABEL_HEIGHT;
+%rename(GRID_DEFAULT_ROW_LABEL_WIDTH) wxGRID_DEFAULT_ROW_LABEL_WIDTH;
+%rename(GRID_LABEL_EDGE_ZONE) wxGRID_LABEL_EDGE_ZONE;
+%rename(GRID_MIN_ROW_HEIGHT) wxGRID_MIN_ROW_HEIGHT;
+%rename(GRID_MIN_COL_WIDTH) wxGRID_MIN_COL_WIDTH;
+%rename(GRID_DEFAULT_SCROLLBAR_WIDTH) wxGRID_DEFAULT_SCROLLBAR_WIDTH;
%rename(GridCellRenderer) wxGridCellRenderer;
%rename(PyGridCellRenderer) wxPyGridCellRenderer;
%rename(GridCellStringRenderer) wxGridCellStringRenderer;
wxPyOORClientData* data = (wxPyOORClientData*)source->GetClientObject(); \
if (data) { \
target = data->m_obj; \
- Py_INCREF(target); \
+ if (target) \
+ Py_INCREF(target); \
} \
/* Otherwise make a new wrapper for it the old fashioned way and \
give it the OOR treatment */ \
%mutable;
-%rename(GRID_DEFAULT_NUMBER_ROWS) WXGRID_DEFAULT_NUMBER_ROWS;
-%rename(GRID_DEFAULT_NUMBER_COLS) WXGRID_DEFAULT_NUMBER_COLS;
-%rename(GRID_DEFAULT_ROW_HEIGHT) WXGRID_DEFAULT_ROW_HEIGHT;
-%rename(GRID_DEFAULT_COL_WIDTH) WXGRID_DEFAULT_COL_WIDTH;
-%rename(GRID_DEFAULT_COL_LABEL_HEIGHT) WXGRID_DEFAULT_COL_LABEL_HEIGHT;
-%rename(GRID_DEFAULT_ROW_LABEL_WIDTH) WXGRID_DEFAULT_ROW_LABEL_WIDTH;
-%rename(GRID_LABEL_EDGE_ZONE) WXGRID_LABEL_EDGE_ZONE;
-%rename(GRID_MIN_ROW_HEIGHT) WXGRID_MIN_ROW_HEIGHT;
-%rename(GRID_MIN_COL_WIDTH) WXGRID_MIN_COL_WIDTH;
-%rename(GRID_DEFAULT_SCROLLBAR_WIDTH) WXGRID_DEFAULT_SCROLLBAR_WIDTH;
+%{
+#define wxGRID_DEFAULT_NUMBER_ROWS WXGRID_DEFAULT_NUMBER_ROWS
+#define wxGRID_DEFAULT_NUMBER_COLS WXGRID_DEFAULT_NUMBER_COLS
+#define wxGRID_DEFAULT_ROW_HEIGHT WXGRID_DEFAULT_ROW_HEIGHT
+#define wxGRID_DEFAULT_COL_WIDTH WXGRID_DEFAULT_COL_WIDTH
+#define wxGRID_DEFAULT_COL_LABEL_HEIGHT WXGRID_DEFAULT_COL_LABEL_HEIGHT
+#define wxGRID_DEFAULT_ROW_LABEL_WIDTH WXGRID_DEFAULT_ROW_LABEL_WIDTH
+#define wxGRID_LABEL_EDGE_ZONE WXGRID_LABEL_EDGE_ZONE
+#define wxGRID_MIN_ROW_HEIGHT WXGRID_MIN_ROW_HEIGHT
+#define wxGRID_MIN_COL_WIDTH WXGRID_MIN_COL_WIDTH
+#define wxGRID_DEFAULT_SCROLLBAR_WIDTH WXGRID_DEFAULT_SCROLLBAR_WIDTH
+%}
enum {
- WXGRID_DEFAULT_NUMBER_ROWS,
- WXGRID_DEFAULT_NUMBER_COLS,
- WXGRID_DEFAULT_ROW_HEIGHT,
- WXGRID_DEFAULT_COL_WIDTH,
- WXGRID_DEFAULT_COL_LABEL_HEIGHT,
- WXGRID_DEFAULT_ROW_LABEL_WIDTH,
- WXGRID_LABEL_EDGE_ZONE,
- WXGRID_MIN_ROW_HEIGHT,
- WXGRID_MIN_COL_WIDTH,
- WXGRID_DEFAULT_SCROLLBAR_WIDTH
+ wxGRID_DEFAULT_NUMBER_ROWS,
+ wxGRID_DEFAULT_NUMBER_COLS,
+ wxGRID_DEFAULT_ROW_HEIGHT,
+ wxGRID_DEFAULT_COL_WIDTH,
+ wxGRID_DEFAULT_COL_LABEL_HEIGHT,
+ wxGRID_DEFAULT_ROW_LABEL_WIDTH,
+ wxGRID_LABEL_EDGE_ZONE,
+ wxGRID_MIN_ROW_HEIGHT,
+ wxGRID_MIN_COL_WIDTH,
+ wxGRID_DEFAULT_SCROLLBAR_WIDTH
};
public:
%extend {
void _setOORInfo(PyObject* _self) {
- self->SetClientObject(new wxPyOORClientData(_self));
+ if (!self->GetClientObject())
+ self->SetClientObject(new wxPyOORClientData(_self));
}
}
public:
%extend {
void _setOORInfo(PyObject* _self) {
- self->SetClientObject(new wxPyOORClientData(_self));
+ if (!self->GetClientObject())
+ self->SetClientObject(new wxPyOORClientData(_self));
}
}
%extend {
void _setOORInfo(PyObject* _self) {
- self->SetClientObject(new wxPyOORClientData(_self));
+ if (!self->GetClientObject())
+ self->SetClientObject(new wxPyOORClientData(_self));
}
}
%pythonAppend wxGridCellAttr "self._setOORInfo(self)"
wxGridCellAttr(wxGridCellAttr *attrDefault = NULL);
-
+
wxGridCellAttr *Clone() const;
void MergeWith(wxGridCellAttr *mergefrom);
void IncRef();
%extend {
void _setOORInfo(PyObject* _self) {
- self->SetClientObject(new wxPyOORClientData(_self));
+ if (!self->GetClientObject())
+ self->SetClientObject(new wxPyOORClientData(_self));
}
}
%extend {
void _setOORInfo(PyObject* _self) {
- self->SetClientObject(new wxPyOORClientData(_self));
+ if (!self->GetClientObject())
+ self->SetClientObject(new wxPyOORClientData(_self));
}
}