]> git.saurik.com Git - wxWidgets.git/blob - src/generic/statline.cpp
rtti api mods added
[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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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 m_statbox = NULL;
52
53 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
54 return FALSE;
55
56 // ok, this is ugly but it's better than nothing: use a thin static box to
57 // emulate static line
58
59 wxSize sizeReal = AdjustSize(size);
60
61 m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name);
62
63 return TRUE;
64 }
65
66 wxStaticLine::~wxStaticLine()
67 {
68 delete m_statbox;
69 }
70
71 WXWidget wxStaticLine::GetMainWidget() const
72 {
73 return m_statbox->GetMainWidget();
74 }
75
76 void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags)
77 {
78 m_statbox->SetSize(x, y, width, height, sizeFlags);
79 }
80
81 void wxStaticLine::DoMoveWindow(int x, int y, int width, int height)
82 {
83 m_statbox->SetSize(x, y, width, height);
84 }
85
86 #endif
87 // wxUSE_STATLINE