1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/statusbr.h
3 // Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIV_STATUSBR_H_
13 #define _WX_UNIV_STATUSBR_H_
16 #pragma interface "univstatusbr.h"
19 // ----------------------------------------------------------------------------
20 // wxStatusBar: a window near the bottom of the frame used for status info
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxStatusBarUniv
: public wxStatusBarBase
,
24 public wxInputConsumer
27 wxStatusBarUniv() { Init(); }
29 wxStatusBarUniv(wxWindow
*parent
,
32 const wxString
& name
= wxPanelNameStr
)
36 (void)Create(parent
, id
, style
, name
);
39 bool Create(wxWindow
*parent
,
42 const wxString
& name
= wxPanelNameStr
);
44 // set field count/widths
45 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
46 virtual void SetStatusWidths(int n
, const int widths
[]);
48 // get/set the text of the given field
49 virtual void SetStatusText(const wxString
& text
, int number
= 0);
50 virtual wxString
GetStatusText(int number
= 0) const;
52 // Get the position and size of the field's internal bounding rectangle
53 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
55 // sets the minimal vertical size of the status bar
56 virtual void SetMinHeight(int height
);
58 // get the dimensions of the horizontal and vertical borders
59 virtual int GetBorderX() const;
60 virtual int GetBorderY() const;
63 // recalculate the field widths
64 void OnSize(wxSizeEvent
& event
);
67 virtual void DoDraw(wxControlRenderer
*renderer
);
69 // wxInputConsumer pure virtual
70 virtual wxWindow
*GetInputWindow() const
71 { return wxConstCast(this, wxStatusBar
); }
73 // tell them about our preferred height
74 virtual wxSize
DoGetBestSize() const;
76 // override DoSetSize() to prevent the status bar height from changing
77 virtual void DoSetSize(int x
, int y
,
78 int width
, int height
,
79 int sizeFlags
= wxSIZE_AUTO
);
81 // get the (fixed) status bar height
82 wxCoord
GetHeight() const;
84 // get the rectangle containing all the fields and the border between them
86 // also updates m_widthsAbs if necessary
87 wxRect
GetTotalFieldRect(wxCoord
*borderBetweenFields
);
89 // refresh the given field
90 void RefreshField(int i
);
92 // common part of all ctors
96 // the status fields strings
97 wxArrayString m_statusText
;
99 // the absolute status fields widths
100 wxArrayInt m_widthsAbs
;
102 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv
)
103 DECLARE_EVENT_TABLE()
104 WX_DECLARE_INPUT_CONSUMER()
107 #endif // _WX_UNIV_STATUSBR_H_