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. /** @cond INTERNAL */
  9. /** @addtogroup GUI-Editor
  10. * @{
  11. */
  12. /** Input box used for renaming elements in a TreeView. */
  13. class GUITreeViewEditBox : public GUIInputBox
  14. {
  15. public:
  16. /** Returns type name of the GUI element used for finding GUI element styles. */
  17. static const String& getGUITypeName();
  18. /**
  19. * Creates a new GUI tree view edito box element.
  20. *
  21. * @param[in] styleName Optional style to use for the element. Style will be retrieved from GUISkin of the
  22. * GUIWidget the element is used on. If not specified default style is used.
  23. */
  24. static GUITreeViewEditBox* create(const String& styleName = StringUtil::BLANK);
  25. /**
  26. * Creates a new GUI tree view edito box element.
  27. *
  28. * @param[in] options Options that allow you to control how is the element positioned and sized.
  29. * This will override any similar options set by style.
  30. * @param[in] styleName Optional style to use for the element. Style will be retrieved from GUISkin of the
  31. * GUIWidget the element is used on. If not specified 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. /** @copydoc GUIElement::_commandEvent */
  40. virtual bool _commandEvent(const GUICommandEvent& ev) override;
  41. };
  42. /** @} */
  43. /** @endcond */
  44. }