OpenMoHAA
0.82.0
Loading...
Searching...
No Matches
uivertscroll.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
unnamed_struct
{
26
public
:
27
int
itemOffset;
28
int
orgItem;
29
};
30
31
class
UIVertScroll :
public
UIWidget {
32
protected
:
33
int
m_numitems;
34
int
m_pageheight;
35
int
m_topitem;
36
UIFont
m_marlett;
37
whatspressed m_pressed;
38
UIRect2D
thumbRect;
39
unnamed_struct
m_dragThumbState;
40
bool
m_frameinitted;
41
UColor
m_thumbcolor;
42
UColor
m_solidbordercolor;
43
44
public
:
45
CLASS_PROTOTYPE( UIVertScroll );
46
47
protected
:
48
int
getItemFromHeight(
float
height );
49
bool
isEnoughItems(
void
);
50
51
public
:
52
UIVertScroll();
53
54
void
Draw(
void
)
override
;
55
void
DrawArrow(
float
top,
const
char
*text,
bool
pressed );
56
void
DrawThumb(
void
);
57
void
MouseDown(
Event
*ev );
58
void
MouseUp(
Event
*ev );
59
void
MouseDragged(
Event
*ev );
60
void
MouseEnter(
Event
*ev );
61
void
MouseLeave(
Event
*ev );
62
void
Scroll(
Event
*ev );
63
bool
AttemptScrollTo(
int
to );
64
void
setNumItems(
int
i );
65
void
setPageHeight(
int
i );
66
void
setTopItem(
int
i );
67
int
getTopItem(
void
);
68
int
getPageHeight(
void
);
69
int
getNumItems(
void
);
70
void
setThumbColor(
const
UColor
& thumb );
71
void
setSolidBorderColor(
const
UColor
& col );
72
void
InitFrameAlignRight( UIWidget *parent,
float
fWidthPadding,
float
fHeightPadding );
73
void
FrameInitialized()
override
;
74
};
75
Event
Definition
listener.h:246
UColor
Definition
ucolor.h:25
UIFont
Definition
uifont.h:40
UIRect2D
Definition
uirect2d.h:28
unnamed_struct
Definition
uivertscroll.h:25
code
uilib
uivertscroll.h
Generated by
1.13.2