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