]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/generic/statusbr.h
wxXML load/save improvements: added ability to not ignore whitespace and specify...
[wxWidgets.git] / include / wx / generic / statusbr.h
... / ...
CommitLineData
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
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_GENERIC_STATUSBR_H_
13#define _WX_GENERIC_STATUSBR_H_
14
15#include "wx/pen.h"
16#include "wx/arrstr.h"
17
18class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
19{
20public:
21 wxStatusBarGeneric() { Init(); }
22 wxStatusBarGeneric(wxWindow *parent,
23 wxWindowID winid = wxID_ANY,
24 long style = wxST_SIZEGRIP,
25 const wxString& name = wxStatusBarNameStr)
26 {
27 Init();
28
29 Create(parent, winid, style, name);
30 }
31
32 virtual ~wxStatusBarGeneric();
33
34 bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
35 long style = wxST_SIZEGRIP,
36 const wxString& name = wxStatusBarNameStr);
37
38 // Create status line
39 virtual void SetFieldsCount(int number = 1,
40 const int *widths = (const int *) NULL);
41
42 // Set status line text
43 virtual void SetStatusText(const wxString& text, int number = 0);
44 virtual wxString GetStatusText(int number = 0) const;
45
46 // Set status line widths
47 virtual void SetStatusWidths(int n, const int widths_field[]);
48
49 // Get the position and size of the field's internal bounding rectangle
50 virtual bool GetFieldRect(int i, wxRect& rect) const;
51
52 // sets the minimal vertical size of the status bar
53 virtual void SetMinHeight(int height);
54
55 virtual int GetBorderX() const { return m_borderX; }
56 virtual int GetBorderY() const { return m_borderY; }
57
58 ////////////////////////////////////////////////////////////////////////
59 // Implementation
60
61 virtual void DrawFieldText(wxDC& dc, int i);
62 virtual void DrawField(wxDC& dc, int i);
63
64 void SetBorderX(int x);
65 void SetBorderY(int y);
66
67 void OnPaint(wxPaintEvent& event);
68
69 void OnLeftDown(wxMouseEvent& event);
70 void OnRightDown(wxMouseEvent& event);
71
72 virtual void InitColours();
73
74 // Responds to colour changes
75 void OnSysColourChanged(wxSysColourChangedEvent& event);
76
77protected:
78 // common part of all ctors
79 void Init();
80
81 wxArrayString m_statusStrings;
82
83 // the last known width of the client rect (used to rebuild cache)
84 int m_lastClientWidth;
85 // the widths of the status bar panes in pixels
86 wxArrayInt m_widthsAbs;
87
88 int m_borderX;
89 int m_borderY;
90 wxPen m_mediumShadowPen;
91 wxPen m_hilightPen;
92
93 virtual wxSize DoGetBestSize() const;
94
95private:
96 DECLARE_EVENT_TABLE()
97 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
98};
99
100#endif
101 // _WX_GENERIC_STATUSBR_H_