1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/statbr.h
3 // Purpose: native implementation of wxStatusBar
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_STATUSBAR_H_
13 #define _WX_MSW_STATUSBAR_H_
15 #if wxUSE_NATIVE_STATUSBAR
17 #include "wx/vector.h"
18 #include "wx/tooltip.h"
20 class WXDLLIMPEXP_FWD_CORE wxClientDC
;
22 class WXDLLIMPEXP_CORE wxStatusBar
: public wxStatusBarBase
27 wxStatusBar(wxWindow
*parent
,
28 wxWindowID id
= wxID_ANY
,
29 long style
= wxSTB_DEFAULT_STYLE
,
30 const wxString
& name
= wxStatusBarNameStr
)
33 (void)Create(parent
, id
, style
, name
);
36 bool Create(wxWindow
*parent
,
37 wxWindowID id
= wxID_ANY
,
38 long style
= wxSTB_DEFAULT_STYLE
,
39 const wxString
& name
= wxStatusBarNameStr
);
41 virtual ~wxStatusBar();
43 // a status line can have several (<256) fields numbered from 0
44 virtual void SetFieldsCount(int number
= 1, const int *widths
= NULL
);
46 // each field of status line has it's own text
47 virtual void SetStatusText(const wxString
& text
, int number
= 0);
49 // set status line fields' widths
50 virtual void SetStatusWidths(int n
, const int widths_field
[]);
52 // set status line fields' styles
53 virtual void SetStatusStyles(int n
, const int styles
[]);
55 // sets the minimal vertical size of the status bar
56 virtual void SetMinHeight(int height
);
58 // get the position and size of the field's internal bounding rectangle
59 virtual bool GetFieldRect(int i
, wxRect
& rect
) const;
61 // get the border size
62 virtual int GetBorderX() const;
63 virtual int GetBorderY() const;
65 virtual bool SetFont(const wxFont
& font
);
67 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
,
72 void CopyFieldsWidth(const int widths
[]);
73 void SetFieldsWidth();
74 void UpdateFieldText(int nField
);
76 // override some base class virtuals
77 virtual wxSize
DoGetBestSize() const;
78 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
80 virtual bool MSWProcessMessage(WXMSG
* pMsg
);
81 virtual bool MSWOnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
* result
);
84 // used by UpdateFieldText
87 // the tooltips used when wxSTB_SHOW_TIPS is given
88 wxVector
<wxToolTip
*> m_tooltips
;
91 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBar
)
94 #endif // wxUSE_NATIVE_STATUSBAR
96 #endif // _WX_MSW_STATUSBAR_H_