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