wxWidgets/include/wx/generic/stattextg.h
Vadim Zeitlin f26c1c3e4a Don't override DoGetBestSize() in wxGenericStaticText, it's unnecessary.
The base class already does exactly the same thing -- except that it also
accounts for the borders properly.

Also fix access for a couple of DoXXX() member functions which should be
protected and an event handler which can be private.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-08 15:56:21 +00:00

69 lines
2.1 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/stattextg.h
// Purpose: wxGenericStaticText header
// Author: Marcin Wojdyr
// Created: 2008-06-26
// Id: $Id$
// Copyright: Marcin Wojdyr
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_STATTEXTG_H_
#define _WX_GENERIC_STATTEXTG_H_
// prevent it from including the platform-specific wxStaticText declaration as
// this is not going to compile if it derives from wxGenericStaticText defined
// below (currently this is only the case in wxUniv but it could also happen
// with other ports)
#define wxNO_PORT_STATTEXT_INCLUDE
#include "wx/stattext.h"
#undef wxNO_PORT_STATTEXT_INCLUDE
class WXDLLIMPEXP_CORE wxGenericStaticText : public wxStaticTextBase
{
public:
wxGenericStaticText() { }
wxGenericStaticText(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticTextNameStr)
{
Create(parent, id, label, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticTextNameStr);
protected:
virtual wxSize DoGetBestClientSize() const;
virtual void SetLabel(const wxString& label);
virtual bool SetFont(const wxFont &font);
virtual wxString DoGetLabel() const { return m_label; }
virtual void DoSetLabel(const wxString& label);
void DoSetSize(int x, int y, int width, int height, int sizeFlags);
private:
void OnPaint(wxPaintEvent& event);
wxString m_label;
int m_mnemonic;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText)
};
#endif // _WX_GENERIC_STATTEXTG_H_