1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/statusbr.h
3 // Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_UNIV_STATUSBR_H_
12 #define _WX_UNIV_STATUSBR_H_
14 #include "wx/univ/inpcons.h"
15 #include "wx/arrstr.h"
17 // ----------------------------------------------------------------------------
18 // wxStatusBarUniv: a window near the bottom of the frame used for status info
19 // ----------------------------------------------------------------------------
21 class WXDLLIMPEXP_CORE wxStatusBarUniv
: public wxStatusBarBase
24 wxStatusBarUniv() { Init(); }
26 wxStatusBarUniv(wxWindow
*parent
,
27 wxWindowID id
= wxID_ANY
,
28 long style
= wxSTB_DEFAULT_STYLE
,
29 const wxString
& name
= wxPanelNameStr
)
33 (void)Create(parent
, id
, style
, name
);
36 bool Create(wxWindow
*parent
,
37 wxWindowID id
= wxID_ANY
,
38 long style
= wxSTB_DEFAULT_STYLE
,
39 const wxString
& name
= wxPanelNameStr
);
41 // implement base class methods
42 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
43 virtual void SetStatusWidths(int n
, const int widths
[]);
45 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
46 virtual void SetMinHeight(int height
);
48 virtual int GetBorderX() const;
49 virtual int GetBorderY() const;
51 // wxInputConsumer pure virtual
52 virtual wxWindow
*GetInputWindow() const
53 { return const_cast<wxStatusBar
*>(this); }
56 virtual void DoUpdateStatusText(int i
);
58 // recalculate the field widths
59 void OnSize(wxSizeEvent
& event
);
62 virtual void DoDraw(wxControlRenderer
*renderer
);
64 // tell them about our preferred height
65 virtual wxSize
DoGetBestSize() const;
67 // override DoSetSize() to prevent the status bar height from changing
68 virtual void DoSetSize(int x
, int y
,
69 int width
, int height
,
70 int sizeFlags
= wxSIZE_AUTO
);
72 // get the (fixed) status bar height
73 wxCoord
GetHeight() const;
75 // get the rectangle containing all the fields and the border between them
77 // also updates m_widthsAbs if necessary
78 wxRect
GetTotalFieldRect(wxCoord
*borderBetweenFields
);
80 // get the rect for this field without ani side effects (see code)
81 wxRect
DoGetFieldRect(int n
) const;
83 // common part of all ctors
87 // the current status fields strings
88 //wxArrayString m_statusText;
90 // the absolute status fields widths
91 wxArrayInt m_widthsAbs
;
93 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv
)
95 WX_DECLARE_INPUT_CONSUMER()
98 #endif // _WX_UNIV_STATUSBR_H_