]>
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 KB |
6 | // Created: 01/02/97 |
7 | // RCS-ID: $Id$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
ed791986 VZ |
12 | #ifndef _WX_GENERIC_STATUSBR_H_ |
13 | #define _WX_GENERIC_STATUSBR_H_ | |
c801d85f | 14 | |
245243ec WS |
15 | #include "wx/defs.h" |
16 | ||
17 | #if wxUSE_STATUSBAR | |
18 | ||
ac57418f | 19 | #include "wx/pen.h" |
2da2f941 | 20 | #include "wx/arrstr.h" |
c801d85f | 21 | |
ed791986 | 22 | class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase |
c801d85f | 23 | { |
c801d85f | 24 | public: |
3304646d WS |
25 | wxStatusBarGeneric() { Init(); } |
26 | wxStatusBarGeneric(wxWindow *parent, | |
53b6d7a2 PC |
27 | wxWindowID winid = wxID_ANY, |
28 | long style = wxST_SIZEGRIP, | |
29 | const wxString& name = wxStatusBarNameStr) | |
3304646d WS |
30 | { |
31 | Init(); | |
390015c0 | 32 | |
3304646d WS |
33 | Create(parent, winid, style, name); |
34 | } | |
ed791986 | 35 | |
3304646d | 36 | virtual ~wxStatusBarGeneric(); |
c801d85f | 37 | |
53b6d7a2 PC |
38 | bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY, |
39 | long style = wxST_SIZEGRIP, | |
40 | const wxString& name = wxStatusBarNameStr); | |
c801d85f | 41 | |
3304646d WS |
42 | // Create status line |
43 | virtual void SetFieldsCount(int number = 1, | |
44 | const int *widths = (const int *) NULL); | |
c801d85f | 45 | |
3304646d WS |
46 | // Set status line text |
47 | virtual void SetStatusText(const wxString& text, int number = 0); | |
48 | virtual wxString GetStatusText(int number = 0) const; | |
c801d85f | 49 | |
3304646d WS |
50 | // Set status line widths |
51 | virtual void SetStatusWidths(int n, const int widths_field[]); | |
c801d85f | 52 | |
3304646d WS |
53 | // Get the position and size of the field's internal bounding rectangle |
54 | virtual bool GetFieldRect(int i, wxRect& rect) const; | |
c801d85f | 55 | |
3304646d WS |
56 | // sets the minimal vertical size of the status bar |
57 | virtual void SetMinHeight(int height); | |
ed791986 | 58 | |
3304646d WS |
59 | virtual int GetBorderX() const { return m_borderX; } |
60 | virtual int GetBorderY() const { return m_borderY; } | |
c801d85f | 61 | |
3304646d WS |
62 | //////////////////////////////////////////////////////////////////////// |
63 | // Implementation | |
c801d85f | 64 | |
3304646d WS |
65 | virtual void DrawFieldText(wxDC& dc, int i); |
66 | virtual void DrawField(wxDC& dc, int i); | |
ed791986 | 67 | |
3304646d WS |
68 | void SetBorderX(int x); |
69 | void SetBorderY(int y); | |
ed791986 | 70 | |
3304646d | 71 | void OnPaint(wxPaintEvent& event); |
ca65c044 | 72 | |
3304646d WS |
73 | void OnLeftDown(wxMouseEvent& event); |
74 | void OnRightDown(wxMouseEvent& event); | |
c801d85f | 75 | |
3304646d | 76 | virtual void InitColours(); |
c801d85f | 77 | |
3304646d WS |
78 | // Responds to colour changes |
79 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
c801d85f KB |
80 | |
81 | protected: | |
3304646d WS |
82 | // common part of all ctors |
83 | void Init(); | |
390015c0 | 84 | |
3304646d | 85 | wxArrayString m_statusStrings; |
390015c0 | 86 | |
3304646d WS |
87 | // the last known width of the client rect (used to rebuild cache) |
88 | int m_lastClientWidth; | |
89 | // the widths of the status bar panes in pixels | |
90 | wxArrayInt m_widthsAbs; | |
390015c0 | 91 | |
3304646d WS |
92 | int m_borderX; |
93 | int m_borderY; | |
94 | wxPen m_mediumShadowPen; | |
95 | wxPen m_hilightPen; | |
c801d85f | 96 | |
3304646d | 97 | virtual wxSize DoGetBestSize() const; |
595a9493 | 98 | |
ed791986 | 99 | private: |
3304646d WS |
100 | DECLARE_EVENT_TABLE() |
101 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric) | |
c801d85f KB |
102 | }; |
103 | ||
245243ec WS |
104 | #endif // wxUSE_STATUSBAR |
105 | ||
c801d85f | 106 | #endif |
ed791986 | 107 | // _WX_GENERIC_STATUSBR_H_ |