stattext.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/stattext.h
  3. // Purpose: wxStaticText class
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2003/02/15
  7. // Copyright: (c) 2003 David Elliott
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_STATTEXT_H__
  11. #define __WX_COCOA_STATTEXT_H__
  12. #include "wx/cocoa/NSTextField.h"
  13. // ========================================================================
  14. // wxStaticText
  15. // ========================================================================
  16. class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase, protected wxCocoaNSTextField
  17. {
  18. DECLARE_DYNAMIC_CLASS(wxStaticText)
  19. DECLARE_EVENT_TABLE()
  20. WX_DECLARE_COCOA_OWNER(NSTextField,NSControl,NSView)
  21. // ------------------------------------------------------------------------
  22. // initialization
  23. // ------------------------------------------------------------------------
  24. public:
  25. wxStaticText() {}
  26. wxStaticText(wxWindow *parent, wxWindowID winid,
  27. const wxString& label,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize, long style = 0,
  30. const wxString& name = wxStaticTextNameStr)
  31. {
  32. Create(parent, winid, label, pos, size, style, name);
  33. }
  34. bool Create(wxWindow *parent, wxWindowID winid,
  35. const wxString& label,
  36. const wxPoint& pos = wxDefaultPosition,
  37. const wxSize& size = wxDefaultSize, long style = 0,
  38. const wxString& name = wxStaticTextNameStr);
  39. virtual ~wxStaticText();
  40. // ------------------------------------------------------------------------
  41. // Cocoa specifics
  42. // ------------------------------------------------------------------------
  43. protected:
  44. virtual void Cocoa_didChangeText(void);
  45. // ------------------------------------------------------------------------
  46. // Implementation
  47. // ------------------------------------------------------------------------
  48. public:
  49. virtual void SetLabel(const wxString& label);
  50. virtual wxString GetLabel() const;
  51. };
  52. #endif // __WX_COCOA_STATTEXT_H__