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
);
48 virtual void SetFieldsCount(int number
= 1,
49 const int *widths
= (const int *) NULL
);
51 // Set status line text
52 virtual void SetStatusText(const wxString
& text
, int number
= 0);
54 // Set status line widths
55 virtual void SetStatusWidths(int n
, const int widths_field
[]);
57 // Get the position and size of the field's internal bounding rectangle
58 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
60 // sets the minimal vertical size of the status bar
61 virtual void SetMinHeight(int height
);
63 virtual int GetBorderX() const { return m_borderX
; }
64 virtual int GetBorderY() const { return m_borderY
; }
67 // implementation only (not part of wxStatusBar public API):
69 int GetFieldFromPoint(const wxPoint
& point
) const;
71 protected: // event handlers
73 void OnPaint(wxPaintEvent
& event
);
74 void OnSize(wxSizeEvent
& event
);
76 void OnLeftDown(wxMouseEvent
& event
);
77 void OnRightDown(wxMouseEvent
& event
);
79 // Responds to colour changes
80 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
84 virtual void DrawFieldText(wxDC
& dc
, const wxRect
& rc
, int i
, int textHeight
);
85 virtual void DrawField(wxDC
& dc
, int i
, int textHeight
);
87 void SetBorderX(int x
);
88 void SetBorderY(int y
);
90 virtual void InitColours();
92 // true if the status bar shows the size grip: for this it must have
93 // wxSTB_SIZEGRIP style and the window it is attached to must be resizeable
95 bool ShowsSizeGrip() const;
97 // returns the position and the size of the size grip
98 wxRect
GetSizeGripRect() const;
100 // common part of all ctors
103 // the last known height of the client rect
104 int m_lastClientHeight
;
106 // the absolute widths of the status bar panes in pixels
107 wxArrayInt m_widthsAbs
;
112 wxPen m_mediumShadowPen
;
115 virtual wxSize
DoGetBestSize() const;
118 DECLARE_EVENT_TABLE()
119 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric
)
122 #endif // wxUSE_STATUSBAR
125 // _WX_GENERIC_STATUSBR_H_