]> git.saurik.com Git - wxWidgets.git/blob - include/wx/statline.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / statline.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/statline.h
3 // Purpose: wxStaticLine class interface
4 // Author: Vadim Zeitlin
5 // Created: 28.06.99
6 // Copyright: (c) 1999 Vadim Zeitlin
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_STATLINE_H_BASE_
11 #define _WX_STATLINE_H_BASE_
12
13 // ----------------------------------------------------------------------------
14 // headers
15 // ----------------------------------------------------------------------------
16
17 // this defines wxUSE_STATLINE
18 #include "wx/defs.h"
19
20 #if wxUSE_STATLINE
21
22 // the base class declaration
23 #include "wx/control.h"
24
25 // ----------------------------------------------------------------------------
26 // global variables
27 // ----------------------------------------------------------------------------
28
29 // the default name for objects of class wxStaticLine
30 extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticLineNameStr[];
31
32 // ----------------------------------------------------------------------------
33 // wxStaticLine - a line in a dialog
34 // ----------------------------------------------------------------------------
35
36 class WXDLLIMPEXP_CORE wxStaticLineBase : public wxControl
37 {
38 public:
39 // constructor
40 wxStaticLineBase() { }
41
42 // is the line vertical?
43 bool IsVertical() const { return (GetWindowStyle() & wxLI_VERTICAL) != 0; }
44
45 // get the default size for the "lesser" dimension of the static line
46 static int GetDefaultSize() { return 2; }
47
48 // overridden base class virtuals
49 virtual bool AcceptsFocus() const { return false; }
50
51 protected:
52 // choose the default border for this window
53 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
54
55 // set the right size for the right dimension
56 wxSize AdjustSize(const wxSize& size) const
57 {
58 wxSize sizeReal(size);
59 if ( IsVertical() )
60 {
61 if ( size.x == wxDefaultCoord )
62 sizeReal.x = GetDefaultSize();
63 }
64 else
65 {
66 if ( size.y == wxDefaultCoord )
67 sizeReal.y = GetDefaultSize();
68 }
69
70 return sizeReal;
71 }
72
73 virtual wxSize DoGetBestSize() const
74 {
75 return AdjustSize(wxDefaultSize);
76 }
77
78 wxDECLARE_NO_COPY_CLASS(wxStaticLineBase);
79 };
80
81 // ----------------------------------------------------------------------------
82 // now include the actual class declaration
83 // ----------------------------------------------------------------------------
84
85 #if defined(__WXUNIVERSAL__)
86 #include "wx/univ/statline.h"
87 #elif defined(__WXMSW__)
88 #include "wx/msw/statline.h"
89 #elif defined(__WXGTK20__)
90 #include "wx/gtk/statline.h"
91 #elif defined(__WXGTK__)
92 #include "wx/gtk1/statline.h"
93 #elif defined(__WXPM__)
94 #include "wx/os2/statline.h"
95 #elif defined(__WXMAC__)
96 #include "wx/osx/statline.h"
97 #elif defined(__WXCOCOA__)
98 #include "wx/cocoa/statline.h"
99 #else // use generic implementation for all other platforms
100 #include "wx/generic/statline.h"
101 #endif
102
103 #endif // wxUSE_STATLINE
104
105 #endif // _WX_STATLINE_H_BASE_