]> git.saurik.com Git - wxWidgets.git/blob - src/os2/statline.cpp
Fix referencing of cairo_t returned from wxDCImpl::GetCairoContext().
[wxWidgets.git] / src / os2 / statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/os2/statline.cpp
3 // Purpose: OS2 version of wxStaticLine class
4 // Author: David Webster
5 // Created: 10/23/99
6 // Copyright: (c) 1999 David Webster
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // ============================================================================
11 // declarations
12 // ============================================================================
13
14 // ----------------------------------------------------------------------------
15 // headers
16 // ----------------------------------------------------------------------------
17
18 // For compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
20
21 #if wxUSE_STATLINE
22
23 #include "wx/statline.h"
24
25 #ifndef WX_PRECOMP
26 #include "wx/log.h"
27 #endif
28
29 #include "wx/os2/private.h"
30
31 // ============================================================================
32 // implementation
33 // ============================================================================
34
35 // ----------------------------------------------------------------------------
36 // wxStaticLine
37 // ----------------------------------------------------------------------------
38
39 bool wxStaticLine::Create(
40 wxWindow* pParent
41 , wxWindowID vId
42 , const wxPoint& rPos
43 , const wxSize& rSize
44 , long lStyle
45 , const wxString& rsName
46 )
47 {
48 wxSize vSize = AdjustSize(rSize);
49
50 if ( !CreateControl( pParent
51 ,vId
52 ,rPos
53 ,vSize
54 ,lStyle
55 ,wxDefaultValidator
56 ,rsName
57 ))
58 return FALSE;
59 if (!OS2CreateControl( wxT("STATIC")
60 ,SS_FGNDFRAME
61 ,rPos
62 ,rSize
63 ,rsName
64 ))
65 return FALSE;
66
67 wxColour vColour;
68
69 vColour.Set(wxString(wxT("GREY")));
70
71 LONG lColor = (LONG)vColour.GetPixel();
72
73 ::WinSetPresParam( m_hWnd
74 ,PP_FOREGROUNDCOLOR
75 ,sizeof(LONG)
76 ,(PVOID)&lColor
77 );
78 return TRUE;
79 } // end of wxStaticLine::Create
80
81 WXDWORD wxStaticLine::OS2GetStyle(
82 long lStyle
83 , WXDWORD* pdwExstyle
84 ) const
85 {
86 //
87 // We never have border
88 //
89 lStyle &= ~wxBORDER_MASK;
90 lStyle |= wxBORDER_NONE;
91
92 WXDWORD dwStyle = wxControl::OS2GetStyle( lStyle
93 ,pdwExstyle
94 );
95 //
96 // Add our default styles
97 //
98 return dwStyle | WS_CLIPSIBLINGS;
99 }
100 #endif // wxUSE_STATLINE