]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/statusbr.h
fix multiple problems with selection in controls with wxTR_MULTIPLE style (closes...
[wxWidgets.git] / include / wx / univ / statusbr.h
CommitLineData
71e03035
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/univ/statusbr.h
3// Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 14.10.01
7// RCS-ID: $Id$
8// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
65571936 9// Licence: wxWindows licence
71e03035
VZ
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_UNIV_STATUSBR_H_
13#define _WX_UNIV_STATUSBR_H_
14
fe9fea7e 15#include "wx/univ/inpcons.h"
b5435dcc 16#include "wx/arrstr.h"
fe9fea7e 17
71e03035 18// ----------------------------------------------------------------------------
7b6fefbe 19// wxStatusBarUniv: a window near the bottom of the frame used for status info
71e03035
VZ
20// ----------------------------------------------------------------------------
21
53a2db12 22class WXDLLIMPEXP_CORE wxStatusBarUniv : public wxStatusBarBase,
71e03035
VZ
23 public wxInputConsumer
24{
25public:
26 wxStatusBarUniv() { Init(); }
27
28 wxStatusBarUniv(wxWindow *parent,
a290fa5a 29 wxWindowID id = wxID_ANY,
71e03035
VZ
30 long style = 0,
31 const wxString& name = wxPanelNameStr)
32 {
33 Init();
34
35 (void)Create(parent, id, style, name);
36 }
37
38 bool Create(wxWindow *parent,
a290fa5a 39 wxWindowID id = wxID_ANY,
71e03035
VZ
40 long style = 0,
41 const wxString& name = wxPanelNameStr);
42
43 // set field count/widths
44 virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
45 virtual void SetStatusWidths(int n, const int widths[]);
46
47 // get/set the text of the given field
48 virtual void SetStatusText(const wxString& text, int number = 0);
71e03035
VZ
49
50 // Get the position and size of the field's internal bounding rectangle
51 virtual bool GetFieldRect(int i, wxRect& rect) const;
52
53 // sets the minimal vertical size of the status bar
54 virtual void SetMinHeight(int height);
55
56 // get the dimensions of the horizontal and vertical borders
57 virtual int GetBorderX() const;
58 virtual int GetBorderY() const;
59
6f02a879
VZ
60 // wxInputConsumer pure virtual
61 virtual wxWindow *GetInputWindow() const
5c33522f 62 { return const_cast<wxStatusBar*>(this); }
6f02a879 63
71e03035
VZ
64protected:
65 // recalculate the field widths
66 void OnSize(wxSizeEvent& event);
67
68 // draw the statusbar
69 virtual void DoDraw(wxControlRenderer *renderer);
70
71e03035
VZ
71 // tell them about our preferred height
72 virtual wxSize DoGetBestSize() const;
73
74 // override DoSetSize() to prevent the status bar height from changing
75 virtual void DoSetSize(int x, int y,
76 int width, int height,
77 int sizeFlags = wxSIZE_AUTO);
78
79 // get the (fixed) status bar height
80 wxCoord GetHeight() const;
81
82 // get the rectangle containing all the fields and the border between them
83 //
84 // also updates m_widthsAbs if necessary
85 wxRect GetTotalFieldRect(wxCoord *borderBetweenFields);
86
069d493e 87 // get the rect for this field without ani side effects (see code)
4077bf8d
JS
88 wxRect DoGetFieldRect(int n) const;
89
71e03035
VZ
90 // refresh the given field
91 void RefreshField(int i);
92
93 // common part of all ctors
94 void Init();
95
96private:
7b6fefbe 97 // the current status fields strings
0cd15959 98 //wxArrayString m_statusText;
71e03035
VZ
99
100 // the absolute status fields widths
101 wxArrayInt m_widthsAbs;
102
103 DECLARE_DYNAMIC_CLASS(wxStatusBarUniv)
104 DECLARE_EVENT_TABLE()
105 WX_DECLARE_INPUT_CONSUMER()
106};
107
108#endif // _WX_UNIV_STATUSBR_H_
109