]> git.saurik.com Git - wxWidgets.git/blob - include/wx/statline.h
some compilation fixes for mingw32 and not only
[wxWidgets.git] / include / wx / statline.h
1 #ifndef _WX_STATLINE_H_BASE_
2 #define _WX_STATLINE_H_BASE_
3
4 // ----------------------------------------------------------------------------
5 // headers
6 // ----------------------------------------------------------------------------
7
8 // this defines wxUSE_STATLINE
9 #include "wx/defs.h"
10
11 #if wxUSE_STATLINE
12
13 // the base class declaration
14 #include "wx/control.h"
15
16 // ----------------------------------------------------------------------------
17 // global variables
18 // ----------------------------------------------------------------------------
19
20 // the default name for objects of class wxStaticLine
21 WXDLLEXPORT_DATA(extern const wxChar*) wxStaticTextNameStr;
22
23 // ----------------------------------------------------------------------------
24 // wxStaticLine - a line in a dialog
25 // ----------------------------------------------------------------------------
26
27 class WXDLLEXPORT wxStaticLineBase : public wxControl
28 {
29 public:
30 // constructor
31 wxStaticLineBase() { }
32
33 // is the line vertical?
34 bool IsVertical() const { return (GetWindowStyle() & wxLI_VERTICAL) != 0; }
35
36 // get the default size for the "lesser" dimension of the static line
37 static int GetDefaultSize() { return 2; }
38
39 protected:
40 // set the right size for the right dimension
41 wxSize AdjustSize(const wxSize& size)
42 {
43 wxSize sizeReal(size);
44 if ( IsVertical() )
45 {
46 if ( size.x == -1 )
47 sizeReal.x = GetDefaultSize();
48 }
49 else
50 {
51 if ( size.y == -1 )
52 sizeReal.y = GetDefaultSize();
53 }
54
55 return sizeReal;
56 }
57 };
58
59 // ----------------------------------------------------------------------------
60 // now include the actual class declaration
61 // ----------------------------------------------------------------------------
62
63 #if defined(__WXMSW__)
64 #include "wx/msw/statline.h"
65 #elif defined(__WXGTK__)
66 #include "wx/gtk/statline.h"
67 #elif defined(__WXPM__)
68 #include "wx/os2/statline.h"
69 #elif defined(__WXMAC__)
70 #include "wx/mac/statline.h"
71 #else // use generic implementation for all other platforms
72 #include "wx/generic/statline.h"
73 #endif
74
75 #endif // wxUSE_STATLINE
76
77 #endif
78 // _WX_STATLINE_H_BASE_