]> git.saurik.com Git - wxWidgets.git/blob - src/os2/statline.cpp
Prevent assertions because of zero image size
[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 // ----------------------------------------------------------------------------
37 // wxStaticLine
38 // ----------------------------------------------------------------------------
39
40 bool wxStaticLine::Create(
41 wxWindow* pParent
42 , wxWindowID vId
43 , const wxPoint& rPos
44 , const wxSize& rSize
45 , long lStyle
46 , const wxString& rsName
47 )
48 {
49 wxSize vSize = AdjustSize(rSize);
50
51 if ( !CreateControl( pParent
52 ,vId
53 ,rPos
54 ,vSize
55 ,lStyle
56 ,wxDefaultValidator
57 ,rsName
58 ))
59 return FALSE;
60 if (!OS2CreateControl( wxT("STATIC")
61 ,SS_FGNDFRAME
62 ,rPos
63 ,rSize
64 ,rsName
65 ))
66 return FALSE;
67
68 wxColour vColour;
69
70 vColour.Set(wxString(wxT("GREY")));
71
72 LONG lColor = (LONG)vColour.GetPixel();
73
74 ::WinSetPresParam( m_hWnd
75 ,PP_FOREGROUNDCOLOR
76 ,sizeof(LONG)
77 ,(PVOID)&lColor
78 );
79 return TRUE;
80 } // end of wxStaticLine::Create
81
82 WXDWORD wxStaticLine::OS2GetStyle(
83 long lStyle
84 , WXDWORD* pdwExstyle
85 ) const
86 {
87 //
88 // We never have border
89 //
90 lStyle &= ~wxBORDER_MASK;
91 lStyle |= wxBORDER_NONE;
92
93 WXDWORD dwStyle = wxControl::OS2GetStyle( lStyle
94 ,pdwExstyle
95 );
96 //
97 // Add our default styles
98 //
99 return dwStyle | WS_CLIPSIBLINGS;
100 }
101 #endif // wxUSE_STATLINE