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