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
aab92d31
Commit
aab92d31
authored
15 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
fix up a few bugs in interactions between col dialog and menu hide.
parent
4de4054f
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/zmapWindow/zmapWindowColConfig.c
+118
-58
118 additions, 58 deletions
src/zmapWindow/zmapWindowColConfig.c
with
118 additions
and
58 deletions
src/zmapWindow/zmapWindowColConfig.c
+
118
−
58
View file @
aab92d31
...
...
@@ -26,9 +26,9 @@
*
* Exported functions: See ZMap/zmapWindow.h
* HISTORY:
* Last edited: J
u
n 1
2 09:26 2009 (rds
)
* Last edited: J
a
n 1
9 18:35 2010 (edgrif
)
* Created: Thu Mar 2 09:07:44 2006 (edgrif)
* CVS info: $Id: zmapWindowColConfig.c,v 1.3
2
200
9
-0
6
-19 1
1:15:39 rds
Exp $
* CVS info: $Id: zmapWindowColConfig.c,v 1.3
3
20
1
0-0
1
-19 1
8:35:45 edgrif
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -50,12 +50,15 @@
typedef
struct
_ColConfigureStruct
*
ColConfigure
;
#define CONFIGURE_DATA "col_data"
typedef
struct
_ColConfigureStruct
{
ZMapWindow
window
;
ZMapWindowColConfigureMode
mode
;
ZMapWindowColConfigureMode
curr_mode
;
GtkWidget
*
notebook
;
GtkWidget
*
loaded_page
;
GtkWidget
*
deferred_page
;
...
...
@@ -67,7 +70,9 @@ typedef struct _ColConfigureStruct
}
ColConfigureStruct
;
typedef
struct
_NotebookPageStruct
*
NotebookPage
;
typedef
struct
_NotebookPageStruct
*
NotebookPage
;
typedef
enum
{
...
...
@@ -76,12 +81,27 @@ typedef enum
NOTEBOOK_APPLY_FUNC
,
NOTEBOOK_UPDATE_FUNC
,
NOTEBOOK_CLEAR_FUNC
,
}
NotebookFuncType
;
}
NotebookFuncType
;
/* For updating button state. */
typedef
struct
{
ZMapWindowColConfigureMode
mode
;
FooCanvasGroup
*
column_group
;
gboolean
button_found
;
}
ChangeButtonStateDataStruct
,
*
ChangeButtonStateData
;
typedef
void
(
*
NotebookPageConstruct
)(
NotebookPage
notebook_page
,
GtkWidget
*
page
);
typedef
void
(
*
NotebookPageColFunc
)(
NotebookPage
notebook_page
,
FooCanvasGroup
*
column_group
);
typedef
void
(
*
NotebookPageUpdateFunc
)(
NotebookPage
notebook_page
,
ChangeButtonStateData
user_data
)
;
typedef
void
(
*
NotebookPageFunc
)(
NotebookPage
notebook_page
);
typedef
struct
_NotebookPageStruct
...
...
@@ -91,12 +111,12 @@ typedef struct _NotebookPageStruct
GtkWidget
*
page_container
;
char
*
page_name
;
NotebookPageConstruct
page_constructor
;
/* A+ */
NotebookPageColFunc
page_populate
;
/* B+ */
NotebookPageFunc
page_apply
;
/* C */
NotebookPage
Col
Func
page_update
;
/* D */
NotebookPageFunc
page_clear
;
/* B- */
NotebookPageFunc
page_destroy
;
/* A- */
NotebookPageConstruct
page_constructor
;
/* A+ */
NotebookPageColFunc
page_populate
;
/* B+ */
NotebookPageFunc
page_apply
;
/* C */
NotebookPage
Update
Func
page_update
;
/* D */
NotebookPageFunc
page_clear
;
/* B- */
NotebookPageFunc
page_destroy
;
/* A- */
gpointer
page_data
;
}
NotebookPageStruct
;
...
...
@@ -185,6 +205,8 @@ typedef struct
}
SizingDataStruct
,
*
SizingData
;
static
GtkWidget
*
make_menu_bar
(
ColConfigure
configure_data
);
static
GtkWidget
*
loaded_cols_panel
(
NotebookPage
notebook_page
,
char
*
frame_title
,
GList
*
column_groups
,
GList
**
show_list_out
,
GList
**
default_list_out
,
GList
**
hide_list_out
)
;
...
...
@@ -203,7 +225,8 @@ static void loaded_show_button_cb(GtkToggleButton *togglebutton, gpointer user_d
static
GtkWidget
*
configure_make_toplevel
(
ColConfigure
configure_data
);
static
void
configure_add_pages
(
ColConfigure
configure_data
);
static
void
configure_simple
(
ColConfigure
configure_data
,
FooCanvasGroup
*
column_group
)
;
static
void
configure_simple
(
ColConfigure
configure_data
,
FooCanvasGroup
*
column_group
,
ZMapWindowColConfigureMode
curr_mode
)
;
static
void
configure_populate_containers
(
ColConfigure
configure_data
,
FooCanvasGroup
*
column_group
);
static
void
configure_clear_containers
(
ColConfigure
configure_data
);
...
...
@@ -235,11 +258,15 @@ static void column_group_set_active_button(ZMapWindowContainerFeatureSet contain
GtkWidget
*
radio_show
,
GtkWidget
*
radio_maybe
,
GtkWidget
*
radio_hide
);
static
gboolean
zmapAddSizingSignalHandlers
(
GtkWidget
*
widget
,
gboolean
debug
,
int
width
,
int
height
);
static
void
activate_matching_column
(
gpointer
list_data
,
gpointer
user_data
)
;
static
gboolean
zmapAddSizingSignalHandlers
(
GtkWidget
*
widget
,
gboolean
debug
,
int
width
,
int
height
);
static
GtkItemFactoryEntry
menu_items_G
[]
=
...
...
@@ -304,7 +331,9 @@ void zmapWindowColumnConfigure(ZMapWindow window,
configure_data
->
mode
=
configure_mode
;
}
configure_simple
(
configure_data
,
column_group
)
;
configure_data
->
curr_mode
=
configure_mode
;
configure_simple
(
configure_data
,
column_group
,
configure_mode
)
;
}
break
;
case
ZMAPWINDOWCOLUMN_CONFIGURE
:
...
...
@@ -375,20 +404,25 @@ void zmapWindowColumnConfigureDestroy(ZMapWindow window)
static
void
configure_simple
(
ColConfigure
configure_data
,
FooCanvasGroup
*
column_group
)
FooCanvasGroup
*
column_group
,
ZMapWindowColConfigureMode
curr_mode
)
{
ZMapStyleColumnDisplayState
col_state
;
/* If there's a config window displayed then toggle correct button in window to effect
* change, otherwise operate directly on column. */
if
(
configure_data
->
window
->
col_config_window
&&
configure_data
->
notebook
)
if
(
configure_data
->
window
->
col_config_window
&&
configure_data
->
notebook
)
{
ChangeButtonStateDataStruct
cb_data
;
cb_data
.
mode
=
curr_mode
;
cb_data
.
column_group
=
column_group
;
cb_data
.
button_found
=
FALSE
;
notebook_foreach_page
(
configure_data
->
notebook
,
FALSE
,
NOTEBOOK_UPDATE_FUNC
,
column_group
)
;
NOTEBOOK_UPDATE_FUNC
,
&
cb_data
)
;
}
else
{
ZMapStyleColumnDisplayState
col_state
;
if
(
configure_data
->
mode
==
ZMAPWINDOWCOLUMN_HIDE
)
col_state
=
ZMAPSTYLE_COLDISPLAY_HIDE
;
else
...
...
@@ -818,63 +852,60 @@ static void loaded_radio_buttons(GtkWidget *parent,
return
;
}
static
void
activate_matching_column
(
gpointer
list_data
,
gpointer
user_data
)
{
ShowHideButton
button_data
=
(
ShowHideButton
)
list_data
;
FooCanvasGroup
*
column_group
=
FOO_CANVAS_GROUP
(
user_data
);
if
(
button_data
->
show_hide_column
==
column_group
)
{
GtkWidget
*
widget
;
widget
=
button_data
->
show_hide_button
;
if
(
GTK_IS_TOGGLE_BUTTON
(
widget
))
{
if
(
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
widget
)))
g_signal_emit_by_name
(
G_OBJECT
(
widget
),
"toggled"
);
}
}
return
;
}
static
void
loaded_page_update
(
NotebookPage
notebook_page
,
FooCanvasGroup
*
column_group
)
static
void
loaded_page_update
(
NotebookPage
notebook_page
,
ChangeButtonStateData
cb_data
)
{
ColConfigure
configure_data
;
ZMapStrand
strand
;
GList
*
show_hide_
button_list
=
NULL
;
ZMapWindowColConfigureMode
mode
;
GList
*
button_list
=
NULL
;
ZMapWindowColConfigureMode
mode
;
ShowHidePageData
show_hide_data
;
/* First get the configure_data */
configure_data
=
notebook_page
->
configure_data
;
mode
=
configure_data
->
mode
;
mode
=
cb_data
->
mode
;
show_hide_data
=
(
ShowHidePageData
)(
notebook_page
->
page_data
)
;
/* - Get the correct strand container for labels */
strand
=
zmapWindowContainerGetStrand
(
(
ZM
apWindowContainerGroup
)
column_group
);
strand
=
zmapWindowContainer
FeatureSet
GetStrand
(
ZM
AP_CONTAINER_FEATURESET
(
cb_data
->
column_group
)
)
;
zMapAssert
(
strand
==
ZMAPSTRAND_FORWARD
||
strand
==
ZMAPSTRAND_REVERSE
)
;
switch
(
mode
)
{
case
ZMAPWINDOWCOLUMN_HIDE
:
if
(
strand
==
ZMAPSTRAND_FORWARD
)
show_hide_button_list
=
show_hide_data
->
fwd_hide_list
;
if
(
strand
==
ZMAPSTRAND_FORWARD
)
{
button_list
=
show_hide_data
->
fwd_hide_list
;
}
else
show_hide_button_list
=
show_hide_data
->
rev_hide_list
;
{
button_list
=
show_hide_data
->
rev_hide_list
;
}
break
;
case
ZMAPWINDOWCOLUMN_SHOW
:
if
(
strand
==
ZMAPSTRAND_FORWARD
)
{
button_list
=
show_hide_data
->
fwd_show_list
;
}
else
{
button_list
=
show_hide_data
->
rev_show_list
;
}
break
;
default:
if
(
strand
==
ZMAPSTRAND_FORWARD
)
show_hide_
button_list
=
show_hide_data
->
fwd_
show
_list
;
button_list
=
show_hide_data
->
fwd_
default
_list
;
else
show_hide_
button_list
=
show_hide_data
->
rev_
show
_list
;
button_list
=
show_hide_data
->
rev_
default
_list
;
break
;
}
if
(
show_hide_
button_list
)
if
(
button_list
)
{
gboolean
save_reposition
,
save_apply_now
;
...
...
@@ -885,15 +916,44 @@ static void loaded_page_update(NotebookPage notebook_page,
show_hide_data
->
apply_now
=
TRUE
;
show_hide_data
->
reposition
=
TRUE
;
g_list_foreach
(
show_hide_
button_list
,
activate_matching_column
,
c
olumn_group
)
;
g_list_foreach
(
button_list
,
activate_matching_column
,
c
b_data
)
;
show_hide_data
->
apply_now
=
save_apply_now
;
show_hide_data
->
reposition
=
save_reposition
;
}
return
;
}
static
void
activate_matching_column
(
gpointer
list_data
,
gpointer
user_data
)
{
ShowHideButton
button_data
=
(
ShowHideButton
)
list_data
;
ChangeButtonStateData
cb_data
=
(
ChangeButtonStateData
)
user_data
;
if
(
!
(
cb_data
->
button_found
)
&&
button_data
->
show_hide_column
==
cb_data
->
column_group
)
{
GtkWidget
*
widget
;
widget
=
button_data
->
show_hide_button
;
if
(
GTK_IS_TOGGLE_BUTTON
(
widget
))
{
if
(
!
gtk_toggle_button_get_active
(
GTK_TOGGLE_BUTTON
(
widget
)))
{
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
widget
),
TRUE
)
;
cb_data
->
button_found
=
TRUE
;
}
}
}
return
;
}
static
NotebookPage
loaded_page_create
(
ColConfigure
configure_data
,
char
**
page_name_out
)
{
NotebookPage
page_data
=
NULL
;
...
...
@@ -1584,9 +1644,9 @@ static GtkWidget *loaded_cols_panel(NotebookPage notebook_page,
*
hide_list_out
=
hide_list
;
}
/* We don't need this for a single column. */
if
(
list_length
>
1
)
{
/* Add the buttons to apply the users changes. */
GtkWidget
*
frame
,
*
button_box
;
frame
=
gtk_frame_new
(
NULL
)
;
...
...
@@ -2032,11 +2092,11 @@ static void notebook_foreach_page(GtkWidget *notebook_widget,
break
;
case
NOTEBOOK_UPDATE_FUNC
:
{
NotebookPage
Col
Func
pop_func
;
NotebookPage
Update
Func
pop_func
;
if
((
pop_func
=
page_data
->
page_update
))
{
(
pop_func
)(
page_data
,
FOO_CANVAS_GROUP
(
foreach_data
)
)
;
(
pop_func
)(
page_data
,
foreach_data
)
;
}
}
break
;
...
...
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