]> git.saurik.com Git - wxWidgets.git/blame - src/generic/statline.cpp
Added Set/GetQuickBestSize
[wxWidgets.git] / src / generic / statline.cpp
CommitLineData
c50f1fb9
VZ
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
65571936 8// Licence: wxWindows licence
c50f1fb9
VZ
9/////////////////////////////////////////////////////////////////////////////
10
11// ============================================================================
12// declarations
13// ============================================================================
14
15// ----------------------------------------------------------------------------
16// headers
17// ----------------------------------------------------------------------------
18
dc3b0532 19#include "wx/wxprec.h"
d7260478 20#if wxUSE_STATLINE
c50f1fb9 21// For compilers that support precompilation, includes "wx.h".
c50f1fb9
VZ
22
23#ifdef __BORLANDC__
24 #pragma hdrstop
25#endif
26
27#include "wx/statline.h"
28#include "wx/statbox.h"
29
30// ============================================================================
31// implementation
32// ============================================================================
33
34IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
35
36// ----------------------------------------------------------------------------
37// wxStaticLine
38// ----------------------------------------------------------------------------
39
40bool wxStaticLine::Create( wxWindow *parent,
41 wxWindowID id,
42 const wxPoint &pos,
43 const wxSize &size,
44 long style,
45 const wxString &name)
46{
d7c40406
MB
47 m_statbox = NULL;
48
7a4b8f27 49 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
ca65c044 50 return false;
c50f1fb9
VZ
51
52 // ok, this is ugly but it's better than nothing: use a thin static box to
53 // emulate static line
54
55 wxSize sizeReal = AdjustSize(size);
56
ca65c044 57 m_statbox = new wxStaticBox(parent, id, wxEmptyString, pos, sizeReal, style, name);
c50f1fb9 58
ca65c044 59 return true;
c50f1fb9 60}
7183e38b 61
d7c40406
MB
62wxStaticLine::~wxStaticLine()
63{
64 delete m_statbox;
65}
7183e38b
MB
66
67WXWidget wxStaticLine::GetMainWidget() const
68{
69 return m_statbox->GetMainWidget();
70}
277f2e52 71
99bdcd55 72void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags)
277f2e52
MB
73{
74 m_statbox->SetSize(x, y, width, height, sizeFlags);
75}
76
77void wxStaticLine::DoMoveWindow(int x, int y, int width, int height)
78{
79 m_statbox->SetSize(x, y, width, height);
80}
d7260478
JS
81
82#endif
83 // wxUSE_STATLINE