]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/headerctrl.h
8a2c388417665bcbaf04ea7fc063d21a50d87dbb
[wxWidgets.git] / include / wx / msw / headerctrl.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/headerctrl.h
3 // Purpose: wxMSW native wxHeaderCtrl
4 // Author: Vadim Zeitlin
5 // Created: 2008-12-01
6 // RCS-ID: $Id$
7 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_MSW_HEADERCTRL_H_
12 #define _WX_MSW_HEADERCTRL_H_
13
14 class WXDLLIMPEXP_FWD_CORE wxImageList;
15
16 // ----------------------------------------------------------------------------
17 // wxHeaderCtrl
18 // ----------------------------------------------------------------------------
19
20 class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
21 {
22 public:
23 wxHeaderCtrl()
24 {
25 Init();
26 }
27
28 wxHeaderCtrl(wxWindow *parent,
29 wxWindowID id = wxID_ANY,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = wxHD_DEFAULT_STYLE,
33 const wxString& name = wxHeaderCtrlNameStr)
34 {
35 Init();
36
37 Create(parent, id, pos, size, style, name);
38 }
39
40 bool Create(wxWindow *parent,
41 wxWindowID id = wxID_ANY,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 long style = wxHD_DEFAULT_STYLE,
45 const wxString& name = wxHeaderCtrlNameStr);
46
47 virtual ~wxHeaderCtrl();
48
49
50 // this method is only overridden in order to synchronize the control with
51 // the main window when it is scrolled
52 virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
53
54 private:
55 // implement base class pure virtuals
56 virtual unsigned int DoGetCount() const;
57 virtual void DoInsert(const wxHeaderColumn& col, unsigned int idx);
58 virtual void DoDelete(unsigned int idx);
59 virtual void DoShowColumn(unsigned int idx, bool show);
60 virtual void DoShowSortIndicator(unsigned int idx, int sortOrder);
61
62 // override wxWindow methods which must be implemented by a new control
63 virtual wxSize DoGetBestSize() const;
64
65 // override MSW-specific methods needed for new control
66 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
67
68 // common part of all ctors
69 void Init();
70
71 // the image list: initially NULL, created on demand
72 wxImageList *m_imageList;
73
74 DECLARE_NO_COPY_CLASS(wxHeaderCtrl)
75 };
76
77 #endif // _WX_MSW_HEADERCTRL_H_
78