BsGUITreeViewEditBox.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "GUI/BsGUIInputBox.h"
  6. namespace bs
  7. {
  8. /** @addtogroup GUI-Editor-Internal
  9. * @{
  10. */
  11. /** Input box used for renaming elements in a TreeView. */
  12. class GUITreeViewEditBox : public GUIInputBox
  13. {
  14. public:
  15. /** Returns type name of the GUI element used for finding GUI element styles. */
  16. static const String& getGUITypeName();
  17. /**
  18. * Creates a new GUI tree view edito box element.
  19. *
  20. * @param[in] styleName Optional style to use for the element. Style will be retrieved from GUISkin of the
  21. * GUIWidget the element is used on. If not specified default style is used.
  22. */
  23. static GUITreeViewEditBox* create(const String& styleName = StringUtil::BLANK);
  24. /**
  25. * Creates a new GUI tree view edito box element.
  26. *
  27. * @param[in] 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[in] styleName Optional style to use for the element. Style will be retrieved from GUISkin of the
  30. * GUIWidget the element is used on. If not specified default style is used.
  31. */
  32. static GUITreeViewEditBox* create(const GUIOptions& options, const String& styleName = StringUtil::BLANK);
  33. Event<void()> onInputConfirmed; /**< Triggered when the user confirms the input in the edit box. */
  34. Event<void()> onInputCanceled; /**< Triggered when the user cancels the input in the edit box. */
  35. Event<void()> onFocusLost; /**< Triggered when the user clicks outside of the editor box. */
  36. private:
  37. GUITreeViewEditBox(const String& styleName, const GUIDimensions& dimensions);
  38. /** @copydoc GUIElement::_commandEvent */
  39. virtual bool _commandEvent(const GUICommandEvent& ev) override;
  40. };
  41. /** @} */
  42. }