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