]> git.saurik.com Git - wxWidgets.git/blame - include/wx/statline.h
Document wxDataViewListCtrl, minor corrections
[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
65571936 8// Licence: wxWindows licence
1e6feb95
VZ
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
53a2db12 31extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticLineNameStr[];
c50f1fb9
VZ
32
33// ----------------------------------------------------------------------------
34// wxStaticLine - a line in a dialog
35// ----------------------------------------------------------------------------
36
53a2db12 37class WXDLLIMPEXP_CORE wxStaticLineBase : public wxControl
c50f1fb9
VZ
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 50 virtual bool AcceptsFocus() const { return false; }
1e6feb95 51
c50f1fb9 52protected:
dc797d8e
JS
53 // choose the default border for this window
54 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
55
c50f1fb9 56 // set the right size for the right dimension
1e6feb95 57 wxSize AdjustSize(const wxSize& size) const
c50f1fb9
VZ
58 {
59 wxSize sizeReal(size);
60 if ( IsVertical() )
61 {
d775fa82 62 if ( size.x == wxDefaultCoord )
c50f1fb9
VZ
63 sizeReal.x = GetDefaultSize();
64 }
65 else
66 {
d775fa82 67 if ( size.y == wxDefaultCoord )
c50f1fb9
VZ
68 sizeReal.y = GetDefaultSize();
69 }
70
71 return sizeReal;
72 }
1e6feb95
VZ
73
74 virtual wxSize DoGetBestSize() const
75 {
76 return AdjustSize(wxDefaultSize);
77 }
fc7a2a60
VZ
78
79 DECLARE_NO_COPY_CLASS(wxStaticLineBase)
c50f1fb9
VZ
80};
81
82// ----------------------------------------------------------------------------
83// now include the actual class declaration
84// ----------------------------------------------------------------------------
85
1e6feb95
VZ
86#if defined(__WXUNIVERSAL__)
87 #include "wx/univ/statline.h"
88#elif defined(__WXMSW__)
c50f1fb9 89 #include "wx/msw/statline.h"
1be7a35c 90#elif defined(__WXGTK20__)
c50f1fb9 91 #include "wx/gtk/statline.h"
1be7a35c
MR
92#elif defined(__WXGTK__)
93 #include "wx/gtk1/statline.h"
1777b9bb
DW
94#elif defined(__WXPM__)
95 #include "wx/os2/statline.h"
51abe921 96#elif defined(__WXMAC__)
ef0e9220 97 #include "wx/osx/statline.h"
e64df9bc
DE
98#elif defined(__WXCOCOA__)
99 #include "wx/cocoa/statline.h"
c50f1fb9
VZ
100#else // use generic implementation for all other platforms
101 #include "wx/generic/statline.h"
b0351fc9
RR
102#endif
103
c50f1fb9
VZ
104#endif // wxUSE_STATLINE
105
73b30256 106#endif // _WX_STATLINE_H_BASE_