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
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_STATUSBR_H_
13 #define _WX_GENERIC_STATUSBR_H_
21 #include "wx/statusbr.h"
22 #include "wx/arrstr.h"
24 extern WXDLLEXPORT_DATA(const wxChar
) wxPanelNameStr
[];
26 class WXDLLEXPORT wxStatusBarGeneric
: public wxStatusBarBase
29 wxStatusBarGeneric() { Init(); }
30 wxStatusBarGeneric(wxWindow
*parent
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxFULL_REPAINT_ON_RESIZE
,
35 const wxString
& name
= wxPanelNameStr
)
39 Create(parent
, winid
, pos
, size
, style
, name
);
41 wxStatusBarGeneric(wxWindow
*parent
,
44 const wxString
& name
= wxPanelNameStr
)
48 Create(parent
, winid
, style
, name
);
51 virtual ~wxStatusBarGeneric();
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
)
59 return Create(parent
, winid
, style
, name
);
62 bool Create(wxWindow
*parent
, wxWindowID winid
,
64 const wxString
& name
= wxPanelNameStr
);
67 virtual void SetFieldsCount(int number
= 1,
68 const int *widths
= (const int *) NULL
);
70 // Set status line text
71 virtual void SetStatusText(const wxString
& text
, int number
= 0);
72 virtual wxString
GetStatusText(int number
= 0) const;
74 // Set status line widths
75 virtual void SetStatusWidths(int n
, const int widths_field
[]);
77 // Get the position and size of the field's internal bounding rectangle
78 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
80 // sets the minimal vertical size of the status bar
81 virtual void SetMinHeight(int height
);
83 virtual int GetBorderX() const { return m_borderX
; }
84 virtual int GetBorderY() const { return m_borderY
; }
86 ////////////////////////////////////////////////////////////////////////
89 virtual void DrawFieldText(wxDC
& dc
, int i
);
90 virtual void DrawField(wxDC
& dc
, int i
);
92 void SetBorderX(int x
);
93 void SetBorderY(int y
);
95 void OnPaint(wxPaintEvent
& event
);
97 void OnLeftDown(wxMouseEvent
& event
);
98 void OnRightDown(wxMouseEvent
& event
);
100 virtual void InitColours();
102 // Responds to colour changes
103 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
106 // common part of all ctors
109 wxArrayString m_statusStrings
;
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
;
118 wxPen m_mediumShadowPen
;
121 virtual wxSize
DoGetBestSize() const;
124 DECLARE_EVENT_TABLE()
125 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric
)
128 #endif // wxUSE_STATUSBAR
131 // _WX_GENERIC_STATUSBR_H_