]>
Commit | Line | Data |
---|---|---|
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 | |
16cba29d | 31 | extern WXDLLEXPORT_DATA(const wxChar*) wxStaticTextNameStr; |
c50f1fb9 VZ |
32 | |
33 | // ---------------------------------------------------------------------------- | |
34 | // wxStaticLine - a line in a dialog | |
35 | // ---------------------------------------------------------------------------- | |
36 | ||
37 | class WXDLLEXPORT wxStaticLineBase : public wxControl | |
38 | { | |
39 | public: | |
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; } |
cc0bffac RD |
51 | virtual void ApplyParentThemeBackground(const wxColour& bg) |
52 | { SetBackgroundColour(bg); } | |
1e6feb95 | 53 | |
c50f1fb9 VZ |
54 | protected: |
55 | // set the right size for the right dimension | |
1e6feb95 | 56 | wxSize AdjustSize(const wxSize& size) const |
c50f1fb9 VZ |
57 | { |
58 | wxSize sizeReal(size); | |
59 | if ( IsVertical() ) | |
60 | { | |
d775fa82 | 61 | if ( size.x == wxDefaultCoord ) |
c50f1fb9 VZ |
62 | sizeReal.x = GetDefaultSize(); |
63 | } | |
64 | else | |
65 | { | |
d775fa82 | 66 | if ( size.y == wxDefaultCoord ) |
c50f1fb9 VZ |
67 | sizeReal.y = GetDefaultSize(); |
68 | } | |
69 | ||
70 | return sizeReal; | |
71 | } | |
1e6feb95 VZ |
72 | |
73 | virtual wxSize DoGetBestSize() const | |
74 | { | |
75 | return AdjustSize(wxDefaultSize); | |
76 | } | |
fc7a2a60 VZ |
77 | |
78 | DECLARE_NO_COPY_CLASS(wxStaticLineBase) | |
c50f1fb9 VZ |
79 | }; |
80 | ||
81 | // ---------------------------------------------------------------------------- | |
82 | // now include the actual class declaration | |
83 | // ---------------------------------------------------------------------------- | |
84 | ||
1e6feb95 VZ |
85 | #if defined(__WXUNIVERSAL__) |
86 | #include "wx/univ/statline.h" | |
87 | #elif defined(__WXMSW__) | |
c50f1fb9 | 88 | #include "wx/msw/statline.h" |
b0351fc9 | 89 | #elif defined(__WXGTK__) |
c50f1fb9 | 90 | #include "wx/gtk/statline.h" |
1777b9bb DW |
91 | #elif defined(__WXPM__) |
92 | #include "wx/os2/statline.h" | |
51abe921 SC |
93 | #elif defined(__WXMAC__) |
94 | #include "wx/mac/statline.h" | |
e64df9bc DE |
95 | #elif defined(__WXCOCOA__) |
96 | #include "wx/cocoa/statline.h" | |
c50f1fb9 VZ |
97 | #else // use generic implementation for all other platforms |
98 | #include "wx/generic/statline.h" | |
b0351fc9 RR |
99 | #endif |
100 | ||
c50f1fb9 VZ |
101 | #endif // wxUSE_STATLINE |
102 | ||
b0351fc9 RR |
103 | #endif |
104 | // _WX_STATLINE_H_BASE_ |