+// ----------------------------------------------------------------------------
+// array classes instantiation
+// ----------------------------------------------------------------------------
+
+struct wxGridCellWithAttr
+{
+ wxGridCellWithAttr(int row, int col, const wxGridCellAttr *pAttr)
+ : coords(row, col), attr(*pAttr)
+ {
+ }
+
+ wxGridCellCoords coords;
+ wxGridCellAttr attr;
+};
+
+WX_DECLARE_OBJARRAY(wxGridCellWithAttr, wxGridCellWithAttrArray);
+
+#include "wx/arrimpl.cpp"
+
+WX_DEFINE_OBJARRAY(wxGridCellCoordsArray)
+WX_DEFINE_OBJARRAY(wxGridCellWithAttrArray)
+
+// ----------------------------------------------------------------------------
+// private classes
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxGridRowLabelWindow : public wxWindow
+{
+public:
+ wxGridRowLabelWindow() { m_owner = (wxGrid *)NULL; }
+ wxGridRowLabelWindow( wxGrid *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size );
+
+private:
+ wxGrid *m_owner;
+
+ void OnPaint( wxPaintEvent& event );
+ void OnMouseEvent( wxMouseEvent& event );
+ void OnKeyDown( wxKeyEvent& event );
+
+ DECLARE_DYNAMIC_CLASS(wxGridRowLabelWindow)
+ DECLARE_EVENT_TABLE()
+};
+
+
+class WXDLLEXPORT wxGridColLabelWindow : public wxWindow
+{
+public:
+ wxGridColLabelWindow() { m_owner = (wxGrid *)NULL; }
+ wxGridColLabelWindow( wxGrid *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size );
+
+private:
+ wxGrid *m_owner;
+
+ void OnPaint( wxPaintEvent &event );
+ void OnMouseEvent( wxMouseEvent& event );
+ void OnKeyDown( wxKeyEvent& event );
+
+ DECLARE_DYNAMIC_CLASS(wxGridColLabelWindow)
+ DECLARE_EVENT_TABLE()
+};
+
+
+class WXDLLEXPORT wxGridCornerLabelWindow : public wxWindow
+{
+public:
+ wxGridCornerLabelWindow() { m_owner = (wxGrid *)NULL; }
+ wxGridCornerLabelWindow( wxGrid *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size );
+
+private:
+ wxGrid *m_owner;
+
+ void OnMouseEvent( wxMouseEvent& event );
+ void OnKeyDown( wxKeyEvent& event );
+ void OnPaint( wxPaintEvent& event );
+
+ DECLARE_DYNAMIC_CLASS(wxGridCornerLabelWindow)
+ DECLARE_EVENT_TABLE()
+};
+
+class WXDLLEXPORT wxGridWindow : public wxPanel
+{
+public:
+ wxGridWindow()
+ {
+ m_owner = (wxGrid *)NULL;
+ m_rowLabelWin = (wxGridRowLabelWindow *)NULL;
+ m_colLabelWin = (wxGridColLabelWindow *)NULL;
+ }
+
+ wxGridWindow( wxGrid *parent,
+ wxGridRowLabelWindow *rowLblWin,
+ wxGridColLabelWindow *colLblWin,
+ wxWindowID id, const wxPoint &pos, const wxSize &size );
+ ~wxGridWindow();
+
+ void ScrollWindow( int dx, int dy, const wxRect *rect );
+
+private:
+ wxGrid *m_owner;
+ wxGridRowLabelWindow *m_rowLabelWin;
+ wxGridColLabelWindow *m_colLabelWin;
+
+ void OnPaint( wxPaintEvent &event );
+ void OnMouseEvent( wxMouseEvent& event );
+ void OnKeyDown( wxKeyEvent& );
+
+ DECLARE_DYNAMIC_CLASS(wxGridWindow)
+ DECLARE_EVENT_TABLE()
+};
+
+// the internal data representation used by wxGridCellAttrProvider
+//
+// TODO make it more efficient
+class WXDLLEXPORT wxGridCellAttrProviderData
+{
+public:
+ void SetAttr(const wxGridCellAttr *attr, int row, int col);
+ wxGridCellAttr *GetAttr(int row, int col) const;
+
+private:
+ // searches for the attr for given cell, returns wxNOT_FOUND if not found
+ int FindIndex(int row, int col) const;
+
+ wxGridCellWithAttrArray m_attrs;
+};
+
+// ----------------------------------------------------------------------------
+// conditional compilation
+// ----------------------------------------------------------------------------
+
+#ifndef WXGRID_DRAW_LINES
+#define WXGRID_DRAW_LINES 1
+#endif