diff --git a/include/signal.h b/include/signal.h index 52756ed..9b2effc 100644 --- a/include/signal.h +++ b/include/signal.h @@ -142,3 +142,5 @@ void on_clicked_topbar_right_measure (GtkWidget *btt_measure, gpointer data); void on_start_new_measure (GtkWidget *btt_new_measure, gpointer data); void on_select_rules_first (GtkWidget *btt_new_measure, gpointer data); +void on_measure_depends_on_a_single_event (GtkWidget *btt, gpointer data); +void on_measure_depends_on_two_events (GtkWidget *btt, gpointer data); diff --git a/include/widget.h b/include/widget.h index 53f4b16..6577b7a 100644 --- a/include/widget.h +++ b/include/widget.h @@ -254,4 +254,6 @@ void widget_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_ void *widget_measure_new(); void *widget_measure_do_select_rules_first(); -void *widget_measure_do_xxx(); +void *widget_measure_do_depends_on_one_or_two_events(); +void *widget_measure_do_depends_on_a_single_event(); +void *widget_measure_do_depends_on_two_events(); diff --git a/src/signal.c b/src/signal.c index 23be041..ef7a814 100644 --- a/src/signal.c +++ b/src/signal.c @@ -364,21 +364,32 @@ void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrol /* M E A S U R E S */ /******************************************************************************/ -void on_clicked_topbar_right_measure (GtkWidget *btt_measure, gpointer data) +void on_clicked_topbar_right_measure (GtkWidget *btt, gpointer data) { gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), GTK_WIDGET (widget_get_measure_page())); } -void on_start_new_measure (GtkWidget *btt_new_measure, gpointer data) +void on_start_new_measure (GtkWidget *btt, gpointer data) { gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), GTK_WIDGET (widget_measure_do_select_rules_first())); } -void on_select_rules_first (GtkWidget *btt_new_measure, gpointer data) +void on_select_rules_first (GtkWidget *btt, gpointer data) { - printf("on_select_rules_first()\n"); gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), - GTK_WIDGET (widget_measure_do_xxx())); + GTK_WIDGET (widget_measure_do_depends_on_one_or_two_events())); +} + +void on_measure_depends_on_a_single_event (GtkWidget *btt, gpointer data) +{ + gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), + GTK_WIDGET (widget_measure_do_depends_on_a_single_event())); +} + +void on_measure_depends_on_two_events (GtkWidget *btt, gpointer data) +{ + gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), + GTK_WIDGET (widget_measure_do_depends_on_two_events())); } diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c index ae6680a..0afa622 100644 --- a/src/widget/measure/dispatch.c +++ b/src/widget/measure/dispatch.c @@ -40,7 +40,6 @@ #define PARTITION_MEASURE 40 static GtkBox *measure_page; -static GtkWidget *label_empty; static GtkBox *edit_a_new_measure_box; static GtkWidget *caliper; @@ -50,19 +49,40 @@ static GtkBox *select_rules_first_box; static GtkWidget *pressure; static GtkWidget *btt_select_rules_first; -void *widget_measure_do_xxx() +static GtkBox *select_one_or_two_rules_events_box; +static GtkWidget *balance; +static GtkWidget *btt_select_first_of_two; +static GtkWidget *btt_select_second_of_two; + +void *widget_measure_do_depends_on_a_single_event() {printf("measure depends on a single event\n"); return measure_page;} +void *widget_measure_do_depends_on_two_events() {printf("measure depends on two events\n"); return measure_page;} + +void *widget_measure_do_depends_on_one_or_two_events() { - printf("on_clicked_measure() >> dispatch.c / widget_measure_do_select_rules_first()\ - >> widget_measure_do_xxx()\n"); - return NULL; + select_one_or_two_rules_events_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); + balance = gtk_picture_new_for_filename + ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/balance icon.png"); + btt_select_first_of_two = gtk_toggle_button_new_with_label ("measure depends on a single event"); + btt_select_second_of_two = gtk_toggle_button_new_with_label ("measure depends on two events"); + g_signal_connect (btt_select_first_of_two, "toggled", + G_CALLBACK (on_measure_depends_on_a_single_event), NULL); + g_signal_connect (btt_select_second_of_two, "toggled", + G_CALLBACK (on_measure_depends_on_two_events), NULL); + + gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (balance)); + gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_first_of_two)); + gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_second_of_two)); + measure_page = widget_get_measure_page(); + gtk_box_append (measure_page, GTK_WIDGET (select_one_or_two_rules_events_box)); + + return measure_page; } void *widget_measure_do_select_rules_first () { - printf("on_clicked_measure() >> dispatch.c / widget_measure_do_select_rules_first()\n"); select_rules_first_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - gtk_box_append (select_rules_first_box, GTK_WIDGET (gtk_picture_new_for_filename - ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure pressure icon.png"))); + pressure = gtk_picture_new_for_filename + ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure pressure icon.png"); btt_select_rules_first = gtk_toggle_button_new_with_label ("select rules first"); g_signal_connect (btt_select_rules_first, "toggled", G_CALLBACK (on_select_rules_first), NULL); @@ -78,8 +98,6 @@ void *widget_measure_do_select_rules_first () void *widget_get_measure_page() { measure_page = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); - label_empty = gtk_label_new (""); - gtk_widget_set_size_request (label_empty, 0, H_MY_SCREEN); // OK (required)) edit_a_new_measure_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); caliper = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure caliper icon.png");