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