]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/headerctrl.h
refresh the grid after resetting the columns positions to the default order
[wxWidgets.git] / include / wx / msw / headerctrl.h
CommitLineData
56873923
VZ
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
14class WXDLLIMPEXP_FWD_CORE wxImageList;
15
16// ----------------------------------------------------------------------------
17// wxHeaderCtrl
18// ----------------------------------------------------------------------------
19
20class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
21{
22public:
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
f24f6579 49
56873923
VZ
50private:
51 // implement base class pure virtuals
e2bfe673 52 virtual void DoSetCount(unsigned int count);
56873923 53 virtual unsigned int DoGetCount() const;
e2bfe673
VZ
54 virtual void DoUpdate(unsigned int idx);
55
d8fc3398 56 virtual void DoScrollHorz(int dx);
56873923 57
702f5349
VZ
58 virtual void DoSetColumnsOrder(const wxArrayInt& order);
59 virtual wxArrayInt DoGetColumnsOrder() const;
60
56873923
VZ
61 // override wxWindow methods which must be implemented by a new control
62 virtual wxSize DoGetBestSize() const;
38cd07c4
VZ
63 virtual void DoSetSize(int x, int y,
64 int width, int height,
65 int sizeFlags = wxSIZE_AUTO);
56873923
VZ
66
67 // override MSW-specific methods needed for new control
68 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
fa3d4aaf 69 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
56873923
VZ
70
71 // common part of all ctors
72 void Init();
73
fe8e8fb8 74 // wrapper around Header_InsertItem(): insert the item by using information
702f5349
VZ
75 // from GetColumn(idx) and at the given display position if order != -1
76 void DoInsertItem(unsigned int idx, int order);
e2bfe673 77
aef252d9
VZ
78 // get the event type corresponding to a click or double click event
79 // (depending on dblclk value) with the specified (using MSW convention)
80 // mouse button
81 wxEventType GetClickEventType(bool dblclk, int button);
fa3d4aaf 82
e2bfe673 83
56873923
VZ
84 // the image list: initially NULL, created on demand
85 wxImageList *m_imageList;
86
38cd07c4
VZ
87 // the offset of the window used to emulate scrolling it
88 int m_scrollOffset;
89
56873923
VZ
90 DECLARE_NO_COPY_CLASS(wxHeaderCtrl)
91};
92
93#endif // _WX_MSW_HEADERCTRL_H_
94