stattext.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/stattext.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_GTK_STATTEXT_H_
  9. #define _WX_GTK_STATTEXT_H_
  10. //-----------------------------------------------------------------------------
  11. // wxStaticText
  12. //-----------------------------------------------------------------------------
  13. class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase
  14. {
  15. public:
  16. wxStaticText();
  17. wxStaticText(wxWindow *parent,
  18. wxWindowID id,
  19. const wxString &label,
  20. const wxPoint &pos = wxDefaultPosition,
  21. const wxSize &size = wxDefaultSize,
  22. long style = 0,
  23. const wxString &name = wxStaticTextNameStr );
  24. bool Create(wxWindow *parent,
  25. wxWindowID id,
  26. const wxString &label,
  27. const wxPoint &pos = wxDefaultPosition,
  28. const wxSize &size = wxDefaultSize,
  29. long style = 0,
  30. const wxString &name = wxStaticTextNameStr );
  31. void SetLabel( const wxString &label );
  32. bool SetFont( const wxFont &font );
  33. static wxVisualAttributes
  34. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  35. // implementation
  36. // --------------
  37. protected:
  38. virtual bool GTKWidgetNeedsMnemonic() const;
  39. virtual void GTKWidgetDoSetMnemonic(GtkWidget* w);
  40. virtual wxSize DoGetBestSize() const;
  41. virtual wxString DoGetLabel() const;
  42. virtual void DoSetLabel(const wxString& str);
  43. #if wxUSE_MARKUP
  44. virtual bool DoSetLabelMarkup(const wxString& markup);
  45. #endif // wxUSE_MARKUP
  46. private:
  47. // Common part of SetLabel() and DoSetLabelMarkup().
  48. typedef void (wxStaticText::*GTKLabelSetter)(GtkLabel *, const wxString&);
  49. void GTKDoSetLabel(GTKLabelSetter setter, const wxString& label);
  50. DECLARE_DYNAMIC_CLASS(wxStaticText)
  51. };
  52. #endif
  53. // _WX_GTK_STATTEXT_H_