]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/statusbr.h
Remove calls to a couple of deprecated methods, fix wxMotif build with
[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 and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GENERIC_STATUSBR_H_
13 #define _WX_GENERIC_STATUSBR_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "statusbr.h"
17 #endif
18
19 #include "wx/pen.h"
20 #include "wx/font.h"
21 #include "wx/statusbr.h"
22
23 WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
24
25 class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
26 {
27 public:
28 wxStatusBarGeneric() { Init(); }
29 wxStatusBarGeneric(wxWindow *parent,
30 wxWindowID id,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
33 long style = 0,
34 const wxString& name = wxPanelNameStr)
35 {
36 Init();
37
38 Create(parent, id, pos, size, style, name);
39 }
40 wxStatusBarGeneric(wxWindow *parent,
41 wxWindowID id,
42 long style,
43 const wxString& name = wxPanelNameStr)
44 {
45 Init();
46
47 Create(parent, id, style, name);
48 }
49
50 virtual ~wxStatusBarGeneric();
51
52 bool Create(wxWindow *parent, wxWindowID id,
53 const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
54 const wxSize& WXUNUSED(size) = wxDefaultSize,
55 long style = 0,
56 const wxString& name = wxPanelNameStr)
57 {
58 return Create(parent, id, style, name);
59 }
60
61 bool Create(wxWindow *parent, wxWindowID id,
62 long style,
63 const wxString& name = wxPanelNameStr);
64
65 // Create status line
66 virtual void SetFieldsCount(int number = 1,
67 const int *widths = (const int *) NULL);
68
69 // Set status line text
70 virtual void SetStatusText(const wxString& text, int number = 0);
71 virtual wxString GetStatusText(int number = 0) const;
72
73 // Set status line widths
74 virtual void SetStatusWidths(int n, const int widths_field[]);
75
76 // Get the position and size of the field's internal bounding rectangle
77 virtual bool GetFieldRect(int i, wxRect& rect) const;
78
79 // sets the minimal vertical size of the status bar
80 virtual void SetMinHeight(int height);
81
82 virtual int GetBorderX() const { return m_borderX; }
83 virtual int GetBorderY() const { return m_borderY; }
84
85 ////////////////////////////////////////////////////////////////////////
86 // Implementation
87
88 virtual void DrawFieldText(wxDC& dc, int i);
89 virtual void DrawField(wxDC& dc, int i);
90
91 void SetBorderX(int x);
92 void SetBorderY(int y);
93
94 void OnPaint(wxPaintEvent& event);
95
96 void OnLeftDown(wxMouseEvent& event);
97 void OnRightDown(wxMouseEvent& event);
98
99 virtual void InitColours();
100
101 // Responds to colour changes
102 void OnSysColourChanged(wxSysColourChangedEvent& event);
103
104 protected:
105 // common part of all ctors
106 void Init();
107
108 wxArrayString m_statusStrings;
109
110 // the last known width of the client rect (used to rebuild cache)
111 int m_lastClientWidth;
112 // the widths of the status bar panes in pixels
113 wxArrayInt m_widthsAbs;
114
115 int m_borderX;
116 int m_borderY;
117 wxFont m_defaultStatusBarFont;
118 wxPen m_mediumShadowPen;
119 wxPen m_hilightPen;
120
121 private:
122 DECLARE_EVENT_TABLE()
123 DECLARE_DYNAMIC_CLASS(wxStatusBarGeneric)
124 };
125
126 #endif
127 // _WX_GENERIC_STATUSBR_H_
128
129 // vi:sts=4:sw=4:et