]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/msw/statusbar.h | |
3 | // Purpose: native implementation of wxStatusBar | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 04.04.98 | |
7 | // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> | |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_MSW_STATUSBAR_H_ | |
12 | #define _WX_MSW_STATUSBAR_H_ | |
13 | ||
14 | #if wxUSE_NATIVE_STATUSBAR | |
15 | ||
16 | #include "wx/vector.h" | |
17 | #include "wx/tooltip.h" | |
18 | ||
19 | class WXDLLIMPEXP_FWD_CORE wxClientDC; | |
20 | ||
21 | class WXDLLIMPEXP_CORE wxStatusBar : public wxStatusBarBase | |
22 | { | |
23 | public: | |
24 | // ctors and such | |
25 | wxStatusBar(); | |
26 | wxStatusBar(wxWindow *parent, | |
27 | wxWindowID id = wxID_ANY, | |
28 | long style = wxSTB_DEFAULT_STYLE, | |
29 | const wxString& name = wxStatusBarNameStr) | |
30 | { | |
31 | m_pDC = NULL; | |
32 | (void)Create(parent, id, style, name); | |
33 | } | |
34 | ||
35 | bool Create(wxWindow *parent, | |
36 | wxWindowID id = wxID_ANY, | |
37 | long style = wxSTB_DEFAULT_STYLE, | |
38 | const wxString& name = wxStatusBarNameStr); | |
39 | ||
40 | virtual ~wxStatusBar(); | |
41 | ||
42 | // implement base class methods | |
43 | virtual void SetFieldsCount(int number = 1, const int *widths = NULL); | |
44 | virtual void SetStatusWidths(int n, const int widths_field[]); | |
45 | virtual void SetStatusStyles(int n, const int styles[]); | |
46 | virtual void SetMinHeight(int height); | |
47 | virtual bool GetFieldRect(int i, wxRect& rect) const; | |
48 | ||
49 | virtual int GetBorderX() const; | |
50 | virtual int GetBorderY() const; | |
51 | ||
52 | // override some wxWindow virtual methods too | |
53 | virtual bool SetFont(const wxFont& font); | |
54 | ||
55 | virtual WXLRESULT MSWWindowProc(WXUINT nMsg, | |
56 | WXWPARAM wParam, | |
57 | WXLPARAM lParam); | |
58 | ||
59 | protected: | |
60 | // implement base class pure virtual method | |
61 | virtual void DoUpdateStatusText(int number); | |
62 | ||
63 | // override some base class virtuals | |
64 | virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; | |
65 | virtual wxSize DoGetBestSize() const; | |
66 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
67 | #if wxUSE_TOOLTIPS | |
68 | virtual bool MSWProcessMessage(WXMSG* pMsg); | |
69 | virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result); | |
70 | #endif | |
71 | ||
72 | // implementation of the public SetStatusWidths() | |
73 | void MSWUpdateFieldsWidths(); | |
74 | ||
75 | // used by DoUpdateStatusText() | |
76 | wxClientDC *m_pDC; | |
77 | ||
78 | #if wxUSE_TOOLTIPS | |
79 | // the tooltips used when wxSTB_SHOW_TIPS is given | |
80 | wxVector<wxToolTip*> m_tooltips; | |
81 | #endif | |
82 | ||
83 | private: | |
84 | struct MSWBorders | |
85 | { | |
86 | int horz, | |
87 | vert, | |
88 | between; | |
89 | }; | |
90 | ||
91 | // retrieve all status bar borders using SB_GETBORDERS | |
92 | MSWBorders MSWGetBorders() const; | |
93 | ||
94 | // return the size of the border between the fields | |
95 | int MSWGetBorderWidth() const; | |
96 | ||
97 | struct MSWMetrics | |
98 | { | |
99 | int gripWidth, | |
100 | textMargin; | |
101 | }; | |
102 | ||
103 | // return the various status bar metrics | |
104 | static const MSWMetrics& MSWGetMetrics(); | |
105 | ||
106 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBar) | |
107 | }; | |
108 | ||
109 | #endif // wxUSE_NATIVE_STATUSBAR | |
110 | ||
111 | #endif // _WX_MSW_STATUSBAR_H_ |