Restored missing SS_SUNKEN for WinCE
[wxWidgets.git] / src / msw / statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msw/statline.cpp
3 // Purpose: MSW version of wxStaticLine class
4 // Author: Vadim Zeitlin
5 // Created: 28.06.99
6 // Version: $Id$
7 // Copyright: (c) 1998 Vadim Zeitlin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 // ============================================================================
12 // declarations
13 // ============================================================================
14
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18
19 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
20 #pragma implementation "statline.h"
21 #endif
22
23 // For compilers that support precompilation, includes "wx.h".
24 #include "wx/wxprec.h"
25
26 #ifdef __BORLANDC__
27 #pragma hdrstop
28 #endif
29
30 #include "wx/statline.h"
31
32 #if wxUSE_STATLINE
33
34 #include "wx/msw/private.h"
35
36 #ifndef SS_SUNKEN
37 #define SS_SUNKEN 0x00001000L
38 #endif
39
40 // ============================================================================
41 // implementation
42 // ============================================================================
43
44 #if wxUSE_EXTENDED_RTTI
45 WX_DEFINE_FLAGS( wxStaticLineStyle )
46
47 wxBEGIN_FLAGS( wxStaticLineStyle )
48 // new style border flags, we put them first to
49 // use them for streaming out
50 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
51 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
52 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
53 wxFLAGS_MEMBER(wxBORDER_RAISED)
54 wxFLAGS_MEMBER(wxBORDER_STATIC)
55 wxFLAGS_MEMBER(wxBORDER_NONE)
56
57 // old style border flags
58 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
59 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
60 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
61 wxFLAGS_MEMBER(wxRAISED_BORDER)
62 wxFLAGS_MEMBER(wxSTATIC_BORDER)
63 wxFLAGS_MEMBER(wxBORDER)
64
65 // standard window styles
66 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
67 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
68 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
69 wxFLAGS_MEMBER(wxWANTS_CHARS)
70 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
71 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
72 wxFLAGS_MEMBER(wxVSCROLL)
73 wxFLAGS_MEMBER(wxHSCROLL)
74
75 wxFLAGS_MEMBER(wxLI_HORIZONTAL)
76 wxFLAGS_MEMBER(wxLI_VERTICAL)
77
78 wxEND_FLAGS( wxStaticLineStyle )
79
80 IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl,"wx/statline.h")
81
82 wxBEGIN_PROPERTIES_TABLE(wxStaticLine)
83 wxPROPERTY_FLAGS( WindowStyle , wxStaticLineStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
84 wxEND_PROPERTIES_TABLE()
85
86 wxBEGIN_HANDLERS_TABLE(wxStaticLine)
87 wxEND_HANDLERS_TABLE()
88
89 wxCONSTRUCTOR_5( wxStaticLine, wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
90
91 #else
92 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
93 #endif
94
95 /*
96 TODO PROPERTIES :
97 style (wxLI_HORIZONTAL)
98 */
99
100 // ----------------------------------------------------------------------------
101 // wxStaticLine
102 // ----------------------------------------------------------------------------
103
104 bool wxStaticLine::Create(wxWindow *parent,
105 wxWindowID id,
106 const wxPoint& pos,
107 const wxSize& sizeOrig,
108 long style,
109 const wxString &name)
110 {
111 wxSize size = AdjustSize(sizeOrig);
112
113 if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
114 return false;
115
116 return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size);
117 }
118
119 WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const
120 {
121 // we never have border
122 style &= ~wxBORDER_MASK;
123 style |= wxBORDER_NONE;
124
125 WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
126
127 // add our default styles
128 msStyle |= SS_SUNKEN | SS_NOTIFY | WS_CLIPSIBLINGS;
129 #ifndef __WXWINCE__
130 msStyle |= SS_GRAYRECT ;
131 #endif
132
133 return msStyle ;
134 }
135
136 #endif // wxUSE_STATLINE
137