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