label.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #if defined(Hiro_Label)
  2. @interface CocoaLabel : NSView {
  3. @public
  4. hiro::mLabel* label;
  5. }
  6. -(id) initWith:(hiro::mLabel&)label;
  7. -(void) resetCursorRects;
  8. -(void) drawRect:(NSRect)dirtyRect;
  9. -(void) mouseButton:(NSEvent*)event down:(BOOL)isDown;
  10. -(void) mouseEntered:(NSEvent*)event;
  11. -(void) mouseExited:(NSEvent*)event;
  12. -(void) mouseMove:(NSEvent*)event;
  13. -(void) mouseDown:(NSEvent*)event;
  14. -(void) mouseUp:(NSEvent*)event;
  15. -(void) mouseDragged:(NSEvent*)event;
  16. -(void) rightMouseDown:(NSEvent*)event;
  17. -(void) rightMouseUp:(NSEvent*)event;
  18. -(void) rightMouseDragged:(NSEvent*)event;
  19. -(void) otherMouseDown:(NSEvent*)event;
  20. -(void) otherMouseUp:(NSEvent*)event;
  21. -(void) otherMouseDragged:(NSEvent*)event;
  22. @end
  23. namespace hiro {
  24. struct pLabel : pWidget {
  25. Declare(Label, Widget)
  26. auto minimumSize() const -> Size override;
  27. auto setAlignment(Alignment alignment) -> void;
  28. auto setBackgroundColor(Color color) -> void;
  29. auto setForegroundColor(Color color) -> void;
  30. auto setText(const string& text) -> void;
  31. CocoaLabel* cocoaLabel = nullptr;
  32. };
  33. }
  34. #endif