FLTK 1.3.5
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
Fl_Scroll.H
1
//
2
// "$Id$"
3
//
4
// Scroll header file for the Fast Light Tool Kit (FLTK).
5
//
6
// Copyright 1998-2015 by Bill Spitzak and others.
7
//
8
// This library is free software. Distribution and use rights are outlined in
9
// the file "COPYING" which should have been included with this file. If this
10
// file is missing or damaged, see the license at:
11
//
12
// http://www.fltk.org/COPYING.php
13
//
14
// Please report all bugs and problems on the following page:
15
//
16
// http://www.fltk.org/str.php
17
//
18
19
/* \file
20
Fl_Scroll widget . */
21
22
#ifndef Fl_Scroll_H
23
#define Fl_Scroll_H
24
25
#include "Fl_Group.H"
26
#include "Fl_Scrollbar.H"
27
87
class
FL_EXPORT
Fl_Scroll
:
public
Fl_Group
{
88
89
int
xposition_, yposition_;
90
int
oldx, oldy;
91
int
scrollbar_size_;
92
static
void
hscrollbar_cb(
Fl_Widget
*,
void
*);
93
static
void
scrollbar_cb(
Fl_Widget
*,
void
*);
94
void
fix_scrollbar_order();
95
static
void
draw_clip(
void
*,
int
,
int
,
int
,
int
);
96
97
#if FLTK_ABI_VERSION >= 10303
98
protected
:
// NEW (STR#1895)
99
#else
100
private
:
// OLD
101
#endif
102
108
typedef
struct
{
110
typedef
struct
{
int
x
,
y
,
w
,
h
; }
Fl_Region_XYWH
;
112
typedef
struct
{
113
int
l
;
114
int
r
;
115
int
t
;
116
int
b
;
117
}
Fl_Region_LRTB
;
119
typedef
struct
{
120
int
x
,
y
,
w
,
h
;
121
int
pos
;
122
int
size
;
123
int
first
;
124
int
total
;
125
}
Fl_Scrollbar_Data
;
126
int
scrollsize;
127
Fl_Region_XYWH
innerbox;
128
Fl_Region_XYWH
innerchild;
129
Fl_Region_LRTB
child
;
130
int
hneeded;
131
int
vneeded;
132
Fl_Scrollbar_Data
hscroll;
133
Fl_Scrollbar_Data
vscroll;
134
} ScrollInfo;
135
void
recalc_scrollbars(ScrollInfo &si);
136
137
protected
:
138
139
void
bbox(
int
&,
int
&,
int
&,
int
&);
140
void
draw
();
141
142
public
:
143
144
Fl_Scrollbar
scrollbar;
145
Fl_Scrollbar
hscrollbar;
146
147
void
resize
(
int
X,
int
Y,
int
W,
int
H);
148
int
handle
(
int
);
149
150
Fl_Scroll
(
int
X,
int
Y,
int
W,
int
H,
const
char
*l=0);
151
152
enum
{
// values for type()
153
HORIZONTAL = 1,
154
VERTICAL = 2,
155
BOTH = 3,
156
ALWAYS_ON = 4,
157
HORIZONTAL_ALWAYS = 5,
158
VERTICAL_ALWAYS = 6,
159
BOTH_ALWAYS = 7
160
};
161
163
int
xposition
()
const
{
return
xposition_;}
165
int
yposition
()
const
{
return
yposition_;}
166
void
scroll_to(
int
,
int
);
167
void
clear
();
177
int
scrollbar_size
()
const
{
178
return
(scrollbar_size_);
179
}
199
void
scrollbar_size
(
int
newSize) {
200
if
( newSize != scrollbar_size_ )
redraw
();
201
scrollbar_size_ = newSize;
202
}
203
};
204
205
#endif
206
207
//
208
// End of "$Id$".
209
//
© 1998-2016 by Bill Spitzak and others.