text-edit.hpp 939 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #if defined(Hiro_TextEdit)
  2. @interface CocoaTextEdit : NSScrollView <NSTextViewDelegate> {
  3. @public
  4. hiro::mTextEdit* textEdit;
  5. NSTextView* content;
  6. }
  7. -(id) initWith:(hiro::mTextEdit&)textEdit;
  8. -(NSTextView*) content;
  9. -(void) configure;
  10. -(void) textDidChange:(NSNotification*)notification;
  11. @end
  12. namespace hiro {
  13. struct pTextEdit : pWidget {
  14. Declare(TextEdit, Widget)
  15. auto setBackgroundColor(Color color) -> void;
  16. auto setEditable(bool editable) -> void;
  17. auto setEnabled(bool enabled) -> void override;
  18. auto setFont(const Font& font) -> void override;
  19. auto setForegroundColor(Color color) -> void;
  20. auto setGeometry(Geometry geometry) -> void override;
  21. auto setText(const string& text) -> void;
  22. auto setTextCursor(TextCursor textCursor) -> void;
  23. auto setWordWrap(bool wordWrap) -> void;
  24. auto text() const -> string;
  25. auto textCursor() const -> TextCursor;
  26. CocoaTextEdit* cocoaTextEdit = nullptr;
  27. };
  28. }
  29. #endif