]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/statusbr.h
wxWindow no longer emits any scroll events after
[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 #ifdef __GNUG__
16 #pragma interface "statusbr.h"
17 #endif
18
19 #include "wx/pen.h"
20 #include "wx/font.h"
21
22 WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
23
24 class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
25 {
26 public:
27 wxStatusBarGeneric();
28 wxStatusBarGeneric(wxWindow *parent,
29 wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = 0,
33 const wxString& name = wxPanelNameStr)
34 {
35 Create(parent, id, pos, size, style, name);
36 }
37 wxStatusBarGeneric(wxWindow *parent,
38 wxWindowID id,
39 long style,
40 const wxString& name = wxPanelNameStr)
41 {
42 Create(parent, id, style, name);
43 }
44
45 ~wxStatusBarGeneric();
46
47 bool Create(wxWindow *parent, wxWindowID id,
48 const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
49 const wxSize& WXUNUSED(size) = wxDefaultSize,
50 long style = 0,
51 const wxString& name = wxPanelNameStr)
52 {
53 return Create(parent, id, style, name);
54 }
55
56 bool Create(wxWindow *parent, wxWindowID id,
57 long style = 0,
58 const wxString& name = wxPanelNameStr);
59
60 // Create status line
61 virtual void SetFieldsCount(int number = 1,
62 const int *widths = (const int *) NULL);
63 int GetFieldsCount() const { return m_nFields; }
64
65 // Set status line text
66 virtual void SetStatusText(const wxString& text, int number = 0);
67 virtual wxString GetStatusText(int number = 0) const;
68
69 // Set status line widths
70 virtual void SetStatusWidths(int n, const int widths_field[]);
71
72 // Get the position and size of the field's internal bounding rectangle
73 virtual bool GetFieldRect(int i, wxRect& rect) const;
74
75 // sets the minimal vertical size of the status bar
76 virtual void SetMinHeight(int height);
77
78 virtual int GetBorderX() const { return m_borderX; }
79 virtual int GetBorderY() const { return m_borderY; }
80
81 ////////////////////////////////////////////////////////////////////////
82 // Implementation
83
84 virtual void DrawFieldText(wxDC& dc, int i);
85 virtual void DrawField(wxDC& dc, int i);
86
87 void SetBorderX(int x);
88 void SetBorderY(int y);
89
90 void OnPaint(wxPaintEvent& event);
91
92 virtual void InitColours();
93
94 // Responds to colour changes
95 void OnSysColourChanged(wxSysColourChangedEvent& event);
96
97 protected:
98 wxString * m_statusStrings;
99 int m_borderX;
100 int m_borderY;
101 wxFont m_defaultStatusBarFont;
102 wxPen m_mediumShadowPen;
103 wxPen m_hilightPen;
104
105 private:
106 DECLARE_EVENT_TABLE()
107 DECLARE_DYNAMIC_CLASS(wxStatusBarGeneric)
108 };
109
110 #endif
111 // _WX_GENERIC_STATUSBR_H_