]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/statusbr.h
rename gsockmsw files to sockmsw
[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
53a2db12 22class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase
c801d85f 23{
c801d85f 24public:
3304646d
WS
25 wxStatusBarGeneric() { Init(); }
26 wxStatusBarGeneric(wxWindow *parent,
53b6d7a2
PC
27 wxWindowID winid = wxID_ANY,
28 long style = wxST_SIZEGRIP,
29 const wxString& name = wxStatusBarNameStr)
3304646d
WS
30 {
31 Init();
390015c0 32
3304646d
WS
33 Create(parent, winid, style, name);
34 }
ed791986 35
3304646d 36 virtual ~wxStatusBarGeneric();
c801d85f 37
53b6d7a2
PC
38 bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
39 long style = wxST_SIZEGRIP,
40 const wxString& name = wxStatusBarNameStr);
c801d85f 41
3304646d
WS
42 // Create status line
43 virtual void SetFieldsCount(int number = 1,
44 const int *widths = (const int *) NULL);
c801d85f 45
3304646d
WS
46 // Set status line text
47 virtual void SetStatusText(const wxString& text, int number = 0);
48 virtual wxString GetStatusText(int number = 0) const;
c801d85f 49
3304646d
WS
50 // Set status line widths
51 virtual void SetStatusWidths(int n, const int widths_field[]);
c801d85f 52
3304646d
WS
53 // Get the position and size of the field's internal bounding rectangle
54 virtual bool GetFieldRect(int i, wxRect& rect) const;
c801d85f 55
3304646d
WS
56 // sets the minimal vertical size of the status bar
57 virtual void SetMinHeight(int height);
ed791986 58
3304646d
WS
59 virtual int GetBorderX() const { return m_borderX; }
60 virtual int GetBorderY() const { return m_borderY; }
c801d85f 61
3304646d
WS
62 ////////////////////////////////////////////////////////////////////////
63 // Implementation
c801d85f 64
3304646d
WS
65 virtual void DrawFieldText(wxDC& dc, int i);
66 virtual void DrawField(wxDC& dc, int i);
ed791986 67
3304646d
WS
68 void SetBorderX(int x);
69 void SetBorderY(int y);
ed791986 70
3304646d 71 void OnPaint(wxPaintEvent& event);
ca65c044 72
3304646d
WS
73 void OnLeftDown(wxMouseEvent& event);
74 void OnRightDown(wxMouseEvent& event);
c801d85f 75
3304646d 76 virtual void InitColours();
c801d85f 77
3304646d
WS
78 // Responds to colour changes
79 void OnSysColourChanged(wxSysColourChangedEvent& event);
c801d85f 80
7422d7c4
VZ
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
c801d85f 86protected:
3304646d
WS
87 // common part of all ctors
88 void Init();
390015c0 89
3304646d 90 wxArrayString m_statusStrings;
390015c0 91
3304646d
WS
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;
390015c0 96
3304646d
WS
97 int m_borderX;
98 int m_borderY;
99 wxPen m_mediumShadowPen;
100 wxPen m_hilightPen;
c801d85f 101
3304646d 102 virtual wxSize DoGetBestSize() const;
595a9493 103
ed791986 104private:
3304646d
WS
105 DECLARE_EVENT_TABLE()
106 DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
c801d85f
KB
107};
108
245243ec
WS
109#endif // wxUSE_STATUSBAR
110
c801d85f 111#endif
ed791986 112 // _WX_GENERIC_STATUSBR_H_