Moved definition
[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 #include "wx/msw/missing.h"
36
37 // ============================================================================
38 // implementation
39 // ============================================================================
40
41 #if wxUSE_EXTENDED_RTTI
42 WX_DEFINE_FLAGS( wxStaticLineStyle )
43
44 wxBEGIN_FLAGS( wxStaticLineStyle )
45 // new style border flags, we put them first to
46 // use them for streaming out
47 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
48 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
49 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
50 wxFLAGS_MEMBER(wxBORDER_RAISED)
51 wxFLAGS_MEMBER(wxBORDER_STATIC)
52 wxFLAGS_MEMBER(wxBORDER_NONE)
53
54 // old style border flags
55 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
56 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
57 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
58 wxFLAGS_MEMBER(wxRAISED_BORDER)
59 wxFLAGS_MEMBER(wxSTATIC_BORDER)
60 wxFLAGS_MEMBER(wxBORDER)
61
62 // standard window styles
63 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
64 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
65 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
66 wxFLAGS_MEMBER(wxWANTS_CHARS)
67 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
68 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
69 wxFLAGS_MEMBER(wxVSCROLL)
70 wxFLAGS_MEMBER(wxHSCROLL)
71
72 wxFLAGS_MEMBER(wxLI_HORIZONTAL)
73 wxFLAGS_MEMBER(wxLI_VERTICAL)
74
75 wxEND_FLAGS( wxStaticLineStyle )
76
77 IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl,"wx/statline.h")
78
79 wxBEGIN_PROPERTIES_TABLE(wxStaticLine)
80 wxPROPERTY_FLAGS( WindowStyle , wxStaticLineStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
81 wxEND_PROPERTIES_TABLE()
82
83 wxBEGIN_HANDLERS_TABLE(wxStaticLine)
84 wxEND_HANDLERS_TABLE()
85
86 wxCONSTRUCTOR_5( wxStaticLine, wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
87
88 #else
89 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
90 #endif
91
92 /*
93 TODO PROPERTIES :
94 style (wxLI_HORIZONTAL)
95 */
96
97 // ----------------------------------------------------------------------------
98 // wxStaticLine
99 // ----------------------------------------------------------------------------
100
101 bool wxStaticLine::Create(wxWindow *parent,
102 wxWindowID id,
103 const wxPoint& pos,
104 const wxSize& sizeOrig,
105 long style,
106 const wxString &name)
107 {
108 wxSize size = AdjustSize(sizeOrig);
109
110 if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
111 return false;
112
113 return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size);
114 }
115
116 WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const
117 {
118 // we never have border
119 style &= ~wxBORDER_MASK;
120 style |= wxBORDER_NONE;
121
122 WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
123
124 // add our default styles
125 msStyle |= SS_SUNKEN | SS_NOTIFY | WS_CLIPSIBLINGS;
126 #ifndef __WXWINCE__
127 msStyle |= SS_GRAYRECT ;
128 #endif
129
130 return msStyle ;
131 }
132
133 #endif // wxUSE_STATLINE
134