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_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "statusbr.h"
21 #include "wx/statusbr.h"
22 #include "wx/arrstr.h"
24 WXDLLEXPORT_DATA(extern 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 wxFont m_defaultStatusBarFont
;
119 wxPen m_mediumShadowPen
;
122 virtual wxSize
DoGetBestSize() const;
125 DECLARE_EVENT_TABLE()
126 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric
)
130 // _WX_GENERIC_STATUSBR_H_