Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
86fc1a6b
Commit
86fc1a6b
authored
20 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add code to support a callback for when user stops dragging the window locator.
parent
f0d50e5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapControl/zmapControlNavigator.c
+38
-6
38 additions, 6 deletions
src/zmapControl/zmapControlNavigator.c
with
38 additions
and
6 deletions
src/zmapControl/zmapControlNavigator.c
+
38
−
6
View file @
86fc1a6b
...
...
@@ -29,9 +29,9 @@
*
* Exported functions: See zmapControl_P.h
* HISTORY:
* Last edited:
Dec 16 16:07
200
4
(edgrif)
* Last edited:
Jan 5 14:55
200
5
(edgrif)
* Created: Thu Jul 8 12:54:27 2004 (edgrif)
* CVS info: $Id: zmapControlNavigator.c,v 1.
19
200
4-12-20 10:54:00
edgrif Exp $
* CVS info: $Id: zmapControlNavigator.c,v 1.
20
200
5-01-07 12:13:46
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -42,6 +42,11 @@
#define BOTTEXT_NO_SCALE ""
static
void
valueCB
(
GtkAdjustment
*
adjustment
,
gpointer
user_data
)
;
/* AGGGGHHHHH, THIS SHOULD BE AN "OBJECT" IN ITS OWN RIGHT.....LETS TRY AND MAKE IT BETTER */
ZMapNavigator
zmapControlNavigatorCreate
(
GtkWidget
**
top_widg_out
)
...
...
@@ -82,20 +87,24 @@ ZMapNavigator zmapControlNavigatorCreate(GtkWidget **top_widg_out)
gtk_box_pack_end
(
GTK_BOX
(
navigator
->
navVBox
),
navigator
->
botLabel
,
FALSE
,
TRUE
,
0
);
/* Construct the window locator. */
/* Construct the window locator. Note that we set the update policy to discontinuous so if
* user drags this scroll bar the position is only reported on button release. This is
* necessary because the underlying canvas window cannot be remapped rapidly. */
navigator
->
wind_vbox
=
gtk_vbox_new
(
FALSE
,
0
);
gtk_paned_add2
(
GTK_PANED
(
pane
),
navigator
->
wind_vbox
)
;
navigator
->
wind_top_label
=
gtk_label_new
(
TOPTEXT_NO_SCALE
)
;
gtk_box_pack_start
(
GTK_BOX
(
navigator
->
wind_vbox
),
navigator
->
wind_top_label
,
FALSE
,
TRUE
,
0
);
/* Make the navigator with a default, "blank" adjustment obj. */
adjustment
=
gtk_adjustment_new
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
)
;
adjustment
=
gtk_adjustment_new
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
)
;
/* "blank" adjustment obj. */
gtk_signal_connect
(
GTK_OBJECT
(
adjustment
),
"value-changed"
,
GTK_SIGNAL_FUNC
(
valueCB
),
(
void
*
)
navigator
)
;
navigator
->
wind_scroll
=
gtk_vscrollbar_new
(
GTK_ADJUSTMENT
(
adjustment
))
;
gtk_range_set_update_policy
(
GTK_RANGE
(
navigator
->
wind_scroll
),
GTK_UPDATE_DISCONTINUOUS
)
;
gtk_box_pack_start
(
GTK_BOX
(
navigator
->
wind_vbox
),
navigator
->
wind_scroll
,
TRUE
,
TRUE
,
0
)
;
/* Note how we pack the label at the end of the vbox and set "expand" to FALSE so that it
* remains small and the vscale expands to fill the rest of the box. */
navigator
->
wind_bot_label
=
gtk_label_new
(
BOTTEXT_NO_SCALE
)
;
...
...
@@ -112,6 +121,15 @@ ZMapNavigator zmapControlNavigatorCreate(GtkWidget **top_widg_out)
return
navigator
;
}
void
zmapControlNavigatorSetWindowCallback
(
ZMapNavigator
navigator
,
ZMapNavigatorScrollValue
cb_func
,
void
*
user_data
)
{
navigator
->
cb_func
=
cb_func
;
navigator
->
user_data
=
user_data
;
return
;
}
void
zmapControlNavigatorSetWindowPos
(
ZMapNavigator
navigator
,
double
top_pos
,
double
bot_pos
)
{
...
...
@@ -262,6 +280,20 @@ void navUpdate(GtkAdjustment *adj, gpointer p)
static
void
valueCB
(
GtkAdjustment
*
adjustment
,
gpointer
user_data
)
{
ZMapNavigator
navigator
=
(
ZMapNavigator
)
user_data
;
printf
(
"top: %f, bottom: %f
\n
"
,
adjustment
->
value
,
adjustment
->
value
+
adjustment
->
page_size
)
;
if
(
navigator
->
cb_func
)
(
*
(
navigator
->
cb_func
))(
navigator
->
user_data
,
adjustment
->
value
,
adjustment
->
value
+
adjustment
->
page_size
)
;
return
;
}
/* UNUSED CURRENTLY but needed for when user alters the hpane interactively....... */
static
void
navResize
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment