1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGrid and related classes
4 // Author: Michael Bedward (based on code by Julian Smart, Robin Dunn)
8 // Copyright: (c) Michael Bedward
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID)
23 #pragma interface "grid.h"
27 #include "wx/scrolwin.h"
28 #include "wx/string.h"
29 #include "wx/scrolbar.h"
31 #include "wx/textctrl.h"
32 #include "wx/combobox.h"
33 #include "wx/dynarray.h"
36 // Default parameters for wxGrid
38 #define WXGRID_DEFAULT_NUMBER_ROWS 10
39 #define WXGRID_DEFAULT_NUMBER_COLS 10
41 #define WXGRID_DEFAULT_ROW_HEIGHT 25
43 #define WXGRID_DEFAULT_ROW_HEIGHT 30
45 #define WXGRID_DEFAULT_COL_WIDTH 80
46 #define WXGRID_DEFAULT_COL_LABEL_HEIGHT 32
47 #define WXGRID_DEFAULT_ROW_LABEL_WIDTH 82
48 #define WXGRID_LABEL_EDGE_ZONE 5
49 #define WXGRID_MIN_ROW_HEIGHT 15
50 #define WXGRID_MIN_COL_WIDTH 15
51 #define WXGRID_DEFAULT_SCROLLBAR_WIDTH 16
53 // ----------------------------------------------------------------------------
54 // forward declarations
55 // ----------------------------------------------------------------------------
57 class WXDLLEXPORT wxGrid
;
58 class WXDLLEXPORT wxGridCellAttr
;
59 class WXDLLEXPORT wxGridCellAttrProviderData
;
60 class WXDLLEXPORT wxGridColLabelWindow
;
61 class WXDLLEXPORT wxGridCornerLabelWindow
;
62 class WXDLLEXPORT wxGridRowLabelWindow
;
63 class WXDLLEXPORT wxGridTableBase
;
64 class WXDLLEXPORT wxGridWindow
;
66 // ----------------------------------------------------------------------------
67 // wxGridCellRenderer: this class is responsible for actually drawing the cell
68 // in the grid. You may pass it to the wxGridCellAttr (below) to change the
69 // format of one given cell or to wxGrid::SetDefaultRenderer() to change the
70 // view of all cells. This is an ABC, you will normally use one of the
71 // predefined derived classes or derive oyur own class from it.
72 // ----------------------------------------------------------------------------
74 class WXDLLEXPORT wxGridCellRenderer
77 // draw the given cell on the provided DC inside the given rectangle
78 // using the style specified by the attribute and the default or selected
79 // state corresponding to the isSelected value.
81 // this pure virtual function has a default implementation which will
82 // prepare the DC using the given attribute: it will draw the rectangle
83 // with the bg colour from attr and set the text colour and font
84 virtual void Draw(wxGrid
& grid
,
92 // the default renderer for the cells containing string data
93 class WXDLLEXPORT wxGridCellStringRenderer
: public wxGridCellRenderer
97 virtual void Draw(wxGrid
& grid
,
106 // ----------------------------------------------------------------------------
107 // wxGridCellEditor: This class is responsible for providing and manipulating
108 // the in-place edit controls for the grid. Instances of wxGridCellEditor
109 // (actually, instances of derived classes since it is an ABC) can be
110 // associated with the cell attributes for individual cells, rows, columns, or
111 // even for the entire grid.
112 // ----------------------------------------------------------------------------
114 class WXDLLEXPORT wxGridCellEditor
118 virtual ~wxGridCellEditor();
120 bool IsCreated() { return m_control
!= NULL
; }
122 // Creates the actual edit control
123 virtual void Create(wxWindow
* parent
,
127 wxEvtHandler
* evtHandler
) = 0;
129 // Size and position the edit control
130 virtual void SetSize(const wxRect
& rect
);
132 // Show or hide the edit control
133 virtual void Show(bool show
);
135 // Fetch the value from the table and prepare the edit control
136 // to begin editing. Set the focus to the edit control.
137 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
,
138 wxGridCellAttr
* attr
) = 0;
140 // Complete the editing of the current cell. If saveValue is
141 // true then send the new value back to the table. Returns true
142 // if the value has changed. If necessary, the control may be
144 virtual bool EndEdit(int row
, int col
, bool saveValue
,
145 wxGrid
* grid
, wxGridCellAttr
* attr
) = 0;
147 // Reset the value in the control back to its starting value
148 virtual void Reset() = 0;
150 // Some types of controls on some platforms may need some help
151 // with the Return key.
152 virtual void HandleReturn(wxKeyEvent
& event
);
155 virtual void Destroy();
158 wxControl
* m_control
;
162 class WXDLLEXPORT wxGridCellTextEditor
: public wxGridCellEditor
165 wxGridCellTextEditor();
167 virtual void Create(wxWindow
* parent
,
171 wxEvtHandler
* evtHandler
);
173 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
,
174 wxGridCellAttr
* attr
);
176 virtual bool EndEdit(int row
, int col
, bool saveValue
,
177 wxGrid
* grid
, wxGridCellAttr
* attr
);
179 virtual void Reset();
180 virtual void HandleReturn(wxKeyEvent
& event
);
184 wxString m_startValue
;
187 // ----------------------------------------------------------------------------
188 // wxGridCellAttr: this class can be used to alter the cells appearance in
189 // the grid by changing their colour/font/... from default. An object of this
190 // class may be returned by wxGridTable::GetAttr().
191 // ----------------------------------------------------------------------------
193 class WXDLLEXPORT wxGridCellAttr
203 wxGridCellAttr(const wxColour
& colText
,
204 const wxColour
& colBack
,
208 : m_colText(colText
), m_colBack(colBack
), m_font(font
)
211 SetAlignment(hAlign
, vAlign
);
214 // default copy ctor ok
216 // this class is ref counted: it is created with ref count of 1, so
217 // calling DecRef() once will delete it. Calling IncRef() allows to lock
218 // it until the matching DecRef() is called
219 void IncRef() { m_nRef
++; }
220 void DecRef() { if ( !--m_nRef
) delete this; }
221 void SafeIncRef() { if ( this ) IncRef(); }
222 void SafeDecRef() { if ( this ) DecRef(); }
225 void SetTextColour(const wxColour
& colText
) { m_colText
= colText
; }
226 void SetBackgroundColour(const wxColour
& colBack
) { m_colBack
= colBack
; }
227 void SetFont(const wxFont
& font
) { m_font
= font
; }
228 void SetAlignment(int hAlign
, int vAlign
)
234 // takes ownership of the pointer
235 void SetRenderer(wxGridCellRenderer
*renderer
)
236 { delete m_renderer
; m_renderer
= renderer
; }
237 void SetEditor(wxGridCellEditor
* editor
)
238 { delete m_editor
; m_editor
= editor
; }
241 bool HasTextColour() const { return m_colText
.Ok(); }
242 bool HasBackgroundColour() const { return m_colBack
.Ok(); }
243 bool HasFont() const { return m_font
.Ok(); }
244 bool HasAlignment() const { return m_hAlign
|| m_vAlign
; }
245 bool HasRenderer() const { return m_renderer
!= NULL
; }
246 bool HasEditor() const { return m_editor
!= NULL
; }
248 const wxColour
& GetTextColour() const;
249 const wxColour
& GetBackgroundColour() const;
250 const wxFont
& GetFont() const;
251 void GetAlignment(int *hAlign
, int *vAlign
) const;
252 wxGridCellRenderer
*GetRenderer() const;
253 wxGridCellEditor
*GetEditor() const;
255 void SetDefAttr(wxGridCellAttr
* defAttr
) { m_defGridAttr
= defAttr
; }
258 // the common part of all ctors
265 // the dtor is private because only DecRef() can delete us
266 ~wxGridCellAttr() { delete m_renderer
; delete m_editor
; }
268 // the ref count - when it goes to 0, we die
277 wxGridCellRenderer
* m_renderer
;
278 wxGridCellEditor
* m_editor
;
279 wxGridCellAttr
* m_defGridAttr
;
281 // suppress the stupid gcc warning about the class having private dtor and
283 friend class wxGridCellAttrDummyFriend
;
286 // ----------------------------------------------------------------------------
287 // wxGridCellAttrProvider: class used by wxGridTableBase to retrieve/store the
289 // ----------------------------------------------------------------------------
291 // implementation note: we separate it from wxGridTableBase because we wish to
292 // avoid deriving a new table class if possible, and sometimes it will be
293 // enough to just derive another wxGridCellAttrProvider instead
295 // the default implementation is reasonably efficient for the generic case,
296 // but you might still wish to implement your own for some specific situations
297 // if you have performance problems with the stock one
298 class WXDLLEXPORT wxGridCellAttrProvider
301 wxGridCellAttrProvider();
302 virtual ~wxGridCellAttrProvider();
304 // DecRef() must be called on the returned pointer
305 virtual wxGridCellAttr
*GetAttr(int row
, int col
) const;
307 // all these functions take ownership of the pointer, don't call DecRef()
309 virtual void SetAttr(wxGridCellAttr
*attr
, int row
, int col
);
310 virtual void SetRowAttr(wxGridCellAttr
*attr
, int row
);
311 virtual void SetColAttr(wxGridCellAttr
*attr
, int col
);
316 wxGridCellAttrProviderData
*m_data
;
319 //////////////////////////////////////////////////////////////////////
321 // Grid table classes
323 //////////////////////////////////////////////////////////////////////
326 class WXDLLEXPORT wxGridTableBase
: public wxObject
330 virtual ~wxGridTableBase();
332 // You must override these functions in a derived table class
334 virtual long GetNumberRows() = 0;
335 virtual long GetNumberCols() = 0;
336 virtual wxString
GetValue( int row
, int col
) = 0;
337 virtual void SetValue( int row
, int col
, const wxString
& s
) = 0;
338 virtual bool IsEmptyCell( int row
, int col
) = 0;
340 // Overriding these is optional
342 virtual void SetView( wxGrid
*grid
) { m_view
= grid
; }
343 virtual wxGrid
* GetView() const { return m_view
; }
345 virtual void Clear() {}
346 virtual bool InsertRows( size_t pos
= 0, size_t numRows
= 1 );
347 virtual bool AppendRows( size_t numRows
= 1 );
348 virtual bool DeleteRows( size_t pos
= 0, size_t numRows
= 1 );
349 virtual bool InsertCols( size_t pos
= 0, size_t numCols
= 1 );
350 virtual bool AppendCols( size_t numCols
= 1 );
351 virtual bool DeleteCols( size_t pos
= 0, size_t numCols
= 1 );
353 virtual wxString
GetRowLabelValue( int row
);
354 virtual wxString
GetColLabelValue( int col
);
355 virtual void SetRowLabelValue( int WXUNUSED(row
), const wxString
& ) {}
356 virtual void SetColLabelValue( int WXUNUSED(col
), const wxString
& ) {}
358 // Attribute handling
361 // give us the attr provider to use - we take ownership of the pointer
362 void SetAttrProvider(wxGridCellAttrProvider
*attrProvider
);
364 // get the currently used attr provider (may be NULL)
365 wxGridCellAttrProvider
*GetAttrProvider() const { return m_attrProvider
; }
367 // by default forwarded to wxGridCellAttrProvider if any. May be
368 // overridden to handle attributes directly in this class.
369 virtual wxGridCellAttr
*GetAttr( int row
, int col
);
371 // these functions take ownership of the pointer
372 virtual void SetAttr(wxGridCellAttr
* attr
, int row
, int col
);
373 virtual void SetRowAttr(wxGridCellAttr
*attr
, int row
);
374 virtual void SetColAttr(wxGridCellAttr
*attr
, int col
);
378 wxGridCellAttrProvider
*m_attrProvider
;
380 DECLARE_ABSTRACT_CLASS( wxGridTableBase
);
384 // ----------------------------------------------------------------------------
385 // wxGridTableMessage
386 // ----------------------------------------------------------------------------
388 // IDs for messages sent from grid table to view
390 enum wxGridTableRequest
392 wxGRIDTABLE_REQUEST_VIEW_GET_VALUES
= 2000,
393 wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES
,
394 wxGRIDTABLE_NOTIFY_ROWS_INSERTED
,
395 wxGRIDTABLE_NOTIFY_ROWS_APPENDED
,
396 wxGRIDTABLE_NOTIFY_ROWS_DELETED
,
397 wxGRIDTABLE_NOTIFY_COLS_INSERTED
,
398 wxGRIDTABLE_NOTIFY_COLS_APPENDED
,
399 wxGRIDTABLE_NOTIFY_COLS_DELETED
402 class WXDLLEXPORT wxGridTableMessage
405 wxGridTableMessage();
406 wxGridTableMessage( wxGridTableBase
*table
, int id
,
410 void SetTableObject( wxGridTableBase
*table
) { m_table
= table
; }
411 wxGridTableBase
* GetTableObject() const { return m_table
; }
412 void SetId( int id
) { m_id
= id
; }
413 int GetId() { return m_id
; }
414 void SetCommandInt( int comInt1
) { m_comInt1
= comInt1
; }
415 int GetCommandInt() { return m_comInt1
; }
416 void SetCommandInt2( int comInt2
) { m_comInt2
= comInt2
; }
417 int GetCommandInt2() { return m_comInt2
; }
420 wxGridTableBase
*m_table
;
428 // ------ wxGridStringArray
429 // A 2-dimensional array of strings for data values
432 WX_DECLARE_EXPORTED_OBJARRAY(wxArrayString
, wxGridStringArray
);
436 // ------ wxGridStringTable
438 // Simplest type of data table for a grid for small tables of strings
439 // that are stored in memory
442 class WXDLLEXPORT wxGridStringTable
: public wxGridTableBase
446 wxGridStringTable( int numRows
, int numCols
);
447 ~wxGridStringTable();
449 // these are pure virtual in wxGridTableBase
451 long GetNumberRows();
452 long GetNumberCols();
453 wxString
GetValue( int row
, int col
);
454 void SetValue( int row
, int col
, const wxString
& s
);
455 bool IsEmptyCell( int row
, int col
);
457 // overridden functions from wxGridTableBase
460 bool InsertRows( size_t pos
= 0, size_t numRows
= 1 );
461 bool AppendRows( size_t numRows
= 1 );
462 bool DeleteRows( size_t pos
= 0, size_t numRows
= 1 );
463 bool InsertCols( size_t pos
= 0, size_t numCols
= 1 );
464 bool AppendCols( size_t numCols
= 1 );
465 bool DeleteCols( size_t pos
= 0, size_t numCols
= 1 );
467 void SetRowLabelValue( int row
, const wxString
& );
468 void SetColLabelValue( int col
, const wxString
& );
469 wxString
GetRowLabelValue( int row
);
470 wxString
GetColLabelValue( int col
);
473 wxGridStringArray m_data
;
475 // These only get used if you set your own labels, otherwise the
476 // GetRow/ColLabelValue functions return wxGridTableBase defaults
478 wxArrayString m_rowLabels
;
479 wxArrayString m_colLabels
;
481 DECLARE_DYNAMIC_CLASS( wxGridStringTable
)
486 //////////////////////////////////////////////////////////////////////
490 //////////////////////////////////////////////////////////////////////
492 class WXDLLEXPORT wxGridCellCoords
495 wxGridCellCoords() { m_row
= m_col
= -1; }
496 wxGridCellCoords( int r
, int c
) { m_row
= r
; m_col
= c
; }
498 // default copy ctor is ok
500 long GetRow() const { return m_row
; }
501 void SetRow( long n
) { m_row
= n
; }
502 long GetCol() const { return m_col
; }
503 void SetCol( long n
) { m_col
= n
; }
504 void Set( long row
, long col
) { m_row
= row
; m_col
= col
; }
506 wxGridCellCoords
& operator=( const wxGridCellCoords
& other
)
508 if ( &other
!= this )
516 bool operator==( const wxGridCellCoords
& other
)
518 return (m_row
== other
.m_row
&& m_col
== other
.m_col
);
521 bool operator!=( const wxGridCellCoords
& other
)
523 return (m_row
!= other
.m_row
|| m_col
!= other
.m_col
);
528 return (m_row
== -1 && m_col
== -1 );
537 // For comparisons...
539 extern wxGridCellCoords wxGridNoCellCoords
;
540 extern wxRect wxGridNoCellRect
;
542 // An array of cell coords...
544 WX_DECLARE_EXPORTED_OBJARRAY(wxGridCellCoords
, wxGridCellCoordsArray
);
548 // This set of classes is to provide for the use of different types of
549 // cell edit controls in the grid while avoiding the wx class info
550 // system in deference to wxPython
552 class WXDLLEXPORT wxGridTextCtrl
: public wxTextCtrl
556 wxGridTextCtrl( wxWindow
*,
560 const wxString
& value
= wxEmptyString
,
561 const wxPoint
& pos
= wxDefaultPosition
,
562 const wxSize
& size
= wxDefaultSize
,
565 void SetStartValue( const wxString
& );
566 wxString
GetStartValue() { return startValue
; }
571 // TRUE for controls placed over cells,
572 // FALSE for a control on a grid control panel
573 bool m_isCellControl
;
577 void OnKeyDown( wxKeyEvent
& );
579 DECLARE_DYNAMIC_CLASS( wxGridTextCtrl
)
580 DECLARE_EVENT_TABLE()
584 // ----------------------------------------------------------------------------
586 // ----------------------------------------------------------------------------
588 class WXDLLEXPORT wxGrid
: public wxScrolledWindow
593 m_table
= (wxGridTableBase
*) NULL
;
594 m_gridWin
= (wxGridWindow
*) NULL
;
595 m_rowLabelWin
= (wxGridRowLabelWindow
*) NULL
;
596 m_colLabelWin
= (wxGridColLabelWindow
*) NULL
;
597 m_cornerLabelWin
= (wxGridCornerLabelWindow
*) NULL
;
598 m_cellEditCtrl
= (wxWindow
*) NULL
;
601 wxGrid( wxWindow
*parent
,
603 const wxPoint
& pos
= wxDefaultPosition
,
604 const wxSize
& size
= wxDefaultSize
,
606 const wxString
& name
= wxPanelNameStr
);
610 bool CreateGrid( int numRows
, int numCols
);
613 // ------ grid dimensions
615 int GetNumberRows() { return m_numRows
; }
616 int GetNumberCols() { return m_numCols
; }
619 // ------ display update functions
621 void CalcRowLabelsExposed( wxRegion
& reg
);
623 void CalcColLabelsExposed( wxRegion
& reg
);
624 void CalcCellsExposed( wxRegion
& reg
);
627 // ------ event handlers
629 void ProcessRowLabelMouseEvent( wxMouseEvent
& event
);
630 void ProcessColLabelMouseEvent( wxMouseEvent
& event
);
631 void ProcessCornerLabelMouseEvent( wxMouseEvent
& event
);
632 void ProcessGridCellMouseEvent( wxMouseEvent
& event
);
633 bool ProcessTableMessage( wxGridTableMessage
& );
635 void DoEndDragResizeRow();
636 void DoEndDragResizeCol();
638 wxGridTableBase
* GetTable() const { return m_table
; }
639 bool SetTable( wxGridTableBase
*table
, bool takeOwnership
=FALSE
);
642 bool InsertRows( int pos
= 0, int numRows
= 1, bool updateLabels
=TRUE
);
643 bool AppendRows( int numRows
= 1, bool updateLabels
=TRUE
);
644 bool DeleteRows( int pos
= 0, int numRows
= 1, bool updateLabels
=TRUE
);
645 bool InsertCols( int pos
= 0, int numCols
= 1, bool updateLabels
=TRUE
);
646 bool AppendCols( int numCols
= 1, bool updateLabels
=TRUE
);
647 bool DeleteCols( int pos
= 0, int numCols
= 1, bool updateLabels
=TRUE
);
649 void DrawGridCellArea( wxDC
& dc
);
650 void DrawCellBorder( wxDC
& dc
, const wxGridCellCoords
& );
651 void DrawAllGridLines( wxDC
& dc
, const wxRegion
& reg
);
652 void DrawCell( wxDC
& dc
, const wxGridCellCoords
& );
653 void DrawCellHighlight( wxDC
& dc
);
655 void DrawRowLabels( wxDC
& dc
);
656 void DrawRowLabel( wxDC
& dc
, int row
);
658 void DrawColLabels( wxDC
& dc
);
659 void DrawColLabel( wxDC
& dc
, int col
);
662 // ------ Cell text drawing functions
664 void DrawTextRectangle( wxDC
& dc
, const wxString
&, const wxRect
&,
665 int horizontalAlignment
= wxLEFT
,
666 int verticalAlignment
= wxTOP
);
668 // Split a string containing newline chararcters into an array of
669 // strings and return the number of lines
671 void StringToLines( const wxString
& value
, wxArrayString
& lines
);
673 void GetTextBoxSize( wxDC
& dc
,
674 wxArrayString
& lines
,
675 long *width
, long *height
);
679 // Code that does a lot of grid modification can be enclosed
680 // between BeginBatch() and EndBatch() calls to avoid screen
683 void BeginBatch() { m_batchCount
++; }
684 void EndBatch() { if ( m_batchCount
> 0 ) m_batchCount
--; }
685 int GetBatchCount() { return m_batchCount
; }
688 // ------ edit control functions
690 bool IsEditable() { return m_editable
; }
691 void EnableEditing( bool edit
);
693 void EnableCellEditControl( bool enable
);
695 bool IsCellEditControlEnabled()
696 { return (m_cellEditCtrl
&& m_cellEditCtrlEnabled
); }
698 void ShowCellEditControl();
699 void HideCellEditControl();
700 void SetEditControlValue( const wxString
& s
= wxEmptyString
);
701 void SaveEditControlValue();
704 // ------ grid location functions
705 // Note that all of these functions work with the logical coordinates of
706 // grid cells and labels so you will need to convert from device
707 // coordinates for mouse events etc.
709 void XYToCell( int x
, int y
, wxGridCellCoords
& );
713 int YToEdgeOfRow( int y
);
714 int XToEdgeOfCol( int x
);
716 wxRect
CellToRect( int row
, int col
);
717 wxRect
CellToRect( const wxGridCellCoords
& coords
)
718 { return CellToRect( coords
.GetRow(), coords
.GetCol() ); }
720 int GetGridCursorRow() { return m_currentCellCoords
.GetRow(); }
721 int GetGridCursorCol() { return m_currentCellCoords
.GetCol(); }
723 // check to see if a cell is either wholly visible (the default arg) or
724 // at least partially visible in the grid window
726 bool IsVisible( int row
, int col
, bool wholeCellVisible
= TRUE
);
727 bool IsVisible( const wxGridCellCoords
& coords
, bool wholeCellVisible
= TRUE
)
728 { return IsVisible( coords
.GetRow(), coords
.GetCol(), wholeCellVisible
); }
729 void MakeCellVisible( int row
, int col
);
730 void MakeCellVisible( const wxGridCellCoords
& coords
)
731 { MakeCellVisible( coords
.GetRow(), coords
.GetCol() ); }
734 // ------ grid cursor movement functions
736 void SetGridCursor( int row
, int col
)
737 { SetCurrentCell( wxGridCellCoords(row
, col
) ); }
740 bool MoveCursorDown();
741 bool MoveCursorLeft();
742 bool MoveCursorRight();
745 bool MoveCursorUpBlock();
746 bool MoveCursorDownBlock();
747 bool MoveCursorLeftBlock();
748 bool MoveCursorRightBlock();
751 // ------ label and gridline formatting
753 int GetDefaultRowLabelSize() { return WXGRID_DEFAULT_ROW_LABEL_WIDTH
; }
754 int GetRowLabelSize() { return m_rowLabelWidth
; }
755 int GetDefaultColLabelSize() { return WXGRID_DEFAULT_COL_LABEL_HEIGHT
; }
756 int GetColLabelSize() { return m_colLabelHeight
; }
757 wxColour
GetLabelBackgroundColour() { return m_labelBackgroundColour
; }
758 wxColour
GetLabelTextColour() { return m_labelTextColour
; }
759 wxFont
GetLabelFont() { return m_labelFont
; }
760 void GetRowLabelAlignment( int *horiz
, int *vert
);
761 void GetColLabelAlignment( int *horiz
, int *vert
);
762 wxString
GetRowLabelValue( int row
);
763 wxString
GetColLabelValue( int col
);
764 wxColour
GetGridLineColour() { return m_gridLineColour
; }
766 void SetRowLabelSize( int width
);
767 void SetColLabelSize( int height
);
768 void SetLabelBackgroundColour( const wxColour
& );
769 void SetLabelTextColour( const wxColour
& );
770 void SetLabelFont( const wxFont
& );
771 void SetRowLabelAlignment( int horiz
, int vert
);
772 void SetColLabelAlignment( int horiz
, int vert
);
773 void SetRowLabelValue( int row
, const wxString
& );
774 void SetColLabelValue( int col
, const wxString
& );
775 void SetGridLineColour( const wxColour
& );
777 // this sets the specified attribute for all cells in this row/col
778 void SetRowAttr(int row
, wxGridCellAttr
*attr
);
779 void SetColAttr(int col
, wxGridCellAttr
*attr
);
781 void EnableGridLines( bool enable
= TRUE
);
782 bool GridLinesEnabled() { return m_gridLinesEnabled
; }
784 // ------ row and col formatting
786 int GetDefaultRowSize();
787 int GetRowSize( int row
);
788 int GetDefaultColSize();
789 int GetColSize( int col
);
790 wxColour
GetDefaultCellBackgroundColour();
791 wxColour
GetCellBackgroundColour( int row
, int col
);
792 wxColour
GetDefaultCellTextColour();
793 wxColour
GetCellTextColour( int row
, int col
);
794 wxFont
GetDefaultCellFont();
795 wxFont
GetCellFont( int row
, int col
);
796 void GetDefaultCellAlignment( int *horiz
, int *vert
);
797 void GetCellAlignment( int row
, int col
, int *horiz
, int *vert
);
799 void SetDefaultRowSize( int height
, bool resizeExistingRows
= FALSE
);
800 void SetRowSize( int row
, int height
);
801 void SetDefaultColSize( int width
, bool resizeExistingCols
= FALSE
);
803 void SetColSize( int col
, int width
);
804 void SetDefaultCellBackgroundColour( const wxColour
& );
805 void SetCellBackgroundColour( int row
, int col
, const wxColour
& );
806 void SetDefaultCellTextColour( const wxColour
& );
808 void SetCellTextColour( int row
, int col
, const wxColour
& );
809 void SetDefaultCellFont( const wxFont
& );
810 void SetCellFont( int row
, int col
, const wxFont
& );
811 void SetDefaultCellAlignment( int horiz
, int vert
);
812 void SetCellAlignment( int row
, int col
, int horiz
, int vert
);
814 // takes ownership of the pointer
815 void SetDefaultRenderer(wxGridCellRenderer
*renderer
);
816 void SetCellRenderer(int row
, int col
, wxGridCellRenderer
*renderer
);
817 wxGridCellRenderer
*GetDefaultRenderer() const;
818 wxGridCellRenderer
* GetCellRenderer(int row
, int col
);
821 // ------ cell value accessors
823 wxString
GetCellValue( int row
, int col
)
827 return m_table
->GetValue( row
, col
);
831 return wxEmptyString
;
835 wxString
GetCellValue( const wxGridCellCoords
& coords
)
836 { return GetCellValue( coords
.GetRow(), coords
.GetCol() ); }
838 void SetCellValue( int row
, int col
, const wxString
& s
);
839 void SetCellValue( const wxGridCellCoords
& coords
, const wxString
& s
)
840 { SetCellValue( coords
.GetRow(), coords
.GetCol(), s
); }
844 // ------ selections of blocks of cells
846 void SelectRow( int row
, bool addToSelected
= FALSE
);
847 void SelectCol( int col
, bool addToSelected
= FALSE
);
849 void SelectBlock( int topRow
, int leftCol
, int bottomRow
, int rightCol
);
851 void SelectBlock( const wxGridCellCoords
& topLeft
,
852 const wxGridCellCoords
& bottomRight
)
853 { SelectBlock( topLeft
.GetRow(), topLeft
.GetCol(),
854 bottomRight
.GetRow(), bottomRight
.GetCol() ); }
859 { return ( m_selectedTopLeft
!= wxGridNoCellCoords
&&
860 m_selectedBottomRight
!= wxGridNoCellCoords
);
863 void ClearSelection();
865 bool IsInSelection( int row
, int col
)
866 { return ( IsSelection() &&
867 row
>= m_selectedTopLeft
.GetRow() &&
868 col
>= m_selectedTopLeft
.GetCol() &&
869 row
<= m_selectedBottomRight
.GetRow() &&
870 col
<= m_selectedBottomRight
.GetCol() );
873 bool IsInSelection( const wxGridCellCoords
& coords
)
874 { return IsInSelection( coords
.GetRow(), coords
.GetCol() ); }
876 void GetSelection( int* topRow
, int* leftCol
, int* bottomRow
, int* rightCol
)
878 // these will all be -1 if there is no selected block
880 *topRow
= m_selectedTopLeft
.GetRow();
881 *leftCol
= m_selectedTopLeft
.GetCol();
882 *bottomRow
= m_selectedBottomRight
.GetRow();
883 *rightCol
= m_selectedBottomRight
.GetCol();
887 // This function returns the rectangle that encloses the block of cells
888 // limited by TopLeft and BottomRight cell in device coords and clipped
889 // to the client size of the grid window.
891 wxRect
BlockToDeviceRect( const wxGridCellCoords
& topLeft
,
892 const wxGridCellCoords
& bottomRight
);
894 // This function returns the rectangle that encloses the selected cells
895 // in device coords and clipped to the client size of the grid window.
897 wxRect
SelectionToDeviceRect()
899 return BlockToDeviceRect( m_selectedTopLeft
,
900 m_selectedBottomRight
);
903 // Access or update the selection fore/back colours
904 wxColour
GetSelectionBackground() const
905 { return m_selectionBackground
; }
906 wxColour
GetSelectionForeground() const
907 { return m_selectionForeground
; }
909 void SetSelectionBackground(const wxColour
& c
) { m_selectionBackground
= c
; }
910 void SetSelectionForeground(const wxColour
& c
) { m_selectionForeground
= c
; }
914 // ------ For compatibility with previous wxGrid only...
916 // ************************************************
917 // ** Don't use these in new code because they **
918 // ** are liable to disappear in a future **
920 // ************************************************
923 wxGrid( wxWindow
*parent
,
924 int x
= -1, int y
= -1, int w
= -1, int h
= -1,
926 const wxString
& name
= wxPanelNameStr
)
927 : wxScrolledWindow( parent
, -1, wxPoint(x
,y
), wxSize(w
,h
), style
, name
)
932 void SetCellValue( const wxString
& val
, int row
, int col
)
933 { SetCellValue( row
, col
, val
); }
935 void UpdateDimensions()
936 { CalcDimensions(); }
938 int GetRows() { return GetNumberRows(); }
939 int GetCols() { return GetNumberCols(); }
940 int GetCursorRow() { return GetGridCursorRow(); }
941 int GetCursorColumn() { return GetGridCursorCol(); }
943 int GetScrollPosX() { return 0; }
944 int GetScrollPosY() { return 0; }
946 void SetScrollX( int x
) { }
947 void SetScrollY( int y
) { }
949 void SetColumnWidth( int col
, int width
)
950 { SetColSize( col
, width
); }
952 int GetColumnWidth( int col
)
953 { return GetColSize( col
); }
955 void SetRowHeight( int row
, int height
)
956 { SetRowSize( row
, height
); }
958 int GetRowHeight( int row
)
959 { return GetRowSize( row
); }
961 int GetViewHeight() // returned num whole rows visible
964 int GetViewWidth() // returned num whole cols visible
967 void SetLabelSize( int orientation
, int sz
)
969 if ( orientation
== wxHORIZONTAL
)
970 SetColLabelSize( sz
);
972 SetRowLabelSize( sz
);
975 int GetLabelSize( int orientation
)
977 if ( orientation
== wxHORIZONTAL
)
978 return GetColLabelSize();
980 return GetRowLabelSize();
983 void SetLabelAlignment( int orientation
, int align
)
985 if ( orientation
== wxHORIZONTAL
)
986 SetColLabelAlignment( align
, -1 );
988 SetRowLabelAlignment( align
, -1 );
991 int GetLabelAlignment( int orientation
, int WXUNUSED(align
) )
994 if ( orientation
== wxHORIZONTAL
)
996 GetColLabelAlignment( &h
, &v
);
1001 GetRowLabelAlignment( &h
, &v
);
1006 void SetLabelValue( int orientation
, const wxString
& val
, int pos
)
1008 if ( orientation
== wxHORIZONTAL
)
1009 SetColLabelValue( pos
, val
);
1011 SetRowLabelValue( pos
, val
);
1014 wxString
GetLabelValue( int orientation
, int pos
)
1016 if ( orientation
== wxHORIZONTAL
)
1017 return GetColLabelValue( pos
);
1019 return GetRowLabelValue( pos
);
1022 wxFont
GetCellTextFont() const
1023 { return m_defaultCellAttr
->GetFont(); }
1025 wxFont
GetCellTextFont(int WXUNUSED(row
), int WXUNUSED(col
)) const
1026 { return m_defaultCellAttr
->GetFont(); }
1028 void SetCellTextFont(const wxFont
& fnt
)
1029 { SetDefaultCellFont( fnt
); }
1031 void SetCellTextFont(const wxFont
& fnt
, int row
, int col
)
1032 { SetCellFont( row
, col
, fnt
); }
1034 void SetCellTextColour(const wxColour
& val
, int row
, int col
)
1035 { SetCellTextColour( row
, col
, val
); }
1037 void SetCellTextColour(const wxColour
& col
)
1038 { SetDefaultCellTextColour( col
); }
1040 void SetCellBackgroundColour(const wxColour
& col
)
1041 { SetDefaultCellBackgroundColour( col
); }
1043 void SetCellBackgroundColour(const wxColour
& colour
, int row
, int col
)
1044 { SetCellBackgroundColour( row
, col
, colour
); }
1046 bool GetEditable() { return IsEditable(); }
1047 void SetEditable( bool edit
= TRUE
) { EnableEditing( edit
); }
1048 bool GetEditInPlace() { return IsCellEditControlEnabled(); }
1050 void SetEditInPlace(bool edit
= TRUE
) { }
1052 void SetCellAlignment( int align
, int row
, int col
)
1053 { SetCellAlignment(row
, col
, align
, wxCENTER
); }
1054 void SetCellAlignment( int WXUNUSED(align
) ) {}
1055 void SetCellBitmap(wxBitmap
*WXUNUSED(bitmap
), int WXUNUSED(row
), int WXUNUSED(col
))
1057 void SetDividerPen(const wxPen
& WXUNUSED(pen
)) { }
1058 wxPen
& GetDividerPen() const { return wxNullPen
; }
1059 void OnActivate(bool WXUNUSED(active
)) {}
1061 // ******** End of compatibility functions **********
1065 // ------ control IDs
1066 enum { wxGRID_CELLCTRL
= 2000,
1069 // ------ control types
1070 enum { wxGRID_TEXTCTRL
= 2100,
1079 wxGridWindow
*m_gridWin
;
1080 wxGridRowLabelWindow
*m_rowLabelWin
;
1081 wxGridColLabelWindow
*m_colLabelWin
;
1082 wxGridCornerLabelWindow
*m_cornerLabelWin
;
1084 wxGridTableBase
*m_table
;
1095 wxGridCellCoords m_currentCellCoords
;
1097 wxGridCellCoords m_selectedTopLeft
;
1098 wxGridCellCoords m_selectedBottomRight
;
1099 wxColour m_selectionBackground
;
1100 wxColour m_selectionForeground
;
1102 int m_defaultRowHeight
;
1103 wxArrayInt m_rowHeights
;
1104 wxArrayInt m_rowBottoms
;
1106 int m_defaultColWidth
;
1107 wxArrayInt m_colWidths
;
1108 wxArrayInt m_colRights
;
1109 int m_rowLabelWidth
;
1110 int m_colLabelHeight
;
1112 wxColour m_labelBackgroundColour
;
1113 wxColour m_labelTextColour
;
1116 int m_rowLabelHorizAlign
;
1117 int m_rowLabelVertAlign
;
1118 int m_colLabelHorizAlign
;
1119 int m_colLabelVertAlign
;
1121 bool m_defaultRowLabelValues
;
1122 bool m_defaultColLabelValues
;
1124 wxColour m_gridLineColour
;
1125 bool m_gridLinesEnabled
;
1128 // do we have some place to store attributes in?
1129 bool CanHaveAttributes();
1131 // returns the attribute we may modify in place: a new one if this cell
1132 // doesn't have any yet or the existing one if it does
1134 // DecRef() must be called on the returned pointer, as usual
1135 wxGridCellAttr
*GetOrCreateCellAttr(int row
, int col
) const;
1137 // cell attribute cache (currently we only cache 1, may be will do
1138 // more/better later)
1142 wxGridCellAttr
*attr
;
1145 // invalidates the attribute cache
1146 void ClearAttrCache();
1148 // adds an attribute to cache
1149 void CacheAttr(int row
, int col
, wxGridCellAttr
*attr
) const;
1151 // looks for an attr in cache, returns TRUE if found
1152 bool LookupAttr(int row
, int col
, wxGridCellAttr
**attr
) const;
1154 // looks for the attr in cache, if not found asks the table and caches the
1156 wxGridCellAttr
*GetCellAttr(int row
, int col
) const;
1158 // the default cell attr object for cells that don't have their own
1159 wxGridCellAttr
* m_defaultCellAttr
;
1162 wxGridCellCoordsArray m_cellsExposed
;
1163 wxArrayInt m_rowsExposed
;
1164 wxArrayInt m_colsExposed
;
1165 wxArrayInt m_rowLabelsExposed
;
1166 wxArrayInt m_colLabelsExposed
;
1173 WXGRID_CURSOR_SELECT_CELL
,
1174 WXGRID_CURSOR_RESIZE_ROW
,
1175 WXGRID_CURSOR_RESIZE_COL
,
1176 WXGRID_CURSOR_SELECT_ROW
,
1177 WXGRID_CURSOR_SELECT_COL
1180 // this method not only sets m_cursorMode but also sets the correct cursor
1181 // for the given mode and, if captureMouse is not FALSE releases the mouse
1182 // if it was captured and captures it if it must be captured
1184 // for this to work, you should always use it and not set m_cursorMode
1186 void ChangeCursorMode(CursorMode mode
,
1187 wxWindow
*win
= (wxWindow
*)NULL
,
1188 bool captureMouse
= TRUE
);
1190 wxWindow
*m_winCapture
; // the window which captured the mouse
1191 CursorMode m_cursorMode
;
1196 wxPoint m_startDragPos
;
1198 wxTimer
* m_editTimer
;
1199 bool m_waitForSlowClick
;
1201 wxGridCellCoords m_selectionStart
;
1203 wxCursor m_rowResizeCursor
;
1204 wxCursor m_colResizeCursor
;
1206 bool m_editable
; // applies to whole grid
1207 int m_editCtrlType
; // for current cell
1208 wxWindow
* m_cellEditCtrl
;
1209 bool m_cellEditCtrlEnabled
;
1214 void CalcDimensions();
1215 void CalcWindowSizes();
1216 bool Redimension( wxGridTableMessage
& );
1219 bool SendEvent( const wxEventType
,
1223 bool SendEvent( const wxEventType
,
1227 void OnPaint( wxPaintEvent
& );
1228 void OnSize( wxSizeEvent
& );
1229 void OnKeyDown( wxKeyEvent
& );
1230 void OnEraseBackground( wxEraseEvent
& );
1231 void OnEditTimer( wxTimerEvent
& );
1234 void SetCurrentCell( const wxGridCellCoords
& coords
);
1235 void SetCurrentCell( int row
, int col
)
1236 { SetCurrentCell( wxGridCellCoords(row
, col
) ); }
1239 // ------ functions to get/send data (see also public functions)
1241 bool GetModelValues();
1242 bool SetModelValues();
1245 DECLARE_DYNAMIC_CLASS( wxGrid
)
1246 DECLARE_EVENT_TABLE()
1254 // ------ Grid event class and event types
1257 class WXDLLEXPORT wxGridEvent
: public wxNotifyEvent
1261 : wxNotifyEvent(), m_row(-1), m_col(-1), m_x(-1), m_y(-1),
1262 m_control(0), m_meta(0), m_shift(0), m_alt(0)
1266 wxGridEvent(int id
, wxEventType type
, wxObject
* obj
,
1267 int row
=-1, int col
=-1, int x
=-1, int y
=-1,
1268 bool control
=FALSE
, bool shift
=FALSE
, bool alt
=FALSE
, bool meta
=FALSE
);
1270 virtual int GetRow() { return m_row
; }
1271 virtual int GetCol() { return m_col
; }
1272 wxPoint
GetPosition() { return wxPoint( m_x
, m_y
); }
1273 bool ControlDown() { return m_control
; }
1274 bool MetaDown() { return m_meta
; }
1275 bool ShiftDown() { return m_shift
; }
1276 bool AltDown() { return m_alt
; }
1288 DECLARE_DYNAMIC_CLASS(wxGridEvent
)
1292 class WXDLLEXPORT wxGridSizeEvent
: public wxNotifyEvent
1296 : wxNotifyEvent(), m_rowOrCol(-1), m_x(-1), m_y(-1),
1297 m_control(0), m_meta(0), m_shift(0), m_alt(0)
1301 wxGridSizeEvent(int id
, wxEventType type
, wxObject
* obj
,
1302 int rowOrCol
=-1, int x
=-1, int y
=-1,
1303 bool control
=FALSE
, bool shift
=FALSE
, bool alt
=FALSE
, bool meta
=FALSE
);
1305 int GetRowOrCol() { return m_rowOrCol
; }
1306 wxPoint
GetPosition() { return wxPoint( m_x
, m_y
); }
1307 bool ControlDown() { return m_control
; }
1308 bool MetaDown() { return m_meta
; }
1309 bool ShiftDown() { return m_shift
; }
1310 bool AltDown() { return m_alt
; }
1321 DECLARE_DYNAMIC_CLASS(wxGridSizeEvent
)
1325 class WXDLLEXPORT wxGridRangeSelectEvent
: public wxNotifyEvent
1328 wxGridRangeSelectEvent()
1331 m_topLeft
= wxGridNoCellCoords
;
1332 m_bottomRight
= wxGridNoCellCoords
;
1339 wxGridRangeSelectEvent(int id
, wxEventType type
, wxObject
* obj
,
1340 const wxGridCellCoords
& topLeft
,
1341 const wxGridCellCoords
& bottomRight
,
1342 bool control
=FALSE
, bool shift
=FALSE
,
1343 bool alt
=FALSE
, bool meta
=FALSE
);
1345 wxGridCellCoords
GetTopLeftCoords() { return m_topLeft
; }
1346 wxGridCellCoords
GetBottomRightCoords() { return m_bottomRight
; }
1347 int GetTopRow() { return m_topLeft
.GetRow(); }
1348 int GetBottomRow() { return m_bottomRight
.GetRow(); }
1349 int GetLeftCol() { return m_topLeft
.GetCol(); }
1350 int GetRightCol() { return m_bottomRight
.GetCol(); }
1351 bool ControlDown() { return m_control
; }
1352 bool MetaDown() { return m_meta
; }
1353 bool ShiftDown() { return m_shift
; }
1354 bool AltDown() { return m_alt
; }
1357 wxGridCellCoords m_topLeft
;
1358 wxGridCellCoords m_bottomRight
;
1364 DECLARE_DYNAMIC_CLASS(wxGridRangeSelectEvent
)
1368 const wxEventType EVT_GRID_CELL_LEFT_CLICK
= wxEVT_FIRST
+ 1580;
1369 const wxEventType EVT_GRID_CELL_RIGHT_CLICK
= wxEVT_FIRST
+ 1581;
1370 const wxEventType EVT_GRID_CELL_LEFT_DCLICK
= wxEVT_FIRST
+ 1582;
1371 const wxEventType EVT_GRID_CELL_RIGHT_DCLICK
= wxEVT_FIRST
+ 1583;
1372 const wxEventType EVT_GRID_LABEL_LEFT_CLICK
= wxEVT_FIRST
+ 1584;
1373 const wxEventType EVT_GRID_LABEL_RIGHT_CLICK
= wxEVT_FIRST
+ 1585;
1374 const wxEventType EVT_GRID_LABEL_LEFT_DCLICK
= wxEVT_FIRST
+ 1586;
1375 const wxEventType EVT_GRID_LABEL_RIGHT_DCLICK
= wxEVT_FIRST
+ 1587;
1376 const wxEventType EVT_GRID_ROW_SIZE
= wxEVT_FIRST
+ 1588;
1377 const wxEventType EVT_GRID_COL_SIZE
= wxEVT_FIRST
+ 1589;
1378 const wxEventType EVT_GRID_RANGE_SELECT
= wxEVT_FIRST
+ 1590;
1379 const wxEventType EVT_GRID_CELL_CHANGE
= wxEVT_FIRST
+ 1591;
1380 const wxEventType EVT_GRID_SELECT_CELL
= wxEVT_FIRST
+ 1592;
1383 typedef void (wxEvtHandler
::*wxGridEventFunction
)(wxGridEvent
&);
1384 typedef void (wxEvtHandler
::*wxGridSizeEventFunction
)(wxGridSizeEvent
&);
1385 typedef void (wxEvtHandler
::*wxGridRangeSelectEventFunction
)(wxGridRangeSelectEvent
&);
1387 #define EVT_GRID_CELL_LEFT_CLICK(fn) { EVT_GRID_CELL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1388 #define EVT_GRID_CELL_RIGHT_CLICK(fn) { EVT_GRID_CELL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1389 #define EVT_GRID_CELL_LEFT_DCLICK(fn) { EVT_GRID_CELL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1390 #define EVT_GRID_CELL_RIGHT_DCLICK(fn) { EVT_GRID_CELL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1391 #define EVT_GRID_LABEL_LEFT_CLICK(fn) { EVT_GRID_LABEL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1392 #define EVT_GRID_LABEL_RIGHT_CLICK(fn) { EVT_GRID_LABEL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1393 #define EVT_GRID_LABEL_LEFT_DCLICK(fn) { EVT_GRID_LABEL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1394 #define EVT_GRID_LABEL_RIGHT_DCLICK(fn) { EVT_GRID_LABEL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1395 #define EVT_GRID_ROW_SIZE(fn) { EVT_GRID_ROW_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL },
1396 #define EVT_GRID_COL_SIZE(fn) { EVT_GRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL },
1397 #define EVT_GRID_RANGE_SELECT(fn) { EVT_GRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridRangeSelectEventFunction) &fn, NULL },
1398 #define EVT_GRID_CELL_CHANGE(fn) { EVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1399 #define EVT_GRID_SELECT_CELL(fn) { EVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1402 #if 0 // TODO: implement these ? others ?
1404 const wxEventType EVT_GRID_CREATE_CELL
= wxEVT_FIRST
+ 1576;
1405 const wxEventType EVT_GRID_CHANGE_LABELS
= wxEVT_FIRST
+ 1577;
1406 const wxEventType EVT_GRID_CHANGE_SEL_LABEL
= wxEVT_FIRST
+ 1578;
1408 #define EVT_GRID_CREATE_CELL(fn) { EVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1409 #define EVT_GRID_CHANGE_LABELS(fn) { EVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1410 #define EVT_GRID_CHANGE_SEL_LABEL(fn) { EVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
1414 #endif // #ifndef __WXGRID_H__
1416 #endif // ifndef wxUSE_NEW_GRID