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