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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "univstatusbr.h"
19 #include "wx/univ/inpcons.h"
20 #include "wx/arrstr.h"
22 // ----------------------------------------------------------------------------
23 // wxStatusBar: a window near the bottom of the frame used for status info
24 // ----------------------------------------------------------------------------
26 class WXDLLEXPORT wxStatusBarUniv
: public wxStatusBarBase
,
27 public wxInputConsumer
30 wxStatusBarUniv() { Init(); }
32 wxStatusBarUniv(wxWindow
*parent
,
35 const wxString
& name
= wxPanelNameStr
)
39 (void)Create(parent
, id
, style
, name
);
42 bool Create(wxWindow
*parent
,
45 const wxString
& name
= wxPanelNameStr
);
47 // set field count/widths
48 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
49 virtual void SetStatusWidths(int n
, const int widths
[]);
51 // get/set the text of the given field
52 virtual void SetStatusText(const wxString
& text
, int number
= 0);
53 virtual wxString
GetStatusText(int number
= 0) const;
55 // Get the position and size of the field's internal bounding rectangle
56 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
58 // sets the minimal vertical size of the status bar
59 virtual void SetMinHeight(int height
);
61 // get the dimensions of the horizontal and vertical borders
62 virtual int GetBorderX() const;
63 virtual int GetBorderY() const;
66 // recalculate the field widths
67 void OnSize(wxSizeEvent
& event
);
70 virtual void DoDraw(wxControlRenderer
*renderer
);
72 // wxInputConsumer pure virtual
73 virtual wxWindow
*GetInputWindow() const
74 { return wxConstCast(this, wxStatusBar
); }
76 // tell them about our preferred height
77 virtual wxSize
DoGetBestSize() const;
79 // override DoSetSize() to prevent the status bar height from changing
80 virtual void DoSetSize(int x
, int y
,
81 int width
, int height
,
82 int sizeFlags
= wxSIZE_AUTO
);
84 // get the (fixed) status bar height
85 wxCoord
GetHeight() const;
87 // get the rectangle containing all the fields and the border between them
89 // also updates m_widthsAbs if necessary
90 wxRect
GetTotalFieldRect(wxCoord
*borderBetweenFields
);
92 // get the rect for this field without ani side effects (see code)
93 wxRect
DoGetFieldRect(int n
) const;
95 // refresh the given field
96 void RefreshField(int i
);
98 // common part of all ctors
102 // the status fields strings
103 wxArrayString m_statusText
;
105 // the absolute status fields widths
106 wxArrayInt m_widthsAbs
;
108 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv
)
109 DECLARE_EVENT_TABLE()
110 WX_DECLARE_INPUT_CONSUMER()
113 #endif // _WX_UNIV_STATUSBR_H_