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 #include "wx/univ/inpcons.h"
21 // ----------------------------------------------------------------------------
22 // wxStatusBar: a window near the bottom of the frame used for status info
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxStatusBarUniv
: public wxStatusBarBase
,
26 public wxInputConsumer
29 wxStatusBarUniv() { Init(); }
31 wxStatusBarUniv(wxWindow
*parent
,
34 const wxString
& name
= wxPanelNameStr
)
38 (void)Create(parent
, id
, style
, name
);
41 bool Create(wxWindow
*parent
,
44 const wxString
& name
= wxPanelNameStr
);
46 // set field count/widths
47 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
48 virtual void SetStatusWidths(int n
, const int widths
[]);
50 // get/set the text of the given field
51 virtual void SetStatusText(const wxString
& text
, int number
= 0);
52 virtual wxString
GetStatusText(int number
= 0) const;
54 // Get the position and size of the field's internal bounding rectangle
55 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
57 // sets the minimal vertical size of the status bar
58 virtual void SetMinHeight(int height
);
60 // get the dimensions of the horizontal and vertical borders
61 virtual int GetBorderX() const;
62 virtual int GetBorderY() const;
65 // recalculate the field widths
66 void OnSize(wxSizeEvent
& event
);
69 virtual void DoDraw(wxControlRenderer
*renderer
);
71 // wxInputConsumer pure virtual
72 virtual wxWindow
*GetInputWindow() const
73 { return wxConstCast(this, wxStatusBar
); }
75 // tell them about our preferred height
76 virtual wxSize
DoGetBestSize() const;
78 // override DoSetSize() to prevent the status bar height from changing
79 virtual void DoSetSize(int x
, int y
,
80 int width
, int height
,
81 int sizeFlags
= wxSIZE_AUTO
);
83 // get the (fixed) status bar height
84 wxCoord
GetHeight() const;
86 // get the rectangle containing all the fields and the border between them
88 // also updates m_widthsAbs if necessary
89 wxRect
GetTotalFieldRect(wxCoord
*borderBetweenFields
);
91 // get the rect for this field without ani side effects (see code)
92 wxRect
DoGetFieldRect(int n
) const;
94 // refresh the given field
95 void RefreshField(int i
);
97 // common part of all ctors
101 // the status fields strings
102 wxArrayString m_statusText
;
104 // the absolute status fields widths
105 wxArrayInt m_widthsAbs
;
107 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv
)
108 DECLARE_EVENT_TABLE()
109 WX_DECLARE_INPUT_CONSUMER()
112 #endif // _WX_UNIV_STATUSBR_H_