EnterTextView.h 771 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
  3. * All rights reserved. Distributed under the terms of the MIT license.
  4. */
  5. #ifndef _ENTER_TEXT_VIEW_H
  6. #define _ENTER_TEXT_VIEW_H
  7. #include "UrlTextView.h"
  8. class EnterTextView : public UrlTextView {
  9. public:
  10. EnterTextView(const char* name);
  11. EnterTextView(const char* name, const BFont* initialFont,
  12. const rgb_color* initialColor,
  13. uint32 flags = B_WILL_DRAW);
  14. virtual void KeyDown(const char* bytes, int32 numBytes);
  15. void SetTarget(BHandler* handler) { fTarget = handler; }
  16. BMessage Message() { return fMessage; }
  17. void SetMessage(BMessage msg, const char* textSlot = NULL);
  18. private:
  19. BMessage fMessage;
  20. BHandler* fTarget;
  21. BString fTextSlot;
  22. };
  23. #endif // _ENTER_TEXT_VIEW_H