]> git.saurik.com Git - wxWidgets.git/blame - include/wx/statusbr.h
the app doesn't exit any more if a dialog is shown (and destroyed) while
[wxWidgets.git] / include / wx / statusbr.h
CommitLineData
ed791986
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/statusbr.h
3// Purpose: wxStatusBar class interface
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 05.02.00
7// RCS-ID: $Id$
8// Copyright: (c) wxWindows team
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_STATUSBR_H_BASE_
13#define _WX_STATUSBR_H_BASE_
c801d85f 14
71e03035
VZ
15#ifdef __GNUG__
16 #pragma interface "statbar.h"
17#endif
18
ed791986
VZ
19#include "wx/window.h"
20
1e6feb95
VZ
21#if wxUSE_STATUSBAR
22
1f361cdd
MB
23#include "wx/list.h"
24
25WX_DECLARE_LIST(wxString, wxListString);
26
ed791986
VZ
27// ----------------------------------------------------------------------------
28// wxStatusBar: a window near the bottom of the frame used for status info
29// ----------------------------------------------------------------------------
30
31class WXDLLEXPORT wxStatusBarBase : public wxWindow
32{
33public:
71e03035
VZ
34 wxStatusBarBase();
35
36 virtual ~wxStatusBarBase();
37
38 // field count
39 // -----------
ed791986 40
71e03035
VZ
41 // set the number of fields and call SetStatusWidths(widths) if widths are
42 // given
43 virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
ed791986
VZ
44 int GetFieldsCount() const { return m_nFields; }
45
71e03035
VZ
46 // field text
47 // ----------
48
ed791986
VZ
49 virtual void SetStatusText(const wxString& text, int number = 0) = 0;
50 virtual wxString GetStatusText(int number = 0) const = 0;
51
1f361cdd
MB
52 void PushStatusText(const wxString& text, int number = 0);
53 void PopStatusText(int number = 0);
54
71e03035
VZ
55 // fields widths
56 // -------------
57
58 // set status field widths as absolute numbers: positive widths mean that
59 // the field has the specified absolute width, negative widths are
60 // interpreted as the sizer options, i.e. the extra space (total space
61 // minus the sum of fixed width fields) is divided between the fields with
62 // negative width according to the abs value of the width (field with width
63 // -2 grows twice as much as one with width -1 &c)
64 virtual void SetStatusWidths(int n, const int widths[]);
65
66 // geometry
67 // --------
ed791986
VZ
68
69 // Get the position and size of the field's internal bounding rectangle
70 virtual bool GetFieldRect(int i, wxRect& rect) const = 0;
71
72 // sets the minimal vertical size of the status bar
73 virtual void SetMinHeight(int height) = 0;
74
75 // get the dimensions of the horizontal and vertical borders
76 virtual int GetBorderX() const = 0;
77 virtual int GetBorderY() const = 0;
78
1e6feb95
VZ
79 // don't want status bars to accept the focus at all
80 virtual bool AcceptsFocus() const { return FALSE; }
81
ed791986 82protected:
71e03035
VZ
83 // set the widths array to NULL
84 void InitWidths();
85
86 // free the status widths arrays
87 void FreeWidths();
88
89 // reset the widths
90 void ReinitWidths() { FreeWidths(); InitWidths(); }
91
1f361cdd
MB
92 // same, for text stacks
93 void InitStacks();
94 void FreeStacks();
95 void ReinitStacks() { FreeStacks(); InitStacks(); }
96
71e03035
VZ
97 // calculate the real field widths for the given total available size
98 wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const;
99
1f361cdd
MB
100 // use these functions to access the stacks of field strings
101 wxListString *GetStatusStack(int i) const;
102 wxListString *GetOrCreateStatusStack(int i);
103
71e03035
VZ
104 // the current number of fields
105 int m_nFields;
106
107 // the widths of the fields in pixels if !NULL, all fields have the same
108 // width otherwise
109 int *m_statusWidths;
1f361cdd
MB
110
111 // stacks of previous values for PushStatusText/PopStatusText
112 // this is created on demand, use GetStatusStack/GetOrCreateStatusStack
113 wxListString **m_statusTextStacks;
ed791986
VZ
114};
115
71e03035
VZ
116// ----------------------------------------------------------------------------
117// include the actual wxStatusBar class declaration
118// ----------------------------------------------------------------------------
119
120#if defined(__WXUNIVERSAL__)
121 #define wxStatusBarUniv wxStatusBar
122 #define sm_classwxStatusBarUniv sm_classwxStatusBar
ed791986 123
71e03035
VZ
124 #include "wx/univ/statusbr.h"
125#elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
126 #define wxStatusBar95 wxStatusBar
127 #define sm_classwxStatusBar95 sm_classwxStatusBar
128
129 #include "wx/msw/statbr95.h"
656fc51c 130#elif defined(__WXMAC__)
71e03035
VZ
131 #define wxStatusBarMac wxStatusBar
132 #define sm_classwxStatusBarMac sm_classwxStatusBar
133
5fde6fcc 134 #include "wx/generic/statusbr.h"
a02bb143 135 #include "wx/mac/statusbr.h"
ed791986 136#else
71e03035
VZ
137 #define wxStatusBarGeneric wxStatusBar
138 #define sm_classwxStatusBarGeneric sm_classwxStatusBar
ed791986 139
71e03035 140 #include "wx/generic/statusbr.h"
ed791986
VZ
141#endif
142
71e03035 143#endif // wxUSE_STATUSBAR
1e6feb95 144
c801d85f 145#endif
34138703 146 // _WX_STATUSBR_H_BASE_