1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStatusBar class interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_STATUSBR_H_BASE_
13 #define _WX_STATUSBR_H_BASE_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "statbar.h"
19 #include "wx/window.h"
24 #include "wx/dynarray.h"
26 WX_DECLARE_LIST(wxString
, wxListString
);
28 // ----------------------------------------------------------------------------
29 // wxStatusBar: a window near the bottom of the frame used for status info
30 // ----------------------------------------------------------------------------
32 class WXDLLEXPORT wxStatusBarBase
: public wxWindow
37 virtual ~wxStatusBarBase();
42 // set the number of fields and call SetStatusWidths(widths) if widths are
44 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
45 int GetFieldsCount() const { return m_nFields
; }
50 virtual void SetStatusText(const wxString
& text
, int number
= 0) = 0;
51 virtual wxString
GetStatusText(int number
= 0) const = 0;
53 void PushStatusText(const wxString
& text
, int number
= 0);
54 void PopStatusText(int number
= 0);
59 // set status field widths as absolute numbers: positive widths mean that
60 // the field has the specified absolute width, negative widths are
61 // interpreted as the sizer options, i.e. the extra space (total space
62 // minus the sum of fixed width fields) is divided between the fields with
63 // negative width according to the abs value of the width (field with width
64 // -2 grows twice as much as one with width -1 &c)
65 virtual void SetStatusWidths(int n
, const int widths
[]);
70 // Get the position and size of the field's internal bounding rectangle
71 virtual bool GetFieldRect(int i
, wxRect
& rect
) const = 0;
73 // sets the minimal vertical size of the status bar
74 virtual void SetMinHeight(int height
) = 0;
76 // get the dimensions of the horizontal and vertical borders
77 virtual int GetBorderX() const = 0;
78 virtual int GetBorderY() const = 0;
80 // don't want status bars to accept the focus at all
81 virtual bool AcceptsFocus() const { return FALSE
; }
84 // set the widths array to NULL
87 // free the status widths arrays
91 void ReinitWidths() { FreeWidths(); InitWidths(); }
93 // same, for text stacks
96 void ReinitStacks() { FreeStacks(); InitStacks(); }
98 // calculate the real field widths for the given total available size
99 wxArrayInt
CalculateAbsWidths(wxCoord widthTotal
) const;
101 // use these functions to access the stacks of field strings
102 wxListString
*GetStatusStack(int i
) const;
103 wxListString
*GetOrCreateStatusStack(int i
);
105 // the current number of fields
108 // the widths of the fields in pixels if !NULL, all fields have the same
112 // stacks of previous values for PushStatusText/PopStatusText
113 // this is created on demand, use GetStatusStack/GetOrCreateStatusStack
114 wxListString
**m_statusTextStacks
;
116 DECLARE_NO_COPY_CLASS(wxStatusBarBase
)
119 // ----------------------------------------------------------------------------
120 // include the actual wxStatusBar class declaration
121 // ----------------------------------------------------------------------------
123 #if defined(__WXUNIVERSAL__)
124 #define wxStatusBarUniv wxStatusBar
126 #include "wx/univ/statusbr.h"
127 #elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
128 #define wxStatusBar95 wxStatusBar
130 #include "wx/msw/statbr95.h"
131 #elif defined(__WXMAC__)
132 #define wxStatusBarMac wxStatusBar
134 #include "wx/generic/statusbr.h"
135 #include "wx/mac/statusbr.h"
137 #define wxStatusBarGeneric wxStatusBar
139 #include "wx/generic/statusbr.h"
142 #endif // wxUSE_STATUSBAR
145 // _WX_STATUSBR_H_BASE_