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