X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/916eabe60eee4adb05387bbf1eaf1915ae5eac18..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/include/wx/generic/stattextg.h?ds=sidebyside diff --git a/include/wx/generic/stattextg.h b/include/wx/generic/stattextg.h index 69ef8b08f6..9df2cd912f 100644 --- a/include/wx/generic/stattextg.h +++ b/include/wx/generic/stattextg.h @@ -3,7 +3,7 @@ // Purpose: wxGenericStaticText header // Author: Marcin Wojdyr // Created: 2008-06-26 -// Id: $Id:$ +// Id: $Id$ // Copyright: Marcin Wojdyr // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -11,12 +11,18 @@ #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() { Init(); } wxGenericStaticText(wxWindow *parent, wxWindowID id, @@ -26,6 +32,8 @@ public: long style = 0, const wxString& name = wxStaticTextNameStr) { + Init(); + Create(parent, id, label, pos, size, style, name); } @@ -37,24 +45,45 @@ public: long style = 0, const wxString& name = wxStaticTextNameStr); + virtual ~wxGenericStaticText(); - virtual wxSize DoGetBestClientSize() const; - virtual wxSize DoGetBestSize() const; + // overridden base class virtual methods virtual void SetLabel(const wxString& label); virtual bool SetFont(const wxFont &font); +protected: + virtual wxSize DoGetBestClientSize() const; + virtual wxString DoGetLabel() const { return m_label; } virtual void DoSetLabel(const wxString& label); -protected: - void OnPaint(wxPaintEvent& event); void DoSetSize(int x, int y, int width, int height, int sizeFlags); +#if wxUSE_MARKUP + virtual bool DoSetLabelMarkup(const wxString& markup); +#endif // wxUSE_MARKUP + private: + void Init() + { +#if wxUSE_MARKUP + m_markupText = NULL; +#endif // wxUSE_MARKUP + } + + void OnPaint(wxPaintEvent& event); + + void DoDrawLabel(wxDC& dc, const wxRect& rect); + + // These fields are only used if m_markupText == NULL. wxString m_label; int m_mnemonic; +#if wxUSE_MARKUP + class wxMarkupText *m_markupText; +#endif // wxUSE_MARKUP + DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText) };