OpenMoHAA
0.83.0
Loading...
Searching...
No Matches
uifloatwnd.h
1
/*
2
===========================================================================
3
Copyright (C) 2024 the OpenMoHAA team
4
5
This file is part of OpenMoHAA source code.
6
7
OpenMoHAA source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
11
12
OpenMoHAA source code is distributed in the hope that it will be
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with OpenMoHAA source code; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
===========================================================================
21
*/
22
23
#pragma once
24
25
class
UIChildSpaceWidget :
public
UIWidget
26
{
27
public
:
28
CLASS_PROTOTYPE(UIChildSpaceWidget);
29
30
public
:
31
UIChildSpaceWidget();
32
33
qboolean KeyEvent(
int
key,
unsigned
int
time)
override
;
34
};
35
36
class
UIFloatingWindow :
public
UIWidget
37
{
38
UIPoint2D
m_clickOffset;
39
bool
m_isPressed;
40
UColor
m_titleColor;
41
UColor
m_textColor;
42
UIChildSpaceWidget
*m_childspace;
43
bool
m_minimized;
44
float
m_restoredHeight;
45
UIPoint2D
m_clickpoint;
46
int
m_clicktime;
47
48
protected
:
49
UIButton
*m_closeButton;
50
UIButton
*m_minimizeButton;
51
52
public
:
53
CLASS_PROTOTYPE(UIFloatingWindow);
54
55
static
Event W_ClosePressed;
56
static
Event W_MinimizePressed;
57
58
protected
:
59
void
FrameInitialized(
void
)
override
;
60
void
FrameInitialized(
bool
bHasDragBar);
61
62
public
:
63
UIFloatingWindow();
64
~UIFloatingWindow();
65
66
void
ClosePressed(Event *ev);
67
void
MinimizePressed(Event *ev);
68
void
Pressed(Event *ev);
69
void
Released(Event *ev);
70
void
Dragged(Event *ev);
71
void
SizeChanged(Event *ev);
72
void
OnActivated(Event *ev);
73
void
OnDeactivated(Event *ev);
74
void
75
Create(UIWidget *parent,
const
UIRect2D
& rect,
const
char
*title,
const
UColor
& bgColor,
const
UColor
& fgColor);
76
void
Draw(
void
)
override
;
77
UIChildSpaceWidget
*getChildSpace(
void
);
78
bool
IsMinimized(
void
);
79
};
80
81
static
UColor
UWindowColor(0.15f, 0.195f, 0.278f, 1);
UColor
Definition
ucolor.h:26
UIButton
Definition
uibutton.h:55
UIChildSpaceWidget
Definition
uifloatwnd.h:26
UIPoint2D
Definition
uipoint2d.h:26
UIRect2D
Definition
uirect2d.h:29
code
uilib
uifloatwnd.h
Generated by
1.13.2