]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/grid.h
corrected control inheritance
[wxWidgets.git] / include / wx / generic / grid.h
index 02c593a38a202c65369bfd9cb1b7351305f3f799..f599587f6cbe8065d0a01499c03a38cf29a1fc94 100644 (file)
@@ -12,7 +12,7 @@
 #include "wx/defs.h"
 
 #if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID)
-#include "gridg.h"
+#include "wx/generic/gridg.h"
 #else
 
 #ifndef __WXGRID_H__
@@ -649,7 +649,7 @@ private:
         Unset = -1,
         ReadWrite,
         ReadOnly
-    }; 
+    };
 
     // the common part of all ctors
     void Init()
@@ -1027,10 +1027,10 @@ public:
 
     // ------ display update functions
     //
-    void CalcRowLabelsExposed( const wxRegion& reg );
+    wxArrayInt CalcRowLabelsExposed( const wxRegion& reg );
 
-    void CalcColLabelsExposed( const wxRegion& reg );
-    void CalcCellsExposed( const wxRegion& reg );
+    wxArrayInt CalcColLabelsExposed( const wxRegion& reg );
+    wxGridCellCoordsArray CalcCellsExposed( const wxRegion& reg );
 
 
     // ------ event handlers
@@ -1057,21 +1057,21 @@ public:
     bool AppendCols( int numCols = 1, bool updateLabels=TRUE );
     bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=TRUE );
 
-    void DrawGridCellArea( wxDC& dc );
+    void DrawGridCellArea( wxDC& dc , const wxGridCellCoordsArray& cells );
     void DrawGridSpace( wxDC& dc );
     void DrawCellBorder( wxDC& dc, const wxGridCellCoords& );
     void DrawAllGridLines( wxDC& dc, const wxRegion & reg );
     void DrawCell( wxDC& dc, const wxGridCellCoords& );
-    void DrawHighlight(wxDC& dc);
+    void DrawHighlight(wxDC& dc, const wxGridCellCoordsArray& cells);
 
     // this function is called when the current cell highlight must be redrawn
     // and may be overridden by the user
     virtual void DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr );
 
-    void DrawRowLabels( wxDC& dc );
+    void DrawRowLabels( wxDC& dc, const wxArrayInt& rows );
     void DrawRowLabel( wxDC& dc, int row );
 
-    void DrawColLabels( wxDC& dc );
+    void DrawColLabels( wxDC& dc, const wxArrayInt& cols );
     void DrawColLabel( wxDC& dc, int col );
 
 
@@ -1081,13 +1081,18 @@ public:
                             int horizontalAlignment = wxALIGN_LEFT,
                             int verticalAlignment = wxALIGN_TOP );
 
+    void DrawTextRectangle( wxDC& dc, const wxArrayString& lines, const wxRect&,
+                            int horizontalAlignment = wxALIGN_LEFT,
+                            int verticalAlignment = wxALIGN_TOP );
+
+
     // 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,
+                         const wxArrayString& lines,
                          long *width, long *height );
 
 
@@ -1704,12 +1709,6 @@ protected:
     wxGridCellAttr*     m_defaultCellAttr;
 
 
-    wxGridCellCoordsArray  m_cellsExposed;
-    wxArrayInt             m_rowsExposed;
-    wxArrayInt             m_colsExposed;
-    wxArrayInt             m_rowLabelsExposed;
-    wxArrayInt             m_colLabelsExposed;
-
     bool m_inOnKeyDown;
     int  m_batchCount;
 
@@ -1921,6 +1920,36 @@ protected:
     DECLARE_DYNAMIC_CLASS(wxGridRangeSelectEvent)
 };
 
+
+class WXDLLEXPORT wxGridEditorCreatedEvent : public wxCommandEvent {
+public:
+    wxGridEditorCreatedEvent()
+        : wxCommandEvent()
+        {
+            m_row  = 0;
+            m_col  = 0;
+            m_ctrl = NULL;
+        }
+
+    wxGridEditorCreatedEvent(int id, wxEventType type, wxObject* obj,
+                             int row, int col, wxControl* ctrl);
+
+    int GetRow()                        { return m_row; }
+    int GetCol()                        { return m_col; }
+    wxControl* GetControl()             { return m_ctrl; }
+    void SetRow(int row)                { m_row = row; }
+    void SetCol(int col)                { m_col = col; }
+    void SetControl(wxControl* ctrl)    { m_ctrl = ctrl; }
+
+private:
+    int m_row;
+    int m_col;
+    wxControl* m_ctrl;
+
+    DECLARE_DYNAMIC_CLASS(wxGridEditorCreatedEvent)
+};
+
+
 BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_CLICK, 1580)
     DECLARE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_CLICK, 1581)
@@ -1937,12 +1966,14 @@ BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EVENT_TYPE(wxEVT_GRID_SELECT_CELL, 1592)
     DECLARE_EVENT_TYPE(wxEVT_GRID_EDITOR_SHOWN, 1593)
     DECLARE_EVENT_TYPE(wxEVT_GRID_EDITOR_HIDDEN, 1594)
+    DECLARE_EVENT_TYPE(wxEVT_GRID_EDITOR_CREATED, 1595)
 END_DECLARE_EVENT_TYPES()
 
 
 typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
 typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&);
 typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&);
+typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&);
 
 #define EVT_GRID_CELL_LEFT_CLICK(fn)     DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK,    -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ),
 #define EVT_GRID_CELL_RIGHT_CLICK(fn)    DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK,   -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ),
@@ -1959,6 +1990,7 @@ typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEv
 #define EVT_GRID_SELECT_CELL(fn)         DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL,        -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ),
 #define EVT_GRID_EDITOR_SHOWN(fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN,       -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ),
 #define EVT_GRID_EDITOR_HIDDEN(fn)       DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN,      -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL ),
+#define EVT_GRID_EDITOR_CREATED(fn)      DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED,     -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEditorCreatedEventFunction) &fn, NULL ),
 
 
 #if 0  // TODO: implement these ?  others ?