]>
Commit | Line | Data |
---|---|---|
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 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_UNIV_STATUSBR_H_ | |
13 | #define _WX_UNIV_STATUSBR_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "univstatusbr.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/univ/inpcons.h" | |
20 | ||
21 | // ---------------------------------------------------------------------------- | |
22 | // wxStatusBar: a window near the bottom of the frame used for status info | |
23 | // ---------------------------------------------------------------------------- | |
24 | ||
25 | class WXDLLEXPORT wxStatusBarUniv : public wxStatusBarBase, | |
26 | public wxInputConsumer | |
27 | { | |
28 | public: | |
29 | wxStatusBarUniv() { Init(); } | |
30 | ||
31 | wxStatusBarUniv(wxWindow *parent, | |
32 | wxWindowID id = -1, | |
33 | long style = 0, | |
34 | const wxString& name = wxPanelNameStr) | |
35 | { | |
36 | Init(); | |
37 | ||
38 | (void)Create(parent, id, style, name); | |
39 | } | |
40 | ||
41 | bool Create(wxWindow *parent, | |
42 | wxWindowID id = -1, | |
43 | long style = 0, | |
44 | const wxString& name = wxPanelNameStr); | |
45 | ||
46 | // set field count/widths | |
47 | virtual void SetFieldsCount(int number = 1, const int *widths = NULL); | |
48 | virtual void SetStatusWidths(int n, const int widths[]); | |
49 | ||
50 | // get/set the text of the given field | |
51 | virtual void SetStatusText(const wxString& text, int number = 0); | |
52 | virtual wxString GetStatusText(int number = 0) const; | |
53 | ||
54 | // Get the position and size of the field's internal bounding rectangle | |
55 | virtual bool GetFieldRect(int i, wxRect& rect) const; | |
56 | ||
57 | // sets the minimal vertical size of the status bar | |
58 | virtual void SetMinHeight(int height); | |
59 | ||
60 | // get the dimensions of the horizontal and vertical borders | |
61 | virtual int GetBorderX() const; | |
62 | virtual int GetBorderY() const; | |
63 | ||
64 | protected: | |
65 | // recalculate the field widths | |
66 | void OnSize(wxSizeEvent& event); | |
67 | ||
68 | // draw the statusbar | |
69 | virtual void DoDraw(wxControlRenderer *renderer); | |
70 | ||
71 | // wxInputConsumer pure virtual | |
72 | virtual wxWindow *GetInputWindow() const | |
73 | { return wxConstCast(this, wxStatusBar); } | |
74 | ||
75 | // tell them about our preferred height | |
76 | virtual wxSize DoGetBestSize() const; | |
77 | ||
78 | // override DoSetSize() to prevent the status bar height from changing | |
79 | virtual void DoSetSize(int x, int y, | |
80 | int width, int height, | |
81 | int sizeFlags = wxSIZE_AUTO); | |
82 | ||
83 | // get the (fixed) status bar height | |
84 | wxCoord GetHeight() const; | |
85 | ||
86 | // get the rectangle containing all the fields and the border between them | |
87 | // | |
88 | // also updates m_widthsAbs if necessary | |
89 | wxRect GetTotalFieldRect(wxCoord *borderBetweenFields); | |
90 | ||
91 | // get the rect for this field without ani side effects (see code) | |
92 | wxRect DoGetFieldRect(int n) const; | |
93 | ||
94 | // refresh the given field | |
95 | void RefreshField(int i); | |
96 | ||
97 | // common part of all ctors | |
98 | void Init(); | |
99 | ||
100 | private: | |
101 | // the status fields strings | |
102 | wxArrayString m_statusText; | |
103 | ||
104 | // the absolute status fields widths | |
105 | wxArrayInt m_widthsAbs; | |
106 | ||
107 | DECLARE_DYNAMIC_CLASS(wxStatusBarUniv) | |
108 | DECLARE_EVENT_TABLE() | |
109 | WX_DECLARE_INPUT_CONSUMER() | |
110 | }; | |
111 | ||
112 | #endif // _WX_UNIV_STATUSBR_H_ | |
113 |