X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/27f35b6674b796e61986681261ec7a96bef93502..4c2300c6a19594abf56832579ce3d8dba09d3834:/include/wx/generic/grid.h diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 85417f5bbc..7962a189dc 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -302,6 +302,9 @@ public: wxControl* GetControl() { return m_control; } void SetControl(wxControl* control) { m_control = control; } + wxGridCellAttr* GetCellAttr() { return m_attr; } + void SetCellAttr(wxGridCellAttr* attr) { m_attr = attr; } + // Creates the actual edit control virtual void Create(wxWindow* parent, wxWindowID id, @@ -357,6 +360,10 @@ public: // create a new object which is the copy of this one virtual wxGridCellEditor *Clone() const = 0; + // DJC MAPTEK + // added GetValue so we can get the value which is in the control + virtual wxString GetValue() const = 0; + protected: // the dtor is private because only DecRef() can delete us virtual ~wxGridCellEditor(); @@ -364,6 +371,9 @@ protected: // the control we show on screen wxControl* m_control; + // a temporary pointer to the attribute being edited + wxGridCellAttr* m_attr; + // if we change the colours/font of the control from the default ones, we // must restore the default later and we save them here between calls to // Show(TRUE) and Show(FALSE) @@ -374,6 +384,8 @@ protected: // suppress the stupid gcc warning about the class having private dtor and // no friends friend class wxGridCellEditorDummyFriend; + + DECLARE_NO_COPY_CLASS(wxGridCellEditor) }; #if wxUSE_TEXTCTRL @@ -405,6 +417,9 @@ public: virtual wxGridCellEditor *Clone() const { return new wxGridCellTextEditor; } + // DJC MAPTEK + // added GetValue so we can get the value which is in the control + virtual wxString GetValue() const; protected: wxTextCtrl *Text() const { return (wxTextCtrl *)m_control; } @@ -441,6 +456,9 @@ public: virtual wxGridCellEditor *Clone() const { return new wxGridCellNumberEditor(m_min, m_max); } + // DJC MAPTEK + // added GetValue so we can get the value which is in the control + virtual wxString GetValue() const; protected: wxSpinCtrl *Spin() const { return (wxSpinCtrl *)m_control; } @@ -516,6 +534,9 @@ public: virtual wxGridCellEditor *Clone() const { return new wxGridCellBoolEditor; } + // DJC MAPTEK + // added GetValue so we can get the value which is in the control + virtual wxString GetValue() const; protected: wxCheckBox *CBox() const { return (wxCheckBox *)m_control; } @@ -552,11 +573,16 @@ public: virtual void SetParameters(const wxString& params); virtual wxGridCellEditor *Clone() const; + // DJC MAPTEK + // added GetValue so we can get the value which is in the control + virtual wxString GetValue() const; protected: wxComboBox *Combo() const { return (wxComboBox *)m_control; } -private: +// DJC - (MAPTEK) you at least need access to m_choices if you +// wish to override this class +protected: wxString m_startValue; wxArrayString m_choices; bool m_allowOthers; @@ -744,6 +770,8 @@ private: void InitData(); wxGridCellAttrProviderData *m_data; + + DECLARE_NO_COPY_CLASS(wxGridCellAttrProvider) }; ////////////////////////////////////////////////////////////////////// @@ -832,6 +860,7 @@ private: wxGridCellAttrProvider *m_attrProvider; DECLARE_ABSTRACT_CLASS( wxGridTableBase ); + DECLARE_NO_COPY_CLASS(wxGridTableBase) }; @@ -875,6 +904,8 @@ private: int m_id; int m_comInt1; int m_comInt2; + + DECLARE_NO_COPY_CLASS(wxGridTableMessage) }; @@ -1029,6 +1060,7 @@ public: wxGrid::wxGridSelectCells ); void SetSelectionMode(wxGrid::wxGridSelectionModes selmode); + wxGrid::wxGridSelectionModes GetSelectionMode() const; // ------ grid dimensions // @@ -1117,7 +1149,8 @@ public: int GetBatchCount() { return m_batchCount; } - virtual void Refresh(bool eraseb=true, wxRect* rect= NULL); + virtual void Refresh(bool eraseb = TRUE, + const wxRect* rect = (const wxRect *) NULL); // Use this, rather than wxWindow::Refresh(), to force an // immediate repainting of the grid. Has no effect if you are @@ -1131,7 +1164,7 @@ public: // ------ edit control functions // - bool IsEditable() { return m_editable; } + bool IsEditable() const { return m_editable; } void EnableEditing( bool edit ); void EnableCellEditControl( bool enable = TRUE ); @@ -1355,7 +1388,7 @@ public: // make the cell editable/readonly void SetReadOnly(int row, int col, bool isReadOnly = TRUE); - // ------ selections of blocks of cells + // ------ select blocks of cells // void SelectRow( int row, bool addToSelected = FALSE ); void SelectCol( int col, bool addToSelected = FALSE ); @@ -1374,7 +1407,7 @@ public: bool IsSelection(); - // ------ deselection + // ------ deselect blocks or cells // void DeselectRow( int row ); void DeselectCol( int col ); @@ -1382,11 +1415,16 @@ public: void ClearSelection(); - bool IsInSelection( int row, int col ); + bool IsInSelection( int row, int col ) const; - bool IsInSelection( const wxGridCellCoords& coords ) + bool IsInSelection( const wxGridCellCoords& coords ) const { return IsInSelection( coords.GetRow(), coords.GetCol() ); } + wxGridCellCoordsArray GetSelectedCells() const; + wxGridCellCoordsArray GetSelectionBlockTopLeft() const; + wxGridCellCoordsArray GetSelectionBlockBottomRight() const; + wxArrayInt GetSelectedRows() const; + wxArrayInt GetSelectedCols() const; // This function returns the rectangle that encloses the block of cells // limited by TopLeft and BottomRight cell in device coords and clipped @@ -1409,12 +1447,13 @@ public: void RegisterDataType(const wxString& typeName, wxGridCellRenderer* renderer, wxGridCellEditor* editor); - wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const; + // DJC MAPTEK + virtual wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const; wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c) const { return GetDefaultEditorForCell(c.GetRow(), c.GetCol()); } - wxGridCellRenderer* GetDefaultRendererForCell(int row, int col) const; - wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName) const; - wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const; + virtual wxGridCellRenderer* GetDefaultRendererForCell(int row, int col) const; + virtual wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName) const; + virtual wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const; // grid may occupy more space than needed for its rows/columns, this // function allows to set how big this extra space is @@ -1817,10 +1856,11 @@ protected: bool GetModelValues(); bool SetModelValues(); - friend class wxGridSelection; + friend class WXDLLEXPORT wxGridSelection; DECLARE_DYNAMIC_CLASS( wxGrid ) DECLARE_EVENT_TABLE() + DECLARE_NO_COPY_CLASS(wxGrid) }; // ---------------------------------------------------------------------------- @@ -1969,6 +2009,7 @@ private: wxControl* m_ctrl; DECLARE_DYNAMIC_CLASS(wxGridEditorCreatedEvent) + DECLARE_NO_COPY_CLASS(wxGridEditorCreatedEvent) };