Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
ScrollWindow.h
Go to the documentation of this file.
1
/* Project nGenEx
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: nGenEx.lib
6
FILE: ScrollWindow.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
ScrollWindow base class for List, Edit, and Rich Text controls
13
*/
14
15
#ifndef ScrollWindow_h
16
#define ScrollWindow_h
17
18
#include "
Types.h
"
19
#include "
ActiveWindow.h
"
20
#include "
List.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
ScrollWindow
:
public
ActiveWindow
25
{
26
public
:
27
enum
POLICY
{
SCROLL_NEVER
,
28
SCROLL_AUTO
,
29
SCROLL_ALWAYS
30
};
31
32
enum
SCROLL
{
SCROLL_NONE
,
33
SCROLL_UP
,
34
SCROLL_PAGE_UP
,
35
SCROLL_DOWN
,
36
SCROLL_PAGE_DOWN
,
37
SCROLL_THUMB
38
};
39
40
enum
MISC
{
BORDER_WIDTH
= 2,
41
EXTRA_WIDTH
= 4,
42
SCROLL_WIDTH
= 16,
43
SCROLL_HEIGHT
= 6,
44
SCROLL_TRACK
=
SCROLL_WIDTH
+ 1,
45
TRACK_START
=
BORDER_WIDTH
+
SCROLL_HEIGHT
,
46
THUMB_HEIGHT
=
SCROLL_WIDTH
,
47
HEADING_EXTRA
=
BORDER_WIDTH
+
EXTRA_WIDTH
48
};
49
50
ScrollWindow
(
ActiveWindow
* p,
int
ax,
int
ay,
int
aw,
int
ah, DWORD aid, DWORD
style
=0,
ActiveWindow
*
parent
=0);
51
ScrollWindow
(
Screen
* s,
int
ax,
int
ay,
int
aw,
int
ah, DWORD aid, DWORD
style
=0,
ActiveWindow
*
parent
=0);
52
virtual
~ScrollWindow
();
53
54
// Operations:
55
virtual
void
Paint
();
56
virtual
void
Draw
();
57
virtual
void
DrawTransparent
();
58
virtual
void
DrawContent
(
const
Rect
& ctrl_rect);
59
virtual
void
DrawTransparentContent
(
const
Rect
& ctrl_rect);
60
virtual
void
DrawScrollBar
();
61
virtual
void
MoveTo
(
const
Rect
& r);
62
63
// Event Target Interface:
64
virtual
int
OnMouseMove
(
int
x,
int
y);
65
virtual
int
OnLButtonDown
(
int
x,
int
y);
66
virtual
int
OnLButtonUp
(
int
x,
int
y);
67
virtual
int
OnMouseWheel
(
int
wheel);
68
virtual
int
OnClick
();
69
70
virtual
int
OnKeyDown
(
int
vk,
int
flags);
71
72
// pseudo-events:
73
virtual
int
OnDragStart
(
int
x,
int
y);
74
virtual
int
OnDragDrop
(
int
x,
int
y,
ActiveWindow
* source);
75
76
// Property accessors:
77
virtual
int
GetLineHeight
();
78
virtual
void
SetLineHeight
(
int
h);
79
80
virtual
int
GetLeading
();
81
virtual
void
SetLeading
(
int
nNewValue);
82
virtual
int
GetScrollBarVisible
();
83
virtual
void
SetScrollBarVisible
(
int
nNewValue);
84
virtual
int
GetDragDrop
();
85
virtual
void
SetDragDrop
(
int
nNewValue);
86
virtual
bool
GetSmoothScroll
();
87
virtual
void
SetSmoothScroll
(
bool
s);
88
89
virtual
bool
IsScrollVisible
();
90
virtual
bool
CanScroll
(
int
direction,
int
nlines=1);
91
virtual
void
EnsureVisible
(
int
index);
92
virtual
void
Scroll
(
int
direction,
int
nlines=1);
93
virtual
void
SmoothScroll
(
int
direction,
double
nlines);
94
virtual
void
ScrollTo
(
int
index);
95
96
// read-only:
97
virtual
int
GetTopIndex
();
98
virtual
int
GetLineCount
();
99
virtual
int
GetPageCount
();
100
virtual
int
GetPageSize
();
101
virtual
int
GetScrollTrack
();
102
103
int
IsDragging
()
const
{
return
dragging
; }
104
int
IsSelecting
()
const
{
return
selecting
; }
105
int
IsScrolling
()
const
{
return
scrolling
; }
106
107
protected
:
108
int
captured
;
109
int
dragging
;
110
int
selecting
;
111
int
scrolling
;
112
int
scroll_count
;
113
int
mouse_x
;
114
int
mouse_y
;
115
int
track_length
;
116
int
thumb_pos
;
117
118
int
leading
;
119
int
scroll_bar
;
120
int
dragdrop
;
121
int
line_count
;
122
int
page_count
;
123
int
page_size
;
124
int
top_index
;
125
int
line_height
;
126
127
bool
smooth_scroll
;
128
double
smooth_offset
;
129
};
130
131
#endif ScrollWindow_h
132
nGenEx
ScrollWindow.h
Generated on Tue Jun 5 2012 20:46:26 for Starshatter_Open by
1.8.1