Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
265fa359
Commit
265fa359
authored
Feb 09, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autoscroll implemented
parent
87a99cfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
+65
-0
xtt/lib/glow/src/glow_growtable.cpp
xtt/lib/glow/src/glow_growtable.cpp
+63
-0
xtt/lib/glow/src/glow_growtable.h
xtt/lib/glow/src/glow_growtable.h
+2
-0
No files found.
xtt/lib/glow/src/glow_growtable.cpp
View file @
265fa359
...
...
@@ -1122,3 +1122,66 @@ void GrowTable::set_input_focus( int focus)
ctx
->
register_inputfocus
(
this
,
0
);
}
}
int
GrowTable
::
make_cell_visible
(
int
column
,
int
row
)
{
int
i
;
double
cell_x_left
,
cell_x_right
,
cell_y_low
,
cell_y_high
;
double
scroll_y
,
scroll_x
;
if
(
column
>=
columns
||
row
>=
rows
||
column
<
0
||
row
<
0
)
return
0
;
// Calculate the current position of the cell
// Find out which cell
double
o_ll_x
=
x_left
+
x_left_offs
;
double
o_ll_y
=
y_low
+
y_low_offs
;
double
o_ur_x
=
x_right
-
vertical_scrollbar
*
scrollbar_width
;
double
o_ur_y
=
y_high
-
horizontal_scrollbar
*
scrollbar_width
;
double
t_ll_x
=
o_ll_x
-
h_value
;
double
t_ll_y
=
o_ll_y
-
v_value
;
scroll_x
=
0
;
if
(
!
(
header_column
&&
column
==
0
))
{
cell_x_left
=
t_ll_x
;
for
(
i
=
header_column
;
i
<
column
;
i
++
)
cell_x_left
+=
column_width
[
i
];
cell_x_right
=
cell_x_left
+
column_width
[
i
+
1
];
if
(
cell_x_left
<
o_ll_x
)
scroll_x
=
cell_x_left
-
o_ll_x
;
else
if
(
cell_x_right
>
o_ur_x
)
{
scroll_x
=
cell_x_right
-
o_ur_x
;
if
(
scroll_x
>
cell_x_left
-
o_ll_x
)
scroll_x
=
cell_x_left
-
o_ll_x
;
}
}
cell_y_low
=
t_ll_y
+
row
*
row_height
;
cell_y_high
=
cell_y_low
+
row_height
;
scroll_y
=
0
;
int
table_size
=
int
((
o_ur_y
-
o_ll_y
)
/
row_height
);
if
(
cell_y_low
<
o_ll_y
-
row_height
/
20
)
// scroll_y = cell_y_low - o_ll_y;
scroll_y
=
min
(
cell_y_low
-
o_ll_y
,
-
int
(
table_size
/
3
)
*
row_height
);
else
if
(
cell_y_high
>
o_ur_y
+
row_height
/
20
)
// scroll_y = cell_y_high - o_ur_y;
scroll_y
=
max
(
cell_y_high
-
o_ur_y
,
int
(
table_size
/
3
)
*
row_height
);
if
(
scroll_x
!=
0
&&
horizontal_scrollbar
)
{
h_value
+=
scroll_x
;
h_value
=
h_scrollbar
->
set_value
(
h_value
);
}
if
(
scroll_y
!=
0
&&
vertical_scrollbar
)
{
v_value
+=
scroll_y
;
v_value
=
v_scrollbar
->
set_value
(
v_value
);
}
if
(
(
scroll_x
!=
0
&&
horizontal_scrollbar
)
||
(
scroll_y
!=
0
&&
vertical_scrollbar
))
{
draw
();
return
1
;
}
return
0
;
}
xtt/lib/glow/src/glow_growtable.h
View file @
265fa359
...
...
@@ -332,6 +332,8 @@ class GrowTable : public GrowRect {
//! Set or reset input focus.
/*! \param focus if 1 focus is set, else focus is reset. */
void
set_input_focus
(
int
focus
);
int
make_cell_visible
(
int
column
,
int
row
);
static
void
v_value_changed_cb
(
void
*
o
,
double
value
);
static
void
h_value_changed_cb
(
void
*
o
,
double
value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment