SCV
4.2.1
Simple Components for Visual
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
ScrollComponent.h
Go to the documentation of this file.
1
7
#ifndef __SCV_SCROLL_COMPONENT_H__
8
#define __SCV_SCROLL_COMPONENT_H__
9
10
#include "
Panel.h
"
11
#include "
Component.h
"
12
#include "
ComponentTexture.h
"
13
14
namespace
scv {
15
16
class
ScrollComponent
:
public
Component
{
17
public
:
18
ScrollComponent
(
const
scv::Point
&p1,
const
scv::Point
&p2,
scv::Component
*
object
= NULL);
19
20
virtual
void
setComponent
(
scv::Component
*
object
);
21
inline
scv::Component
*
getComponent
(
void
)
const
;
22
23
void
processMouse
(
const
scv::MouseEvent
&evt);
24
void
processKey
(
const
scv::KeyEvent
&evt);
25
26
void
setHeight
(
int
height);
27
void
setWidth
(
int
width);
28
29
void
display
(
void
);
30
31
protected
:
32
virtual
void
refreshSCrollPaneSize
(
void
);
33
virtual
void
refreshContainerPosition
(
void
);
34
35
protected
:
36
enum
Button
{
37
BUT_NONE
,
38
BUT_UP
,
BUT_DOWN
,
BUT_VERT
,
39
BUT_LEFT
,
BUT_RIGHT
,
BUT_HORZ
,
40
BUT_PAGEUP
,
BUT_PAGEDOWN
,
41
BUT_PAGELEFT
,
BUT_PAGERIGHT
42
};
43
44
bool
isOnLeftButton
(
Point
p);
45
bool
isOnRightButton
(
Point
p);
46
bool
isOnUpButton
(
Point
p);
47
bool
isOnBottomButton
(
Point
p);
48
49
bool
isOnVertButton
(
Point
p);
50
bool
isOnHorzButton
(
Point
p);
51
bool
isOnVertBar
(
Point
p);
52
bool
isOnHorzBar
(
Point
p);
53
54
float
pixelToFloat
(
int
pix,
bool
horz);
55
float
barPixelToFloat
(
int
pix,
bool
horz);
56
57
void
createTexture
(
void
);
58
ComponentTexture
*
_cTexture
;
59
60
static
const
int
s_initDesloc
= 16;
61
static
const
int
s_border
= 15;
62
static
const
int
s_unnecessaryBorder
= (3 *
s_initDesloc
+ 1);
63
64
Button
_draggingBar
,
_overButton
;
65
66
float
_translateHeight
,
_translateWidth
;
67
int
_scrollSizeVertical
,
_scrollSizeHorizontal
;
68
int
_maxDeslocHeight
,
_maxDeslocWidth
;
69
int
_containerHeight
,
_containerWidth
;
70
int
_dragBarOffset
;
71
72
Point
_minContainerPos
;
73
74
bool
_holdButton
;
75
Component
*
_registeredComponent
;
76
};
77
79
scv::Component
*
ScrollComponent::getComponent
(
void
)
const
{
80
return
_registeredComponent
;
81
}
82
83
}
// namespace scv
84
85
#endif // __SCV_SCROLL_COMPONENT_H__
include
SCV
ScrollComponent.h
Generated on Fri Dec 14 2012 09:44:49 for SCV by
1.8.2