]> git.saurik.com Git - wxWidgets.git/blob - src/os2/statline.cpp
overriding to allocate an outer autorelease pool
[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 // 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 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
21
22 #if wxUSE_STATLINE
23
24 #include "wx/statline.h"
25
26 #ifndef WX_PRECOMP
27 #include "wx/log.h"
28 #endif
29
30 #include "wx/os2/private.h"
31
32 // ============================================================================
33 // implementation
34 // ============================================================================
35
36 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
37
38 // ----------------------------------------------------------------------------
39 // wxStaticLine
40 // ----------------------------------------------------------------------------
41
42 bool wxStaticLine::Create(
43 wxWindow* pParent
44 , wxWindowID vId
45 , const wxPoint& rPos
46 , const wxSize& rSize
47 , long lStyle
48 , const wxString& rsName
49 )
50 {
51 wxSize vSize = AdjustSize(rSize);
52
53 if ( !CreateControl( pParent
54 ,vId
55 ,rPos
56 ,vSize
57 ,lStyle
58 ,wxDefaultValidator
59 ,rsName
60 ))
61 return FALSE;
62 if (!OS2CreateControl( wxT("STATIC")
63 ,SS_FGNDFRAME
64 ,rPos
65 ,rSize
66 ,rsName
67 ))
68 return FALSE;
69
70 wxColour vColour;
71
72 vColour.Set(wxString(wxT("GREY")));
73
74 LONG lColor = (LONG)vColour.GetPixel();
75
76 ::WinSetPresParam( m_hWnd
77 ,PP_FOREGROUNDCOLOR
78 ,sizeof(LONG)
79 ,(PVOID)&lColor
80 );
81 return TRUE;
82 } // end of wxStaticLine::Create
83
84 WXDWORD wxStaticLine::OS2GetStyle(
85 long lStyle
86 , WXDWORD* pdwExstyle
87 ) const
88 {
89 //
90 // We never have border
91 //
92 lStyle &= ~wxBORDER_MASK;
93 lStyle |= wxBORDER_NONE;
94
95 WXDWORD dwStyle = wxControl::OS2GetStyle( lStyle
96 ,pdwExstyle
97 );
98 //
99 // Add our default styles
100 //
101 return dwStyle | WS_CLIPSIBLINGS;
102 }
103 #endif // wxUSE_STATLINE