]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
ed791986 VZ |
2 | // Name: wx/generic/statusbr.h |
3 | // Purpose: wxStatusBarGeneric class | |
c801d85f | 4 | // Author: Julian Smart |
ed791986 | 5 | // Modified by: VZ at 05.02.00 to derive from wxStatusBarBase |
c801d85f | 6 | // Created: 01/02/97 |
371a5b4e | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
c801d85f KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
ed791986 VZ |
11 | #ifndef _WX_GENERIC_STATUSBR_H_ |
12 | #define _WX_GENERIC_STATUSBR_H_ | |
c801d85f | 13 | |
245243ec WS |
14 | #include "wx/defs.h" |
15 | ||
16 | #if wxUSE_STATUSBAR | |
17 | ||
ac57418f | 18 | #include "wx/pen.h" |
2da2f941 | 19 | #include "wx/arrstr.h" |
c801d85f | 20 | |
7b6fefbe FM |
21 | |
22 | // ---------------------------------------------------------------------------- | |
23 | // wxStatusBarGeneric | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
53a2db12 | 26 | class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase |
c801d85f | 27 | { |
c801d85f | 28 | public: |
3304646d WS |
29 | wxStatusBarGeneric() { Init(); } |
30 | wxStatusBarGeneric(wxWindow *parent, | |
53b6d7a2 | 31 | wxWindowID winid = wxID_ANY, |
c4c178c1 | 32 | long style = wxSTB_DEFAULT_STYLE, |
53b6d7a2 | 33 | const wxString& name = wxStatusBarNameStr) |
3304646d WS |
34 | { |
35 | Init(); | |
390015c0 | 36 | |
3304646d WS |
37 | Create(parent, winid, style, name); |
38 | } | |
ed791986 | 39 | |
3304646d | 40 | virtual ~wxStatusBarGeneric(); |
c801d85f | 41 | |
53b6d7a2 | 42 | bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY, |
c4c178c1 | 43 | long style = wxSTB_DEFAULT_STYLE, |
53b6d7a2 | 44 | const wxString& name = wxStatusBarNameStr); |
c801d85f | 45 | |
6cf68971 | 46 | // implement base class methods |
3304646d | 47 | virtual void SetStatusWidths(int n, const int widths_field[]); |
3304646d | 48 | virtual bool GetFieldRect(int i, wxRect& rect) const; |
3304646d | 49 | virtual void SetMinHeight(int height); |
ed791986 | 50 | |
3304646d WS |
51 | virtual int GetBorderX() const { return m_borderX; } |
52 | virtual int GetBorderY() const { return m_borderY; } | |
c801d85f | 53 | |
78612fa6 | 54 | |
c94bdf2a FM |
55 | // implementation only (not part of wxStatusBar public API): |
56 | ||
57 | int GetFieldFromPoint(const wxPoint& point) const; | |
58 | ||
6cf68971 VZ |
59 | protected: |
60 | virtual void DoUpdateStatusText(int number); | |
ed791986 | 61 | |
6cf68971 | 62 | // event handlers |
3304646d | 63 | void OnPaint(wxPaintEvent& event); |
ba4589db | 64 | void OnSize(wxSizeEvent& event); |
ca65c044 | 65 | |
3304646d WS |
66 | void OnLeftDown(wxMouseEvent& event); |
67 | void OnRightDown(wxMouseEvent& event); | |
c801d85f | 68 | |
3304646d WS |
69 | // Responds to colour changes |
70 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
c801d85f | 71 | |
ba4589db FM |
72 | protected: |
73 | ||
74 | virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight); | |
75 | virtual void DrawField(wxDC& dc, int i, int textHeight); | |
76 | ||
77 | void SetBorderX(int x); | |
78 | void SetBorderY(int y); | |
79 | ||
80 | virtual void InitColours(); | |
81 | ||
7422d7c4 | 82 | // true if the status bar shows the size grip: for this it must have |
d13b34d3 | 83 | // wxSTB_SIZEGRIP style and the window it is attached to must be resizable |
7422d7c4 VZ |
84 | // and not maximized |
85 | bool ShowsSizeGrip() const; | |
86 | ||
78612fa6 FM |
87 | // returns the position and the size of the size grip |
88 | wxRect GetSizeGripRect() const; | |
89 | ||
3304646d WS |
90 | // common part of all ctors |
91 | void Init(); | |
390015c0 | 92 | |
8e8d9109 VZ |
93 | // the last known size, fields widths must be updated whenever it's out of |
94 | // date | |
95 | wxSize m_lastClientSize; | |
7b6fefbe FM |
96 | |
97 | // the absolute widths of the status bar panes in pixels | |
3304646d | 98 | wxArrayInt m_widthsAbs; |
390015c0 | 99 | |
3304646d WS |
100 | int m_borderX; |
101 | int m_borderY; | |
c94bdf2a | 102 | |
3304646d WS |
103 | wxPen m_mediumShadowPen; |
104 | wxPen m_hilightPen; | |
c801d85f | 105 | |
3304646d | 106 | virtual wxSize DoGetBestSize() const; |
595a9493 | 107 | |
ed791986 | 108 | private: |
8e8d9109 VZ |
109 | // Update m_lastClientSize and m_widthsAbs from the current size. |
110 | void DoUpdateFieldWidths(); | |
111 | ||
3304646d WS |
112 | DECLARE_EVENT_TABLE() |
113 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric) | |
c801d85f KB |
114 | }; |
115 | ||
245243ec WS |
116 | #endif // wxUSE_STATUSBAR |
117 | ||
c801d85f | 118 | #endif |
ed791986 | 119 | // _WX_GENERIC_STATUSBR_H_ |