Initial commit.
This commit is contained in:
commit
59c6161fdb
134 changed files with 4751 additions and 0 deletions
67
src/ui_elements/desktop_elements/Window.cpp
Normal file
67
src/ui_elements/desktop_elements/Window.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
#include "Window.h"
|
||||
|
||||
namespace mt{
|
||||
Window::Window()
|
||||
:mWidth(400),
|
||||
mHeight(300),
|
||||
mWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Window::~Window()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::vector<VisualLayerPtr> Window::GetLayers()
|
||||
{
|
||||
return mLayers;
|
||||
}
|
||||
|
||||
void Window::OnMouseEvent(MouseEventPtr event)
|
||||
{
|
||||
mWidget->OnMouseEvent(event);
|
||||
}
|
||||
|
||||
void Window::OnPaint(PaintEventPtr event)
|
||||
{
|
||||
mLayers.clear();
|
||||
mWidget->SetSize(mWidth, mHeight);
|
||||
mWidget->OnPaintEvent(event);
|
||||
|
||||
auto layers = mWidget->GetLayers();
|
||||
mLayers.insert(mLayers.end(), layers.begin(), layers.end());
|
||||
}
|
||||
|
||||
std::shared_ptr<Window> Window::Create()
|
||||
{
|
||||
return std::make_shared<Window>();
|
||||
}
|
||||
|
||||
void Window::AddWidget(WidgetPtr widget)
|
||||
{
|
||||
mWidget = widget;
|
||||
}
|
||||
|
||||
WidgetPtr Window::GetWidget()
|
||||
{
|
||||
return mWidget;
|
||||
}
|
||||
|
||||
unsigned Window::GetWidth()
|
||||
{
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
unsigned Window::GetHeight()
|
||||
{
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
void Window::SetSize(unsigned width, unsigned height)
|
||||
{
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue