X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45bee2eea9184dd09bfd210427570a378d794916..3e7fb41b4bf5836a5571321619cfaaedf6844361:/include/wx/generic/grid.h?ds=inline diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 3133174a82..eb39abc469 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -93,8 +93,8 @@ class wxGridTableBase : public wxObject virtual wxString GetRowLabelValue( int row ); virtual wxString GetColLabelValue( int col ); - virtual void SetRowLabelValue( int row, const wxString& ) {} - virtual void SetColLabelValue( int col, const wxString& ) {} + virtual void SetRowLabelValue( int WXUNUSED(row), const wxString& ) {} + virtual void SetColLabelValue( int WXUNUSED(col), const wxString& ) {} DECLARE_ABSTRACT_CLASS( wxGridTableBase ); }; @@ -287,7 +287,7 @@ class wxGrid : public wxPanel { DECLARE_DYNAMIC_CLASS( wxGrid ) - private: + protected: bool m_created; wxGridTableBase *m_table; @@ -459,14 +459,21 @@ class wxGrid : public wxPanel void DrawGridLines( wxDC& dc ); void DrawCells( wxDC& dc ); void DrawCellBackground( wxDC& dc, const wxRect&, int row, int col ); - void DrawCellValue( wxDC& dc, const wxRect&, int row, int col ); - - // this one is useful when you just need to draw one or a few + void DrawCellValue( wxDC& dc, const wxRect&, int row, int col, + const wxString& value = wxEmptyString, bool useValueArg = FALSE ); + + // this updates the displayed cell text value but not the underlying + // table cell value (it is used to echo text being entered into + // the top edit control when in-place editing is turned off) + // + void DrawCellValue( const wxGridCellCoords& coords, const wxString& value ); + + // these are useful when you just need to draw one or a few // cells void DrawCell( int row, int col ); void DrawCell( const wxGridCellCoords& coords ) { DrawCell( coords.GetRow(), coords.GetCol() ); } - + void DrawCellHighlight( wxDC& dc, int row, int col ); void DrawCellHighlight( wxDC& dc, wxGridCellCoords& coords ) { DrawCellHighlight( dc, coords.GetRow(), coords.GetCol() ); } @@ -621,7 +628,7 @@ class wxGrid : public wxPanel void SetDefaultCellAlignment( int horiz, int vert ); void SetCellAlignment( int row, int col, int horiz, int vert ); - + // ------ cell value accessors // wxString GetCellValue( int row, int col ) @@ -796,7 +803,7 @@ class wxGrid : public wxPanel SetRowLabelAlignment( align, -1 ); } - int GetLabelAlignment( int orientation, int align ) + int GetLabelAlignment( int orientation, int WXUNUSED(align) ) { int h, v; if ( orientation == wxHORIZONTAL ) @@ -830,7 +837,7 @@ class wxGrid : public wxPanel wxFont GetCellTextFont() const { return m_defaultCellFont; } - wxFont GetCellTextFont(int row, int col) const + wxFont GetCellTextFont(int WXUNUSED(row), int WXUNUSED(col)) const { return m_defaultCellFont; } void SetCellTextFont(const wxFont& fnt) @@ -856,6 +863,14 @@ class wxGrid : public wxPanel bool GetEditInPlace() { return IsCellEditControlEnabled(); } void SetEditInPlace(bool edit = TRUE) { EnableCellEditControl( edit ); } + void SetCellAlignment( int align, int row, int col) + { SetCellAlignment(row, col, align, wxCENTER); } + void SetCellAlignment( int WXUNUSED(align) ) {} + void SetCellBitmap(wxBitmap *WXUNUSED(bitmap), int WXUNUSED(row), int WXUNUSED(col)) + { } + void SetDividerPen(const wxPen& WXUNUSED(pen)) { } + wxPen& GetDividerPen() const { return wxNullPen; } + void OnActivate(bool WXUNUSED(active)) {} // ******** End of compatibility functions ********** @@ -888,7 +903,7 @@ class WXDLLEXPORT wxGridEvent : public wxNotifyEvent { DECLARE_DYNAMIC_CLASS(wxGridEvent) - private: + protected: int m_row; int m_col; int m_x; @@ -923,7 +938,7 @@ class WXDLLEXPORT wxGridSizeEvent : public wxNotifyEvent { DECLARE_DYNAMIC_CLASS(wxGridSizeEvent) - private: + protected: int m_rowOrCol; int m_x; int m_y; @@ -956,7 +971,7 @@ class WXDLLEXPORT wxGridRangeSelectEvent : public wxNotifyEvent { DECLARE_DYNAMIC_CLASS(wxGridRangeSelectEvent) - private: + protected: wxGridCellCoords m_topLeft; wxGridCellCoords m_bottomRight; bool m_control; @@ -1007,6 +1022,8 @@ const wxEventType EVT_GRID_ROW_SIZE = wxEVT_FIRST + 1588; const wxEventType EVT_GRID_COL_SIZE = wxEVT_FIRST + 1589; const wxEventType EVT_GRID_RANGE_SELECT = wxEVT_FIRST + 1590; const wxEventType EVT_GRID_CELL_CHANGE = wxEVT_FIRST + 1591; +const wxEventType EVT_GRID_SELECT_CELL = wxEVT_FIRST + 1592; + typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&); typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&); @@ -1024,16 +1041,15 @@ typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEv #define EVT_GRID_COL_SIZE(fn) { EVT_GRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL }, #define EVT_GRID_RANGE_SELECT(fn) { EVT_GRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridRangeSelectEventFunction) &fn, NULL }, #define EVT_GRID_CELL_CHANGE(fn) { EVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, +#define EVT_GRID_SELECT_CELL(fn) { EVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, #if 0 // TODO: implement these ? others ? -const wxEventType EVT_GRID_SELECT_CELL = wxEVT_FIRST + 1575; const wxEventType EVT_GRID_CREATE_CELL = wxEVT_FIRST + 1576; const wxEventType EVT_GRID_CHANGE_LABELS = wxEVT_FIRST + 1577; const wxEventType EVT_GRID_CHANGE_SEL_LABEL = wxEVT_FIRST + 1578; -#define EVT_GRID_SELECT_CELL(fn) { EVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, #define EVT_GRID_CREATE_CELL(fn) { EVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, #define EVT_GRID_CHANGE_LABELS(fn) { EVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL }, #define EVT_GRID_CHANGE_SEL_LABEL(fn) { EVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },