]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/generic/statusbr.h
addind nonowned window implementation
[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/defs.h"
16
17#if wxUSE_STATUSBAR
18
19#include "wx/pen.h"
20#include "wx/arrstr.h"
21
22class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
23{
24public:
25 wxStatusBarGeneric() { Init(); }
26 wxStatusBarGeneric(wxWindow *parent,
27 wxWindowID winid = wxID_ANY,
28 long style = wxST_SIZEGRIP,
29 const wxString& name = wxStatusBarNameStr)
30 {
31 Init();
32
33 Create(parent, winid, style, name);
34 }
35
36 virtual ~wxStatusBarGeneric();
37
38 bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
39 long style = wxST_SIZEGRIP,
40 const wxString& name = wxStatusBarNameStr);
41
42 // Create status line
43 virtual void SetFieldsCount(int number = 1,
44 const int *widths = (const int *) NULL);
45
46 // Set status line text
47 virtual void SetStatusText(const wxString& text, int number = 0);
48 virtual wxString GetStatusText(int number = 0) const;
49
50 // Set status line widths
51 virtual void SetStatusWidths(int n, const int widths_field[]);
52
53 // Get the position and size of the field's internal bounding rectangle
54 virtual bool GetFieldRect(int i, wxRect& rect) const;
55
56 // sets the minimal vertical size of the status bar
57 virtual void SetMinHeight(int height);
58
59 virtual int GetBorderX() const { return m_borderX; }
60 virtual int GetBorderY() const { return m_borderY; }
61
62 ////////////////////////////////////////////////////////////////////////
63 // Implementation
64
65 virtual void DrawFieldText(wxDC& dc, int i);
66 virtual void DrawField(wxDC& dc, int i);
67
68 void SetBorderX(int x);
69 void SetBorderY(int y);
70
71 void OnPaint(wxPaintEvent& event);
72
73 void OnLeftDown(wxMouseEvent& event);
74 void OnRightDown(wxMouseEvent& event);
75
76 virtual void InitColours();
77
78 // Responds to colour changes
79 void OnSysColourChanged(wxSysColourChangedEvent& event);
80
81 // true if the status bar shows the size grip: for this it must have
82 // wxST_SIZEGRIP style and the window it is attached to must be resizeable
83 // and not maximized
84 bool ShowsSizeGrip() const;
85
86protected:
87 // common part of all ctors
88 void Init();
89
90 wxArrayString m_statusStrings;
91
92 // the last known width of the client rect (used to rebuild cache)
93 int m_lastClientWidth;
94 // the widths of the status bar panes in pixels
95 wxArrayInt m_widthsAbs;
96
97 int m_borderX;
98 int m_borderY;
99 wxPen m_mediumShadowPen;
100 wxPen m_hilightPen;
101
102 virtual wxSize DoGetBestSize() const;
103
104private:
105 DECLARE_EVENT_TABLE()
106 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
107};
108
109#endif // wxUSE_STATUSBAR
110
111#endif
112 // _WX_GENERIC_STATUSBR_H_