//---------------------------------------------------------------------------
// OOR related typemaps and helper functions
//---------------------------------------------------------------------------
// OOR related typemaps and helper functions
- wxGridCellDateTimeRenderer(wxString outformat = wxPyDateTimeFormatStr,
- wxString informat = wxPyDateTimeFormatStr);
+ wxGridCellDateTimeRenderer(wxString outformat = wxPyDefaultDateTimeFormat,
+ wxString informat = wxPyDefaultDateTimeFormat);
bool blocked = wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
PyObject* go = wxPyMake_wxObject(grid,false);
bool blocked = wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
PyObject* go = wxPyMake_wxObject(grid,false);
%pythonAppend wxGridCellChoiceEditor "self._setOORInfo(self)"
wxGridCellChoiceEditor(int choices = 0,
const wxString* choices_array = NULL,
%pythonAppend wxGridCellChoiceEditor "self._setOORInfo(self)"
wxGridCellChoiceEditor(int choices = 0,
const wxString* choices_array = NULL,
void SetFont(const wxFont& font);
void SetAlignment(int hAlign, int vAlign);
void SetSize(int num_rows, int num_cols);
void SetFont(const wxFont& font);
void SetAlignment(int hAlign, int vAlign);
void SetSize(int num_rows, int num_cols);
}
// otherwise a 2-tuple of integers is expected
else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
}
// otherwise a 2-tuple of integers is expected
else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
if (wxPySwigInstance_Check(source) &&
wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
if (wxPySwigInstance_Check(source) &&
wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
%typemap(out) wxGrid*; // turn off this typemap
wxGrid( wxWindow *parent,
%typemap(out) wxGrid*; // turn off this typemap
wxGrid( wxWindow *parent,
long style = wxWANTS_CHARS,
const wxString& name = wxPyPanelNameStr);
long style = wxWANTS_CHARS,
const wxString& name = wxPyPanelNameStr);
- bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=True );
- bool AppendRows( int numRows = 1, bool updateLabels=True );
- bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=True );
- bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=True );
- bool AppendCols( int numCols = 1, bool updateLabels=True );
- bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=True );
+ bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=true );
+ bool AppendRows( int numRows = 1, bool updateLabels=true );
+ bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=true );
+ bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=true );
+ bool AppendCols( int numCols = 1, bool updateLabels=true );
+ bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=true );
void DisableCellEditControl();
bool CanEnableCellControl() const;
bool IsCellEditControlEnabled() const;
void DisableCellEditControl();
bool CanEnableCellControl() const;
bool IsCellEditControlEnabled() const;
// check to see if a cell is either wholly visible (the default arg) or
// at least partially visible in the grid window
//
// check to see if a cell is either wholly visible (the default arg) or
// at least partially visible in the grid window
//
- bool IsVisible( int row, int col, bool wholeCellVisible = True );
- // TODO: ??? bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = True );
+ bool IsVisible( int row, int col, bool wholeCellVisible = true );
+ // TODO: ??? bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = true );
void MakeCellVisible( int row, int col );
// TODO: ??? void MakeCellVisible( const wxGridCellCoords& coords );
void MakeCellVisible( int row, int col );
// TODO: ??? void MakeCellVisible( const wxGridCellCoords& coords );
// this sets the specified attribute for all cells in this row/col
void SetAttr(int row, int col, wxGridCellAttr *attr);
void SetRowAttr(int row, wxGridCellAttr *attr);
void SetColAttr(int col, wxGridCellAttr *attr);
// this sets the specified attribute for all cells in this row/col
void SetAttr(int row, int col, wxGridCellAttr *attr);
void SetRowAttr(int row, wxGridCellAttr *attr);
void SetColAttr(int col, wxGridCellAttr *attr);
+ // returns the attribute we may modify in place: a new one if this cell
+ // doesn't have any yet or the existing one if it does
+ //
+ // DecRef() must be called on the returned pointer, as usual
+ wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+
+
// shortcuts for setting the column parameters
// set the format for the data in the column: default is string
// shortcuts for setting the column parameters
// set the format for the data in the column: default is string
void SetColFormatFloat(int col, int width = -1, int precision = -1);
void SetColFormatCustom(int col, const wxString& typeName);
void SetColFormatFloat(int col, int width = -1, int precision = -1);
void SetColFormatCustom(int col, const wxString& typeName);
void, GetCellSize( int row, int col, int *OUTPUT, int *OUTPUT ),
"GetCellSize(int row, int col) -> (num_rows, num_cols)");
void, GetCellSize( int row, int col, int *OUTPUT, int *OUTPUT ),
"GetCellSize(int row, int col) -> (num_rows, num_cols)");
void SetColSize( int col, int width );
// automatically size the column or row to fit to its contents, if
// setAsMin is True, this optimal width will also be set as minimal width
// for this column
void SetColSize( int col, int width );
// automatically size the column or row to fit to its contents, if
// setAsMin is True, this optimal width will also be set as minimal width
// for this column
- void AutoSizeColumn( int col, bool setAsMin = True );
- void AutoSizeRow( int row, bool setAsMin = True );
+ void AutoSizeColumn( int col, bool setAsMin = true );
+ void AutoSizeRow( int row, bool setAsMin = true );
// auto size the grid, that is make the columns/rows of the "right" size
// and also set the grid size to just fit its contents
// auto size the grid, that is make the columns/rows of the "right" size
// and also set the grid size to just fit its contents
bool IsReadOnly(int row, int col) const;
// make the cell editable/readonly
bool IsReadOnly(int row, int col) const;
// make the cell editable/readonly
- void SelectRow( int row, bool addToSelected = False );
- void SelectCol( int col, bool addToSelected = False );
+ void SelectRow( int row, bool addToSelected = false );
+ void SelectCol( int col, bool addToSelected = false );
void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
// TODO: ??? void SelectBlock( const wxGridCellCoords& topLeft,
// TODO: ??? const wxGridCellCoords& bottomRight )
// TODO: ??? void SelectBlock( const wxGridCellCoords& topLeft,
// TODO: ??? const wxGridCellCoords& bottomRight )
+ // Allow adjustment of scroll increment. The default is (15, 15).
+ void SetScrollLineX(int x);
+ void SetScrollLineY(int y);
+ int GetScrollLineX() const;
+ int GetScrollLineY() const;
+
+ int GetScrollX(int x) const;
+ int GetScrollY(int y) const;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
{
public:
wxGridEvent(int id, wxEventType type, wxGrid* obj,
{
public:
wxGridEvent(int id, wxEventType type, wxGrid* obj,
- int row=-1, int col=-1, int x=-1, int y=-1, bool sel = True,
- bool control=False, bool shift=False, bool alt=False, bool meta=False);
+ int row=-1, int col=-1, int x=-1, int y=-1, bool sel = true,
+ bool control=false, bool shift=false, bool alt=false, bool meta=false);
public:
wxGridSizeEvent(int id, wxEventType type, wxGrid* obj,
int rowOrCol=-1, int x=-1, int y=-1,
public:
wxGridSizeEvent(int id, wxEventType type, wxGrid* obj,
int rowOrCol=-1, int x=-1, int y=-1,
- bool control=False, bool shift=False, bool alt=False, bool meta=False);
+ bool control=false, bool shift=false, bool alt=false, bool meta=false);
wxGridRangeSelectEvent(int id, wxEventType type, wxGrid* obj,
const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
wxGridRangeSelectEvent(int id, wxEventType type, wxGrid* obj,
const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight,
- bool sel = True,
- bool control=False, bool shift=False,
- bool alt=False, bool meta=False);
+ bool sel = true,
+ bool control=false, bool shift=false,
+ bool alt=false, bool meta=false);
%constant wxEventType wxEVT_GRID_EDITOR_SHOWN;
%constant wxEventType wxEVT_GRID_EDITOR_HIDDEN;
%constant wxEventType wxEVT_GRID_EDITOR_CREATED;
%constant wxEventType wxEVT_GRID_EDITOR_SHOWN;
%constant wxEventType wxEVT_GRID_EDITOR_HIDDEN;
%constant wxEventType wxEVT_GRID_EDITOR_CREATED;
EVT_GRID_EDITOR_SHOWN = wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN )
EVT_GRID_EDITOR_HIDDEN = wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN )
EVT_GRID_EDITOR_CREATED = wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED )
EVT_GRID_EDITOR_SHOWN = wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN )
EVT_GRID_EDITOR_HIDDEN = wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN )
EVT_GRID_EDITOR_CREATED = wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED )
EVT_GRID_CMD_EDITOR_SHOWN = wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN, 1 )
EVT_GRID_CMD_EDITOR_HIDDEN = wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN, 1 )
EVT_GRID_CMD_EDITOR_CREATED = wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED, 1 )
EVT_GRID_CMD_EDITOR_SHOWN = wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN, 1 )
EVT_GRID_CMD_EDITOR_HIDDEN = wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN, 1 )
EVT_GRID_CMD_EDITOR_CREATED = wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED, 1 )