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
,
23 public wxInputConsumer
26 wxStatusBarUniv() { Init(); }
28 wxStatusBarUniv(wxWindow
*parent
,
29 wxWindowID id
= wxID_ANY
,
30 long style
= wxSTB_DEFAULT_STYLE
,
31 const wxString
& name
= wxPanelNameStr
)
35 (void)Create(parent
, id
, style
, name
);
38 bool Create(wxWindow
*parent
,
39 wxWindowID id
= wxID_ANY
,
40 long style
= wxSTB_DEFAULT_STYLE
,
41 const wxString
& name
= wxPanelNameStr
);
43 // implement base class methods
44 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
45 virtual void SetStatusWidths(int n
, const int widths
[]);
47 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
48 virtual void SetMinHeight(int height
);
50 virtual int GetBorderX() const;
51 virtual int GetBorderY() const;
53 // wxInputConsumer pure virtual
54 virtual wxWindow
*GetInputWindow() const
55 { return const_cast<wxStatusBar
*>(this); }
58 virtual void DoUpdateStatusText(int i
);
60 // recalculate the field widths
61 void OnSize(wxSizeEvent
& event
);
64 virtual void DoDraw(wxControlRenderer
*renderer
);
66 // tell them about our preferred height
67 virtual wxSize
DoGetBestSize() const;
69 // override DoSetSize() to prevent the status bar height from changing
70 virtual void DoSetSize(int x
, int y
,
71 int width
, int height
,
72 int sizeFlags
= wxSIZE_AUTO
);
74 // get the (fixed) status bar height
75 wxCoord
GetHeight() const;
77 // get the rectangle containing all the fields and the border between them
79 // also updates m_widthsAbs if necessary
80 wxRect
GetTotalFieldRect(wxCoord
*borderBetweenFields
);
82 // get the rect for this field without ani side effects (see code)
83 wxRect
DoGetFieldRect(int n
) const;
85 // common part of all ctors
89 // the current status fields strings
90 //wxArrayString m_statusText;
92 // the absolute status fields widths
93 wxArrayInt m_widthsAbs
;
95 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv
)
97 WX_DECLARE_INPUT_CONSUMER()
100 #endif // _WX_UNIV_STATUSBR_H_