wxwidgets/src/generic/statline.cpp
Vadim Zeitlin 4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00

82 lines
2.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/generic/statline.cpp
// Purpose: a generic wxStaticLine class
// Author: Vadim Zeitlin
// Created: 28.06.99
// Copyright: (c) 1998 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#if wxUSE_STATLINE
#include "wx/statline.h"
#ifndef WX_PRECOMP
#include "wx/statbox.h"
#endif
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// wxStaticLine
// ----------------------------------------------------------------------------
bool wxStaticLine::Create( wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
long style,
const wxString &name)
{
m_statbox = nullptr;
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, wxEmptyString, pos, sizeReal, style, name);
return true;
}
wxStaticLine::~wxStaticLine()
{
delete m_statbox;
}
WXWidget wxStaticLine::GetMainWidget() const
{
return m_statbox->GetMainWidget();
}
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