OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
uistatus.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
25typedef enum { M_NONE, M_DRAGGING } mouseState_t;
26
27class UIWindowSizer : public UIWidget {
28protected:
29 class UIWidget *m_draggingwidget;
30 mouseState_t m_mouseState;
31 UIPoint2D m_screenDragPoint;
32
33public:
34 CLASS_PROTOTYPE( UIWindowSizer );
35
36 UIWindowSizer();
37 UIWindowSizer(UIWidget* w);
38
39 void Draw( void ) override;
40 void FrameInitialized( void ) override;
41 void MouseDown( Event *ev );
42 void MouseUp( Event *ev );
43 void MouseDragged( Event *ev );
44 void setDraggingWidget( UIWidget *w );
45 UIWidget *getDraggingWidget( void );
46};
47
48typedef enum { WND_ALIGN_NONE, WND_ALIGN_BOTTOM } alignment_t;
49
50typedef struct align_s {
51public:
52 float dist;
53 alignment_t alignment;
54} align_t;
55
56class UIStatusBar : public UIWidget {
57protected:
58 align_t m_align;
59 class UIWidget *m_sizeenabled;
60 bool m_created;
61
62 UIWindowSizer *m_sizer;
63
64public:
65 CLASS_PROTOTYPE( UIStatusBar );
66
67protected:
68 void FrameInitialized( void ) override;
69
70public:
71 UIStatusBar();
72 UIStatusBar( alignment_t align, float height );
73
74 void Draw( void ) override;
75 void AlignBar( alignment_t align, float height );
76 void DontAlignBar( void );
77 void EnableSizeBox( UIWidget *which );
78 void ParentSized( Event *ev );
79 void SelfSized( Event *ev );
80};
Definition listener.h:246
Definition uipoint2d.h:25
Definition uistatus.h:27
Definition uistatus.h:50