BsGUIWindowMover.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElement.h"
  4. #include "BsImageSprite.h"
  5. #include <boost/signals.hpp>
  6. namespace BansheeEditor
  7. {
  8. class GUIWindowMover : public BS::GUIElement
  9. {
  10. public:
  11. static const CM::String& getGUITypeName();
  12. static GUIWindowMover* create(BS::GUIWidget& parent, const BS::GUIElementStyle* style = nullptr);
  13. static GUIWindowMover* create(BS::GUIWidget& parent, const BS::GUILayoutOptions& layoutOptions, const BS::GUIElementStyle* style = nullptr);
  14. void setFocused(bool focused);
  15. boost::signal<void()> onDraggedItemDropped;
  16. protected:
  17. ~GUIWindowMover();
  18. /**
  19. * @copydoc GUIElement::getNumRenderElements()
  20. */
  21. virtual CM::UINT32 getNumRenderElements() const;
  22. /**
  23. * @copydoc GUIElement::getMaterial()
  24. */
  25. virtual const CM::HMaterial& getMaterial(CM::UINT32 renderElementIdx) const;
  26. /**
  27. * @copydoc GUIElement::getNumQuads()
  28. */
  29. virtual CM::UINT32 getNumQuads(CM::UINT32 renderElementIdx) const;
  30. /**
  31. * @copydoc GUIElement::fillBuffer()
  32. */
  33. virtual void fillBuffer(CM::UINT8* vertices, CM::UINT8* uv, CM::UINT32* indices, CM::UINT32 startingQuad,
  34. CM::UINT32 maxNumQuads, CM::UINT32 vertexStride, CM::UINT32 indexStride, CM::UINT32 renderElementIdx) const;
  35. /**
  36. * @copydoc GUIElement::updateRenderElementsInternal()
  37. */
  38. virtual void updateRenderElementsInternal();
  39. /**
  40. * @copydoc GUIElement::updateBounds()
  41. */
  42. virtual void updateBounds();
  43. virtual CM::UINT32 _getOptimalWidth() const;
  44. virtual CM::UINT32 _getOptimalHeight() const;
  45. private:
  46. BS::ImageSprite* mImageSprite;
  47. BS::IMAGE_SPRITE_DESC mDesc;
  48. GUIWindowMover(BS::GUIWidget& parent, const BS::GUIElementStyle* style, const BS::GUILayoutOptions& layoutOptions);
  49. virtual bool mouseEvent(const BS::GUIMouseEvent& ev);
  50. };
  51. }