| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #pragma once
- #include "BsEditorPrerequisites.h"
- #include "BsGUIWidget.h"
- #include "BsEvent.h"
- namespace BansheeEngine
- {
- /**
- * @brief A GUIWidget specialization that when attached to a window will
- * create a window border, window background and provide resize
- * functionality.
- */
- class WindowFrameWidget : public GUIWidget
- {
- public:
- /**
- * @brief Constructs a new window frame.
- *
- * @param parent Parent SceneObject to attach the Component to.
- * @param allowResize Should the widget set up resize handles that can be dragged by the user.
- * @param target Viewport to draw the GUI elements in.
- * @param ownerWindow Window that the frame widget will act on.
- * @param skin GUI skin used for the GUI child elements.
- */
- WindowFrameWidget(const HSceneObject& parent, bool allowResize, Viewport* target, RenderWindow* ownerWindow, const HGUISkin& skin);
- virtual ~WindowFrameWidget();
- protected:
- /**
- * @copydoc Component::update
- */
- virtual void update() override;
- /**
- * @copydoc GUIWidget::ownerWindowFocusChanged
- */
- virtual bool _mouseEvent(GUIElement* element, const GUIMouseEvent& ev) override;
- /**
- * @copydoc GUIWidget::ownerWindowFocusChanged
- */
- virtual void ownerWindowFocusChanged() override;
- /**
- * @copydoc GUIWidget::ownerTargetResized
- */
- virtual void ownerTargetResized() override;
- /**
- * @brief Updates the non-client areas that notify the OS where the interactable elements
- * used for window resize operations are. This should be called after any resize
- * operations.
- */
- void refreshNonClientAreas() const;
- static const UINT32 RESIZE_BORDER_WIDTH;
- bool mAllowResize;
- GUIPanel* mWindowFramePanel;
- RenderWindow* mParentWindow;
- GUIWindowFrame* mWindowFrame;
- };
- }
|