BsGUITreeViewEditBox.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIInputBox.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Input box used for renaming elements in a TreeView.
  8. */
  9. class GUITreeViewEditBox : public GUIInputBox
  10. {
  11. public:
  12. /**
  13. * Returns type name of the GUI element used for finding GUI element styles.
  14. */
  15. static const String& getGUITypeName();
  16. /**
  17. * @brief Creates a new GUI tree view edito box element.
  18. *
  19. * @param styleName Optional style to use for the element. Style will be retrieved
  20. * from GUISkin of the GUIWidget the element is used on. If not specified
  21. * default style is used.
  22. */
  23. static GUITreeViewEditBox* create(const String& styleName = StringUtil::BLANK);
  24. /**
  25. * @brief Creates a new GUI tree view edito box element.
  26. *
  27. * @param options Options that allow you to control how is the element positioned and sized.
  28. * This will override any similar options set by style.
  29. * @param styleName Optional style to use for the element. Style will be retrieved
  30. * from GUISkin of the GUIWidget the element is used on. If not specified
  31. * default style is used.
  32. */
  33. static GUITreeViewEditBox* create(const GUIOptions& options, const String& styleName = StringUtil::BLANK);
  34. Event<void()> onInputConfirmed; /**< Triggered when the user confirms the input in the edit box. */
  35. Event<void()> onInputCanceled; /**< Triggered when the user cancels the input in the edit box. */
  36. Event<void()> onFocusLost; /**< Triggered when the user clicks outside of the editor box. */
  37. private:
  38. GUITreeViewEditBox(const String& styleName, const GUIDimensions& dimensions);
  39. /**
  40. * @copydoc GUIElement::_commandEvent
  41. */
  42. virtual bool _commandEvent(const GUICommandEvent& ev) override;
  43. };
  44. }