]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/statusbr.h
Enable wxDVC on OS X Cocoa using the generic control.
[wxWidgets.git] / include / wx / generic / statusbr.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/statusbr.h
3 // Purpose: wxStatusBarGeneric class
4 // Author: Julian Smart
5 // Modified by: VZ at 05.02.00 to derive from wxStatusBarBase
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GENERIC_STATUSBR_H_
13 #define _WX_GENERIC_STATUSBR_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_STATUSBAR
18
19 #include "wx/pen.h"
20 #include "wx/arrstr.h"
21
22
23 // ----------------------------------------------------------------------------
24 // wxStatusBarGeneric
25 // ----------------------------------------------------------------------------
26
27 class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase
28 {
29 public:
30 wxStatusBarGeneric() { Init(); }
31 wxStatusBarGeneric(wxWindow *parent,
32 wxWindowID winid = wxID_ANY,
33 long style = wxST_SIZEGRIP,
34 const wxString& name = wxStatusBarNameStr)
35 {
36 Init();
37
38 Create(parent, winid, style, name);
39 }
40
41 virtual ~wxStatusBarGeneric();
42
43 bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
44 long style = wxST_SIZEGRIP,
45 const wxString& name = wxStatusBarNameStr);
46
47 // Create status line
48 virtual void SetFieldsCount(int number = 1,
49 const int *widths = (const int *) NULL);
50
51 // Set status line text
52 virtual void SetStatusText(const wxString& text, int number = 0);
53 virtual wxString GetStatusText(int number = 0) const;
54
55 // Set status line widths
56 virtual void SetStatusWidths(int n, const int widths_field[]);
57
58 // Get the position and size of the field's internal bounding rectangle
59 virtual bool GetFieldRect(int i, wxRect& rect) const;
60
61 // sets the minimal vertical size of the status bar
62 virtual void SetMinHeight(int height);
63
64 virtual int GetBorderX() const { return m_borderX; }
65 virtual int GetBorderY() const { return m_borderY; }
66
67
68 protected: // event handlers
69
70 void OnPaint(wxPaintEvent& event);
71 void OnSize(wxSizeEvent& event);
72
73 void OnLeftDown(wxMouseEvent& event);
74 void OnRightDown(wxMouseEvent& event);
75
76 // Responds to colour changes
77 void OnSysColourChanged(wxSysColourChangedEvent& event);
78
79 protected:
80
81 virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight);
82 virtual void DrawField(wxDC& dc, int i, int textHeight);
83
84 void SetBorderX(int x);
85 void SetBorderY(int y);
86
87 virtual void InitColours();
88
89 // true if the status bar shows the size grip: for this it must have
90 // wxST_SIZEGRIP style and the window it is attached to must be resizeable
91 // and not maximized
92 bool ShowsSizeGrip() const;
93
94 // returns the position and the size of the size grip
95 wxRect GetSizeGripRect() const;
96
97 // common part of all ctors
98 void Init();
99
100 // the array of the currently displayed strings
101 wxArrayString m_statusStrings;
102
103 // the last known height of the client rect
104 int m_lastClientHeight;
105
106 // the absolute widths of the status bar panes in pixels
107 wxArrayInt m_widthsAbs;
108
109 int m_borderX;
110 int m_borderY;
111 wxPen m_mediumShadowPen;
112 wxPen m_hilightPen;
113
114 virtual wxSize DoGetBestSize() const;
115
116 private:
117 DECLARE_EVENT_TABLE()
118 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
119 };
120
121 #endif // wxUSE_STATUSBAR
122
123 #endif
124 // _WX_GENERIC_STATUSBR_H_