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_
16 #pragma interface "statbar.h"
19 #include "wx/window.h"
23 // ----------------------------------------------------------------------------
24 // wxStatusBar: a window near the bottom of the frame used for status info
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxStatusBarBase
: public wxWindow
32 virtual ~wxStatusBarBase();
37 // set the number of fields and call SetStatusWidths(widths) if widths are
39 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
40 int GetFieldsCount() const { return m_nFields
; }
45 virtual void SetStatusText(const wxString
& text
, int number
= 0) = 0;
46 virtual wxString
GetStatusText(int number
= 0) const = 0;
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
[]);
62 // Get the position and size of the field's internal bounding rectangle
63 virtual bool GetFieldRect(int i
, wxRect
& rect
) const = 0;
65 // sets the minimal vertical size of the status bar
66 virtual void SetMinHeight(int height
) = 0;
68 // get the dimensions of the horizontal and vertical borders
69 virtual int GetBorderX() const = 0;
70 virtual int GetBorderY() const = 0;
72 // don't want status bars to accept the focus at all
73 virtual bool AcceptsFocus() const { return FALSE
; }
76 // set the widths array to NULL
79 // free the status widths arrays
83 void ReinitWidths() { FreeWidths(); InitWidths(); }
85 // calculate the real field widths for the given total available size
86 wxArrayInt
CalculateAbsWidths(wxCoord widthTotal
) const;
88 // the current number of fields
91 // the widths of the fields in pixels if !NULL, all fields have the same
96 // ----------------------------------------------------------------------------
97 // include the actual wxStatusBar class declaration
98 // ----------------------------------------------------------------------------
100 #if defined(__WXUNIVERSAL__)
101 #define wxStatusBarUniv wxStatusBar
102 #define sm_classwxStatusBarUniv sm_classwxStatusBar
104 #include "wx/univ/statusbr.h"
105 #elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
106 #define wxStatusBar95 wxStatusBar
107 #define sm_classwxStatusBar95 sm_classwxStatusBar
109 #include "wx/msw/statbr95.h"
110 #elif defined(__WXMAC__)
111 #define wxStatusBarMac wxStatusBar
112 #define sm_classwxStatusBarMac sm_classwxStatusBar
114 #include "wx/generic/statusbr.h"
115 #include "wx/mac/statusbr.h"
117 #define wxStatusBarGeneric wxStatusBar
118 #define sm_classwxStatusBarGeneric sm_classwxStatusBar
120 #include "wx/generic/statusbr.h"
123 #endif // wxUSE_STATUSBAR
126 // _WX_STATUSBR_H_BASE_