]>
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
20 #pragma implementation "statline.h"
23 // For compilers that support precompilation, includes "wx.h".
24 #include "wx/wxprec.h"
30 #include "wx/statline.h"
34 #include "wx/msw/private.h"
38 #define SS_SUNKEN 0x00001000L
42 #define SS_NOTIFY 0x00000100L
45 // ============================================================================
47 // ============================================================================
49 #if wxUSE_EXTENDED_RTTI
50 WX_DEFINE_FLAGS( wxStaticLineStyle
)
52 wxBEGIN_FLAGS( wxStaticLineStyle
)
53 // new style border flags, we put them first to
54 // use them for streaming out
55 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
56 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
57 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
58 wxFLAGS_MEMBER(wxBORDER_RAISED
)
59 wxFLAGS_MEMBER(wxBORDER_STATIC
)
60 wxFLAGS_MEMBER(wxBORDER_NONE
)
62 // old style border flags
63 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
64 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
65 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
66 wxFLAGS_MEMBER(wxRAISED_BORDER
)
67 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
68 wxFLAGS_MEMBER(wxBORDER
)
70 // standard window styles
71 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
72 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
73 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
74 wxFLAGS_MEMBER(wxWANTS_CHARS
)
75 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
76 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
77 wxFLAGS_MEMBER(wxVSCROLL
)
78 wxFLAGS_MEMBER(wxHSCROLL
)
80 wxFLAGS_MEMBER(wxLI_HORIZONTAL
)
81 wxFLAGS_MEMBER(wxLI_VERTICAL
)
83 wxEND_FLAGS( wxStaticLineStyle
)
85 IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine
, wxControl
,"wx/statline.h")
87 wxBEGIN_PROPERTIES_TABLE(wxStaticLine
)
88 wxPROPERTY_FLAGS( WindowStyle
, wxStaticLineStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
89 wxEND_PROPERTIES_TABLE()
91 wxBEGIN_HANDLERS_TABLE(wxStaticLine
)
92 wxEND_HANDLERS_TABLE()
94 wxCONSTRUCTOR_5( wxStaticLine
, wxWindow
* , Parent
, wxWindowID
, Id
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
97 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine
, wxControl
)
102 style (wxLI_HORIZONTAL)
105 // ----------------------------------------------------------------------------
107 // ----------------------------------------------------------------------------
109 bool wxStaticLine::Create(wxWindow
*parent
,
112 const wxSize
& sizeOrig
,
114 const wxString
&name
)
116 wxSize size
= AdjustSize(sizeOrig
);
118 if ( !CreateControl(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
121 return MSWCreateControl(_T("STATIC"), wxEmptyString
, pos
, size
);
124 WXDWORD
wxStaticLine::MSWGetStyle(long style
, WXDWORD
*exstyle
) const
126 // we never have border
127 style
&= ~wxBORDER_MASK
;
128 style
|= wxBORDER_NONE
;
130 WXDWORD msStyle
= wxControl::MSWGetStyle(style
, exstyle
);
132 // add our default styles
133 msStyle
|= SS_SUNKEN
| SS_NOTIFY
| WS_CLIPSIBLINGS
;
135 msStyle
|= SS_GRAYRECT
;
141 #endif // wxUSE_STATLINE