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_
15 #include "wx/univ/inpcons.h"
16 #include "wx/arrstr.h"
18 // ----------------------------------------------------------------------------
19 // wxStatusBarUniv: a window near the bottom of the frame used for status info
20 // ----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxStatusBarUniv
: public wxStatusBarBase
25 wxStatusBarUniv() { Init(); }
27 wxStatusBarUniv(wxWindow
*parent
,
28 wxWindowID id
= wxID_ANY
,
29 long style
= wxSTB_DEFAULT_STYLE
,
30 const wxString
& name
= wxPanelNameStr
)
34 (void)Create(parent
, id
, style
, name
);
37 bool Create(wxWindow
*parent
,
38 wxWindowID id
= wxID_ANY
,
39 long style
= wxSTB_DEFAULT_STYLE
,
40 const wxString
& name
= wxPanelNameStr
);
42 // implement base class methods
43 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
44 virtual void SetStatusWidths(int n
, const int widths
[]);
46 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
47 virtual void SetMinHeight(int height
);
49 virtual int GetBorderX() const;
50 virtual int GetBorderY() const;
52 // wxInputConsumer pure virtual
53 virtual wxWindow
*GetInputWindow() const
54 { return const_cast<wxStatusBar
*>(this); }
57 virtual void DoUpdateStatusText(int i
);
59 // recalculate the field widths
60 void OnSize(wxSizeEvent
& event
);
63 virtual void DoDraw(wxControlRenderer
*renderer
);
65 // tell them about our preferred height
66 virtual wxSize
DoGetBestSize() const;
68 // override DoSetSize() to prevent the status bar height from changing
69 virtual void DoSetSize(int x
, int y
,
70 int width
, int height
,
71 int sizeFlags
= wxSIZE_AUTO
);
73 // get the (fixed) status bar height
74 wxCoord
GetHeight() const;
76 // get the rectangle containing all the fields and the border between them
78 // also updates m_widthsAbs if necessary
79 wxRect
GetTotalFieldRect(wxCoord
*borderBetweenFields
);
81 // get the rect for this field without ani side effects (see code)
82 wxRect
DoGetFieldRect(int n
) const;
84 // common part of all ctors
88 // the current status fields strings
89 //wxArrayString m_statusText;
91 // the absolute status fields widths
92 wxArrayInt m_widthsAbs
;
94 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv
)
96 WX_DECLARE_INPUT_CONSUMER()
99 #endif // _WX_UNIV_STATUSBR_H_