X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c50f1fb9226d9260454ccb9c8a67d0be23c2827f..36a0190ebd5bd9a7302f60f6dcd608b80574e21c:/src/generic/statline.cpp diff --git a/src/generic/statline.cpp b/src/generic/statline.cpp index 21ad893852..a36445889b 100644 --- a/src/generic/statline.cpp +++ b/src/generic/statline.cpp @@ -1,9 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: generic/statline.cpp +// Name: src/generic/statline.cpp // Purpose: a generic wxStaticLine class // Author: Vadim Zeitlin // Created: 28.06.99 -// Version: $Id$ // Copyright: (c) 1998 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -16,26 +15,26 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "statline.h" -#endif +#include "wx/wxprec.h" // For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif +#if wxUSE_STATLINE + #include "wx/statline.h" -#include "wx/statbox.h" + +#ifndef WX_PRECOMP + #include "wx/statbox.h" +#endif // ============================================================================ // implementation // ============================================================================ -IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl) - // ---------------------------------------------------------------------------- // wxStaticLine // ---------------------------------------------------------------------------- @@ -47,15 +46,40 @@ bool wxStaticLine::Create( wxWindow *parent, long style, const wxString &name) { - if ( !CreateBase(parent, id, pos, size, style, name) ) - return FALSE; + m_statbox = NULL; + + if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) + return false; // ok, this is ugly but it's better than nothing: use a thin static box to // emulate static line wxSize sizeReal = AdjustSize(size); - m_statbox = new wxStaticBox(parent, id, _T(""), pos, sizeReal, style, name); + m_statbox = new wxStaticBox(parent, id, wxEmptyString, pos, sizeReal, style, name); + + return true; +} + +wxStaticLine::~wxStaticLine() +{ + delete m_statbox; +} + +WXWidget wxStaticLine::GetMainWidget() const +{ + return m_statbox->GetMainWidget(); +} - return TRUE; +void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags) +{ + m_statbox->SetSize(x, y, width, height, sizeFlags); } + +void wxStaticLine::DoMoveWindow(int x, int y, int width, int height) +{ + m_statbox->SetSize(x, y, width, height); +} + +#endif + // wxUSE_STATLINE