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