OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
uifloatwnd.h
1/*
2===========================================================================
3Copyright (C) 2024 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25class UIChildSpaceWidget : public UIWidget
26{
27public:
28 CLASS_PROTOTYPE(UIChildSpaceWidget);
29
30public:
31 UIChildSpaceWidget();
32
33 qboolean KeyEvent(int key, unsigned int time) override;
34};
35
36class 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
48protected:
49 UIButton *m_closeButton;
50 UIButton *m_minimizeButton;
51
52public:
53 CLASS_PROTOTYPE(UIFloatingWindow);
54
55 static Event W_ClosePressed;
56 static Event W_MinimizePressed;
57
58protected:
59 void FrameInitialized(void) override;
60 void FrameInitialized(bool bHasDragBar);
61
62public:
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
81static UColor UWindowColor(0.15f, 0.195f, 0.278f, 1);
Definition listener.h:246
Definition ucolor.h:26
Definition uibutton.h:55
Definition uifloatwnd.h:26
Definition uipoint2d.h:26
Definition uirect2d.h:29