+ // called on column addition/removal
+ virtual void UpdateDisplay() { /* by default, do nothing */ }
+
+ // returns the n-th column
+ virtual wxDataViewColumn *GetColumn(unsigned int n)
+ {
+ wxASSERT(m_owner);
+ wxDataViewColumn *ret = m_owner->GetColumn(n);
+ wxASSERT(ret);
+
+ return ret;
+ }
+
+protected:
+ wxDataViewCtrl *m_owner;
+
+ // sends an event generated from the n-th wxDataViewColumn
+ void SendEvent(wxEventType type, unsigned int n);
+};
+
+// on wxMSW the header window (only that part however) can be made native!
+#if defined(__WXMSW__) && USE_NATIVE_HEADER_WINDOW
+
+#define COLUMN_WIDTH_OFFSET 2
+#define wxDataViewHeaderWindowMSW wxDataViewHeaderWindow
+
+class wxDataViewHeaderWindowMSW : public wxDataViewHeaderWindowBase
+{
+public:
+
+ wxDataViewHeaderWindowMSW( wxDataViewCtrl *parent,
+ wxWindowID id,
+ const wxPoint &pos = wxDefaultPosition,
+ const wxSize &size = wxDefaultSize,
+ const wxString &name = wxT("wxdataviewctrlheaderwindow") )
+ {
+ Create(parent, id, pos, size, name);
+ }
+
+ bool Create(wxDataViewCtrl *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size,
+ const wxString &name);
+
+ ~wxDataViewHeaderWindowMSW();
+
+ // called when any column setting is changed and/or changed
+ // the column count
+ virtual void UpdateDisplay();
+
+ // called when the main window gets scrolled
+ virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
+
+protected:
+ virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
+ virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
+
+ unsigned int GetColumnIdxFromHeader(NMHEADER *nmHDR);
+
+ wxDataViewColumn *GetColumnFromHeader(NMHEADER *nmHDR)
+ { return GetColumn(GetColumnIdxFromHeader(nmHDR)); }
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxDataViewHeaderWindowMSW)
+};
+
+#else // !defined(__WXMSW__)
+
+#define HEADER_WINDOW_HEIGHT 25
+#define HEADER_HORIZ_BORDER 5
+#define HEADER_VERT_BORDER 3
+#define wxGenericDataViewHeaderWindow wxDataViewHeaderWindow
+
+class wxGenericDataViewHeaderWindow : public wxDataViewHeaderWindowBase
+{
+public:
+ wxGenericDataViewHeaderWindow( wxDataViewCtrl *parent,
+ wxWindowID id,
+ const wxPoint &pos = wxDefaultPosition,
+ const wxSize &size = wxDefaultSize,
+ const wxString &name = wxT("wxdataviewctrlheaderwindow") )
+ {
+ Init();
+ Create(parent, id, pos, size, name);
+ }
+
+ bool Create(wxDataViewCtrl *parent, wxWindowID id,
+ const wxPoint &pos, const wxSize &size,
+ const wxString &name);
+
+ ~wxGenericDataViewHeaderWindow()
+ {
+ delete m_resizeCursor;
+ }
+
+ virtual void UpdateDisplay() { Refresh(); }
+
+ // event handlers:
+