mtollari 4db94043cb Patch level : 12.0 no-patch
Files correlati     : 
Commento            : Spostamento in libraries delle librerie esterne di Campo per una maggiore pulizia e organizzazione

git-svn-id: svn://10.65.10.50/branches/R_10_00@24150 c028cbd2-c16b-5b4b-a496-9718f37d4682
2017-10-26 09:11:15 +00:00

95 lines
2.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/univ/stattext.cpp
// Purpose: wxStaticText
// Author: Vadim Zeitlin
// Modified by:
// Created: 14.08.00
// RCS-ID: $Id: stattext.cpp 45447 2007-04-14 01:17:28Z VZ $
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_STATTEXT
#include "wx/stattext.h"
#ifndef WX_PRECOMP
#include "wx/dcclient.h"
#include "wx/validate.h"
#endif
#include "wx/univ/renderer.h"
#include "wx/univ/theme.h"
// ============================================================================
// implementation
// ============================================================================
IMPLEMENT_ABSTRACT_CLASS(wxStaticText, wxControl)
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
bool wxStaticText::Create(wxWindow *parent,
wxWindowID id,
const wxString &label,
const wxPoint &pos,
const wxSize &size,
long style,
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
SetLabel(label);
SetInitialSize(size);
return true;
}
// ----------------------------------------------------------------------------
// size management
// ----------------------------------------------------------------------------
void wxStaticText::SetLabel(const wxString& label)
{
wxControl::SetLabel(label);
}
wxSize wxStaticText::DoGetBestClientSize() const
{
wxStaticText *self = wxConstCast(this, wxStaticText);
wxClientDC dc(self);
dc.SetFont(GetFont());
wxCoord width, height;
dc.GetMultiLineTextExtent(GetLabel(), &width, &height);
return wxSize(width, height);
}
// ----------------------------------------------------------------------------
// drawing
// ----------------------------------------------------------------------------
void wxStaticText::DoDraw(wxControlRenderer *renderer)
{
renderer->DrawLabel();
}
#endif // wxUSE_STATTEXT