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: statusbr.h 41200 2006-09-13 19:10:31Z ABX $
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/defs.h"
16 
17 #if wxUSE_STATUSBAR
18 
19 #include "wx/pen.h"
20 #include "wx/arrstr.h"
21 
22 class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
23 {
24 public:
wxStatusBarGeneric()25     wxStatusBarGeneric() { Init(); }
26     wxStatusBarGeneric(wxWindow *parent,
27                        wxWindowID winid = wxID_ANY,
28                        long style = wxST_SIZEGRIP,
29                        const wxString& name = wxStatusBarNameStr)
30     {
31         Init();
32 
33         Create(parent, winid, style, name);
34     }
35 
36     virtual ~wxStatusBarGeneric();
37 
38     bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
39                 long style = wxST_SIZEGRIP,
40                 const wxString& name = wxStatusBarNameStr);
41 
42     // Create status line
43     virtual void SetFieldsCount(int number = 1,
44                                 const int *widths = (const int *) NULL);
45 
46     // Set status line text
47     virtual void SetStatusText(const wxString& text, int number = 0);
48     virtual wxString GetStatusText(int number = 0) const;
49 
50     // Set status line widths
51     virtual void SetStatusWidths(int n, const int widths_field[]);
52 
53     // Get the position and size of the field's internal bounding rectangle
54     virtual bool GetFieldRect(int i, wxRect& rect) const;
55 
56     // sets the minimal vertical size of the status bar
57     virtual void SetMinHeight(int height);
58 
GetBorderX()59     virtual int GetBorderX() const { return m_borderX; }
GetBorderY()60     virtual int GetBorderY() const { return m_borderY; }
61 
62     ////////////////////////////////////////////////////////////////////////
63     // Implementation
64 
65     virtual void DrawFieldText(wxDC& dc, int i);
66     virtual void DrawField(wxDC& dc, int i);
67 
68     void SetBorderX(int x);
69     void SetBorderY(int y);
70 
71     void OnPaint(wxPaintEvent& event);
72 
73     void OnLeftDown(wxMouseEvent& event);
74     void OnRightDown(wxMouseEvent& event);
75 
76     virtual void InitColours();
77 
78     // Responds to colour changes
79     void OnSysColourChanged(wxSysColourChangedEvent& event);
80 
81 protected:
82     // common part of all ctors
83     void Init();
84 
85     wxArrayString     m_statusStrings;
86 
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;
91 
92     int               m_borderX;
93     int               m_borderY;
94     wxPen             m_mediumShadowPen;
95     wxPen             m_hilightPen;
96 
97     virtual wxSize DoGetBestSize() const;
98 
99 private:
100     DECLARE_EVENT_TABLE()
101     DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
102 };
103 
104 #endif // wxUSE_STATUSBAR
105 
106 #endif
107     // _WX_GENERIC_STATUSBR_H_
108