]>
Commit | Line | Data |
---|---|---|
ed791986 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/statusbr.h | |
3 | // Purpose: wxStatusBar class interface | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 05.02.00 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) wxWindows team | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
34138703 JS |
12 | #ifndef _WX_STATUSBR_H_BASE_ |
13 | #define _WX_STATUSBR_H_BASE_ | |
c801d85f | 14 | |
71e03035 VZ |
15 | #ifdef __GNUG__ |
16 | #pragma interface "statbar.h" | |
17 | #endif | |
18 | ||
ed791986 VZ |
19 | #include "wx/window.h" |
20 | ||
1e6feb95 VZ |
21 | #if wxUSE_STATUSBAR |
22 | ||
ed791986 VZ |
23 | // ---------------------------------------------------------------------------- |
24 | // wxStatusBar: a window near the bottom of the frame used for status info | |
25 | // ---------------------------------------------------------------------------- | |
26 | ||
27 | class WXDLLEXPORT wxStatusBarBase : public wxWindow | |
28 | { | |
29 | public: | |
71e03035 VZ |
30 | wxStatusBarBase(); |
31 | ||
32 | virtual ~wxStatusBarBase(); | |
33 | ||
34 | // field count | |
35 | // ----------- | |
ed791986 | 36 | |
71e03035 VZ |
37 | // set the number of fields and call SetStatusWidths(widths) if widths are |
38 | // given | |
39 | virtual void SetFieldsCount(int number = 1, const int *widths = NULL); | |
ed791986 VZ |
40 | int GetFieldsCount() const { return m_nFields; } |
41 | ||
71e03035 VZ |
42 | // field text |
43 | // ---------- | |
44 | ||
ed791986 VZ |
45 | virtual void SetStatusText(const wxString& text, int number = 0) = 0; |
46 | virtual wxString GetStatusText(int number = 0) const = 0; | |
47 | ||
71e03035 VZ |
48 | // fields widths |
49 | // ------------- | |
50 | ||
51 | // set status field widths as absolute numbers: positive widths mean that | |
52 | // the field has the specified absolute width, negative widths are | |
53 | // interpreted as the sizer options, i.e. the extra space (total space | |
54 | // minus the sum of fixed width fields) is divided between the fields with | |
55 | // negative width according to the abs value of the width (field with width | |
56 | // -2 grows twice as much as one with width -1 &c) | |
57 | virtual void SetStatusWidths(int n, const int widths[]); | |
58 | ||
59 | // geometry | |
60 | // -------- | |
ed791986 VZ |
61 | |
62 | // Get the position and size of the field's internal bounding rectangle | |
63 | virtual bool GetFieldRect(int i, wxRect& rect) const = 0; | |
64 | ||
65 | // sets the minimal vertical size of the status bar | |
66 | virtual void SetMinHeight(int height) = 0; | |
67 | ||
68 | // get the dimensions of the horizontal and vertical borders | |
69 | virtual int GetBorderX() const = 0; | |
70 | virtual int GetBorderY() const = 0; | |
71 | ||
1e6feb95 VZ |
72 | // don't want status bars to accept the focus at all |
73 | virtual bool AcceptsFocus() const { return FALSE; } | |
74 | ||
ed791986 | 75 | protected: |
71e03035 VZ |
76 | // set the widths array to NULL |
77 | void InitWidths(); | |
78 | ||
79 | // free the status widths arrays | |
80 | void FreeWidths(); | |
81 | ||
82 | // reset the widths | |
83 | void ReinitWidths() { FreeWidths(); InitWidths(); } | |
84 | ||
85 | // calculate the real field widths for the given total available size | |
86 | wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const; | |
87 | ||
88 | // the current number of fields | |
89 | int m_nFields; | |
90 | ||
91 | // the widths of the fields in pixels if !NULL, all fields have the same | |
92 | // width otherwise | |
93 | int *m_statusWidths; | |
ed791986 VZ |
94 | }; |
95 | ||
71e03035 VZ |
96 | // ---------------------------------------------------------------------------- |
97 | // include the actual wxStatusBar class declaration | |
98 | // ---------------------------------------------------------------------------- | |
99 | ||
100 | #if defined(__WXUNIVERSAL__) | |
101 | #define wxStatusBarUniv wxStatusBar | |
102 | #define sm_classwxStatusBarUniv sm_classwxStatusBar | |
ed791986 | 103 | |
71e03035 VZ |
104 | #include "wx/univ/statusbr.h" |
105 | #elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR | |
106 | #define wxStatusBar95 wxStatusBar | |
107 | #define sm_classwxStatusBar95 sm_classwxStatusBar | |
108 | ||
109 | #include "wx/msw/statbr95.h" | |
656fc51c | 110 | #elif defined(__WXMAC__) |
71e03035 VZ |
111 | #define wxStatusBarMac wxStatusBar |
112 | #define sm_classwxStatusBarMac sm_classwxStatusBar | |
113 | ||
5fde6fcc | 114 | #include "wx/generic/statusbr.h" |
a02bb143 | 115 | #include "wx/mac/statusbr.h" |
ed791986 | 116 | #else |
71e03035 VZ |
117 | #define wxStatusBarGeneric wxStatusBar |
118 | #define sm_classwxStatusBarGeneric sm_classwxStatusBar | |
ed791986 | 119 | |
71e03035 | 120 | #include "wx/generic/statusbr.h" |
ed791986 VZ |
121 | #endif |
122 | ||
71e03035 | 123 | #endif // wxUSE_STATUSBAR |
1e6feb95 | 124 | |
c801d85f | 125 | #endif |
34138703 | 126 | // _WX_STATUSBR_H_BASE_ |