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_
20 #include "wx/arrstr.h"
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 class WXDLLIMPEXP_CORE wxStatusBarGeneric
: public wxStatusBarBase
30 wxStatusBarGeneric() { Init(); }
31 wxStatusBarGeneric(wxWindow
*parent
,
32 wxWindowID winid
= wxID_ANY
,
33 long style
= wxSTB_DEFAULT_STYLE
,
34 const wxString
& name
= wxStatusBarNameStr
)
38 Create(parent
, winid
, style
, name
);
41 virtual ~wxStatusBarGeneric();
43 bool Create(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
,
44 long style
= wxSTB_DEFAULT_STYLE
,
45 const wxString
& name
= wxStatusBarNameStr
);
47 // implement base class methods
48 virtual void SetStatusWidths(int n
, const int widths_field
[]);
49 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
50 virtual void SetMinHeight(int height
);
52 virtual int GetBorderX() const { return m_borderX
; }
53 virtual int GetBorderY() const { return m_borderY
; }
56 // implementation only (not part of wxStatusBar public API):
58 int GetFieldFromPoint(const wxPoint
& point
) const;
61 virtual void DoUpdateStatusText(int number
);
64 void OnPaint(wxPaintEvent
& event
);
65 void OnSize(wxSizeEvent
& event
);
67 void OnLeftDown(wxMouseEvent
& event
);
68 void OnRightDown(wxMouseEvent
& event
);
70 // Responds to colour changes
71 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
75 virtual void DrawFieldText(wxDC
& dc
, const wxRect
& rc
, int i
, int textHeight
);
76 virtual void DrawField(wxDC
& dc
, int i
, int textHeight
);
78 void SetBorderX(int x
);
79 void SetBorderY(int y
);
81 virtual void InitColours();
83 // true if the status bar shows the size grip: for this it must have
84 // wxSTB_SIZEGRIP style and the window it is attached to must be resizable
86 bool ShowsSizeGrip() const;
88 // returns the position and the size of the size grip
89 wxRect
GetSizeGripRect() const;
91 // common part of all ctors
94 // the last known size, fields widths must be updated whenever it's out of
96 wxSize m_lastClientSize
;
98 // the absolute widths of the status bar panes in pixels
99 wxArrayInt m_widthsAbs
;
104 wxPen m_mediumShadowPen
;
107 virtual wxSize
DoGetBestSize() const;
110 // Update m_lastClientSize and m_widthsAbs from the current size.
111 void DoUpdateFieldWidths();
113 DECLARE_EVENT_TABLE()
114 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric
)
117 #endif // wxUSE_STATUSBAR
120 // _WX_GENERIC_STATUSBR_H_