72 lines
1.2 KiB
C++
72 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "neovision/view.h"
|
|
|
|
namespace neovision {
|
|
|
|
/**
|
|
* @brief A GUI window.
|
|
*
|
|
* Windows are Views with a frame around, optionally with a title bar, and all
|
|
* sorts of other features,...
|
|
*
|
|
*/
|
|
class Window: public View
|
|
{
|
|
|
|
std::wstring m_title{L"Window"};
|
|
std::wstring m_content;
|
|
|
|
public:
|
|
|
|
/**
|
|
* @brief Default constructor.
|
|
*/
|
|
Window();
|
|
|
|
/**
|
|
* @brief Destructor.
|
|
*/
|
|
virtual ~Window() = default;
|
|
|
|
/**
|
|
* @brief Get window title.
|
|
*
|
|
* @return Returns the window title string.
|
|
*/
|
|
std::wstring Title() const;
|
|
|
|
/**
|
|
* @brief Set window title.
|
|
*
|
|
* @param title The new window title.
|
|
*/
|
|
void Title(const std::wstring& title);
|
|
|
|
protected:
|
|
|
|
/**
|
|
* @brief Initialize event.
|
|
*
|
|
* This runs when the application initializes the view.
|
|
*/
|
|
virtual void Initialize();
|
|
|
|
/**
|
|
* @brief Draw event.
|
|
*
|
|
* Draws the window into the view buffer.
|
|
*/
|
|
virtual void OnDraw();
|
|
|
|
/**
|
|
* @brief Mouse event.
|
|
*
|
|
* Triggers when a mouse event happens.
|
|
*/
|
|
virtual void OnMouse(const MouseEventData&);
|
|
|
|
};
|
|
|
|
} // namespace neovision
|