]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/statusbar.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / msw / statusbar.h
CommitLineData
2bda0e17 1///////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/msw/statusbar.h
2bda0e17
KB
3// Purpose: native implementation of wxStatusBar
4// Author: Vadim Zeitlin
a79fa1ed 5// Modified by:
2bda0e17 6// Created: 04.04.98
2bda0e17 7// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
65571936 8// Licence: wxWindows licence
2bda0e17
KB
9///////////////////////////////////////////////////////////////////////////////
10
936f6353
VZ
11#ifndef _WX_MSW_STATUSBAR_H_
12#define _WX_MSW_STATUSBAR_H_
2bda0e17 13
ed791986 14#if wxUSE_NATIVE_STATUSBAR
2bda0e17 15
6418ad5e
FM
16#include "wx/vector.h"
17#include "wx/tooltip.h"
18
22b476f1 19class WXDLLIMPEXP_FWD_CORE wxClientDC;
0cd15959 20
53a2db12 21class WXDLLIMPEXP_CORE wxStatusBar : public wxStatusBarBase
2bda0e17 22{
2bda0e17 23public:
ed791986 24 // ctors and such
936f6353
VZ
25 wxStatusBar();
26 wxStatusBar(wxWindow *parent,
27 wxWindowID id = wxID_ANY,
c4c178c1 28 long style = wxSTB_DEFAULT_STYLE,
936f6353 29 const wxString& name = wxStatusBarNameStr)
ed791986 30 {
80255b7e 31 m_pDC = NULL;
ed791986
VZ
32 (void)Create(parent, id, style, name);
33 }
34
35 bool Create(wxWindow *parent,
57f4f925 36 wxWindowID id = wxID_ANY,
c4c178c1 37 long style = wxSTB_DEFAULT_STYLE,
53b6d7a2 38 const wxString& name = wxStatusBarNameStr);
ed791986 39
936f6353 40 virtual ~wxStatusBar();
2bda0e17 41
6cf68971 42 // implement base class methods
ed791986 43 virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
ed791986 44 virtual void SetStatusWidths(int n, const int widths_field[]);
c2919ab3 45 virtual void SetStatusStyles(int n, const int styles[]);
ed791986 46 virtual void SetMinHeight(int height);
ed791986 47 virtual bool GetFieldRect(int i, wxRect& rect) const;
2bda0e17 48
ed791986
VZ
49 virtual int GetBorderX() const;
50 virtual int GetBorderY() const;
51
6cf68971 52 // override some wxWindow virtual methods too
0cd15959
FM
53 virtual bool SetFont(const wxFont& font);
54
6f02a879
VZ
55 virtual WXLRESULT MSWWindowProc(WXUINT nMsg,
56 WXWPARAM wParam,
57 WXLPARAM lParam);
6418ad5e 58
2bda0e17 59protected:
6cf68971
VZ
60 // implement base class pure virtual method
61 virtual void DoUpdateStatusText(int number);
ed791986 62
c0ac3149 63 // override some base class virtuals
db6150d5 64 virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
c0ac3149
VZ
65 virtual wxSize DoGetBestSize() const;
66 virtual void DoMoveWindow(int x, int y, int width, int height);
6418ad5e
FM
67#if wxUSE_TOOLTIPS
68 virtual bool MSWProcessMessage(WXMSG* pMsg);
69 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result);
70#endif
cbc66a27 71
6cf68971
VZ
72 // implementation of the public SetStatusWidths()
73 void MSWUpdateFieldsWidths();
74
75 // used by DoUpdateStatusText()
0cd15959
FM
76 wxClientDC *m_pDC;
77
864c08b2 78#if wxUSE_TOOLTIPS
6418ad5e
FM
79 // the tooltips used when wxSTB_SHOW_TIPS is given
80 wxVector<wxToolTip*> m_tooltips;
864c08b2 81#endif
6418ad5e 82
ed791986 83private:
edd608b1
VZ
84 struct MSWBorders
85 {
86 int horz,
87 vert,
88 between;
89 };
90
91 // retrieve all status bar borders using SB_GETBORDERS
92 MSWBorders MSWGetBorders() const;
93
94 // return the size of the border between the fields
95 int MSWGetBorderWidth() const;
96
97 struct MSWMetrics
98 {
99 int gripWidth,
100 textMargin;
101 };
102
103 // return the various status bar metrics
104 static const MSWMetrics& MSWGetMetrics();
105
936f6353 106 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBar)
2bda0e17
KB
107};
108
47d67540 109#endif // wxUSE_NATIVE_STATUSBAR
2bda0e17 110
936f6353 111#endif // _WX_MSW_STATUSBAR_H_