BlackTopp Studios
inc
Main
Namespaces
Classes
Files
File List
File Members
Mezzanine
src
UI
window.cpp
1
// © Copyright 2010 - 2016 BlackTopp Studios Inc.
2
/* This file is part of The Mezzanine Engine.
3
4
The Mezzanine Engine is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
The Mezzanine Engine is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
/* The original authors have included a copy of the license specified above in the
18
'Docs' folder. See 'gpl.txt'
19
*/
20
/* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21
Build professional software and charge for their product.
22
23
However there are some practical restrictions, so if your project involves
24
any of the following you should contact us and we will try to work something
25
out:
26
- DRM or Copy Protection of any kind(except Copyrights)
27
- Software Patents You Do Not Wish to Freely License
28
- Any Kind of Linking to Non-GPL licensed Works
29
- Are Currently In Violation of Another Copyright Holder's GPL License
30
- If You want to change our code and not add a few hundred MB of stuff to
31
your distribution
32
33
These and other limitations could cause serious legal problems if you ignore
34
them, so it is best to simply contact us or the Free Software Foundation, if
35
you have any questions.
36
37
Joseph Toppi - toppij@gmail.com
38
John Blackwood - makoenergy02@gmail.com
39
*/
40
#ifndef _uiwindow_cpp
41
#define _uiwindow_cpp
42
43
#include "UI/window.h"
44
#include "UI/uimanager.h"
45
#include "UI/screen.h"
46
#include "entresol.h"
47
48
namespace
Mezzanine
49
{
50
namespace
UI
51
{
52
/*Window::Window(ConstString& name, const Rect& RendRect, Screen* PScreen) :
53
EnclosedRenderableContainerWidget(name,RendRect,PScreen),
54
BorderWidth(0),
55
CurrentRM(RM_None)
56
{
57
Type = Widget::W_Window;
58
}
59
60
Window::~Window()
61
{
62
}
63
64
void Window::BorderAreaCheck(const Vector2& ScreenLoc)
65
{
66
if(!BorderWidth)
67
return;
68
Vector2 Size = WidgetBack->GetActualSize();
69
Vector2 Position = WidgetBack->GetActualPosition();
70
bool Left = ScreenLoc.X >= Position.X && ScreenLoc.X <= Position.X + BorderWidth;
71
bool Right = ScreenLoc.X >= Position.X + Size.X && ScreenLoc.X <= (Position.X + Size.X) - BorderWidth;
72
bool Top = ScreenLoc.Y >= Position.Y && ScreenLoc.Y <= Position.Y + BorderWidth;
73
bool Bottom = ScreenLoc.Y >= Position.Y + Size.Y && ScreenLoc.Y <= (Position.Y + Size.Y) - BorderWidth;
74
if( Top && Left ) CurrentRM = Window::RM_TopLeft;
75
else if( Top && Right ) CurrentRM = Window::RM_TopRight;
76
else if( Bottom && Left ) CurrentRM = Window::RM_BottomLeft;
77
else if( Bottom && Right ) CurrentRM = Window::RM_BottomRight;
78
else if( Left ) CurrentRM = Window::RM_Left;
79
else if( Right ) CurrentRM = Window::RM_BottomRight;
80
else if( Top ) CurrentRM = Window::RM_BottomRight;
81
else if( Bottom ) CurrentRM = Window::RM_BottomRight;
82
}
83
84
void Window::UpdateImpl(bool Force)
85
{
86
EnclosedRenderableContainerWidget::UpdateImpl(Force);
87
}
88
89
void Window::SetVisibleImpl(bool visible)
90
{
91
EnclosedRenderableContainerWidget::SetVisibleImpl(visible);
92
}
93
94
bool Window::CheckMouseHoverImpl()
95
{
96
return EnclosedRenderableContainerWidget::CheckMouseHoverImpl();
97
}
98
99
void Window::SetPosition(const Vector2& Position)
100
{
101
EnclosedRenderableContainerWidget::SetPosition(Position);
102
}
103
104
void Window::SetActualPosition(const Vector2& Position)
105
{
106
EnclosedRenderableContainerWidget::SetActualPosition(Position);
107
}
108
109
void Window::SetSize(const Vector2& Size)
110
{
111
EnclosedRenderableContainerWidget::SetSize(Size);
112
}
113
114
void Window::SetActualSize(const Vector2& Size)
115
{
116
EnclosedRenderableContainerWidget::SetActualSize(Size);
117
}
118
119
void Window::UpdateDimensions()
120
{
121
EnclosedRenderableContainerWidget::UpdateDimensions();
122
}
123
124
Rectangle* Window::GetWindowBack()
125
{
126
return WidgetBack;
127
}// */
128
}
//UI
129
}
//Mezzanine
130
131
#endif
Mezzanine
The bulk of the engine components go in this namspace.
Definition:
actor.cpp:56
Generated on Wed Apr 6 2016 08:34:48 for BlackTopp Studios inc by
1.8.9.1. Thanks to the
Open Icon Library
for help with some of the icons.