2008-10-12 09:04:00 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/generic/stattextg.h
|
|
|
|
// Purpose: wxGenericStaticText header
|
|
|
|
// Author: Marcin Wojdyr
|
|
|
|
// Created: 2008-06-26
|
|
|
|
// Copyright: Marcin Wojdyr
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GENERIC_STATTEXTG_H_
|
|
|
|
#define _WX_GENERIC_STATTEXTG_H_
|
|
|
|
|
2008-10-17 08:02:47 -04:00
|
|
|
// 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
|
2008-10-12 09:04:00 -04:00
|
|
|
#include "wx/stattext.h"
|
2008-10-17 08:02:47 -04:00
|
|
|
#undef wxNO_PORT_STATTEXT_INCLUDE
|
2008-10-12 09:04:00 -04:00
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxGenericStaticText : public wxStaticTextBase
|
|
|
|
{
|
|
|
|
public:
|
2011-02-27 07:48:38 -05:00
|
|
|
wxGenericStaticText() { Init(); }
|
2008-10-12 09:04:00 -04:00
|
|
|
|
|
|
|
wxGenericStaticText(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxStaticTextNameStr)
|
|
|
|
{
|
2011-02-27 07:48:38 -05:00
|
|
|
Init();
|
|
|
|
|
2008-10-12 09:04:00 -04:00
|
|
|
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);
|
|
|
|
|
2011-02-27 07:48:38 -05:00
|
|
|
virtual ~wxGenericStaticText();
|
|
|
|
|
2008-10-12 09:04:00 -04:00
|
|
|
|
2009-12-14 07:41:55 -05:00
|
|
|
// overridden base class virtual methods
|
2008-10-12 09:04:00 -04:00
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual bool SetFont(const wxFont &font);
|
|
|
|
|
2009-12-14 07:41:55 -05:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestClientSize() const;
|
|
|
|
|
2008-10-12 09:04:00 -04:00
|
|
|
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);
|
|
|
|
|
2011-02-27 07:48:38 -05:00
|
|
|
#if wxUSE_MARKUP
|
|
|
|
virtual bool DoSetLabelMarkup(const wxString& markup);
|
|
|
|
#endif // wxUSE_MARKUP
|
|
|
|
|
2008-10-12 09:04:00 -04:00
|
|
|
private:
|
2011-02-27 07:48:38 -05:00
|
|
|
void Init()
|
|
|
|
{
|
|
|
|
#if wxUSE_MARKUP
|
|
|
|
m_markupText = NULL;
|
|
|
|
#endif // wxUSE_MARKUP
|
|
|
|
}
|
|
|
|
|
2009-12-08 10:56:21 -05:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
|
2011-02-27 07:48:38 -05:00
|
|
|
void DoDrawLabel(wxDC& dc, const wxRect& rect);
|
|
|
|
|
|
|
|
// These fields are only used if m_markupText == NULL.
|
2008-10-12 09:04:00 -04:00
|
|
|
wxString m_label;
|
|
|
|
int m_mnemonic;
|
|
|
|
|
2011-02-27 07:48:38 -05:00
|
|
|
#if wxUSE_MARKUP
|
|
|
|
class wxMarkupText *m_markupText;
|
|
|
|
#endif // wxUSE_MARKUP
|
|
|
|
|
2008-10-12 09:04:00 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GENERIC_STATTEXTG_H_
|
|
|
|
|