-
-
- // ------ label drawing functions
- //
- void DrawLabelAreas( wxDC& dc );
- void DrawColLabelBorders( wxDC& dc );
- void DrawColLabels( wxDC& dc );
- void DrawColLabel( wxDC& dc, const wxRect&, int col );
- void DrawRowLabelBorders( wxDC& dc );
- void DrawRowLabels( wxDC& dc );
- void DrawRowLabel( wxDC& dc, const wxRect&, int col );
-
-
- // ------ cell drawing functions
- //
- void DrawCellArea( wxDC& dc );
- void DrawGridLines( wxDC& dc );
- void DrawCells( wxDC& dc );
- void DrawCellBackground( wxDC& dc, const wxRect&, int row, int col );
- void DrawCellValue( wxDC& dc, const wxRect&, int row, int col );
-
- // this one is useful when you just need to draw one or a few
- // cells
- void DrawCell( int row, int col );
- void DrawCell( const wxGridCellCoords& coords )
- { DrawCell( coords.GetRow(), coords.GetCol() ); }
-
- void DrawCellHighlight( wxDC& dc, int row, int col );
- void DrawCellHighlight( wxDC& dc, wxGridCellCoords& coords )
- { DrawCellHighlight( dc, coords.GetRow(), coords.GetCol() ); }
- void ShowCurrentCellHighlight( wxDC& dc );
- void HideCurrentCellHighlight( wxDC& dc );
-
-
- // ------ generic drawing functions
- //
- void DrawTextRectangle( wxDC& dc, const wxString&, const wxRect&,
- int horizontalAlignment = wxLEFT,
- int verticalAlignment = wxTOP );
-
- // Split a string containing newline chararcters into an array of
- // strings and return the number of lines
- //
- void StringToLines( const wxString& value, wxArrayString& lines );
-
- void GetTextBoxSize( wxDC& dc,
- wxArrayString& lines,
- long *width, long *height );
-
-
- // ------ functions to get/send data (see also public functions)
- //
- bool GetModelValues();
- bool SetModelValues();
-
-
- ////////////////////// Public section ////////////////////
-
- public:
- wxGrid()
- { Create(); }
-
- wxGrid( wxWindow *parent,
- wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr )
- : wxPanel( parent, id, pos, size, style, name )
- {
- Create();
- }
-
- ~wxGrid();
-
- bool CreateGrid( int numRows = WXGRID_DEFAULT_NUMBER_ROWS,
- int numCols = WXGRID_DEFAULT_NUMBER_COLS );
-
- wxGridTableBase * GetTable() const { return m_table; }
- void SetTable( wxGridTableBase *table ) { m_table = table; }
-
- void ClearGrid();
- bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=TRUE );
- bool AppendRows( int numRows = 1, bool updateLabels=TRUE );
- bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=TRUE );
- bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=TRUE );
- bool AppendCols( int numCols = 1, bool updateLabels=TRUE );
- bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=TRUE );
-
- // ------ editing and edit controls
- //
- bool IsEditable() { return m_editable; }
- void EnableEditing( bool edit );
-
- void EnableTopEditControl( bool enable );
- bool IsTopEditControlEnabled()
- { return (m_topEditCtrl && m_topEditCtrlEnabled); }
- void EnableCellEditControl( bool enable );
- bool IsCellEditControlEnabled()
- { return (m_cellEditCtrl && m_cellEditCtrlEnabled); }
- void SetEditControlValue( const wxString& s = wxEmptyString );
-
-
- // ------ grid dimensions
- //
- int GetNumberRows() { return m_numRows; }
- int GetNumberCols() { return m_numCols; }
- int GetNumberVisibleRows() { return m_wholeRowsVisible; }
- int GetNumberVisibleCols() { return m_wholeColsVisible; }