]>
Commit | Line | Data |
---|---|---|
71e03035 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/univ/statusbr.h | |
3 | // Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 14.10.01 | |
71e03035 | 7 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) |
65571936 | 8 | // Licence: wxWindows licence |
71e03035 VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_UNIV_STATUSBR_H_ | |
12 | #define _WX_UNIV_STATUSBR_H_ | |
13 | ||
fe9fea7e | 14 | #include "wx/univ/inpcons.h" |
b5435dcc | 15 | #include "wx/arrstr.h" |
fe9fea7e | 16 | |
71e03035 | 17 | // ---------------------------------------------------------------------------- |
7b6fefbe | 18 | // wxStatusBarUniv: a window near the bottom of the frame used for status info |
71e03035 VZ |
19 | // ---------------------------------------------------------------------------- |
20 | ||
4ed7b577 | 21 | class WXDLLIMPEXP_CORE wxStatusBarUniv : public wxStatusBarBase |
71e03035 VZ |
22 | { |
23 | public: | |
24 | wxStatusBarUniv() { Init(); } | |
25 | ||
26 | wxStatusBarUniv(wxWindow *parent, | |
a290fa5a | 27 | wxWindowID id = wxID_ANY, |
c4c178c1 | 28 | long style = wxSTB_DEFAULT_STYLE, |
71e03035 VZ |
29 | const wxString& name = wxPanelNameStr) |
30 | { | |
31 | Init(); | |
32 | ||
33 | (void)Create(parent, id, style, name); | |
34 | } | |
35 | ||
36 | bool Create(wxWindow *parent, | |
a290fa5a | 37 | wxWindowID id = wxID_ANY, |
c4c178c1 | 38 | long style = wxSTB_DEFAULT_STYLE, |
71e03035 VZ |
39 | const wxString& name = wxPanelNameStr); |
40 | ||
6cf68971 | 41 | // implement base class methods |
71e03035 VZ |
42 | virtual void SetFieldsCount(int number = 1, const int *widths = NULL); |
43 | virtual void SetStatusWidths(int n, const int widths[]); | |
44 | ||
71e03035 | 45 | virtual bool GetFieldRect(int i, wxRect& rect) const; |
71e03035 VZ |
46 | virtual void SetMinHeight(int height); |
47 | ||
71e03035 VZ |
48 | virtual int GetBorderX() const; |
49 | virtual int GetBorderY() const; | |
50 | ||
6f02a879 VZ |
51 | // wxInputConsumer pure virtual |
52 | virtual wxWindow *GetInputWindow() const | |
5c33522f | 53 | { return const_cast<wxStatusBar*>(this); } |
6f02a879 | 54 | |
71e03035 | 55 | protected: |
6cf68971 VZ |
56 | virtual void DoUpdateStatusText(int i); |
57 | ||
71e03035 VZ |
58 | // recalculate the field widths |
59 | void OnSize(wxSizeEvent& event); | |
60 | ||
61 | // draw the statusbar | |
62 | virtual void DoDraw(wxControlRenderer *renderer); | |
63 | ||
71e03035 VZ |
64 | // tell them about our preferred height |
65 | virtual wxSize DoGetBestSize() const; | |
66 | ||
67 | // override DoSetSize() to prevent the status bar height from changing | |
68 | virtual void DoSetSize(int x, int y, | |
69 | int width, int height, | |
70 | int sizeFlags = wxSIZE_AUTO); | |
71 | ||
72 | // get the (fixed) status bar height | |
73 | wxCoord GetHeight() const; | |
74 | ||
75 | // get the rectangle containing all the fields and the border between them | |
76 | // | |
77 | // also updates m_widthsAbs if necessary | |
78 | wxRect GetTotalFieldRect(wxCoord *borderBetweenFields); | |
79 | ||
069d493e | 80 | // get the rect for this field without ani side effects (see code) |
4077bf8d JS |
81 | wxRect DoGetFieldRect(int n) const; |
82 | ||
71e03035 VZ |
83 | // common part of all ctors |
84 | void Init(); | |
85 | ||
86 | private: | |
7b6fefbe | 87 | // the current status fields strings |
0cd15959 | 88 | //wxArrayString m_statusText; |
71e03035 VZ |
89 | |
90 | // the absolute status fields widths | |
91 | wxArrayInt m_widthsAbs; | |
92 | ||
93 | DECLARE_DYNAMIC_CLASS(wxStatusBarUniv) | |
94 | DECLARE_EVENT_TABLE() | |
95 | WX_DECLARE_INPUT_CONSUMER() | |
96 | }; | |
97 | ||
98 | #endif // _WX_UNIV_STATUSBR_H_ | |
99 |