From 29bd8069edf8e65e83f3bc20dc8f6bd3bed9a0b5 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Tue, 6 Aug 2024 23:19:45 +0200 Subject: [PATCH] WIP: measures process II --- include/signal.h | 2 ++ include/widget.h | 1 + src/signal.c | 7 ++++ src/widget/measure/dispatch.c | 68 ++++++++++++++++++++++------------- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/include/signal.h b/include/signal.h index d3dfb25..99d5a58 100644 --- a/include/signal.h +++ b/include/signal.h @@ -132,3 +132,5 @@ void on_updating_objects_transparencies (GtkWidget *btt_reset, GtkScrollbar *res void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar); void on_resetting_XYZ_in_state_page (); + +void on_select_rules_first (GtkWidget *btt_new_measure, gpointer data); diff --git a/include/widget.h b/include/widget.h index 48d1148..0d6c31d 100644 --- a/include/widget.h +++ b/include/widget.h @@ -254,3 +254,4 @@ 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_do_xxx(); diff --git a/src/signal.c b/src/signal.c index a6cb3f6..62e465a 100644 --- a/src/signal.c +++ b/src/signal.c @@ -375,3 +375,10 @@ void on_clicked_new_measure (GtkWidget *btt_new_measure, 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) +{ + printf("on_select_rules_first()\n"); + gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), + GTK_WIDGET (widget_do_xxx())); +} diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c index 8f81885..ceec2c5 100644 --- a/src/widget/measure/dispatch.c +++ b/src/widget/measure/dispatch.c @@ -39,36 +39,56 @@ #define PARTITION_MEASURE 40 +static GtkBox *measure_page; +static GtkWidget *label_empty; + +static GtkBox *edit_a_new_measure_box; +static GtkWidget *caliper; +static GtkWidget *btt_edit_a_new_measure; + +static GtkBox *select_rules_first_box; +static GtkWidget *pressure; +static GtkWidget *btt_select_rules_first; + +void *widget_do_xxx() +{ + printf("on_clicked_measure() >> dispatch.c / widget_measure_do_select_rules_first() >> widget_do_xxx()\n"); + return NULL; +} + void *widget_measure_do_select_rules_first () { printf("on_clicked_measure() >> dispatch.c / widget_measure_do_select_rules_first()\n"); - GtkBox *measure_select_rules_first = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - gtk_box_append (measure_select_rules_first, GTK_WIDGET (gtk_picture_new_for_filename + 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"))); - return measure_select_rules_first; -} + 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); -void *widget_measure_new () -{ - GtkBox *measure_new = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - gtk_box_append (measure_new, GTK_WIDGET (gtk_picture_new_for_filename - ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure caliper icon.png"))); - GtkWidget *btt_edit_a_new_measure = gtk_toggle_button_new_with_label ("edit a new measure"); - g_signal_connect (btt_edit_a_new_measure, "toggled", - G_CALLBACK (on_clicked_new_measure), NULL); - gtk_box_append (measure_new, GTK_WIDGET (btt_edit_a_new_measure)); - return measure_new; + gtk_box_append (select_rules_first_box, GTK_WIDGET (pressure)); + gtk_box_append (select_rules_first_box, GTK_WIDGET (btt_select_rules_first)); + measure_page = widget_get_measure_page(); + gtk_box_append (measure_page, GTK_WIDGET (select_rules_first_box)); + + return measure_page; } void *widget_get_measure_page() { - GtkWidget *any_widget = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_paned_set_start_child (GTK_PANED (any_widget), - GTK_WIDGET (widget_measure_new())); - gtk_paned_set_end_child (GTK_PANED (any_widget), gtk_label_new ("")); - gtk_paned_set_position (GTK_PANED (any_widget), PARTITION_MEASURE); - gtk_paned_set_shrink_start_child (GTK_PANED (any_widget), FALSE); - gtk_paned_set_shrink_end_child (GTK_PANED (any_widget), FALSE); - gtk_widget_set_size_request (any_widget, 0, H_MY_SCREEN); // OK (required)) - return any_widget; -} + 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"); + btt_edit_a_new_measure = gtk_toggle_button_new_with_label ("edit a new measure"); + g_signal_connect (btt_edit_a_new_measure, "toggled", + G_CALLBACK (on_clicked_new_measure), NULL); + + gtk_box_append (edit_a_new_measure_box, GTK_WIDGET (caliper)); + gtk_box_append (edit_a_new_measure_box, GTK_WIDGET (btt_edit_a_new_measure)); + gtk_box_append (measure_page, GTK_WIDGET (edit_a_new_measure_box)); + + return measure_page; + }