]> git.saurik.com Git - wxWidgets.git/blame - include/wx/statline.h
Delay checking for the requested sash position until the first
[wxWidgets.git] / include / wx / statline.h
CommitLineData
1e6feb95
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/statline.h
3// Purpose: wxStaticLine class interface
4// Author: Vadim Zeitlin
5// Created: 28.06.99
6// Version: $Id$
7// Copyright: (c) 1999 Vadim Zeitlin
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
b0351fc9
RR
11#ifndef _WX_STATLINE_H_BASE_
12#define _WX_STATLINE_H_BASE_
13
c50f1fb9
VZ
14// ----------------------------------------------------------------------------
15// headers
16// ----------------------------------------------------------------------------
17
18// this defines wxUSE_STATLINE
19#include "wx/defs.h"
20
21#if wxUSE_STATLINE
22
23// the base class declaration
24#include "wx/control.h"
25
26// ----------------------------------------------------------------------------
27// global variables
28// ----------------------------------------------------------------------------
29
30// the default name for objects of class wxStaticLine
31WXDLLEXPORT_DATA(extern const wxChar*) wxStaticTextNameStr;
32
33// ----------------------------------------------------------------------------
34// wxStaticLine - a line in a dialog
35// ----------------------------------------------------------------------------
36
37class WXDLLEXPORT wxStaticLineBase : public wxControl
38{
39public:
40 // constructor
41 wxStaticLineBase() { }
42
43 // is the line vertical?
44 bool IsVertical() const { return (GetWindowStyle() & wxLI_VERTICAL) != 0; }
45
46 // get the default size for the "lesser" dimension of the static line
47 static int GetDefaultSize() { return 2; }
48
1e6feb95 49 // overriden base class virtuals
bd507486
RD
50 virtual bool AcceptsFocus() const { return false; }
51 virtual bool CanApplyParentThemeBackground() const { return true; }
1e6feb95 52
c50f1fb9
VZ
53protected:
54 // set the right size for the right dimension
1e6feb95 55 wxSize AdjustSize(const wxSize& size) const
c50f1fb9
VZ
56 {
57 wxSize sizeReal(size);
58 if ( IsVertical() )
59 {
60 if ( size.x == -1 )
61 sizeReal.x = GetDefaultSize();
62 }
63 else
64 {
65 if ( size.y == -1 )
66 sizeReal.y = GetDefaultSize();
67 }
68
69 return sizeReal;
70 }
1e6feb95
VZ
71
72 virtual wxSize DoGetBestSize() const
73 {
74 return AdjustSize(wxDefaultSize);
75 }
fc7a2a60
VZ
76
77 DECLARE_NO_COPY_CLASS(wxStaticLineBase)
c50f1fb9
VZ
78};
79
80// ----------------------------------------------------------------------------
81// now include the actual class declaration
82// ----------------------------------------------------------------------------
83
1e6feb95
VZ
84#if defined(__WXUNIVERSAL__)
85 #include "wx/univ/statline.h"
86#elif defined(__WXMSW__)
c50f1fb9 87 #include "wx/msw/statline.h"
b0351fc9 88#elif defined(__WXGTK__)
c50f1fb9 89 #include "wx/gtk/statline.h"
1777b9bb
DW
90#elif defined(__WXPM__)
91 #include "wx/os2/statline.h"
51abe921
SC
92#elif defined(__WXMAC__)
93 #include "wx/mac/statline.h"
e64df9bc
DE
94#elif defined(__WXCOCOA__)
95 #include "wx/cocoa/statline.h"
c50f1fb9
VZ
96#else // use generic implementation for all other platforms
97 #include "wx/generic/statline.h"
b0351fc9
RR
98#endif
99
c50f1fb9
VZ
100#endif // wxUSE_STATLINE
101
b0351fc9
RR
102#endif
103 // _WX_STATLINE_H_BASE_