+protected:
+ bool m_created;
+ bool m_displayed;
+
+ wxGridWindow *m_gridWin;
+ wxGridRowLabelWindow *m_rowLabelWin;
+ wxGridColLabelWindow *m_colLabelWin;
+ wxGridCornerLabelWindow *m_cornerLabelWin;
+
+ wxGridTableBase *m_table;
+
+ int m_left;
+ int m_top;
+ int m_right;
+ int m_bottom;
+
+ int m_numRows;
+ int m_numCols;
+
+ wxGridCellCoords m_currentCellCoords;
+
+ wxGridCellCoords m_selectedTopLeft;
+ wxGridCellCoords m_selectedBottomRight;
+
+ int m_defaultRowHeight;
+ wxArrayInt m_rowHeights;
+ wxArrayInt m_rowBottoms;
+
+ int m_defaultColWidth;
+ wxArrayInt m_colWidths;
+ wxArrayInt m_colRights;
+
+ int m_rowLabelWidth;
+ int m_colLabelHeight;
+
+ wxColour m_labelBackgroundColour;
+ wxColour m_labelTextColour;
+ wxFont m_labelFont;
+
+ int m_rowLabelHorizAlign;
+ int m_rowLabelVertAlign;
+ int m_colLabelHorizAlign;
+ int m_colLabelVertAlign;
+
+ bool m_defaultRowLabelValues;
+ bool m_defaultColLabelValues;
+
+ wxColour m_gridLineColour;
+ bool m_gridLinesEnabled;
+
+ // default cell attributes
+ wxFont m_defaultCellFont;
+ int m_defaultCellHAlign,
+ m_defaultCellVAlign;
+
+ // do we have some place to store attributes in?
+ bool CanHaveAttributes();
+
+ wxGridCellCoordsArray m_cellsExposed;
+ wxArrayInt m_rowsExposed;
+ wxArrayInt m_colsExposed;
+ wxArrayInt m_rowLabelsExposed;
+ wxArrayInt m_colLabelsExposed;
+
+ bool m_inOnKeyDown;
+ int m_batchCount;
+
+ int m_cursorMode;
+ enum { WXGRID_CURSOR_SELECT_CELL,
+ WXGRID_CURSOR_RESIZE_ROW,
+ WXGRID_CURSOR_RESIZE_COL,
+ WXGRID_CURSOR_SELECT_ROW,
+ WXGRID_CURSOR_SELECT_COL
+ };
+
+ int m_dragLastPos;
+ int m_dragRowOrCol;
+ bool m_isDragging;
+
+ wxGridCellCoords m_selectionStart;
+
+ wxCursor m_rowResizeCursor;
+ wxCursor m_colResizeCursor;
+
+ bool m_editable; // applies to whole grid
+ int m_editCtrlType; // for current cell
+ wxWindow* m_cellEditCtrl;
+ bool m_cellEditCtrlEnabled;
+
+
+ void Create();
+ void Init();
+ void CalcDimensions();
+ void CalcWindowSizes();
+ bool Redimension( wxGridTableMessage& );
+
+
+ bool SendEvent( const wxEventType,
+ int row, int col,
+ wxMouseEvent& );
+
+ bool SendEvent( const wxEventType,
+ int row, int col );
+
+
+ void OnPaint( wxPaintEvent& );
+ void OnSize( wxSizeEvent& );
+ void OnKeyDown( wxKeyEvent& );
+
+
+ void SetCurrentCell( const wxGridCellCoords& coords );
+ void SetCurrentCell( int row, int col )
+ { SetCurrentCell( wxGridCellCoords(row, col) ); }
+
+
+ // ------ functions to get/send data (see also public functions)
+ //
+ bool GetModelValues();
+ bool SetModelValues();
+
+
+ DECLARE_DYNAMIC_CLASS( wxGrid )