]> git.saurik.com Git - wxWidgets.git/blob - include/wx/univ/statusbr.h
Add lambda-friendly wxDialog::ShowWindowModalThenDo().
[wxWidgets.git] / include / wx / univ / statusbr.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/statusbr.h
3 // Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 14.10.01
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_UNIV_STATUSBR_H_
12 #define _WX_UNIV_STATUSBR_H_
13
14 #include "wx/univ/inpcons.h"
15 #include "wx/arrstr.h"
16
17 // ----------------------------------------------------------------------------
18 // wxStatusBarUniv: a window near the bottom of the frame used for status info
19 // ----------------------------------------------------------------------------
20
21 class WXDLLIMPEXP_CORE wxStatusBarUniv : public wxStatusBarBase
22 {
23 public:
24 wxStatusBarUniv() { Init(); }
25
26 wxStatusBarUniv(wxWindow *parent,
27 wxWindowID id = wxID_ANY,
28 long style = wxSTB_DEFAULT_STYLE,
29 const wxString& name = wxPanelNameStr)
30 {
31 Init();
32
33 (void)Create(parent, id, style, name);
34 }
35
36 bool Create(wxWindow *parent,
37 wxWindowID id = wxID_ANY,
38 long style = wxSTB_DEFAULT_STYLE,
39 const wxString& name = wxPanelNameStr);
40
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[]);
44
45 virtual bool GetFieldRect(int i, wxRect& rect) const;
46 virtual void SetMinHeight(int height);
47
48 virtual int GetBorderX() const;
49 virtual int GetBorderY() const;
50
51 // wxInputConsumer pure virtual
52 virtual wxWindow *GetInputWindow() const
53 { return const_cast<wxStatusBar*>(this); }
54
55 protected:
56 virtual void DoUpdateStatusText(int i);
57
58 // recalculate the field widths
59 void OnSize(wxSizeEvent& event);
60
61 // draw the statusbar
62 virtual void DoDraw(wxControlRenderer *renderer);
63
64 // tell them about our preferred height
65 virtual wxSize DoGetBestSize() const;
66
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);
71
72 // get the (fixed) status bar height
73 wxCoord GetHeight() const;
74
75 // get the rectangle containing all the fields and the border between them
76 //
77 // also updates m_widthsAbs if necessary
78 wxRect GetTotalFieldRect(wxCoord *borderBetweenFields);
79
80 // get the rect for this field without ani side effects (see code)
81 wxRect DoGetFieldRect(int n) const;
82
83 // common part of all ctors
84 void Init();
85
86 private:
87 // the current status fields strings
88 //wxArrayString m_statusText;
89
90 // the absolute status fields widths
91 wxArrayInt m_widthsAbs;
92
93 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv)
94 DECLARE_EVENT_TABLE()
95 WX_DECLARE_INPUT_CONSUMER()
96 };
97
98 #endif // _WX_UNIV_STATUSBR_H_
99