]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/statusbr.h
added a couple of base classes
[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
3304646d
WS
15#include "wx/defs.h"
16
17#if wxUSE_STATUSBAR
18
ac57418f
RR
19#include "wx/pen.h"
20#include "wx/font.h"
af07f174 21#include "wx/statusbr.h"
2da2f941 22#include "wx/arrstr.h"
c801d85f 23
63ec432b 24extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[];
c801d85f 25
ed791986 26class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
c801d85f 27{
c801d85f 28public:
3304646d
WS
29 wxStatusBarGeneric() { Init(); }
30 wxStatusBarGeneric(wxWindow *parent,
31 wxWindowID winid,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxFULL_REPAINT_ON_RESIZE,
35 const wxString& name = wxPanelNameStr)
36 {
37 Init();
390015c0 38
3304646d
WS
39 Create(parent, winid, pos, size, style, name);
40 }
41 wxStatusBarGeneric(wxWindow *parent,
42 wxWindowID winid,
43 long style,
44 const wxString& name = wxPanelNameStr)
45 {
46 Init();
390015c0 47
3304646d
WS
48 Create(parent, winid, style, name);
49 }
ed791986 50
3304646d 51 virtual ~wxStatusBarGeneric();
c801d85f 52
3304646d
WS
53 bool Create(wxWindow *parent, wxWindowID winid,
54 const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
55 const wxSize& WXUNUSED(size) = wxDefaultSize,
56 long style = wxFULL_REPAINT_ON_RESIZE,
57 const wxString& name = wxPanelNameStr)
58 {
59 return Create(parent, winid, style, name);
60 }
c801d85f 61
3304646d
WS
62 bool Create(wxWindow *parent, wxWindowID winid,
63 long style,
64 const wxString& name = wxPanelNameStr);
c801d85f 65
3304646d
WS
66 // Create status line
67 virtual void SetFieldsCount(int number = 1,
68 const int *widths = (const int *) NULL);
c801d85f 69
3304646d
WS
70 // Set status line text
71 virtual void SetStatusText(const wxString& text, int number = 0);
72 virtual wxString GetStatusText(int number = 0) const;
c801d85f 73
3304646d
WS
74 // Set status line widths
75 virtual void SetStatusWidths(int n, const int widths_field[]);
c801d85f 76
3304646d
WS
77 // Get the position and size of the field's internal bounding rectangle
78 virtual bool GetFieldRect(int i, wxRect& rect) const;
c801d85f 79
3304646d
WS
80 // sets the minimal vertical size of the status bar
81 virtual void SetMinHeight(int height);
ed791986 82
3304646d
WS
83 virtual int GetBorderX() const { return m_borderX; }
84 virtual int GetBorderY() const { return m_borderY; }
c801d85f 85
3304646d
WS
86 ////////////////////////////////////////////////////////////////////////
87 // Implementation
c801d85f 88
3304646d
WS
89 virtual void DrawFieldText(wxDC& dc, int i);
90 virtual void DrawField(wxDC& dc, int i);
ed791986 91
3304646d
WS
92 void SetBorderX(int x);
93 void SetBorderY(int y);
ed791986 94
3304646d 95 void OnPaint(wxPaintEvent& event);
ca65c044 96
3304646d
WS
97 void OnLeftDown(wxMouseEvent& event);
98 void OnRightDown(wxMouseEvent& event);
c801d85f 99
3304646d 100 virtual void InitColours();
c801d85f 101
3304646d
WS
102 // Responds to colour changes
103 void OnSysColourChanged(wxSysColourChangedEvent& event);
c801d85f
KB
104
105protected:
3304646d
WS
106 // common part of all ctors
107 void Init();
390015c0 108
3304646d 109 wxArrayString m_statusStrings;
390015c0 110
3304646d
WS
111 // the last known width of the client rect (used to rebuild cache)
112 int m_lastClientWidth;
113 // the widths of the status bar panes in pixels
114 wxArrayInt m_widthsAbs;
390015c0 115
3304646d
WS
116 int m_borderX;
117 int m_borderY;
118 wxPen m_mediumShadowPen;
119 wxPen m_hilightPen;
c801d85f 120
3304646d 121 virtual wxSize DoGetBestSize() const;
595a9493 122
ed791986 123private:
3304646d
WS
124 DECLARE_EVENT_TABLE()
125 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
c801d85f
KB
126};
127
3304646d
WS
128#endif // wxUSE_STATUSBAR
129
c801d85f 130#endif
ed791986 131 // _WX_GENERIC_STATUSBR_H_