]> git.saurik.com Git - wxWidgets.git/blame - src/os2/statline.cpp
code cleanup
[wxWidgets.git] / src / os2 / statline.cpp
CommitLineData
a66ebb5b
DW
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
65571936 8// Licence: wxWindows licence
a66ebb5b
DW
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#include "wx/statline.h"
23
24#if wxUSE_STATLINE
25
26#include "wx/os2/private.h"
27#include "wx/log.h"
28
29// ============================================================================
30// implementation
31// ============================================================================
32
33IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
34
35// ----------------------------------------------------------------------------
36// wxStaticLine
37// ----------------------------------------------------------------------------
38
3c299c3a
DW
39bool wxStaticLine::Create(
40 wxWindow* pParent
41, wxWindowID vId
42, const wxPoint& rPos
43, const wxSize& rSize
44, long lStyle
45, const wxString& rsName
46)
a66ebb5b 47{
b9b1d6c8 48 wxSize vSize = AdjustSize(rSize);
3c299c3a 49
b9b1d6c8
DW
50 if ( !CreateControl( pParent
51 ,vId
52 ,rPos
53 ,vSize
54 ,lStyle
55 ,wxDefaultValidator
56 ,rsName
57 ))
a66ebb5b 58 return FALSE;
0fba44b4 59 if (!OS2CreateControl( wxT("STATIC")
70a2c656
DW
60 ,SS_FGNDFRAME
61 ,rPos
62 ,rSize
63 ,rsName
64 ))
65 return FALSE;
66
67 wxColour vColour;
68
0fba44b4 69 vColour.Set(wxString(wxT("GREY")));
70a2c656
DW
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;
3c299c3a 79} // end of wxStaticLine::Create
a66ebb5b 80
b9b1d6c8
DW
81WXDWORD 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}
3c299c3a 100#endif // wxUSE_STATLINE