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
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_STATUSBR_H_
12 #define _WX_GENERIC_STATUSBR_H_
19 #include "wx/arrstr.h"
22 // ----------------------------------------------------------------------------
24 // ----------------------------------------------------------------------------
26 class WXDLLIMPEXP_CORE wxStatusBarGeneric
: public wxStatusBarBase
29 wxStatusBarGeneric() { Init(); }
30 wxStatusBarGeneric(wxWindow
*parent
,
31 wxWindowID winid
= wxID_ANY
,
32 long style
= wxSTB_DEFAULT_STYLE
,
33 const wxString
& name
= wxStatusBarNameStr
)
37 Create(parent
, winid
, style
, name
);
40 virtual ~wxStatusBarGeneric();
42 bool Create(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
,
43 long style
= wxSTB_DEFAULT_STYLE
,
44 const wxString
& name
= wxStatusBarNameStr
);
46 // implement base class methods
47 virtual void SetStatusWidths(int n
, const int widths_field
[]);
48 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
49 virtual void SetMinHeight(int height
);
51 virtual int GetBorderX() const { return m_borderX
; }
52 virtual int GetBorderY() const { return m_borderY
; }
55 // implementation only (not part of wxStatusBar public API):
57 int GetFieldFromPoint(const wxPoint
& point
) const;
60 virtual void DoUpdateStatusText(int number
);
63 void OnPaint(wxPaintEvent
& event
);
64 void OnSize(wxSizeEvent
& event
);
66 void OnLeftDown(wxMouseEvent
& event
);
67 void OnRightDown(wxMouseEvent
& event
);
69 // Responds to colour changes
70 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
74 virtual void DrawFieldText(wxDC
& dc
, const wxRect
& rc
, int i
, int textHeight
);
75 virtual void DrawField(wxDC
& dc
, int i
, int textHeight
);
77 void SetBorderX(int x
);
78 void SetBorderY(int y
);
80 virtual void InitColours();
82 // true if the status bar shows the size grip: for this it must have
83 // wxSTB_SIZEGRIP style and the window it is attached to must be resizable
85 bool ShowsSizeGrip() const;
87 // returns the position and the size of the size grip
88 wxRect
GetSizeGripRect() const;
90 // common part of all ctors
93 // the last known size, fields widths must be updated whenever it's out of
95 wxSize m_lastClientSize
;
97 // the absolute widths of the status bar panes in pixels
98 wxArrayInt m_widthsAbs
;
103 wxPen m_mediumShadowPen
;
106 virtual wxSize
DoGetBestSize() const;
109 // Update m_lastClientSize and m_widthsAbs from the current size.
110 void DoUpdateFieldWidths();
112 DECLARE_EVENT_TABLE()
113 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric
)
116 #endif // wxUSE_STATUSBAR
119 // _WX_GENERIC_STATUSBR_H_