1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStatusBar class interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_STATUSBR_H_BASE_
13 #define _WX_STATUSBR_H_BASE_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "statbar.h"
19 #include "wx/window.h"
25 WX_DECLARE_LIST(wxString
, wxListString
);
27 // ----------------------------------------------------------------------------
28 // wxStatusBar: a window near the bottom of the frame used for status info
29 // ----------------------------------------------------------------------------
31 class WXDLLEXPORT wxStatusBarBase
: public wxWindow
36 virtual ~wxStatusBarBase();
41 // set the number of fields and call SetStatusWidths(widths) if widths are
43 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
44 int GetFieldsCount() const { return m_nFields
; }
49 virtual void SetStatusText(const wxString
& text
, int number
= 0) = 0;
50 virtual wxString
GetStatusText(int number
= 0) const = 0;
52 void PushStatusText(const wxString
& text
, int number
= 0);
53 void PopStatusText(int number
= 0);
58 // set status field widths as absolute numbers: positive widths mean that
59 // the field has the specified absolute width, negative widths are
60 // interpreted as the sizer options, i.e. the extra space (total space
61 // minus the sum of fixed width fields) is divided between the fields with
62 // negative width according to the abs value of the width (field with width
63 // -2 grows twice as much as one with width -1 &c)
64 virtual void SetStatusWidths(int n
, const int widths
[]);
69 // Get the position and size of the field's internal bounding rectangle
70 virtual bool GetFieldRect(int i
, wxRect
& rect
) const = 0;
72 // sets the minimal vertical size of the status bar
73 virtual void SetMinHeight(int height
) = 0;
75 // get the dimensions of the horizontal and vertical borders
76 virtual int GetBorderX() const = 0;
77 virtual int GetBorderY() const = 0;
79 // don't want status bars to accept the focus at all
80 virtual bool AcceptsFocus() const { return FALSE
; }
83 // set the widths array to NULL
86 // free the status widths arrays
90 void ReinitWidths() { FreeWidths(); InitWidths(); }
92 // same, for text stacks
95 void ReinitStacks() { FreeStacks(); InitStacks(); }
97 // calculate the real field widths for the given total available size
98 wxArrayInt
CalculateAbsWidths(wxCoord widthTotal
) const;
100 // use these functions to access the stacks of field strings
101 wxListString
*GetStatusStack(int i
) const;
102 wxListString
*GetOrCreateStatusStack(int i
);
104 // the current number of fields
107 // the widths of the fields in pixels if !NULL, all fields have the same
111 // stacks of previous values for PushStatusText/PopStatusText
112 // this is created on demand, use GetStatusStack/GetOrCreateStatusStack
113 wxListString
**m_statusTextStacks
;
116 // ----------------------------------------------------------------------------
117 // include the actual wxStatusBar class declaration
118 // ----------------------------------------------------------------------------
120 #if defined(__WXUNIVERSAL__)
121 #define wxStatusBarUniv wxStatusBar
122 #define sm_classwxStatusBarUniv sm_classwxStatusBar
124 #include "wx/univ/statusbr.h"
125 #elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
126 #define wxStatusBar95 wxStatusBar
127 #define sm_classwxStatusBar95 sm_classwxStatusBar
129 #include "wx/msw/statbr95.h"
130 #elif defined(__WXMAC__)
131 #define wxStatusBarMac wxStatusBar
132 #define sm_classwxStatusBarMac sm_classwxStatusBar
134 #include "wx/generic/statusbr.h"
135 #include "wx/mac/statusbr.h"
137 #define wxStatusBarGeneric wxStatusBar
138 #define sm_classwxStatusBarGeneric sm_classwxStatusBar
140 #include "wx/generic/statusbr.h"
143 #endif // wxUSE_STATUSBAR
146 // _WX_STATUSBR_H_BASE_