]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msw/statline.cpp
3 // Purpose: MSW version of wxStaticLine class
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 1998 Vadim Zeitlin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
26 #include "wx/statline.h"
30 #include "wx/msw/private.h"
31 #include "wx/msw/missing.h"
33 // ============================================================================
35 // ============================================================================
37 #if wxUSE_EXTENDED_RTTI
38 WX_DEFINE_FLAGS( wxStaticLineStyle
)
40 wxBEGIN_FLAGS( wxStaticLineStyle
)
41 // new style border flags, we put them first to
42 // use them for streaming out
43 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
44 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
45 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
46 wxFLAGS_MEMBER(wxBORDER_RAISED
)
47 wxFLAGS_MEMBER(wxBORDER_STATIC
)
48 wxFLAGS_MEMBER(wxBORDER_NONE
)
50 // old style border flags
51 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
52 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
53 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
54 wxFLAGS_MEMBER(wxRAISED_BORDER
)
55 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
56 wxFLAGS_MEMBER(wxBORDER
)
58 // standard window styles
59 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
60 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
61 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
62 wxFLAGS_MEMBER(wxWANTS_CHARS
)
63 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
64 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
65 wxFLAGS_MEMBER(wxVSCROLL
)
66 wxFLAGS_MEMBER(wxHSCROLL
)
68 wxFLAGS_MEMBER(wxLI_HORIZONTAL
)
69 wxFLAGS_MEMBER(wxLI_VERTICAL
)
71 wxEND_FLAGS( wxStaticLineStyle
)
73 IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine
, wxControl
,"wx/statline.h")
75 wxBEGIN_PROPERTIES_TABLE(wxStaticLine
)
76 wxPROPERTY_FLAGS( WindowStyle
, wxStaticLineStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
77 wxEND_PROPERTIES_TABLE()
79 wxBEGIN_HANDLERS_TABLE(wxStaticLine
)
80 wxEND_HANDLERS_TABLE()
82 wxCONSTRUCTOR_5( wxStaticLine
, wxWindow
* , Parent
, wxWindowID
, Id
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
85 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine
, wxControl
)
90 style (wxLI_HORIZONTAL)
93 // ----------------------------------------------------------------------------
95 // ----------------------------------------------------------------------------
97 bool wxStaticLine::Create(wxWindow
*parent
,
100 const wxSize
& sizeOrig
,
102 const wxString
&name
)
104 wxSize size
= AdjustSize(sizeOrig
);
106 if ( !CreateControl(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
109 return MSWCreateControl(_T("STATIC"), wxEmptyString
, pos
, size
);
112 WXDWORD
wxStaticLine::MSWGetStyle(long style
, WXDWORD
*exstyle
) const
114 // we never have border
115 style
&= ~wxBORDER_MASK
;
116 style
|= wxBORDER_NONE
;
118 WXDWORD msStyle
= wxControl::MSWGetStyle(style
, exstyle
);
120 // add our default styles
121 msStyle
|= SS_SUNKEN
| SS_NOTIFY
| WS_CLIPSIBLINGS
;
123 msStyle
|= SS_GRAYRECT
;
129 #endif // wxUSE_STATLINE