| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsEditorPrerequisites.h"
- #include "GUI/BsGUIButtonBase.h"
- #include "GUI/BsGUIToggleGroup.h"
- #include "2D/BsImageSprite.h"
- #include "2D/BsTextSprite.h"
- #include "GUI/BsGUIContent.h"
- #include "Utility/BsEvent.h"
- namespace bs
- {
- /** @addtogroup GUI-Editor
- * @{
- */
- /**
- * GUI element that accepts a drag and drop operation of a specified type.
- *
- * @see DragAndDropManager
- */
- class BS_ED_EXPORT GUIDropButton : public GUIButtonBase
- {
- public:
- /** Returns type name of the GUI element used for finding GUI element styles. */
- static const String& getGUITypeName();
- /**
- * Creates a new GUI drop button element.
- *
- * @param[in] dragType Identifier of the drag operation to accept.
- * @param[in] styleName Optional style to use for the element. Style will be retrieved from GUISkin of the
- * GUIWidget the element is used on. If not specified default style is used.
- */
- static GUIDropButton* create(UINT32 dragType, const String& styleName = StringUtil::BLANK);
- /**
- * Creates a new GUI drop button element.
- *
- * @param[in] dragType Identifier of the drag operation to accept.
- * @param[in] options Options that allow you to control how is the element positioned and sized. This will
- * override any similar options set by style.
- * @param[in] styleName Optional style to use for the element. Style will be retrieved from GUISkin of the
- * GUIWidget the element is used on. If not specified default style is used.
- */
- static GUIDropButton* create(UINT32 dragType, const GUIOptions& options,
- const String& styleName = StringUtil::BLANK);
- /** Triggered when drag and drop operation finishes while over the button and is of the correct type. */
- Event<void(void*)> onDataDropped;
- protected:
- virtual ~GUIDropButton() = default;
- protected:
- GUIDropButton(UINT32 dragType, const String& styleName, const GUIDimensions& dimensions);
- /** @copydoc GUIButtonBase::_mouseEvent */
- bool _mouseEvent(const GUIMouseEvent& ev) override;
- /** @copydoc GUIButtonBase::_acceptDragAndDrop */
- bool _acceptDragAndDrop(const Vector2I position, UINT32 typeId) const override;
- UINT32 mDragType;
- };
- /** @} */
- }
|