]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/grid.h
compilation fix for raw bitmaps (can't include wx/rawbmp.h from wx/bitmap.h as the...
[wxWidgets.git] / include / wx / generic / grid.h
index 4e1fe217ea4d4911a61d9010bca8255a394c87fb..22096fc6e1c9aab8948837c25868336de2ca3903 100644 (file)
@@ -79,7 +79,9 @@ class WXDLLIMPEXP_ADV wxGridSelection;
 class WXDLLEXPORT wxCheckBox;
 class WXDLLEXPORT wxComboBox;
 class WXDLLEXPORT wxTextCtrl;
+#if wxUSE_SPINCTRL
 class WXDLLEXPORT wxSpinCtrl;
+#endif
 
 // ----------------------------------------------------------------------------
 // macros
@@ -460,10 +462,19 @@ public:
     virtual wxString GetValue() const;
 
 protected:
+#if wxUSE_SPINCTRL
     wxSpinCtrl *Spin() const { return (wxSpinCtrl *)m_control; }
+#endif
 
     // if HasRange(), we use wxSpinCtrl - otherwise wxTextCtrl
-    bool HasRange() const { return m_min != m_max; }
+    bool HasRange() const
+    {
+#if wxUSE_SPINCTRL
+        return m_min != m_max;
+#else
+        return false;
+#endif
+    }
 
     // string representation of m_valueOld
     wxString GetString() const
@@ -881,7 +892,7 @@ private:
     wxGrid * m_view;
     wxGridCellAttrProvider *m_attrProvider;
 
-    DECLARE_ABSTRACT_CLASS( wxGridTableBase );
+    DECLARE_ABSTRACT_CLASS(wxGridTableBase)
     DECLARE_NO_COPY_CLASS(wxGridTableBase)
 };
 
@@ -1139,11 +1150,11 @@ public:
     // and may be overridden by the user
     virtual void DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr );
 
-    void DrawRowLabels( wxDC& dc, const wxArrayInt& rows );
-    void DrawRowLabel( wxDC& dc, int row );
+    virtual void DrawRowLabels( wxDC& dc, const wxArrayInt& rows );
+    virtual void DrawRowLabel( wxDC& dc, int row );
 
-    void DrawColLabels( wxDC& dc, const wxArrayInt& cols );
-    void DrawColLabel( wxDC& dc, int col );
+    virtual void DrawColLabels( wxDC& dc, const wxArrayInt& cols );
+    virtual void DrawColLabel( wxDC& dc, int col );
 
 
     // ------ Cell text drawing functions
@@ -1310,6 +1321,13 @@ public:
     void     SetRowAttr(int row, wxGridCellAttr *attr);
     void     SetColAttr(int col, wxGridCellAttr *attr);
 
+    // returns the attribute we may modify in place: a new one if this cell
+    // doesn't have any yet or the existing one if it does
+    //
+    // DecRef() must be called on the returned pointer, as usual
+    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+
+    
     // shortcuts for setting the column parameters
 
     // set the format for the data in the column: default is string
@@ -1525,6 +1543,26 @@ public:
     wxWindow* GetGridColLabelWindow()    { return (wxWindow*)m_colLabelWin; }
     wxWindow* GetGridCornerLabelWindow() { return (wxWindow*)m_cornerLabelWin; }
 
+    // Allow adjustment of scroll increment. The default is (15, 15).
+    void SetScrollLineX(int x) { m_scrollLineX = x; }
+    void SetScrollLineY(int y) { m_scrollLineY = y; }
+    int GetScrollLineX() const { return m_scrollLineX; }
+    int GetScrollLineY() const { return m_scrollLineY; }
+
+    // Implementation
+    int GetScrollX(int x) const
+    {
+        return (x + GetScrollLineX() - 1) / GetScrollLineX();
+    }
+
+    int GetScrollY(int y) const
+    {
+        return (y + GetScrollLineY() - 1) / GetScrollLineY();
+    }
+
+
+    // override some base class functions
+    virtual bool Enable(bool enable = true);
 
 
     // ------ For compatibility with previous wxGrid only...
@@ -1794,12 +1832,6 @@ protected:
     // do we have some place to store attributes in?
     bool CanHaveAttributes();
 
-    // returns the attribute we may modify in place: a new one if this cell
-    // doesn't have any yet or the existing one if it does
-    //
-    // DecRef() must be called on the returned pointer, as usual
-    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
-
     // cell attribute cache (currently we only cache 1, may be will do
     // more/better later)
     struct CachedAttr
@@ -1874,6 +1906,8 @@ protected:
     bool       m_editable;              // applies to whole grid
     bool       m_cellEditCtrlEnabled;   // is in-place edit currently shown?
 
+    int m_scrollLineX; // X scroll increment
+    int m_scrollLineY; // Y scroll increment
 
     void Create();
     void Init();