OpenMoHAA
0.82.0
Loading...
Searching...
No Matches
uihorizscroll.h
1
/*
2
===========================================================================
3
Copyright (C) 2015 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
typedef
enum
{
26
VS_NONE,
27
VS_UP_ARROW,
28
VS_DOWN_ARROW,
29
VS_THUMB,
30
VS_PAGE_DOWN,
31
VS_PAGE_UP
32
} whatspressed;
33
34
class
UIHorizScroll :
public
UIWidget
35
{
36
protected
:
37
int
m_numitems;
38
int
m_pagewidth;
39
int
m_topitem;
40
UIFont
m_marlett;
41
whatspressed m_pressed;
42
UIRect2D
thumbRect;
43
44
struct
{
45
int
itemOffset;
46
int
orgItem;
47
} m_dragThumbState;
48
49
bool
m_frameinitted;
50
UColor
m_thumbcolor;
51
UColor
m_solidbordercolor;
52
53
public
:
54
CLASS_PROTOTYPE(UIHorizScroll);
55
56
protected
:
57
int
getItemFromWidth(
float
height);
58
bool
isEnoughItems(
void
);
59
60
public
:
61
UIHorizScroll();
62
63
void
Draw(
void
)
override
;
64
void
DrawArrow(
float
top,
const
char
*text,
bool
pressed);
65
void
DrawThumb();
66
void
MouseDown(
Event
*ev);
67
void
MouseUp(
Event
*ev);
68
void
MouseDragged(
Event
*ev);
69
void
MouseEnter(
Event
*ev);
70
void
MouseLeave(
Event
*ev);
71
void
Scroll(
Event
*ev);
72
bool
AttemptScrollTo(
int
to);
73
void
setNumItems(
int
i);
74
void
setPageWidth(
int
i);
75
void
setTopItem(
int
i);
76
int
getTopItem(
void
);
77
int
getPageWidth(
void
);
78
int
getNumItems(
void
);
79
void
setThumbColor(
const
UColor
& thumb);
80
void
setSolidBorderColor(
const
UColor
& col);
81
void
InitFrameAlignRight(UIWidget *parent);
82
};
Event
Definition
listener.h:246
UColor
Definition
ucolor.h:25
UIFont
Definition
uifont.h:40
UIRect2D
Definition
uirect2d.h:28
code
uilib
uihorizscroll.h
Generated by
1.13.2