OpenMoHAA 0.82.0
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 {
26public:
27 CLASS_PROTOTYPE( UIChildSpaceWidget );
28
29public:
30 UIChildSpaceWidget();
31
32 qboolean KeyEvent( int key, unsigned int time ) override;
33};
34
35class UIFloatingWindow : public UIWidget {
36 UIPoint2D m_clickOffset;
37 bool m_isPressed;
38 UColor m_titleColor;
39 UColor m_textColor;
40 UIChildSpaceWidget *m_childspace;
41 bool m_minimized;
42 float m_restoredHeight;
43 UIPoint2D m_clickpoint;
44 int m_clicktime;
45
46protected:
47 UIButton *m_closeButton;
48 UIButton *m_minimizeButton;
49
50public:
51 CLASS_PROTOTYPE( UIFloatingWindow );
52
53 static Event W_ClosePressed;
54 static Event W_MinimizePressed;
55
56protected:
57 void FrameInitialized( void ) override;
58 void FrameInitialized( bool bHasDragBar );
59
60public:
61
62 UIFloatingWindow();
63 ~UIFloatingWindow();
64
65 void ClosePressed( Event *ev );
66 void MinimizePressed( Event *ev );
67 void Pressed( Event *ev );
68 void Released( Event *ev );
69 void Dragged( Event *ev );
70 void SizeChanged( Event *ev );
71 void OnActivated( Event *ev );
72 void OnDeactivated( Event *ev );
73 void Create( UIWidget *parent, const UIRect2D& rect, const char *title, const UColor& bgColor, const UColor& fgColor );
74 void Draw( void ) override;
75 UIChildSpaceWidget *getChildSpace( void );
76 bool IsMinimized( void );
77};
78
79static UColor UWindowColor(0.15f, 0.195f, 0.278f, 1);
Definition listener.h:246
Definition ucolor.h:25
Definition uibutton.h:53
Definition uifloatwnd.h:25
Definition uipoint2d.h:25
Definition uirect2d.h:28