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