11#ifndef _WX_GENERIC_GRID_H_
12#define _WX_GENERIC_GRID_H_
18#include "wx/hashmap.h"
20#include "wx/scrolwin.h"
26extern WXDLLIMPEXP_DATA_ADV(
const char) wxGridNameStr[];
30#define WXGRID_DEFAULT_NUMBER_ROWS 10
31#define WXGRID_DEFAULT_NUMBER_COLS 10
32#if defined(__WXMSW__) || defined(__WXGTK20__)
33#define WXGRID_DEFAULT_ROW_HEIGHT 25
35#define WXGRID_DEFAULT_ROW_HEIGHT 30
37#define WXGRID_DEFAULT_COL_WIDTH 80
38#define WXGRID_DEFAULT_COL_LABEL_HEIGHT 32
39#define WXGRID_DEFAULT_ROW_LABEL_WIDTH 82
40#define WXGRID_LABEL_EDGE_ZONE 2
41#define WXGRID_MIN_ROW_HEIGHT 15
42#define WXGRID_MIN_COL_WIDTH 15
43#define WXGRID_DEFAULT_SCROLLBAR_WIDTH 16
46#define wxGRID_VALUE_STRING wxT("string")
47#define wxGRID_VALUE_BOOL wxT("bool")
48#define wxGRID_VALUE_NUMBER wxT("long")
49#define wxGRID_VALUE_FLOAT wxT("double")
50#define wxGRID_VALUE_CHOICE wxT("choice")
52#define wxGRID_VALUE_TEXT wxGRID_VALUE_STRING
53#define wxGRID_VALUE_LONG wxGRID_VALUE_NUMBER
57#define wxGRID_AUTOSIZE (-1)
70 wxGRID_DRAW_ROWS_HEADER = 0x001,
71 wxGRID_DRAW_COLS_HEADER = 0x002,
72 wxGRID_DRAW_CELL_LINES = 0x004,
73 wxGRID_DRAW_BOX_RECT = 0x008,
74 wxGRID_DRAW_SELECTION = 0x010,
75 wxGRID_DRAW_DEFAULT = wxGRID_DRAW_ROWS_HEADER |
76 wxGRID_DRAW_COLS_HEADER |
77 wxGRID_DRAW_CELL_LINES |
85class WXDLLIMPEXP_FWD_ADV wxGrid;
86class WXDLLIMPEXP_FWD_ADV wxGridCellAttr;
87class WXDLLIMPEXP_FWD_ADV wxGridCellAttrProviderData;
88class WXDLLIMPEXP_FWD_ADV wxGridColLabelWindow;
89class WXDLLIMPEXP_FWD_ADV wxGridCornerLabelWindow;
90class WXDLLIMPEXP_FWD_ADV wxGridRowLabelWindow;
91class WXDLLIMPEXP_FWD_ADV wxGridWindow;
92class WXDLLIMPEXP_FWD_ADV wxGridTypeRegistry;
93class WXDLLIMPEXP_FWD_ADV wxGridSelection;
95class WXDLLIMPEXP_FWD_CORE wxHeaderCtrl;
96class WXDLLIMPEXP_FWD_CORE wxCheckBox;
97class WXDLLIMPEXP_FWD_CORE wxComboBox;
98class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
100class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
103class wxGridFixedIndicesSet;
105class wxGridOperations;
106class wxGridRowOperations;
107class wxGridColumnOperations;
108class wxGridDirectionOperations;
115#define wxSafeIncRef(p) if ( p ) (p)->IncRef()
116#define wxSafeDecRef(p) if ( p ) (p)->DecRef()
126class WXDLLIMPEXP_ADV wxGridCellWorker :
public wxClientDataContainer,
public wxRefCounter
129 wxGridCellWorker() { }
133 virtual void SetParameters(
const wxString& params);
138 virtual ~wxGridCellWorker();
143 friend class wxGridCellWorkerDummyFriend;
154class WXDLLIMPEXP_ADV wxGridCellRenderer :
public wxGridCellWorker
164 virtual void Draw(wxGrid& grid,
165 wxGridCellAttr& attr,
169 bool isSelected) = 0;
172 virtual wxSize GetBestSize(wxGrid& grid,
173 wxGridCellAttr& attr,
175 int row,
int col) = 0;
178 virtual wxGridCellRenderer *Clone()
const = 0;
189class WXDLLIMPEXP_ADV wxGridCellEditor :
public wxGridCellWorker
194 bool IsCreated()
const {
return m_control != NULL; }
195 wxControl* GetControl()
const {
return m_control; }
196 void SetControl(wxControl* control) { m_control = control; }
198 wxGridCellAttr* GetCellAttr()
const {
return m_attr; }
199 void SetCellAttr(wxGridCellAttr* attr) { m_attr = attr; }
202 virtual void Create(wxWindow* parent,
204 wxEvtHandler* evtHandler) = 0;
207 virtual void SetSize(
const wxRect& rect);
211 virtual void Show(
bool show, wxGridCellAttr *attr = NULL);
215 virtual void PaintBackground(wxDC& dc,
216 const wxRect& rectCell,
217 const wxGridCellAttr& attr);
226 virtual void BeginEdit(
int row,
int col, wxGrid* grid) = 0;
234 virtual bool EndEdit(
int row,
int col,
const wxGrid *grid,
235 const wxString& oldval, wxString *newval) = 0;
239 virtual void ApplyEdit(
int row,
int col, wxGrid* grid) = 0;
243 virtual void Reset() = 0;
253 virtual bool IsAcceptedKey(wxKeyEvent& event);
257 virtual void StartingKey(wxKeyEvent& event);
261 virtual void StartingClick();
265 virtual void HandleReturn(wxKeyEvent& event);
268 virtual void Destroy();
271 virtual wxGridCellEditor *Clone()
const = 0;
274 virtual wxString GetValue()
const = 0;
278 virtual ~wxGridCellEditor();
281 wxControl* m_control;
284 wxGridCellAttr* m_attr;
295 friend class wxGridCellEditorDummyFriend;
297 wxDECLARE_NO_COPY_CLASS(wxGridCellEditor);
306class WXDLLIMPEXP_ADV wxGridCornerHeaderRenderer
310 virtual void DrawBorder(
const wxGrid& grid,
312 wxRect& rect)
const = 0;
317 virtual ~wxGridCornerHeaderRenderer() { }
322class WXDLLIMPEXP_ADV wxGridHeaderLabelsRenderer
323 :
public wxGridCornerHeaderRenderer
327 virtual void DrawLabel(
const wxGrid& grid,
329 const wxString& value,
333 int textOrientation)
const;
340class WXDLLIMPEXP_ADV wxGridRowHeaderRenderer
341 :
public wxGridHeaderLabelsRenderer
345class WXDLLIMPEXP_ADV wxGridColumnHeaderRenderer
346 :
public wxGridHeaderLabelsRenderer
352class WXDLLIMPEXP_ADV wxGridRowHeaderRendererDefault
353 :
public wxGridRowHeaderRenderer
356 virtual void DrawBorder(
const wxGrid& grid,
362class WXDLLIMPEXP_ADV wxGridColumnHeaderRendererDefault
363 :
public wxGridColumnHeaderRenderer
366 virtual void DrawBorder(
const wxGrid& grid,
372class WXDLLIMPEXP_ADV wxGridCornerHeaderRendererDefault
373 :
public wxGridCornerHeaderRenderer
376 virtual void DrawBorder(
const wxGrid& grid,
388class WXDLLIMPEXP_ADV wxGridCellAttr :
public wxClientDataContainer,
public wxRefCounter
402 wxGridCellAttr(wxGridCellAttr *attrDefault = NULL)
406 SetAlignment(wxALIGN_INVALID, wxALIGN_INVALID);
411 wxGridCellAttr(
const wxColour& colText,
412 const wxColour& colBack,
416 : m_colText(colText), m_colBack(colBack), m_font(font)
419 SetAlignment(hAlign, vAlign);
423 wxGridCellAttr *Clone()
const;
424 void MergeWith(wxGridCellAttr *mergefrom);
427 void SetTextColour(
const wxColour& colText) { m_colText = colText; }
428 void SetBackgroundColour(
const wxColour& colBack) { m_colBack = colBack; }
429 void SetFont(
const wxFont& font) { m_font = font; }
430 void SetAlignment(
int hAlign,
int vAlign)
435 void SetSize(
int num_rows,
int num_cols);
436 void SetOverflow(
bool allow =
true)
437 { m_overflow = allow ? Overflow : SingleCell; }
438 void SetReadOnly(
bool isReadOnly =
true)
439 { m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; }
442 void SetRenderer(wxGridCellRenderer *renderer)
443 { wxSafeDecRef(m_renderer); m_renderer = renderer; }
444 void SetEditor(wxGridCellEditor* editor)
445 { wxSafeDecRef(m_editor); m_editor = editor; }
447 void SetKind(wxAttrKind kind) { m_attrkind = kind; }
450 bool HasTextColour()
const {
return m_colText.IsOk(); }
451 bool HasBackgroundColour()
const {
return m_colBack.IsOk(); }
452 bool HasFont()
const {
return m_font.IsOk(); }
453 bool HasAlignment()
const
455 return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID;
457 bool HasRenderer()
const {
return m_renderer != NULL; }
458 bool HasEditor()
const {
return m_editor != NULL; }
459 bool HasReadWriteMode()
const {
return m_isReadOnly != Unset; }
460 bool HasOverflowMode()
const {
return m_overflow != UnsetOverflow; }
461 bool HasSize()
const {
return m_sizeRows != 1 || m_sizeCols != 1; }
463 const wxColour& GetTextColour()
const;
464 const wxColour& GetBackgroundColour()
const;
465 const wxFont& GetFont()
const;
466 void GetAlignment(
int *hAlign,
int *vAlign)
const;
474 void GetNonDefaultAlignment(
int *hAlign,
int *vAlign)
const;
476 void GetSize(
int *num_rows,
int *num_cols)
const;
477 bool GetOverflow()
const
478 {
return m_overflow != SingleCell; }
479 wxGridCellRenderer *GetRenderer(
const wxGrid* grid,
int row,
int col)
const;
480 wxGridCellEditor *GetEditor(
const wxGrid* grid,
int row,
int col)
const;
482 bool IsReadOnly()
const {
return m_isReadOnly == wxGridCellAttr::ReadOnly; }
484 wxAttrKind GetKind() {
return m_attrkind; }
486 void SetDefAttr(wxGridCellAttr* defAttr) { m_defGridAttr = defAttr; }
490 virtual ~wxGridCellAttr()
492 wxSafeDecRef(m_renderer);
493 wxSafeDecRef(m_editor);
504 enum wxAttrOverflowMode
512 void Init(wxGridCellAttr *attrDefault = NULL);
523 wxAttrOverflowMode m_overflow;
525 wxGridCellRenderer* m_renderer;
526 wxGridCellEditor* m_editor;
527 wxGridCellAttr* m_defGridAttr;
529 wxAttrReadMode m_isReadOnly;
531 wxAttrKind m_attrkind;
534 wxDECLARE_NO_COPY_CLASS(wxGridCellAttr);
538 friend class wxGridCellAttrDummyFriend;
553class WXDLLIMPEXP_ADV wxGridCellAttrProvider :
public wxClientDataContainer
556 wxGridCellAttrProvider();
557 virtual ~wxGridCellAttrProvider();
560 virtual wxGridCellAttr *GetAttr(
int row,
int col,
561 wxGridCellAttr::wxAttrKind kind )
const;
565 virtual void SetAttr(wxGridCellAttr *attr,
int row,
int col);
566 virtual void SetRowAttr(wxGridCellAttr *attr,
int row,
bool clear =
false);
567 virtual void SetColAttr(wxGridCellAttr *attr,
int col,
bool clear =
false);
571 void UpdateAttrRows(
size_t pos,
int numRows );
572 void UpdateAttrCols(
size_t pos,
int numCols );
578 virtual const wxGridColumnHeaderRenderer& GetColumnHeaderRenderer(
int col);
579 virtual const wxGridRowHeaderRenderer& GetRowHeaderRenderer(
int row);
580 virtual const wxGridCornerHeaderRenderer& GetCornerRenderer();
585 wxGridCellAttrProviderData *m_data;
587 wxDECLARE_NO_COPY_CLASS(wxGridCellAttrProvider);
594class WXDLLIMPEXP_ADV wxGridCellCoords
597 wxGridCellCoords() { m_row = m_col = -1; }
598 wxGridCellCoords(
int r,
int c ) { m_row = r; m_col = c; }
602 int GetRow()
const {
return m_row; }
603 void SetRow(
int n ) { m_row = n; }
604 int GetCol()
const {
return m_col; }
605 void SetCol(
int n ) { m_col = n; }
606 void Set(
int row,
int col ) { m_row = row; m_col = col; }
608 wxGridCellCoords& operator=(
const wxGridCellCoords& other )
610 if ( &other !=
this )
618 bool operator==(
const wxGridCellCoords& other )
const
620 return (m_row == other.m_row && m_col == other.m_col);
623 bool operator!=(
const wxGridCellCoords& other )
const
625 return (m_row != other.m_row || m_col != other.m_col);
628 bool operator!()
const
630 return (m_row == -1 && m_col == -1 );
641extern WXDLLIMPEXP_ADV wxGridCellCoords wxGridNoCellCoords;
642extern WXDLLIMPEXP_ADV wxRect wxGridNoCellRect;
646WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellCoords, wxGridCellCoordsArray,
647 class WXDLLIMPEXP_ADV);
654class WXDLLIMPEXP_ADV wxGridTableBase :
public wxObject,
655 public wxClientDataContainer
659 virtual ~wxGridTableBase();
665 virtual int GetNumberRows() = 0;
666 virtual int GetNumberCols() = 0;
672 int GetRowsCount()
const
673 {
return const_cast<wxGridTableBase *
>(
this)->GetNumberRows(); }
674 int GetColsCount()
const
675 {
return const_cast<wxGridTableBase *
>(
this)->GetNumberCols(); }
678 virtual bool IsEmptyCell(
int row,
int col )
680 return GetValue(row, col).empty();
683 bool IsEmpty(
const wxGridCellCoords& coord)
685 return IsEmptyCell(coord.GetRow(), coord.GetCol());
688 virtual wxString GetValue(
int row,
int col ) = 0;
689 virtual void SetValue(
int row,
int col,
const wxString& value ) = 0;
692 virtual wxString GetTypeName(
int row,
int col );
693 virtual bool CanGetValueAs(
int row,
int col,
const wxString& typeName );
694 virtual bool CanSetValueAs(
int row,
int col,
const wxString& typeName );
696 virtual long GetValueAsLong(
int row,
int col );
697 virtual double GetValueAsDouble(
int row,
int col );
698 virtual bool GetValueAsBool(
int row,
int col );
700 virtual void SetValueAsLong(
int row,
int col,
long value );
701 virtual void SetValueAsDouble(
int row,
int col,
double value );
702 virtual void SetValueAsBool(
int row,
int col,
bool value );
705 virtual void* GetValueAsCustom(
int row,
int col,
const wxString& typeName );
706 virtual void SetValueAsCustom(
int row,
int col,
const wxString& typeName,
void* value );
711 virtual void SetView( wxGrid *grid ) { m_view = grid; }
712 virtual wxGrid * GetView()
const {
return m_view; }
714 virtual void Clear() {}
715 virtual bool InsertRows(
size_t pos = 0,
size_t numRows = 1 );
716 virtual bool AppendRows(
size_t numRows = 1 );
717 virtual bool DeleteRows(
size_t pos = 0,
size_t numRows = 1 );
718 virtual bool InsertCols(
size_t pos = 0,
size_t numCols = 1 );
719 virtual bool AppendCols(
size_t numCols = 1 );
720 virtual bool DeleteCols(
size_t pos = 0,
size_t numCols = 1 );
722 virtual wxString GetRowLabelValue(
int row );
723 virtual wxString GetColLabelValue(
int col );
724 virtual void SetRowLabelValue(
int WXUNUSED(row),
const wxString& ) {}
725 virtual void SetColLabelValue(
int WXUNUSED(col),
const wxString& ) {}
731 void SetAttrProvider(wxGridCellAttrProvider *attrProvider);
734 wxGridCellAttrProvider *GetAttrProvider()
const {
return m_attrProvider; }
738 virtual bool CanHaveAttributes();
742 virtual wxGridCellAttr *GetAttr(
int row,
int col,
743 wxGridCellAttr::wxAttrKind kind );
747 virtual void SetAttr(wxGridCellAttr* attr,
int row,
int col);
748 virtual void SetRowAttr(wxGridCellAttr *attr,
int row,
bool clear =
false);
749 virtual void SetColAttr(wxGridCellAttr *attr,
int col,
bool clear =
false);
753 wxGridCellAttrProvider *m_attrProvider;
755 DECLARE_ABSTRACT_CLASS(wxGridTableBase)
756 wxDECLARE_NO_COPY_CLASS(wxGridTableBase);
766enum wxGridTableRequest
768 wxGRIDTABLE_REQUEST_VIEW_GET_VALUES = 2000,
769 wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES,
770 wxGRIDTABLE_NOTIFY_ROWS_INSERTED,
771 wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
772 wxGRIDTABLE_NOTIFY_ROWS_DELETED,
773 wxGRIDTABLE_NOTIFY_COLS_INSERTED,
774 wxGRIDTABLE_NOTIFY_COLS_APPENDED,
775 wxGRIDTABLE_NOTIFY_COLS_DELETED
778class WXDLLIMPEXP_ADV wxGridTableMessage
781 wxGridTableMessage();
782 wxGridTableMessage( wxGridTableBase *table,
int id,
786 void SetTableObject( wxGridTableBase *table ) { m_table = table; }
787 wxGridTableBase * GetTableObject()
const {
return m_table; }
788 void SetId(
int id ) { m_id = id; }
789 int GetId() {
return m_id; }
790 void SetCommandInt(
int comInt1 ) { m_comInt1 = comInt1; }
791 int GetCommandInt() {
return m_comInt1; }
792 void SetCommandInt2(
int comInt2 ) { m_comInt2 = comInt2; }
793 int GetCommandInt2() {
return m_comInt2; }
796 wxGridTableBase *m_table;
801 wxDECLARE_NO_COPY_CLASS(wxGridTableMessage);
810WX_DECLARE_OBJARRAY_WITH_DECL(wxArrayString, wxGridStringArray,
811 class WXDLLIMPEXP_ADV);
821class WXDLLIMPEXP_ADV wxGridStringTable :
public wxGridTableBase
825 wxGridStringTable(
int numRows,
int numCols );
829 virtual int GetNumberRows() {
return static_cast<int>(m_data.size()); }
830 virtual int GetNumberCols() {
return m_numCols; }
831 virtual wxString GetValue(
int row,
int col );
832 virtual void SetValue(
int row,
int col,
const wxString& s );
837 bool InsertRows(
size_t pos = 0,
size_t numRows = 1 );
838 bool AppendRows(
size_t numRows = 1 );
839 bool DeleteRows(
size_t pos = 0,
size_t numRows = 1 );
840 bool InsertCols(
size_t pos = 0,
size_t numCols = 1 );
841 bool AppendCols(
size_t numCols = 1 );
842 bool DeleteCols(
size_t pos = 0,
size_t numCols = 1 );
844 void SetRowLabelValue(
int row,
const wxString& );
845 void SetColLabelValue(
int col,
const wxString& );
846 wxString GetRowLabelValue(
int row );
847 wxString GetColLabelValue(
int col );
850 wxGridStringArray m_data;
861 wxArrayString m_rowLabels;
862 wxArrayString m_colLabels;
864 DECLARE_DYNAMIC_CLASS_NO_COPY( wxGridStringTable )
882WX_DECLARE_HASH_MAP_WITH_DECL(
unsigned,
int, wxIntegerHash, wxIntegerEqual,
883 wxUnsignedToIntHashMap,
class WXDLLIMPEXP_ADV );
885struct WXDLLIMPEXP_ADV wxGridSizesInfo
888 wxGridSizesInfo() { }
891 wxGridSizesInfo(
int defSize,
const wxArrayInt& allSizes);
896 int GetSize(
unsigned pos)
const;
903 wxUnsignedToIntHashMap m_customSizes;
910class WXDLLIMPEXP_ADV wxGrid :
public wxScrolledWindow
914 enum wxGridSelectionModes
916 wxGridSelectCells = 0,
917 wxGridSelectRows = 1,
918 wxGridSelectColumns = 2,
919 wxGridSelectRowsOrColumns = wxGridSelectRows | wxGridSelectColumns
937 wxGrid(wxWindow *parent,
939 const wxPoint& pos = wxDefaultPosition,
940 const wxSize& size = wxDefaultSize,
941 long style = wxWANTS_CHARS,
942 const wxString&
name = wxGridNameStr)
946 Create(parent,
id, pos, size, style,
name);
949 bool Create(wxWindow *parent,
951 const wxPoint& pos = wxDefaultPosition,
952 const wxSize& size = wxDefaultSize,
953 long style = wxWANTS_CHARS,
954 const wxString&
name = wxGridNameStr);
965 bool CreateGrid(
int numRows,
int numCols,
966 wxGridSelectionModes selmode = wxGridSelectCells );
968 bool SetTable( wxGridTableBase *table,
969 bool takeOwnership =
false,
970 wxGridSelectionModes selmode = wxGridSelectCells );
972 bool ProcessTableMessage(wxGridTableMessage&);
974 wxGridTableBase *GetTable()
const {
return m_table; }
977 void SetSelectionMode(wxGridSelectionModes selmode);
978 wxGridSelectionModes GetSelectionMode()
const;
982 int GetNumberRows()
const {
return m_numRows; }
983 int GetNumberCols()
const {
return m_numCols; }
988 wxArrayInt CalcRowLabelsExposed(
const wxRegion& reg )
const;
990 wxArrayInt CalcColLabelsExposed(
const wxRegion& reg )
const;
991 wxGridCellCoordsArray CalcCellsExposed(
const wxRegion& reg )
const;
995 bool InsertRows(
int pos = 0,
int numRows = 1,
bool updateLabels =
true)
997 return DoModifyLines(&wxGridTableBase::InsertRows,
998 pos, numRows, updateLabels);
1000 bool InsertCols(
int pos = 0,
int numCols = 1,
bool updateLabels =
true)
1002 return DoModifyLines(&wxGridTableBase::InsertCols,
1003 pos, numCols, updateLabels);
1006 bool AppendRows(
int numRows = 1,
bool updateLabels =
true)
1008 return DoAppendLines(&wxGridTableBase::AppendRows, numRows, updateLabels);
1010 bool AppendCols(
int numCols = 1,
bool updateLabels =
true)
1012 return DoAppendLines(&wxGridTableBase::AppendCols, numCols, updateLabels);
1015 bool DeleteRows(
int pos = 0,
int numRows = 1,
bool updateLabels =
true)
1017 return DoModifyLines(&wxGridTableBase::DeleteRows,
1018 pos, numRows, updateLabels);
1020 bool DeleteCols(
int pos = 0,
int numCols = 1,
bool updateLabels =
true)
1022 return DoModifyLines(&wxGridTableBase::DeleteCols,
1023 pos, numCols, updateLabels);
1026 void DrawGridCellArea( wxDC& dc ,
const wxGridCellCoordsArray& cells );
1027 void DrawGridSpace( wxDC& dc );
1028 void DrawCellBorder( wxDC& dc,
const wxGridCellCoords& );
1029 void DrawAllGridLines( wxDC& dc,
const wxRegion & reg );
1030 void DrawCell( wxDC& dc,
const wxGridCellCoords& );
1031 void DrawHighlight(wxDC& dc,
const wxGridCellCoordsArray& cells);
1035 virtual void DrawCellHighlight( wxDC& dc,
const wxGridCellAttr *attr );
1037 virtual void DrawRowLabels( wxDC& dc,
const wxArrayInt& rows );
1038 virtual void DrawRowLabel( wxDC& dc,
int row );
1040 virtual void DrawColLabels( wxDC& dc,
const wxArrayInt& cols );
1041 virtual void DrawColLabel( wxDC& dc,
int col );
1043 virtual void DrawCornerLabel(wxDC& dc);
1047 void DrawTextRectangle( wxDC& dc,
const wxString&,
const wxRect&,
1048 int horizontalAlignment = wxALIGN_LEFT,
1049 int verticalAlignment = wxALIGN_TOP,
1050 int textOrientation = wxHORIZONTAL )
const;
1052 void DrawTextRectangle( wxDC& dc,
const wxArrayString& lines,
const wxRect&,
1053 int horizontalAlignment = wxALIGN_LEFT,
1054 int verticalAlignment = wxALIGN_TOP,
1055 int textOrientation = wxHORIZONTAL )
const;
1059 void Render( wxDC& dc,
1060 const wxPoint& pos = wxDefaultPosition,
1061 const wxSize& size = wxDefaultSize,
1062 const wxGridCellCoords& topLeft = wxGridCellCoords(-1, -1),
1063 const wxGridCellCoords& bottomRight = wxGridCellCoords(-1, -1),
1064 int style = wxGRID_DRAW_DEFAULT );
1069 void StringToLines(
const wxString& value, wxArrayString& lines )
const;
1071 void GetTextBoxSize(
const wxDC& dc,
1072 const wxArrayString& lines,
1073 long *width,
long *height )
const;
1081 void BeginBatch() { m_batchCount++; }
1084 int GetBatchCount() {
return m_batchCount; }
1086 virtual void Refresh(
bool eraseb =
true,
const wxRect* rect = NULL);
1095 void ForceRefresh();
1100 bool IsEditable()
const {
return m_editable; }
1101 void EnableEditing(
bool edit );
1103 void EnableCellEditControl(
bool enable =
true );
1104 void DisableCellEditControl() { EnableCellEditControl(
false); }
1105 bool CanEnableCellControl()
const;
1106 bool IsCellEditControlEnabled()
const;
1107 bool IsCellEditControlShown()
const;
1109 bool IsCurrentCellReadOnly()
const;
1111 void ShowCellEditControl();
1112 void HideCellEditControl();
1113 void SaveEditControlValue();
1121 wxGridCellCoords XYToCell(
int x,
int y)
const;
1122 void XYToCell(
int x,
int y, wxGridCellCoords& coords)
const
1123 { coords = XYToCell(x, y); }
1124 wxGridCellCoords XYToCell(
const wxPoint& pos)
const
1125 {
return XYToCell(pos.x, pos.y); }
1133 int YToRow(
int y,
bool clipToMinMax =
false )
const;
1134 int XToCol(
int x,
bool clipToMinMax =
false )
const;
1136 int YToEdgeOfRow(
int y )
const;
1137 int XToEdgeOfCol(
int x )
const;
1139 wxRect CellToRect(
int row,
int col )
const;
1140 wxRect CellToRect(
const wxGridCellCoords& coords )
const
1141 {
return CellToRect( coords.GetRow(), coords.GetCol() ); }
1143 int GetGridCursorRow()
const {
return m_currentCellCoords.GetRow(); }
1144 int GetGridCursorCol()
const {
return m_currentCellCoords.GetCol(); }
1149 bool IsVisible(
int row,
int col,
bool wholeCellVisible =
true )
const;
1150 bool IsVisible(
const wxGridCellCoords& coords,
bool wholeCellVisible =
true )
const
1151 {
return IsVisible( coords.GetRow(), coords.GetCol(), wholeCellVisible ); }
1152 void MakeCellVisible(
int row,
int col );
1153 void MakeCellVisible(
const wxGridCellCoords& coords )
1154 { MakeCellVisible( coords.GetRow(), coords.GetCol() ); }
1159 void SetGridCursor(
int row,
int col) { SetCurrentCell(row, col); }
1160 void SetGridCursor(
const wxGridCellCoords& c) { SetCurrentCell(c); }
1162 void GoToCell(
int row,
int col)
1164 if ( SetCurrentCell(row, col) )
1165 MakeCellVisible(row, col);
1168 void GoToCell(
const wxGridCellCoords& coords)
1170 if ( SetCurrentCell(coords) )
1171 MakeCellVisible(coords);
1174 bool MoveCursorUp(
bool expandSelection );
1175 bool MoveCursorDown(
bool expandSelection );
1176 bool MoveCursorLeft(
bool expandSelection );
1177 bool MoveCursorRight(
bool expandSelection );
1178 bool MovePageDown();
1180 bool MoveCursorUpBlock(
bool expandSelection );
1181 bool MoveCursorDownBlock(
bool expandSelection );
1182 bool MoveCursorLeftBlock(
bool expandSelection );
1183 bool MoveCursorRightBlock(
bool expandSelection );
1185 void SetTabBehaviour(TabBehaviour behaviour) { m_tabBehaviour = behaviour; }
1190 int GetDefaultRowLabelSize()
const {
return WXGRID_DEFAULT_ROW_LABEL_WIDTH; }
1191 int GetRowLabelSize()
const {
return m_rowLabelWidth; }
1192 int GetDefaultColLabelSize()
const {
return WXGRID_DEFAULT_COL_LABEL_HEIGHT; }
1193 int GetColLabelSize()
const {
return m_colLabelHeight; }
1194 wxColour GetLabelBackgroundColour()
const {
return m_labelBackgroundColour; }
1195 wxColour GetLabelTextColour()
const {
return m_labelTextColour; }
1196 wxFont GetLabelFont()
const {
return m_labelFont; }
1197 void GetRowLabelAlignment(
int *horiz,
int *vert )
const;
1198 void GetColLabelAlignment(
int *horiz,
int *vert )
const;
1199 int GetColLabelTextOrientation()
const;
1200 wxString GetRowLabelValue(
int row )
const;
1201 wxString GetColLabelValue(
int col )
const;
1203 wxColour GetCellHighlightColour()
const {
return m_cellHighlightColour; }
1204 int GetCellHighlightPenWidth()
const {
return m_cellHighlightPenWidth; }
1205 int GetCellHighlightROPenWidth()
const {
return m_cellHighlightROPenWidth; }
1208 void UseNativeColHeader(
bool native =
true);
1212 void SetUseNativeColLabels(
bool native =
true );
1214 void SetRowLabelSize(
int width );
1215 void SetColLabelSize(
int height );
1216 void HideRowLabels() { SetRowLabelSize( 0 ); }
1217 void HideColLabels() { SetColLabelSize( 0 ); }
1218 void SetLabelBackgroundColour(
const wxColour& );
1219 void SetLabelTextColour(
const wxColour& );
1220 void SetLabelFont(
const wxFont& );
1221 void SetRowLabelAlignment(
int horiz,
int vert );
1222 void SetColLabelAlignment(
int horiz,
int vert );
1223 void SetColLabelTextOrientation(
int textOrientation );
1224 void SetRowLabelValue(
int row,
const wxString& );
1225 void SetColLabelValue(
int col,
const wxString& );
1226 void SetCellHighlightColour(
const wxColour& );
1227 void SetCellHighlightPenWidth(
int width);
1228 void SetCellHighlightROPenWidth(
int width);
1236 void EnableDragRowSize(
bool enable =
true );
1237 void DisableDragRowSize() { EnableDragRowSize(
false ); }
1239 void EnableDragColSize(
bool enable =
true );
1240 void DisableDragColSize() { EnableDragColSize(
false ); }
1244 void DisableRowResize(
int row) { DoDisableLineResize(row, m_setFixedRows); }
1245 void DisableColResize(
int col) { DoDisableLineResize(col, m_setFixedCols); }
1250 bool CanDragRowSize(
int row)
const
1251 {
return m_canDragRowSize && DoCanResizeLine(row, m_setFixedRows); }
1252 bool CanDragColSize(
int col)
const
1253 {
return m_canDragColSize && DoCanResizeLine(col, m_setFixedCols); }
1256 void EnableDragColMove(
bool enable =
true );
1257 void DisableDragColMove() { EnableDragColMove(
false ); }
1258 bool CanDragColMove()
const {
return m_canDragColMove; }
1261 void EnableDragGridSize(
bool enable =
true);
1262 void DisableDragGridSize() { EnableDragGridSize(
false); }
1263 bool CanDragGridSize()
const {
return m_canDragGridSize; }
1266 void EnableDragCell(
bool enable =
true );
1267 void DisableDragCell() { EnableDragCell(
false ); }
1268 bool CanDragCell()
const {
return m_canDragCell; }
1275 void EnableGridLines(
bool enable =
true);
1276 bool GridLinesEnabled()
const {
return m_gridLinesEnabled; }
1279 void ClipHorzGridLines(
bool clip)
1280 { DoClipGridLines(m_gridLinesClipHorz, clip); }
1281 void ClipVertGridLines(
bool clip)
1282 { DoClipGridLines(m_gridLinesClipVert, clip); }
1283 bool AreHorzGridLinesClipped()
const {
return m_gridLinesClipHorz; }
1284 bool AreVertGridLinesClipped()
const {
return m_gridLinesClipVert; }
1287 void SetGridLineColour(
const wxColour& col);
1288 wxColour GetGridLineColour()
const {
return m_gridLineColour; }
1292 virtual wxPen GetDefaultGridLinePen();
1293 virtual wxPen GetRowGridLinePen(
int row);
1294 virtual wxPen GetColGridLinePen(
int col);
1301 void SetAttr(
int row,
int col, wxGridCellAttr *attr);
1302 void SetRowAttr(
int row, wxGridCellAttr *attr,
bool clear =
false);
1303 void SetColAttr(
int col, wxGridCellAttr *attr,
bool clear =
false);
1309 void RefreshAttr(
int row,
int col);
1315 wxGridCellAttr *GetOrCreateCellAttr(
int row,
int col)
const;
1321 void SetColFormatBool(
int col);
1322 void SetColFormatNumber(
int col);
1323 void SetColFormatFloat(
int col,
int width = -1,
int precision = -1);
1324 void SetColFormatCustom(
int col,
const wxString& typeName);
1328 int GetDefaultRowSize()
const;
1329 int GetRowSize(
int row )
const;
1330 bool IsRowShown(
int row)
const {
return GetRowSize(row) != 0; }
1331 int GetDefaultColSize()
const;
1332 int GetColSize(
int col )
const;
1333 bool IsColShown(
int col)
const {
return GetColSize(col) != 0; }
1334 wxColour GetDefaultCellBackgroundColour()
const;
1335 wxColour GetCellBackgroundColour(
int row,
int col )
const;
1336 wxColour GetDefaultCellTextColour()
const;
1337 wxColour GetCellTextColour(
int row,
int col )
const;
1338 wxFont GetDefaultCellFont()
const;
1339 wxFont GetCellFont(
int row,
int col )
const;
1340 void GetDefaultCellAlignment(
int *horiz,
int *vert )
const;
1341 void GetCellAlignment(
int row,
int col,
int *horiz,
int *vert )
const;
1342 bool GetDefaultCellOverflow()
const;
1343 bool GetCellOverflow(
int row,
int col )
const;
1355 CellSpan_Inside = -1,
1360 CellSpan GetCellSize(
int row,
int col,
int *num_rows,
int *num_cols )
const;
1362 wxSize GetCellSize(
const wxGridCellCoords& coords)
1365 GetCellSize(coords.GetRow(), coords.GetCol(), &s.x, &s.y);
1370 void SetDefaultRowSize(
int height,
bool resizeExistingRows =
false );
1371 void SetRowSize(
int row,
int height );
1372 void HideRow(
int row) { DoSetRowSize(row, 0); }
1373 void ShowRow(
int row) { DoSetRowSize(row, -1); }
1375 void SetDefaultColSize(
int width,
bool resizeExistingCols =
false );
1376 void SetColSize(
int col,
int width );
1377 void HideCol(
int col) { DoSetColSize(col, 0); }
1378 void ShowCol(
int col) { DoSetColSize(col, -1); }
1383 wxGridSizesInfo GetColSizes()
const
1384 {
return wxGridSizesInfo(GetDefaultColSize(), m_colWidths); }
1385 wxGridSizesInfo GetRowSizes()
const
1386 {
return wxGridSizesInfo(GetDefaultRowSize(), m_rowHeights); }
1388 void SetColSizes(
const wxGridSizesInfo& sizeInfo);
1389 void SetRowSizes(
const wxGridSizesInfo& sizeInfo);
1407 void SetColumnsOrder(
const wxArrayInt& order);
1410 int GetColAt(
int pos)
const
1412 return m_colAt.empty() ? pos : m_colAt[pos];
1417 void SetColPos(
int idx,
int pos);
1422 int GetColPos(
int idx)
const
1424 if ( m_colAt.IsEmpty() )
1427 for (
int i = 0; i < m_numCols; i++ )
1429 if ( m_colAt[i] == idx )
1433 wxFAIL_MSG(
"invalid column index" );
1445 void AutoSizeColumn(
int col,
bool setAsMin =
true )
1446 { AutoSizeColOrRow(col, setAsMin, wxGRID_COLUMN); }
1447 void AutoSizeRow(
int row,
bool setAsMin =
true )
1448 { AutoSizeColOrRow(row, setAsMin, wxGRID_ROW); }
1451 void AutoSizeColumns(
bool setAsMin =
true )
1452 { (void)SetOrCalcColumnSizes(
false, setAsMin); }
1454 void AutoSizeRows(
bool setAsMin =
true )
1455 { (void)SetOrCalcRowSizes(
false, setAsMin); }
1466 void AutoSizeRowLabelSize(
int row );
1469 void AutoSizeColLabelSize(
int col );
1474 void SetColMinimalWidth(
int col,
int width );
1475 void SetRowMinimalHeight(
int row,
int width );
1484 void SetColMinimalAcceptableWidth(
int width );
1485 void SetRowMinimalAcceptableHeight(
int width );
1486 int GetColMinimalAcceptableWidth()
const;
1487 int GetRowMinimalAcceptableHeight()
const;
1489 void SetDefaultCellBackgroundColour(
const wxColour& );
1490 void SetCellBackgroundColour(
int row,
int col,
const wxColour& );
1491 void SetDefaultCellTextColour(
const wxColour& );
1493 void SetCellTextColour(
int row,
int col,
const wxColour& );
1494 void SetDefaultCellFont(
const wxFont& );
1495 void SetCellFont(
int row,
int col,
const wxFont& );
1496 void SetDefaultCellAlignment(
int horiz,
int vert );
1497 void SetCellAlignment(
int row,
int col,
int horiz,
int vert );
1498 void SetDefaultCellOverflow(
bool allow );
1499 void SetCellOverflow(
int row,
int col,
bool allow );
1500 void SetCellSize(
int row,
int col,
int num_rows,
int num_cols );
1503 void SetDefaultRenderer(wxGridCellRenderer *renderer);
1504 void SetCellRenderer(
int row,
int col, wxGridCellRenderer *renderer);
1505 wxGridCellRenderer *GetDefaultRenderer()
const;
1506 wxGridCellRenderer* GetCellRenderer(
int row,
int col)
const;
1509 void SetDefaultEditor(wxGridCellEditor *editor);
1510 void SetCellEditor(
int row,
int col, wxGridCellEditor *editor);
1511 wxGridCellEditor *GetDefaultEditor()
const;
1512 wxGridCellEditor* GetCellEditor(
int row,
int col)
const;
1518 wxString GetCellValue(
int row,
int col )
const
1522 return m_table->GetValue( row, col );
1526 return wxEmptyString;
1530 wxString GetCellValue(
const wxGridCellCoords& coords )
const
1531 {
return GetCellValue( coords.GetRow(), coords.GetCol() ); }
1533 void SetCellValue(
int row,
int col,
const wxString& s );
1534 void SetCellValue(
const wxGridCellCoords& coords,
const wxString& s )
1535 { SetCellValue( coords.GetRow(), coords.GetCol(), s ); }
1538 bool IsReadOnly(
int row,
int col)
const;
1541 void SetReadOnly(
int row,
int col,
bool isReadOnly =
true);
1545 void SelectRow(
int row,
bool addToSelected =
false );
1546 void SelectCol(
int col,
bool addToSelected =
false );
1548 void SelectBlock(
int topRow,
int leftCol,
int bottomRow,
int rightCol,
1549 bool addToSelected =
false );
1551 void SelectBlock(
const wxGridCellCoords& topLeft,
1552 const wxGridCellCoords& bottomRight,
1553 bool addToSelected =
false )
1554 { SelectBlock( topLeft.GetRow(), topLeft.GetCol(),
1555 bottomRight.GetRow(), bottomRight.GetCol(),
1560 bool IsSelection()
const;
1564 void DeselectRow(
int row );
1565 void DeselectCol(
int col );
1566 void DeselectCell(
int row,
int col );
1568 void ClearSelection();
1570 bool IsInSelection(
int row,
int col )
const;
1572 bool IsInSelection(
const wxGridCellCoords& coords )
const
1573 {
return IsInSelection( coords.GetRow(), coords.GetCol() ); }
1575 wxGridCellCoordsArray GetSelectedCells()
const;
1576 wxGridCellCoordsArray GetSelectionBlockTopLeft()
const;
1577 wxGridCellCoordsArray GetSelectionBlockBottomRight()
const;
1578 wxArrayInt GetSelectedRows()
const;
1579 wxArrayInt GetSelectedCols()
const;
1585 wxRect BlockToDeviceRect(
const wxGridCellCoords & topLeft,
1586 const wxGridCellCoords & bottomRight )
const;
1589 wxColour GetSelectionBackground()
const
1590 {
return m_selectionBackground; }
1591 wxColour GetSelectionForeground()
const
1592 {
return m_selectionForeground; }
1594 void SetSelectionBackground(
const wxColour& c) { m_selectionBackground = c; }
1595 void SetSelectionForeground(
const wxColour& c) { m_selectionForeground = c; }
1599 void RegisterDataType(
const wxString& typeName,
1600 wxGridCellRenderer* renderer,
1601 wxGridCellEditor* editor);
1603 virtual wxGridCellEditor* GetDefaultEditorForCell(
int row,
int col)
const;
1604 wxGridCellEditor* GetDefaultEditorForCell(
const wxGridCellCoords& c)
const
1605 {
return GetDefaultEditorForCell(c.GetRow(), c.GetCol()); }
1606 virtual wxGridCellRenderer* GetDefaultRendererForCell(
int row,
int col)
const;
1607 virtual wxGridCellEditor* GetDefaultEditorForType(
const wxString& typeName)
const;
1608 virtual wxGridCellRenderer* GetDefaultRendererForType(
const wxString& typeName)
const;
1612 void SetMargins(
int extraWidth,
int extraHeight)
1614 m_extraWidth = extraWidth;
1615 m_extraHeight = extraHeight;
1621 wxWindow* GetGridWindow()
const {
return (wxWindow*)m_gridWin; }
1622 wxWindow* GetGridRowLabelWindow()
const {
return (wxWindow*)m_rowLabelWin; }
1623 wxWindow* GetGridColLabelWindow()
const {
return m_colWindow; }
1624 wxWindow* GetGridCornerLabelWindow()
const {
return (wxWindow*)m_cornerLabelWin; }
1627 wxHeaderCtrl *GetGridColHeader()
const
1629 wxASSERT_MSG( m_useNativeHeader,
"no column header window" );
1634 return reinterpret_cast<wxHeaderCtrl *
>(m_colWindow);
1638 void SetScrollLineX(
int x) { m_xScrollPixelsPerLine = x; }
1639 void SetScrollLineY(
int y) { m_yScrollPixelsPerLine = y; }
1640 int GetScrollLineX()
const {
return m_xScrollPixelsPerLine; }
1641 int GetScrollLineY()
const {
return m_yScrollPixelsPerLine; }
1644#if wxUSE_DRAG_AND_DROP
1645 virtual void SetDropTarget(wxDropTarget *dropTarget);
1657 int GetSortingColumn()
const {
return m_sortCol; }
1660 bool IsSortingBy(
int col)
const {
return GetSortingColumn() == col; }
1665 bool IsSortOrderAscending()
const {
return m_sortIsAscending; }
1669 void SetSortingColumn(
int col,
bool ascending =
true);
1672 void UnsetSortingColumn() { SetSortingColumn(wxNOT_FOUND); }
1674#if WXWIN_COMPATIBILITY_2_8
1684 wxGrid( wxWindow *parent,
1685 int x,
int y,
int w = wxDefaultCoord,
int h = wxDefaultCoord,
1686 long style = wxWANTS_CHARS,
1687 const wxString&
name = wxPanelNameStr )
1690 Create(parent, wxID_ANY, wxPoint(x, y), wxSize(w, h), style,
name);
1693 void SetCellValue(
const wxString& val,
int row,
int col )
1694 { SetCellValue( row, col, val ); }
1696 void UpdateDimensions()
1697 { CalcDimensions(); }
1699 int GetRows()
const {
return GetNumberRows(); }
1700 int GetCols()
const {
return GetNumberCols(); }
1701 int GetCursorRow()
const {
return GetGridCursorRow(); }
1702 int GetCursorColumn()
const {
return GetGridCursorCol(); }
1704 int GetScrollPosX()
const {
return 0; }
1705 int GetScrollPosY()
const {
return 0; }
1707 void SetScrollX(
int WXUNUSED(x) ) { }
1708 void SetScrollY(
int WXUNUSED(y) ) { }
1710 void SetColumnWidth(
int col,
int width )
1711 { SetColSize( col, width ); }
1713 int GetColumnWidth(
int col )
const
1714 {
return GetColSize( col ); }
1716 void SetRowHeight(
int row,
int height )
1717 { SetRowSize( row, height ); }
1721 int GetViewHeight() const
1724 int GetViewWidth() const
1727 void SetLabelSize(
int orientation,
int sz )
1729 if ( orientation == wxHORIZONTAL )
1730 SetColLabelSize( sz );
1732 SetRowLabelSize( sz );
1735 int GetLabelSize(
int orientation )
const
1737 if ( orientation == wxHORIZONTAL )
1738 return GetColLabelSize();
1740 return GetRowLabelSize();
1743 void SetLabelAlignment(
int orientation,
int align )
1745 if ( orientation == wxHORIZONTAL )
1746 SetColLabelAlignment( align, wxALIGN_INVALID );
1748 SetRowLabelAlignment( align, wxALIGN_INVALID );
1751 int GetLabelAlignment(
int orientation,
int WXUNUSED(align) )
const
1754 if ( orientation == wxHORIZONTAL )
1756 GetColLabelAlignment( &h, &v );
1761 GetRowLabelAlignment( &h, &v );
1766 void SetLabelValue(
int orientation,
const wxString& val,
int pos )
1768 if ( orientation == wxHORIZONTAL )
1769 SetColLabelValue( pos, val );
1771 SetRowLabelValue( pos, val );
1774 wxString GetLabelValue(
int orientation,
int pos)
const
1776 if ( orientation == wxHORIZONTAL )
1777 return GetColLabelValue( pos );
1779 return GetRowLabelValue( pos );
1782 wxFont GetCellTextFont()
const
1783 {
return m_defaultCellAttr->GetFont(); }
1785 wxFont GetCellTextFont(
int WXUNUSED(row),
int WXUNUSED(col))
const
1786 {
return m_defaultCellAttr->GetFont(); }
1788 void SetCellTextFont(
const wxFont& fnt)
1789 { SetDefaultCellFont( fnt ); }
1791 void SetCellTextFont(
const wxFont& fnt,
int row,
int col)
1792 { SetCellFont( row, col, fnt ); }
1794 void SetCellTextColour(
const wxColour& val,
int row,
int col)
1795 { SetCellTextColour( row, col, val ); }
1797 void SetCellTextColour(
const wxColour& col)
1798 { SetDefaultCellTextColour( col ); }
1800 void SetCellBackgroundColour(
const wxColour& col)
1801 { SetDefaultCellBackgroundColour( col ); }
1803 void SetCellBackgroundColour(
const wxColour& colour,
int row,
int col)
1804 { SetCellBackgroundColour( row, col, colour ); }
1806 bool GetEditable()
const {
return IsEditable(); }
1807 void SetEditable(
bool edit =
true ) { EnableEditing( edit ); }
1808 bool GetEditInPlace()
const {
return IsCellEditControlEnabled(); }
1810 void SetEditInPlace(
bool WXUNUSED(edit) =
true) { }
1812 void SetCellAlignment(
int align,
int row,
int col)
1813 { SetCellAlignment(row, col, align, wxALIGN_CENTER); }
1814 void SetCellAlignment(
int WXUNUSED(align) ) {}
1815 void SetCellBitmap(wxBitmap *WXUNUSED(bitmap),
int WXUNUSED(row),
int WXUNUSED(col))
1817 void SetDividerPen(
const wxPen& WXUNUSED(pen)) { }
1818 wxPen& GetDividerPen()
const;
1819 void OnActivate(
bool WXUNUSED(active)) {}
1826 enum { wxGRID_CELLCTRL = 2000,
1830 enum { wxGRID_TEXTCTRL = 2100,
1835 wxDEPRECATED_INLINE(
bool CanDragRowSize()
const,
return m_canDragRowSize; )
1836 wxDEPRECATED_INLINE(
bool CanDragColSize()
const,
return m_canDragColSize; )
1841 virtual bool Enable(
bool enable =
true);
1842 virtual wxWindow *GetMainWindowOfCompositeControl()
1843 {
return (wxWindow*)m_gridWin; }
1847 void CancelMouseCapture();
1850 virtual wxSize DoGetBestSize()
const;
1854 wxGridWindow *m_gridWin;
1855 wxGridCornerLabelWindow *m_cornerLabelWin;
1856 wxGridRowLabelWindow *m_rowLabelWin;
1861 wxWindow *m_colWindow;
1863 wxGridColLabelWindow *GetColLabelWindow()
const
1865 wxASSERT_MSG( !m_useNativeHeader,
"no column label window" );
1867 return reinterpret_cast<wxGridColLabelWindow *
>(m_colWindow);
1870 wxGridTableBase *m_table;
1876 wxGridCellCoords m_currentCellCoords;
1879 wxGridCellCoords m_selectedBlockTopLeft;
1880 wxGridCellCoords m_selectedBlockBottomRight;
1890 wxGridCellCoords m_selectedBlockCorner;
1892 wxGridSelection *m_selection;
1894 wxColour m_selectionBackground;
1895 wxColour m_selectionForeground;
1901 void InitRowHeights();
1903 int m_defaultRowHeight;
1904 int m_minAcceptableRowHeight;
1905 wxArrayInt m_rowHeights;
1906 wxArrayInt m_rowBottoms;
1909 void InitColWidths();
1911 int m_defaultColWidth;
1912 int m_minAcceptableColWidth;
1913 wxArrayInt m_colWidths;
1914 wxArrayInt m_colRights;
1917 bool m_sortIsAscending;
1919 bool m_useNativeHeader,
1920 m_nativeColumnLabels;
1923 int GetColWidth(
int col)
const;
1924 int GetColLeft(
int col)
const;
1925 int GetColRight(
int col)
const;
1929 int GetRowHeight(
int row)
const;
1932 int GetRowTop(
int row)
const;
1933 int GetRowBottom(
int row)
const;
1935 int m_rowLabelWidth;
1936 int m_colLabelHeight;
1942 wxColour m_labelBackgroundColour;
1943 wxColour m_labelTextColour;
1946 int m_rowLabelHorizAlign;
1947 int m_rowLabelVertAlign;
1948 int m_colLabelHorizAlign;
1949 int m_colLabelVertAlign;
1950 int m_colLabelTextOrientation;
1952 bool m_defaultRowLabelValues;
1953 bool m_defaultColLabelValues;
1955 wxColour m_gridLineColour;
1956 bool m_gridLinesEnabled;
1957 bool m_gridLinesClipHorz,
1958 m_gridLinesClipVert;
1959 wxColour m_cellHighlightColour;
1960 int m_cellHighlightPenWidth;
1961 int m_cellHighlightROPenWidth;
1965 int SetOrCalcColumnSizes(
bool calcOnly,
bool setAsMin =
true);
1966 int SetOrCalcRowSizes(
bool calcOnly,
bool setAsMin =
true);
1969 void AutoSizeColOrRow(
int n,
bool setAsMin, wxGridDirection direction);
1972 wxCoord CalcColOrRowLabelAreaMinSize(wxGridDirection direction);
1976 wxLongToLongHashMap m_colMinWidths,
1980 int GetColMinimalWidth(
int col)
const;
1981 int GetRowMinimalHeight(
int col)
const;
1984 bool CanHaveAttributes()
const;
1991 wxGridCellAttr *attr;
1995 void ClearAttrCache();
1998 void CacheAttr(
int row,
int col, wxGridCellAttr *attr)
const;
2001 bool LookupAttr(
int row,
int col, wxGridCellAttr **attr)
const;
2005 wxGridCellAttr *GetCellAttr(
int row,
int col)
const;
2006 wxGridCellAttr *GetCellAttr(
const wxGridCellCoords& coords )
const
2007 {
return GetCellAttr( coords.GetRow(), coords.GetCol() ); }
2010 wxGridCellAttr* m_defaultCellAttr;
2017 wxGridTypeRegistry* m_typeRegistry;
2021 WXGRID_CURSOR_SELECT_CELL,
2022 WXGRID_CURSOR_RESIZE_ROW,
2023 WXGRID_CURSOR_RESIZE_COL,
2024 WXGRID_CURSOR_SELECT_ROW,
2025 WXGRID_CURSOR_SELECT_COL,
2026 WXGRID_CURSOR_MOVE_COL
2035 void ChangeCursorMode(CursorMode mode,
2036 wxWindow *win = NULL,
2037 bool captureMouse =
true);
2039 wxWindow *m_winCapture;
2049 CursorMode m_cursorMode;
2055 bool m_canDragRowSize;
2056 bool m_canDragColSize;
2057 bool m_canDragColMove;
2058 bool m_canDragGridSize;
2077 wxPoint m_startDragPos;
2079 bool m_waitForSlowClick;
2081 wxGridCellCoords m_selectionStart;
2083 wxCursor m_rowResizeCursor;
2084 wxCursor m_colResizeCursor;
2087 bool m_cellEditCtrlEnabled;
2089 TabBehaviour m_tabBehaviour;
2093 void CreateColumnWindow();
2094 void CalcDimensions();
2095 void CalcWindowSizes();
2096 bool Redimension( wxGridTableMessage& );
2101 int SendEvent(
const wxEventType evtType,
2103 const wxMouseEvent& e);
2104 int SendEvent(
const wxEventType evtType,
2105 const wxGridCellCoords& coords,
2106 const wxMouseEvent& e)
2107 {
return SendEvent(evtType, coords.GetRow(), coords.GetCol(), e); }
2108 int SendEvent(
const wxEventType evtType,
2110 const wxString& s = wxString());
2111 int SendEvent(
const wxEventType evtType,
2112 const wxGridCellCoords& coords,
2113 const wxString& s = wxString())
2114 {
return SendEvent(evtType, coords.GetRow(), coords.GetCol(), s); }
2115 int SendEvent(
const wxEventType evtType,
const wxString& s = wxString())
2116 {
return SendEvent(evtType, m_currentCellCoords, s); }
2120 bool SendGridSizeEvent(wxEventType type,
2122 const wxMouseEvent& mouseEv);
2124 void OnPaint( wxPaintEvent& );
2125 void OnSize( wxSizeEvent& );
2126 void OnKeyDown( wxKeyEvent& );
2127 void OnKeyUp( wxKeyEvent& );
2128 void OnChar( wxKeyEvent& );
2129 void OnEraseBackground( wxEraseEvent& );
2130 void OnHideEditor( wxCommandEvent& );
2133 bool SetCurrentCell(
const wxGridCellCoords& coords );
2134 bool SetCurrentCell(
int row,
int col )
2135 {
return SetCurrentCell( wxGridCellCoords(row, col) ); }
2140 void UpdateBlockBeingSelected(
int topRow,
int leftCol,
2141 int bottomRow,
int rightCol);
2143 void UpdateBlockBeingSelected(
const wxGridCellCoords& topLeft,
2144 const wxGridCellCoords& bottomRight)
2145 { UpdateBlockBeingSelected(topLeft.GetRow(), topLeft.GetCol(),
2146 bottomRight.GetRow(), bottomRight.GetCol()); }
2150 bool GetModelValues();
2151 bool SetModelValues();
2153 friend class WXDLLIMPEXP_FWD_ADV wxGridSelection;
2154 friend class wxGridRowOperations;
2155 friend class wxGridColumnOperations;
2158 friend class wxGridCornerLabelWindow;
2159 friend class wxGridColLabelWindow;
2160 friend class wxGridRowLabelWindow;
2161 friend class wxGridWindow;
2162 friend class wxGridHeaderRenderer;
2164 friend class wxGridHeaderCtrl;
2169 virtual wxSize GetSizeAvailableForScrollTarget(
const wxSize& size);
2172 void RedrawGridLines();
2176 void DrawRangeGridLines(wxDC& dc,
const wxRegion& reg,
2177 const wxGridCellCoords& topLeft,
2178 const wxGridCellCoords& bottomRight);
2184 void DoDrawGridLines(wxDC& dc,
2186 int bottom,
int right,
2187 int topRow,
int leftCol,
2188 int bottomRight,
int rightCol);
2191 void DoClipGridLines(
bool& var,
bool clip);
2198 void UpdateColumnSortingIndicator(
int col);
2202 void RefreshAfterColPosChange();
2210 int XToPos(
int x)
const;
2217 bool DoGridCellDrag(wxMouseEvent& event,
2218 const wxGridCellCoords& coords,
2222 void DoGridLineDrag(wxMouseEvent& event,
const wxGridOperations& oper);
2225 void DoGridDragEvent(wxMouseEvent& event,
const wxGridCellCoords& coords);
2228 void DoGridCellLeftDown(wxMouseEvent& event,
2229 const wxGridCellCoords& coords,
2230 const wxPoint& pos);
2231 void DoGridCellLeftDClick(wxMouseEvent& event,
2232 const wxGridCellCoords& coords,
2233 const wxPoint& pos);
2234 void DoGridCellLeftUp(wxMouseEvent& event,
const wxGridCellCoords& coords);
2237 void DoGridMouseMoveEvent(wxMouseEvent& event,
2238 const wxGridCellCoords& coords,
2239 const wxPoint& pos);
2242 void ProcessGridCellMouseEvent(wxMouseEvent& event);
2245 void ProcessRowLabelMouseEvent(wxMouseEvent& event);
2246 void ProcessColLabelMouseEvent(wxMouseEvent& event);
2247 void ProcessCornerLabelMouseEvent(wxMouseEvent& event);
2249 void DoColHeaderClick(
int col);
2251 void DoStartResizeCol(
int col);
2252 void DoUpdateResizeCol(
int x);
2253 void DoUpdateResizeColWidth(
int w);
2254 void DoStartMoveCol(
int col);
2256 void DoEndDragResizeRow(
const wxMouseEvent& event);
2257 void DoEndDragResizeCol(
const wxMouseEvent& event);
2258 void DoEndMoveCol(
int pos);
2261 void DoGridProcessTab(wxKeyboardState& kbdState);
2264 void DeselectLine(
int line,
const wxGridOperations& oper);
2265 bool DoEndDragResizeLine(
const wxGridOperations& oper);
2266 int PosToLinePos(
int pos,
bool clipToMinMax,
2267 const wxGridOperations& oper)
const;
2268 int PosToLine(
int pos,
bool clipToMinMax,
2269 const wxGridOperations& oper)
const;
2270 int PosToEdgeOfLine(
int pos,
const wxGridOperations& oper)
const;
2272 bool DoMoveCursor(
bool expandSelection,
2273 const wxGridDirectionOperations& diroper);
2274 bool DoMoveCursorByPage(
const wxGridDirectionOperations& diroper);
2275 bool DoMoveCursorByBlock(
bool expandSelection,
2276 const wxGridDirectionOperations& diroper);
2277 void AdvanceToNextNonEmpty(wxGridCellCoords& coords,
2278 const wxGridDirectionOperations& diroper);
2281 bool DoModifyLines(
bool (wxGridTableBase::*funcModify)(
size_t,
size_t),
2282 int pos,
int num,
bool updateLabels);
2284 bool DoAppendLines(
bool (wxGridTableBase::*funcAppend)(
size_t),
2285 int num,
bool updateLabels);
2288 void DoSetSizes(
const wxGridSizesInfo& sizeInfo,
2289 const wxGridOperations& oper);
2292 void DoDisableLineResize(
int line, wxGridFixedIndicesSet *& setFixed);
2293 bool DoCanResizeLine(
int line,
const wxGridFixedIndicesSet *setFixed)
const;
2296 void GetRenderSizes(
const wxGridCellCoords& topLeft,
2297 const wxGridCellCoords& bottomRight,
2298 wxPoint& pointOffSet, wxSize& sizeGrid,
2299 wxGridCellCoordsArray& renderCells,
2300 wxArrayInt& arrayCols, wxArrayInt& arrayRows );
2303 void SetRenderScale( wxDC& dc,
const wxPoint& pos,
const wxSize& size,
2304 const wxSize& sizeGrid );
2307 wxPoint GetRenderPosition( wxDC& dc,
const wxPoint& position );
2310 void DoRenderBox( wxDC& dc,
const int& style,
2311 const wxPoint& pointOffSet,
2312 const wxSize& sizeCellArea,
2313 const wxGridCellCoords& topLeft,
2314 const wxGridCellCoords& bottomRight );
2322 void DoSetRowSize(
int row,
int height );
2323 void DoSetColSize(
int col,
int width );
2329 wxGridFixedIndicesSet *m_setFixedRows,
2332 DECLARE_DYNAMIC_CLASS( wxGrid )
2333 DECLARE_EVENT_TABLE()
2334 wxDECLARE_NO_COPY_CLASS(wxGrid);
2341class WXDLLIMPEXP_ADV wxGridUpdateLocker
2345 wxGridUpdateLocker(wxGrid *grid = NULL)
2352 void Create(wxGrid *grid)
2354 wxASSERT_MSG( !m_grid, wxT(
"shouldn't be called more than once") );
2359 ~wxGridUpdateLocker()
2366 void Init(wxGrid *grid)
2370 m_grid->BeginBatch();
2375 wxDECLARE_NO_COPY_CLASS(wxGridUpdateLocker);
2382class WXDLLIMPEXP_ADV wxGridEvent :
public wxNotifyEvent,
2383 public wxKeyboardState
2389 Init(-1, -1, -1, -1,
false);
2395 int row = -1,
int col = -1,
2396 int x = -1,
int y = -1,
2398 const wxKeyboardState& kbd = wxKeyboardState())
2399 : wxNotifyEvent(type, id),
2400 wxKeyboardState(kbd)
2402 Init(row, col, x, y, sel);
2403 SetEventObject(obj);
2408 wxDEPRECATED_CONSTRUCTOR(
2416 bool shift =
false,
bool alt =
false,
bool meta =
false));
2418 virtual int GetRow() {
return m_row; }
2419 virtual int GetCol() {
return m_col; }
2420 wxPoint GetPosition() {
return wxPoint( m_x, m_y ); }
2421 bool Selecting() {
return m_selecting; }
2423 virtual wxEvent *Clone()
const {
return new wxGridEvent(*
this); }
2433 void Init(
int row,
int col,
int x,
int y,
bool sel)
2442 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridEvent)
2445class WXDLLIMPEXP_ADV wxGridSizeEvent :
public wxNotifyEvent,
2446 public wxKeyboardState
2455 wxGridSizeEvent(
int id,
2459 int x = -1,
int y = -1,
2460 const wxKeyboardState& kbd = wxKeyboardState())
2461 : wxNotifyEvent(type, id),
2462 wxKeyboardState(kbd)
2464 Init(rowOrCol, x, y);
2466 SetEventObject(obj);
2469 wxDEPRECATED_CONSTRUCTOR(
2470 wxGridSizeEvent(
int id,
2478 bool meta =
false) );
2480 int GetRowOrCol() {
return m_rowOrCol; }
2481 wxPoint GetPosition() {
return wxPoint( m_x, m_y ); }
2483 virtual wxEvent *Clone()
const {
return new wxGridSizeEvent(*
this); }
2491 void Init(
int rowOrCol,
int x,
int y)
2493 m_rowOrCol = rowOrCol;
2498 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridSizeEvent)
2502class WXDLLIMPEXP_ADV wxGridRangeSelectEvent :
public wxNotifyEvent,
2503 public wxKeyboardState
2506 wxGridRangeSelectEvent()
2509 Init(wxGridNoCellCoords, wxGridNoCellCoords,
false);
2512 wxGridRangeSelectEvent(
int id,
2515 const wxGridCellCoords& topLeft,
2516 const wxGridCellCoords& bottomRight,
2518 const wxKeyboardState& kbd = wxKeyboardState())
2519 : wxNotifyEvent(type, id),
2520 wxKeyboardState(kbd)
2522 Init(topLeft, bottomRight, sel);
2524 SetEventObject(obj);
2527 wxDEPRECATED_CONSTRUCTOR(
2528 wxGridRangeSelectEvent(
int id,
2531 const wxGridCellCoords& topLeft,
2532 const wxGridCellCoords& bottomRight,
2537 bool meta =
false) );
2539 wxGridCellCoords GetTopLeftCoords() {
return m_topLeft; }
2540 wxGridCellCoords GetBottomRightCoords() {
return m_bottomRight; }
2541 int GetTopRow() {
return m_topLeft.GetRow(); }
2542 int GetBottomRow() {
return m_bottomRight.GetRow(); }
2543 int GetLeftCol() {
return m_topLeft.GetCol(); }
2544 int GetRightCol() {
return m_bottomRight.GetCol(); }
2545 bool Selecting() {
return m_selecting; }
2547 virtual wxEvent *Clone()
const {
return new wxGridRangeSelectEvent(*
this); }
2550 void Init(
const wxGridCellCoords& topLeft,
2551 const wxGridCellCoords& bottomRight,
2554 m_topLeft = topLeft;
2555 m_bottomRight = bottomRight;
2556 m_selecting = selecting;
2559 wxGridCellCoords m_topLeft;
2560 wxGridCellCoords m_bottomRight;
2563 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridRangeSelectEvent)
2567class WXDLLIMPEXP_ADV wxGridEditorCreatedEvent :
public wxCommandEvent
2570 wxGridEditorCreatedEvent()
2578 wxGridEditorCreatedEvent(
int id, wxEventType type, wxObject* obj,
2579 int row,
int col, wxControl* ctrl);
2581 int GetRow() {
return m_row; }
2582 int GetCol() {
return m_col; }
2583 wxControl* GetControl() {
return m_ctrl; }
2584 void SetRow(
int row) { m_row = row; }
2585 void SetCol(
int col) { m_col = col; }
2586 void SetControl(wxControl* ctrl) { m_ctrl = ctrl; }
2588 virtual wxEvent *Clone()
const {
return new wxGridEditorCreatedEvent(*
this); }
2595 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridEditorCreatedEvent)
2599wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEvent );
2600wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEvent );
2601wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEvent );
2602wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_DCLICK, wxGridEvent );
2603wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEvent );
2604wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEvent );
2605wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEvent );
2606wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_DCLICK, wxGridEvent );
2607wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_ROW_SIZE, wxGridSizeEvent );
2608wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SIZE, wxGridSizeEvent );
2609wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_AUTO_SIZE, wxGridSizeEvent );
2610wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEvent );
2611wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGING, wxGridEvent );
2612wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGED, wxGridEvent );
2613wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_SELECT_CELL, wxGridEvent );
2614wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_SHOWN, wxGridEvent );
2615wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_HIDDEN, wxGridEvent );
2616wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_CREATED, wxGridEditorCreatedEvent );
2617wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_BEGIN_DRAG, wxGridEvent );
2618wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_MOVE, wxGridEvent );
2619wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SORT, wxGridEvent );
2620wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_TABBING, wxGridEvent );
2622typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
2623typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&);
2624typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&);
2625typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&);
2627#define wxGridEventHandler(func) \
2628 wxEVENT_HANDLER_CAST(wxGridEventFunction, func)
2630#define wxGridSizeEventHandler(func) \
2631 wxEVENT_HANDLER_CAST(wxGridSizeEventFunction, func)
2633#define wxGridRangeSelectEventHandler(func) \
2634 wxEVENT_HANDLER_CAST(wxGridRangeSelectEventFunction, func)
2636#define wxGridEditorCreatedEventHandler(func) \
2637 wxEVENT_HANDLER_CAST(wxGridEditorCreatedEventFunction, func)
2639#define wx__DECLARE_GRIDEVT(evt, id, fn) \
2640 wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEventHandler(fn))
2642#define wx__DECLARE_GRIDSIZEEVT(evt, id, fn) \
2643 wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridSizeEventHandler(fn))
2645#define wx__DECLARE_GRIDRANGESELEVT(evt, id, fn) \
2646 wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridRangeSelectEventHandler(fn))
2648#define wx__DECLARE_GRIDEDITOREVT(evt, id, fn) \
2649 wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEditorCreatedEventHandler(fn))
2651#define EVT_GRID_CMD_CELL_LEFT_CLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_LEFT_CLICK, id, fn)
2652#define EVT_GRID_CMD_CELL_RIGHT_CLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_RIGHT_CLICK, id, fn)
2653#define EVT_GRID_CMD_CELL_LEFT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_LEFT_DCLICK, id, fn)
2654#define EVT_GRID_CMD_CELL_RIGHT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_RIGHT_DCLICK, id, fn)
2655#define EVT_GRID_CMD_LABEL_LEFT_CLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_LEFT_CLICK, id, fn)
2656#define EVT_GRID_CMD_LABEL_RIGHT_CLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_RIGHT_CLICK, id, fn)
2657#define EVT_GRID_CMD_LABEL_LEFT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_LEFT_DCLICK, id, fn)
2658#define EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_RIGHT_DCLICK, id, fn)
2659#define EVT_GRID_CMD_ROW_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(ROW_SIZE, id, fn)
2660#define EVT_GRID_CMD_COL_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(COL_SIZE, id, fn)
2661#define EVT_GRID_CMD_COL_AUTO_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(COL_AUTO_SIZE, id, fn)
2662#define EVT_GRID_CMD_COL_MOVE(id, fn) wx__DECLARE_GRIDEVT(COL_MOVE, id, fn)
2663#define EVT_GRID_CMD_COL_SORT(id, fn) wx__DECLARE_GRIDEVT(COL_SORT, id, fn)
2664#define EVT_GRID_CMD_RANGE_SELECT(id, fn) wx__DECLARE_GRIDRANGESELEVT(RANGE_SELECT, id, fn)
2665#define EVT_GRID_CMD_CELL_CHANGING(id, fn) wx__DECLARE_GRIDEVT(CELL_CHANGING, id, fn)
2666#define EVT_GRID_CMD_CELL_CHANGED(id, fn) wx__DECLARE_GRIDEVT(CELL_CHANGED, id, fn)
2667#define EVT_GRID_CMD_SELECT_CELL(id, fn) wx__DECLARE_GRIDEVT(SELECT_CELL, id, fn)
2668#define EVT_GRID_CMD_EDITOR_SHOWN(id, fn) wx__DECLARE_GRIDEVT(EDITOR_SHOWN, id, fn)
2669#define EVT_GRID_CMD_EDITOR_HIDDEN(id, fn) wx__DECLARE_GRIDEVT(EDITOR_HIDDEN, id, fn)
2670#define EVT_GRID_CMD_EDITOR_CREATED(id, fn) wx__DECLARE_GRIDEDITOREVT(EDITOR_CREATED, id, fn)
2671#define EVT_GRID_CMD_CELL_BEGIN_DRAG(id, fn) wx__DECLARE_GRIDEVT(CELL_BEGIN_DRAG, id, fn)
2672#define EVT_GRID_CMD_TABBING(id, fn) wx__DECLARE_GRIDEVT(TABBING, id, fn)
2676#define EVT_GRID_CELL_LEFT_CLICK(fn) EVT_GRID_CMD_CELL_LEFT_CLICK(wxID_ANY, fn)
2677#define EVT_GRID_CELL_RIGHT_CLICK(fn) EVT_GRID_CMD_CELL_RIGHT_CLICK(wxID_ANY, fn)
2678#define EVT_GRID_CELL_LEFT_DCLICK(fn) EVT_GRID_CMD_CELL_LEFT_DCLICK(wxID_ANY, fn)
2679#define EVT_GRID_CELL_RIGHT_DCLICK(fn) EVT_GRID_CMD_CELL_RIGHT_DCLICK(wxID_ANY, fn)
2680#define EVT_GRID_LABEL_LEFT_CLICK(fn) EVT_GRID_CMD_LABEL_LEFT_CLICK(wxID_ANY, fn)
2681#define EVT_GRID_LABEL_RIGHT_CLICK(fn) EVT_GRID_CMD_LABEL_RIGHT_CLICK(wxID_ANY, fn)
2682#define EVT_GRID_LABEL_LEFT_DCLICK(fn) EVT_GRID_CMD_LABEL_LEFT_DCLICK(wxID_ANY, fn)
2683#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) EVT_GRID_CMD_LABEL_RIGHT_DCLICK(wxID_ANY, fn)
2684#define EVT_GRID_ROW_SIZE(fn) EVT_GRID_CMD_ROW_SIZE(wxID_ANY, fn)
2685#define EVT_GRID_COL_SIZE(fn) EVT_GRID_CMD_COL_SIZE(wxID_ANY, fn)
2686#define EVT_GRID_COL_AUTO_SIZE(fn) EVT_GRID_CMD_COL_AUTO_SIZE(wxID_ANY, fn)
2687#define EVT_GRID_COL_MOVE(fn) EVT_GRID_CMD_COL_MOVE(wxID_ANY, fn)
2688#define EVT_GRID_COL_SORT(fn) EVT_GRID_CMD_COL_SORT(wxID_ANY, fn)
2689#define EVT_GRID_RANGE_SELECT(fn) EVT_GRID_CMD_RANGE_SELECT(wxID_ANY, fn)
2690#define EVT_GRID_CELL_CHANGING(fn) EVT_GRID_CMD_CELL_CHANGING(wxID_ANY, fn)
2691#define EVT_GRID_CELL_CHANGED(fn) EVT_GRID_CMD_CELL_CHANGED(wxID_ANY, fn)
2692#define EVT_GRID_SELECT_CELL(fn) EVT_GRID_CMD_SELECT_CELL(wxID_ANY, fn)
2693#define EVT_GRID_EDITOR_SHOWN(fn) EVT_GRID_CMD_EDITOR_SHOWN(wxID_ANY, fn)
2694#define EVT_GRID_EDITOR_HIDDEN(fn) EVT_GRID_CMD_EDITOR_HIDDEN(wxID_ANY, fn)
2695#define EVT_GRID_EDITOR_CREATED(fn) EVT_GRID_CMD_EDITOR_CREATED(wxID_ANY, fn)
2696#define EVT_GRID_CELL_BEGIN_DRAG(fn) EVT_GRID_CMD_CELL_BEGIN_DRAG(wxID_ANY, fn)
2697#define EVT_GRID_TABBING(fn) EVT_GRID_CMD_TABBING(wxID_ANY, fn)
2703#if WXWIN_COMPATIBILITY_2_8
2704 #define wxEVT_GRID_CELL_CHANGE wxEVT_GRID_CELL_CHANGED
2706 #define EVT_GRID_CMD_CELL_CHANGE EVT_GRID_CMD_CELL_CHANGED
2707 #define EVT_GRID_CELL_CHANGE EVT_GRID_CELL_CHANGED
2712extern const int wxEVT_GRID_CREATE_CELL;
2713extern const int wxEVT_GRID_CHANGE_LABELS;
2714extern const int wxEVT_GRID_CHANGE_SEL_LABEL;
2716#define EVT_GRID_CREATE_CELL(fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CREATE_CELL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
2717#define EVT_GRID_CHANGE_LABELS(fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_LABELS, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
2718#define EVT_GRID_CHANGE_SEL_LABEL(fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_SEL_LABEL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
CONSTCD11 bool operator==(const day &x, const day &y) NOEXCEPT
CONSTCD11 bool operator!=(const day &x, const day &y) NOEXCEPT