Committing in .
[wxWidgets.git] / src / generic / statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: generic/statline.cpp
3 // Purpose: a generic 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 #include "wx/wxprec.h"
24 #if wxUSE_STATLINE
25 // For compilers that support precompilation, includes "wx.h".
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #include "wx/statline.h"
32 #include "wx/statbox.h"
33
34 // ============================================================================
35 // implementation
36 // ============================================================================
37
38 IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
39
40 // ----------------------------------------------------------------------------
41 // wxStaticLine
42 // ----------------------------------------------------------------------------
43
44 bool wxStaticLine::Create( wxWindow *parent,
45 wxWindowID id,
46 const wxPoint &pos,
47 const wxSize &size,
48 long style,
49 const wxString &name)
50 {
51 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
52 return FALSE;
53
54 // ok, this is ugly but it's better than nothing: use a thin static box to
55 // emulate static line
56
57 wxSize sizeReal = AdjustSize(size);
58
59 m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name);
60
61 return TRUE;
62 }
63
64
65 WXWidget wxStaticLine::GetMainWidget() const
66 {
67 return m_statbox->GetMainWidget();
68 }
69
70 void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags)
71 {
72 m_statbox->SetSize(x, y, width, height, sizeFlags);
73 }
74
75 void wxStaticLine::DoMoveWindow(int x, int y, int width, int height)
76 {
77 m_statbox->SetSize(x, y, width, height);
78 }
79
80 #endif
81 // wxUSE_STATLINE