its string form and possibly saved internally using its real type by
BeginEdit()). If it isn't, it just returns @false, otherwise it must do
the following:
- # Save the new value internally so that ApplyEdit() could apply it.
- # Fill @a newval (which is never @NULL) with the string
+ - Save the new value internally so that ApplyEdit() could apply it.
+ - Fill @a newval (which is never @NULL) with the string
representation of the new value.
- # Return @true
+ - Return @true
Notice that it must @em not modify the grid as the change could still
be vetoed.
{
public:
/**
- Default constructor.
+ Text cell editor constructor.
+
+ @param maxChars
+ Maximum width of text (this parameter is supported starting since
+ wxWidgets 2.9.5).
*/
- wxGridCellTextEditor();
+ explicit wxGridCellTextEditor(size_t maxChars = 0);
/**
The parameters string format is "n" where n is a number representing
the maximum width.
*/
virtual void SetParameters(const wxString& params);
+
+ /**
+ Set validator to validate user input.
+
+ @since 2.9.5
+ */
+ virtual void SetValidator(const wxValidator& validator);
};
/**
wxDC& dc,
wxRect& rect) const = 0;
};
+
/**
Common base class for row and column headers renderers.
virtual bool CanHaveAttributes();
};
+
+
+enum wxGridTableRequest
+{
+ wxGRIDTABLE_REQUEST_VIEW_GET_VALUES = 2000,
+ wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES,
+ wxGRIDTABLE_NOTIFY_ROWS_INSERTED,
+ wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
+ wxGRIDTABLE_NOTIFY_ROWS_DELETED,
+ wxGRIDTABLE_NOTIFY_COLS_INSERTED,
+ wxGRIDTABLE_NOTIFY_COLS_APPENDED,
+ wxGRIDTABLE_NOTIFY_COLS_DELETED
+};
+
+
+/**
+ @class wxGridTableMessage
+
+ A simple class used to pass messages from the table to the grid.
+
+ @library{wxadv}
+ @category{grid}
+*/
+class wxGridTableMessage
+{
+public:
+ wxGridTableMessage();
+ wxGridTableMessage( wxGridTableBase *table, int id,
+ int comInt1 = -1,
+ int comInt2 = -1 );
+
+ void SetTableObject( wxGridTableBase *table );
+ wxGridTableBase * GetTableObject() const;
+ void SetId( int id );
+ int GetId();
+ void SetCommandInt( int comInt1 );
+ int GetCommandInt();
+ void SetCommandInt2( int comInt2 );
+ int GetCommandInt2();
+};
+
+
+
+/**
+ @class wxGridStringTable
+
+ Simplest type of data table for a grid for small tables of strings
+ that are stored in memory
+*/
+class wxGridStringTable : public wxGridTableBase
+{
+public:
+ wxGridStringTable();
+ wxGridStringTable( int numRows, int numCols );
+
+ // these are pure virtual in wxGridTableBase
+ virtual int GetNumberRows();
+ virtual int GetNumberCols();
+ virtual wxString GetValue( int row, int col );
+ virtual void SetValue( int row, int col, const wxString& value );
+
+ // overridden functions from wxGridTableBase
+ void Clear();
+ bool InsertRows( size_t pos = 0, size_t numRows = 1 );
+ bool AppendRows( size_t numRows = 1 );
+ bool DeleteRows( size_t pos = 0, size_t numRows = 1 );
+ bool InsertCols( size_t pos = 0, size_t numCols = 1 );
+ bool AppendCols( size_t numCols = 1 );
+ bool DeleteCols( size_t pos = 0, size_t numCols = 1 );
+
+ void SetRowLabelValue( int row, const wxString& );
+ void SetColLabelValue( int col, const wxString& );
+ wxString GetRowLabelValue( int row );
+ wxString GetColLabelValue( int col );
+};
+
+
+
+
+
+
/**
@class wxGridSizesInfo
bool SetTable(wxGridTableBase* table, bool takeOwnership = false,
wxGridSelectionModes selmode = wxGridSelectCells);
+ /**
+ Receive and handle a message from the table.
+ */
+ bool ProcessTableMessage(wxGridTableMessage& msg);
+
//@}
To show the column later you need to call SetColSize() with non-0
width or ShowCol() to restore the previous column width.
- Notice that this method shouldn't be called if the column is already
- hidden.
+ If the column is already hidden, this method doesn't do anything.
@param col
The column index.
The column is shown again with the same width that it had before
HideCol() call.
- Notice that this method shouldn't be called if the column is not
- currently hidden.
+ If the column is currently shown, this method doesn't do anything.
@see HideCol(), SetColSize()
*/
To show the row later you need to call SetRowSize() with non-0
width or ShowRow() to restore its original height.
+ If the row is already hidden, this method doesn't do anything.
+
@param col
The row index.
*/
The row is shown again with the same height that it had before
HideRow() call.
+ If the row is currently shown, this method doesn't do anything.
+
@see HideRow(), SetRowSize()
*/
void ShowRow(int col);
type.
@event{EVT_GRID_COL_SIZE(func)}
Same as EVT_GRID_CMD_COL_SIZE() but uses `wxID_ANY` id.
+ @event{EVT_GRID_COL_AUTO_SIZE(func)}
+ This event is sent when a column must be resized to its best size, e.g.
+ when the user double clicks the column divider. The default
+ implementation simply resizes the column to fit the column label (but
+ not its contents as this could be too slow for big grids). This macro
+ corresponds to @c wxEVT_GRID_COL_AUTO_SIZE event type and is new since
+ wxWidgets 2.9.5.
@event{EVT_GRID_ROW_SIZE(func)}
Same as EVT_GRID_CMD_ROW_SIZE() but uses `wxID_ANY` id.
@endEventTable
void SetRow(int row);
};
+
+wxEventType wxEVT_GRID_CELL_LEFT_CLICK;
+wxEventType wxEVT_GRID_CELL_RIGHT_CLICK;
+wxEventType wxEVT_GRID_CELL_LEFT_DCLICK;
+wxEventType wxEVT_GRID_CELL_RIGHT_DCLICK;
+wxEventType wxEVT_GRID_LABEL_LEFT_CLICK;
+wxEventType wxEVT_GRID_LABEL_RIGHT_CLICK;
+wxEventType wxEVT_GRID_LABEL_LEFT_DCLICK;
+wxEventType wxEVT_GRID_LABEL_RIGHT_DCLICK;
+wxEventType wxEVT_GRID_ROW_SIZE;
+wxEventType wxEVT_GRID_COL_SIZE;
+wxEventType wxEVT_GRID_COL_AUTO_SIZE;
+wxEventType wxEVT_GRID_RANGE_SELECT;
+wxEventType wxEVT_GRID_CELL_CHANGING;
+wxEventType wxEVT_GRID_CELL_CHANGED;
+wxEventType wxEVT_GRID_SELECT_CELL;
+wxEventType wxEVT_GRID_EDITOR_SHOWN;
+wxEventType wxEVT_GRID_EDITOR_HIDDEN;
+wxEventType wxEVT_GRID_EDITOR_CREATED;
+wxEventType wxEVT_GRID_CELL_BEGIN_DRAG;
+wxEventType wxEVT_GRID_COL_MOVE;
+wxEventType wxEVT_GRID_COL_SORT;
+wxEventType wxEVT_GRID_TABBING;
+