]> git.saurik.com Git - wxWidgets.git/blob - src/msw/statline.cpp
No #if wxUSE_DRAG_AND_DROP around the wxMetafileDataObject class, so compilation...
[wxWidgets.git] / src / msw / statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msw/statline.cpp
3 // Purpose: MSW version of wxStaticLine class
4 // Author: Vadim Zeitlin
5 // Created: 28.06.99
6 // Version: $Id$
7 // Copyright: (c) 1998 Vadim Zeitlin
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 #ifdef __BORLANDC__
27 #pragma hdrstop
28 #endif
29
30 #include "wx/statline.h"
31
32 #if wxUSE_STATLINE
33
34 #include "wx/msw/private.h"
35 #include "wx/log.h"
36
37 // ============================================================================
38 // implementation
39 // ============================================================================
40
41 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
42
43 // ----------------------------------------------------------------------------
44 // wxStaticLine
45 // ----------------------------------------------------------------------------
46
47 bool wxStaticLine::Create( wxWindow *parent,
48 wxWindowID id,
49 const wxPoint &pos,
50 const wxSize &size,
51 long style,
52 const wxString &name)
53 {
54 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
55 return FALSE;
56
57 parent->AddChild(this);
58
59 wxSize sizeReal = AdjustSize(size);
60
61 #ifndef WIN32
62 #define SS_SUNKEN 0
63 #endif
64
65 m_hWnd = (WXHWND)::CreateWindow
66 (
67 wxT("STATIC"),
68 wxT(""),
69 WS_VISIBLE | WS_CHILD |
70 SS_GRAYRECT | SS_SUNKEN, // | SS_ETCHEDFRAME,
71 pos.x, pos.y, sizeReal.x, sizeReal.y,
72 GetWinHwnd(parent),
73 (HMENU)m_windowId,
74 wxGetInstance(),
75 NULL
76 );
77
78 if ( !m_hWnd )
79 {
80 #ifdef __WXDEBUG__
81 wxLogDebug(wxT("Failed to create static control"));
82 #endif
83 return FALSE;
84 }
85
86 SubclassWin(m_hWnd);
87
88 return TRUE;
89 }
90 #endif
91