BsGUITreeViewEditBox.h 2.0 KB

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