]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/statusbr.h
make wxFileName::{Mk,Rm}dir() const (closes #10868)
[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
3304646d
WS
47 // Create status line
48 virtual void SetFieldsCount(int number = 1,
49 const int *widths = (const int *) NULL);
c801d85f 50
3304646d
WS
51 // Set status line text
52 virtual void SetStatusText(const wxString& text, int number = 0);
c801d85f 53
3304646d
WS
54 // Set status line widths
55 virtual void SetStatusWidths(int n, const int widths_field[]);
c801d85f 56
3304646d
WS
57 // Get the position and size of the field's internal bounding rectangle
58 virtual bool GetFieldRect(int i, wxRect& rect) const;
c801d85f 59
3304646d
WS
60 // sets the minimal vertical size of the status bar
61 virtual void SetMinHeight(int height);
ed791986 62
3304646d
WS
63 virtual int GetBorderX() const { return m_borderX; }
64 virtual int GetBorderY() const { return m_borderY; }
c801d85f 65
78612fa6 66
c94bdf2a
FM
67 // implementation only (not part of wxStatusBar public API):
68
69 int GetFieldFromPoint(const wxPoint& point) const;
70
ba4589db 71protected: // event handlers
ed791986 72
3304646d 73 void OnPaint(wxPaintEvent& event);
ba4589db 74 void OnSize(wxSizeEvent& event);
ca65c044 75
3304646d
WS
76 void OnLeftDown(wxMouseEvent& event);
77 void OnRightDown(wxMouseEvent& event);
c801d85f 78
3304646d
WS
79 // Responds to colour changes
80 void OnSysColourChanged(wxSysColourChangedEvent& event);
c801d85f 81
ba4589db
FM
82protected:
83
84 virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight);
85 virtual void DrawField(wxDC& dc, int i, int textHeight);
86
87 void SetBorderX(int x);
88 void SetBorderY(int y);
89
90 virtual void InitColours();
91
7422d7c4 92 // true if the status bar shows the size grip: for this it must have
c4c178c1 93 // wxSTB_SIZEGRIP style and the window it is attached to must be resizeable
7422d7c4
VZ
94 // and not maximized
95 bool ShowsSizeGrip() const;
96
78612fa6
FM
97 // returns the position and the size of the size grip
98 wxRect GetSizeGripRect() const;
99
3304646d
WS
100 // common part of all ctors
101 void Init();
390015c0 102
ba4589db
FM
103 // the last known height of the client rect
104 int m_lastClientHeight;
7b6fefbe
FM
105
106 // the absolute widths of the status bar panes in pixels
3304646d 107 wxArrayInt m_widthsAbs;
390015c0 108
3304646d
WS
109 int m_borderX;
110 int m_borderY;
c94bdf2a 111
3304646d
WS
112 wxPen m_mediumShadowPen;
113 wxPen m_hilightPen;
c801d85f 114
3304646d 115 virtual wxSize DoGetBestSize() const;
595a9493 116
ed791986 117private:
3304646d
WS
118 DECLARE_EVENT_TABLE()
119 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
c801d85f
KB
120};
121
245243ec
WS
122#endif // wxUSE_STATUSBAR
123
c801d85f 124#endif
ed791986 125 // _WX_GENERIC_STATUSBR_H_