]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/statusbr.h
correction to make wxGTK1 compile
[wxWidgets.git] / include / wx / generic / statusbr.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
ed791986
VZ
2// Name: wx/generic/statusbr.h
3// Purpose: wxStatusBarGeneric class
c801d85f 4// Author: Julian Smart
ed791986 5// Modified by: VZ at 05.02.00 to derive from wxStatusBarBase
c801d85f
KB
6// Created: 01/02/97
7// RCS-ID: $Id$
371a5b4e 8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
ed791986
VZ
12#ifndef _WX_GENERIC_STATUSBR_H_
13#define _WX_GENERIC_STATUSBR_H_
c801d85f 14
245243ec
WS
15#include "wx/defs.h"
16
17#if wxUSE_STATUSBAR
18
ac57418f 19#include "wx/pen.h"
2da2f941 20#include "wx/arrstr.h"
c801d85f 21
7b6fefbe
FM
22
23// ----------------------------------------------------------------------------
24// wxStatusBarGeneric
25// ----------------------------------------------------------------------------
26
53a2db12 27class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase
c801d85f 28{
c801d85f 29public:
3304646d
WS
30 wxStatusBarGeneric() { Init(); }
31 wxStatusBarGeneric(wxWindow *parent,
53b6d7a2 32 wxWindowID winid = wxID_ANY,
c4c178c1 33 long style = wxSTB_DEFAULT_STYLE,
53b6d7a2 34 const wxString& name = wxStatusBarNameStr)
3304646d
WS
35 {
36 Init();
390015c0 37
3304646d
WS
38 Create(parent, winid, style, name);
39 }
ed791986 40
3304646d 41 virtual ~wxStatusBarGeneric();
c801d85f 42
53b6d7a2 43 bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
c4c178c1 44 long style = wxSTB_DEFAULT_STYLE,
53b6d7a2 45 const wxString& name = wxStatusBarNameStr);
c801d85f 46
6cf68971 47 // implement base class methods
3304646d 48 virtual void SetStatusWidths(int n, const int widths_field[]);
3304646d 49 virtual bool GetFieldRect(int i, wxRect& rect) const;
3304646d 50 virtual void SetMinHeight(int height);
ed791986 51
3304646d
WS
52 virtual int GetBorderX() const { return m_borderX; }
53 virtual int GetBorderY() const { return m_borderY; }
c801d85f 54
78612fa6 55
c94bdf2a
FM
56 // implementation only (not part of wxStatusBar public API):
57
58 int GetFieldFromPoint(const wxPoint& point) const;
59
6cf68971
VZ
60protected:
61 virtual void DoUpdateStatusText(int number);
ed791986 62
6cf68971 63 // event handlers
3304646d 64 void OnPaint(wxPaintEvent& event);
ba4589db 65 void OnSize(wxSizeEvent& event);
ca65c044 66
3304646d
WS
67 void OnLeftDown(wxMouseEvent& event);
68 void OnRightDown(wxMouseEvent& event);
c801d85f 69
3304646d
WS
70 // Responds to colour changes
71 void OnSysColourChanged(wxSysColourChangedEvent& event);
c801d85f 72
ba4589db
FM
73protected:
74
75 virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight);
76 virtual void DrawField(wxDC& dc, int i, int textHeight);
77
78 void SetBorderX(int x);
79 void SetBorderY(int y);
80
81 virtual void InitColours();
82
7422d7c4 83 // true if the status bar shows the size grip: for this it must have
c4c178c1 84 // wxSTB_SIZEGRIP style and the window it is attached to must be resizeable
7422d7c4
VZ
85 // and not maximized
86 bool ShowsSizeGrip() const;
87
78612fa6
FM
88 // returns the position and the size of the size grip
89 wxRect GetSizeGripRect() const;
90
3304646d
WS
91 // common part of all ctors
92 void Init();
390015c0 93
ba4589db
FM
94 // the last known height of the client rect
95 int m_lastClientHeight;
7b6fefbe
FM
96
97 // the absolute widths of the status bar panes in pixels
3304646d 98 wxArrayInt m_widthsAbs;
390015c0 99
3304646d
WS
100 int m_borderX;
101 int m_borderY;
c94bdf2a 102
3304646d
WS
103 wxPen m_mediumShadowPen;
104 wxPen m_hilightPen;
c801d85f 105
3304646d 106 virtual wxSize DoGetBestSize() const;
595a9493 107
ed791986 108private:
3304646d
WS
109 DECLARE_EVENT_TABLE()
110 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
c801d85f
KB
111};
112
245243ec
WS
113#endif // wxUSE_STATUSBAR
114
c801d85f 115#endif
ed791986 116 // _WX_GENERIC_STATUSBR_H_