diff --git a/include/base.h b/include/base.h index d30b470..d6f7d90 100644 --- a/include/base.h +++ b/include/base.h @@ -140,4 +140,4 @@ static inline char *read_file(char *filename) char *get_space_run_edit_specif(); char *get_rules_run_edit_specif(); -/* (texts are in widgets_lab) */ +/* (texts are in widgets_lab or wdgt_lab_I or II) */ diff --git a/include/widgets.h b/include/widgets.h index 64cc986..bf98055 100644 --- a/include/widgets.h +++ b/include/widgets.h @@ -30,14 +30,6 @@ #include -#define W 1920 // TODO 2024-06-30 -#define H 960 -#define W_IMAGE W - 320 -#define H_IMAGE H - 126 -#define H_STYLES_PANE 30 -#define W_IMAGE_LOCAL W / 16 -#define H_IMAGE_LOCAL H / 16 - void set_main_window (GtkApplication *app); void set_dialog_window (GtkApplication *app); @@ -48,17 +40,21 @@ void dialog_window_design (GtkWindow *main_window, GtkWindow *get_main_window(); GtkWindow *get_dialog_window(); +GtkButton *get_GtkButton (char *btt_name); + GtkWidget *get_window_child_STATE(); GtkWidget *get_window_child_RULES(); GtkWidget *get_window_child_DATA(); +//-------------------------------------------------------- + GtkWidget *get_selected_rules_vpaned_new(); GtkWidget *get_rules_tree_hpaned_new(); GtkWidget *get_rules_page_new(); -GtkWidget *get_TIME_EXEC_controls_box(); +//GtkWidget *get_TIME_EXEC_controls_box(); //GtkWidget *get_SPACE_EDIT_controls_box(); -GtkWidget *get_OBJECTS_and_SITUATIONS(); +//GtkWidget *get_OBJECTS_and_SITUATIONS(); GtkWidget *get_text_view(); @@ -72,13 +68,11 @@ GtkWidget *get_image_DOPAMINE(); GtkWidget *get_image_ATP(); GtkWidget *get_image_AMP(); -GtkButton *get_GtkButton (char *btt_name); - GtkFrame *get_frame_with_label(); GtkProgressBar *get_ELAPSED_TIME_ProgressBar(); -GtkBox *get_RUN_STOP_box(); +//GtkBox *get_RUN_STOP_box(); GtkBox *get_ZOOM_box(); GtkBox *get_edit_TOOL_box(); GtkBox *get_XYZ_box(); diff --git a/src/callbacks.c b/src/callbacks.c index 467b2fe..672cecd 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -50,7 +50,7 @@ void on_dialog_window_activation (GtkApplication *app, dialog_window_design (get_main_window(), get_dialog_window()); - gtk_window_present (GTK_WINDOW (get_dialog_window())); + if (0) gtk_window_present (GTK_WINDOW (get_dialog_window())); } diff --git a/src/wdgt_lab_I b/src/wdgt_lab_I new file mode 100644 index 0000000..28023fd --- /dev/null +++ b/src/wdgt_lab_I @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* Gem-graph client * +* * +* Widgets header * +* * +* Copyright © 2021 Libre en Communs * +* Copyright © 2021 Jean Sirmai * +* * +* This file is part of Gem-graph. * +* * +* This program is free software: you can redistribute it and/or modify it * +* under the terms of the GNU Affero General Public License * +* as published by the Free Software Foundation, * +* either version 3 of the License, * +* or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; * +* without even the implied warranty of MERCHANTABILITY * +* or FITNESS FOR A PARTICULAR PURPOSE. * +* See the GNU Affero General Public License for more details. * +* * +* You should have received a copy of the GNU Affero General Public License * +* along with this program. If not, see . * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +#include "../include/widgets.h" + +// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO +// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery + + diff --git a/src/widgets_lab.c b/src/wdgt_lab_II.c similarity index 79% rename from src/widgets_lab.c rename to src/wdgt_lab_II.c index c0d3e7f..834713b 100644 --- a/src/widgets_lab.c +++ b/src/wdgt_lab_II.c @@ -32,6 +32,13 @@ // https://blog.gtk.org/2020/09/08/on-list-models/ < TODO // https://docs.gtk.org/gtk4/visual_index.html < widgets gallery +#define W 1920 // TODO 2024-06-30 +#define H 960 // Ad hoc (pour mon écran) +#define W_IMAGE W - 320 +#define H_IMAGE H - 126 +#define H_STYLES_PANE 30 +#define W_IMAGE_LOCAL W / 16 +#define H_IMAGE_LOCAL H / 16 //------------------------------------------------------------------------------ @@ -125,7 +132,7 @@ static GtkBox *get_DO_SPEED_box(){ return SPEED_box; } -GtkBox *get_RUN_STOP_box(){ +static GtkBox *get_RUN_STOP_box_lab(){ GtkBox *RUN_STOP_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20)); gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_UNDO_SPEED_box())); gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_label_new (" STEP\n(show active rule) "))); @@ -189,10 +196,19 @@ GtkProgressBar *get_ELAPSED_TIME_ProgressBar(){ // To rename : DO - UNDO - REDO "\n<--- [buffer] (simulation extensive time) --->\n\ supports DO - UNDO - REDO functions\n"); gtk_progress_bar_set_show_text (buffer, TRUE); - gtk_widget_set_size_request (GTK_WIDGET (buffer), W - 560, 0); + gtk_widget_set_size_request (GTK_WIDGET (buffer), W - 740, 0); return buffer; } +static GtkWidget *get_TIME_EXEC_controls_box_lab() { + GtkBox *top_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); + gtk_box_append (top_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar())); + gtk_box_append (top_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); + gtk_box_append (top_box, GTK_WIDGET (get_RUN_STOP_box_lab())); + return GTK_WIDGET (top_box); +} + + //------------------------------------------------------------------------------ // Chaque label "objet" ou "situation" sera remplacé par un curseur "transparence" (vertical) @@ -307,6 +323,106 @@ GtkWidget *get_rules_page_new(){ } +GtkWidget *get_window_child_DATA_lab () { + if (0) printf("widgets.get_window_child_DATA (line 279)\n"); + GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 32)); + + GtkWidget* frame_rule_effect = gtk_frame_new ("rule effect\n-----------"); + gtk_frame_set_label_align (GTK_FRAME (frame_rule_effect), 0.5); + GtkBox *rule_effect_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_rule_effect), GTK_WIDGET (rule_effect_box)); + + GtkWidget* frame_rule_topic = gtk_frame_new ("rule topic\n----------"); + gtk_frame_set_label_align (GTK_FRAME (frame_rule_topic), 0.5); + GtkBox *rule_topic_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_rule_topic), GTK_WIDGET (rule_topic_box)); + + GtkWidget* frame_data_type = gtk_frame_new ("data type\n----------"); + gtk_frame_set_label_align (GTK_FRAME (frame_data_type), 0.5); + GtkBox *data_type_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_data_type), GTK_WIDGET (data_type_box)); + + GtkWidget* frame_interpretations = gtk_frame_new ("interpretation\n---------------"); + gtk_frame_set_label_align (GTK_FRAME (frame_interpretations), 0.5); + GtkBox *interpretations_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_interpretations), GTK_WIDGET (interpretations_box)); + + GtkWidget* frame_discussions = gtk_frame_new ("discussion\n------------"); + gtk_frame_set_label_align (GTK_FRAME (frame_discussions), 0.5); + GtkBox *discussions_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_discussions), GTK_WIDGET (discussions_box)); + + GtkWidget* frame_separator = gtk_frame_new ("\n"); + + GtkWidget* frame_game = gtk_frame_new ("game\n------"); + gtk_frame_set_label_align (GTK_FRAME (frame_game), 0.5); + GtkBox *game_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_game), GTK_WIDGET (game_box)); + + GtkWidget* frame_help = gtk_frame_new ("help\n-----"); + gtk_frame_set_label_align (GTK_FRAME (frame_help), 0.5); + GtkBox *help_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + gtk_frame_set_child (GTK_FRAME (frame_help), GTK_WIDGET (help_box)); + + gtk_box_append (data_box, GTK_WIDGET (frame_rule_effect)); + gtk_box_append (data_box, GTK_WIDGET (frame_rule_topic)); + gtk_box_append (data_box, GTK_WIDGET (frame_data_type)); + gtk_box_append (data_box, GTK_WIDGET (frame_interpretations)); + gtk_box_append (data_box, GTK_WIDGET (frame_discussions)); + gtk_box_append (data_box, GTK_WIDGET (frame_separator)); + gtk_box_append (data_box, GTK_WIDGET (frame_game)); + gtk_box_append (data_box, GTK_WIDGET (frame_help)); + + gtk_box_append (rule_effect_box, gtk_button_new_with_label ("movement")); + gtk_box_append (rule_effect_box, gtk_button_new_with_label ("transport")); + gtk_box_append (rule_effect_box, gtk_button_new_with_label ("transformation")); + + gtk_box_append (rule_topic_box, gtk_button_new_with_label ("objects")); + gtk_box_append (rule_topic_box, gtk_button_new_with_label ("situations")); + + gtk_box_append (rule_topic_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + gtk_box_append (rule_topic_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + gtk_box_append (rule_topic_box, gtk_button_new_with_label ("accuracy")); + gtk_box_append (rule_topic_box, gtk_button_new_with_label ("pattern recognition")); + + gtk_box_append (data_type_box, gtk_button_new_with_label ("repartitions")); + gtk_box_append (data_type_box, gtk_button_new_with_label ("evolutions")); + gtk_box_append (data_type_box, gtk_button_new_with_label ("correlations")); + + gtk_box_append (interpretations_box, gtk_button_new_with_label ("stochastic")); + gtk_box_append (interpretations_box, gtk_button_new_with_label ("deterministic")); + + gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + gtk_box_append (interpretations_box, gtk_button_new_with_label ("physical")); + gtk_box_append (interpretations_box, gtk_button_new_with_label ("chemical")); + gtk_box_append (interpretations_box, gtk_button_new_with_label ("biological")); + gtk_box_append (interpretations_box, gtk_button_new_with_label ("social")); + gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + + gtk_box_append (discussions_box, gtk_button_new_with_label ("context")); + gtk_box_append (discussions_box, gtk_button_new_with_label ("methodology")); + gtk_box_append (discussions_box, gtk_button_new_with_label ("comparisons")); + gtk_box_append (discussions_box, gtk_button_new_with_label ("to improve")); + gtk_box_append (discussions_box, gtk_button_new_with_label ("summary")); + + gtk_box_append (game_box, gtk_button_new_with_label ("single player")); + gtk_box_append (game_box, gtk_button_new_with_label ("multiple players")); + gtk_box_append (game_box, gtk_button_new_with_label ("edition facilities")); + + gtk_box_append (help_box, gtk_button_new_with_label ("modelization")); + gtk_box_append (help_box, gtk_button_new_with_label ("measurements")); + gtk_box_append (help_box, gtk_button_new_with_label ("results")); + gtk_box_append (help_box, gtk_button_new_with_label ("data analysis")); + + gtk_box_append (help_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + gtk_box_append (help_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + gtk_box_append (help_box, gtk_button_new_with_label ("preferences")); + + //SWITCH_TO (DATA); + return GTK_WIDGET (data_box); +} + char *get_space_run_edit_specif(){ return "\n\ \ diff --git a/src/widgets.c b/src/widgets.c index 064a775..756db8a 100644 --- a/src/widgets.c +++ b/src/widgets.c @@ -30,6 +30,15 @@ #include "../include/callbacks.h" #include "../include/widgets.h" +#define W 1920 // TODO 2024-06-30 +#define H 960 // Ad hoc (pour mon écran) +#define W_IMAGE W - 500 +#define H_IMAGE H - 300 +#define H_STYLES_PANE 30 +#define W_IMAGE_LOCAL W / 16 +#define H_IMAGE_LOCAL H / 16 +#define TIME_EXEC_CONTROLS_PARTITION 1200 + static GtkWindow *main_window, *dialog_window; static GtkButton *btt_open_STATE, *btt_open_RULES, *btt_open_DATA; @@ -125,6 +134,8 @@ GtkWidget *get_help_page_new() { return run_help_grid; } +static GtkWidget *get_OBJECTS_and_SITUATIONS(); + GtkWidget *get_edit_space_page_new() { GtkWidget *space_grid = gtk_grid_new(); gtk_grid_attach (GTK_GRID(space_grid), get_image_ALL_SPACE(), 0, 0, 1, 3); @@ -139,7 +150,7 @@ GtkWidget *get_edit_space_page_new() { //------------------------------------------------------------------------------ GtkWidget *get_selected_rules_vpaned_new() { - GtkPaned *V_selected_1_vs_2 = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL)); + GtkPaned *EXEC_CONTROLS_pane = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL)); GtkBox *up_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMATE())); @@ -151,20 +162,36 @@ GtkWidget *get_selected_rules_vpaned_new() { gtk_box_append (bottom_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (bottom_box, GTK_WIDGET (get_image_AMP())); - gtk_paned_set_start_child (V_selected_1_vs_2, GTK_WIDGET (up_box)); - gtk_paned_set_end_child (V_selected_1_vs_2, GTK_WIDGET (bottom_box)); + gtk_paned_set_start_child (EXEC_CONTROLS_pane, GTK_WIDGET (up_box)); + gtk_paned_set_end_child (EXEC_CONTROLS_pane, GTK_WIDGET (bottom_box)); - return GTK_WIDGET (V_selected_1_vs_2); + return GTK_WIDGET (EXEC_CONTROLS_pane); } +static GtkBox *get_DO_UNDO_REDO_box(){ + GtkBox *DO_UNDO_REDO_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); + gtk_box_append (DO_UNDO_REDO_box, GTK_WIDGET(gtk_label_new ("\n"))); + gtk_box_append (DO_UNDO_REDO_box, GTK_WIDGET(gtk_progress_bar_new ())); + gtk_box_append (DO_UNDO_REDO_box, GTK_WIDGET(gtk_label_new ("\n\ + DO - UNDO - REDO\n"))); + return DO_UNDO_REDO_box; +} +static GtkBox *get_RUN_STOP_box(){ + GtkBox *RUN_STOP_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); + gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_label_new ("\n\n\ + R U N / S T O P\ + SPEED UP <> SLOW DOWN\ + STEP by STEP (show active rule) \n\n"))); + return RUN_STOP_box; +} -GtkWidget *get_TIME_EXEC_controls_box() { - GtkBox *top_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - gtk_box_append (top_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar())); - gtk_box_append (top_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); - gtk_box_append (top_box, GTK_WIDGET (get_RUN_STOP_box())); - return GTK_WIDGET (top_box); +static GtkWidget *get_TIME_EXEC_CONTROLS_box() { + GtkPaned *EXEC_CONTROLS_pane = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); + gtk_paned_set_start_child (EXEC_CONTROLS_pane, GTK_WIDGET (get_DO_UNDO_REDO_box())); + gtk_paned_set_end_child (EXEC_CONTROLS_pane, GTK_WIDGET (get_RUN_STOP_box())); + gtk_paned_set_position (EXEC_CONTROLS_pane, TIME_EXEC_CONTROLS_PARTITION); + return GTK_WIDGET (EXEC_CONTROLS_pane); } GtkWidget *get_SPACE_VIEW_box() { @@ -175,29 +202,26 @@ GtkWidget *get_SPACE_VIEW_box() { GtkBox *middle_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - printf("\nwidgets.get_SPACE_VIEW_box()\ - TODO ui_setup_glarea (0, GTK_WIDGET (middle_box));\n\n"); // TODO + // TODO gtk_box_append (middle_box, GTK_WIDGET (get_image_ALL_SPACE())); -// ui_setup_glarea (0, GTK_WIDGET (middle_box)); + // ui_setup_glarea (0, GTK_WIDGET (middle_box)); gtk_box_append (middle_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); gtk_box_append (middle_box, GTK_WIDGET (right_box)); return GTK_WIDGET (middle_box); } -static GtkWidget *get_SPACE_EDIT_controls_box() { +static GtkWidget *get_SPACE_EDIT_CONTROLS_box() { GtkWidget *label_ad_hoc = gtk_label_new ("_____________\n\ SPACE EDIT\n controls\n_____________"); return GTK_WIDGET (label_ad_hoc); } - void set_check_button_active (GtkButton *button, int active){ const char *lab = gtk_button_get_label (button); if (strcmp (lab, "state")) printf("set_check_button_active > %s\n", lab); } - static void window_header_bar (GtkWindow *window, char *title){ GtkWidget *header_bar = GTK_WIDGET (gtk_header_bar_new ()); gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title)); @@ -253,22 +277,78 @@ void main_window_design (GtkWindow *main_window){ +static GtkBox *get_objects_box(){ + GtkBox *objects_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); + GtkAdjustment *adjust = gtk_adjustment_new (0, 0, 255, 1, 0, 0); + if (0) for (int i = 0; i < 10; i++) + gtk_box_append (objects_box, gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adjust)); + char string[7]; + for (int i = 0; i < 16; i++){ + sprintf(string, " [%d] \n", i); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (string))); + } + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" membrane \n"))); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" co-enzyme A \n"))); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" ribosome \n"))); + gtk_box_append (objects_box, GTK_WIDGET (gtk_label_new (" ATP synthase \n"))); + return objects_box; +} + +static GtkBox *get_situations_box(){ + GtkBox *situations_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); + char string[7]; + for (int i = 0; i < 64; i++){ + sprintf(string, " [%d] \n", i); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (string))); + } + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" transcription \n"))); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" transport Na/K \n"))); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" ubiquitination \n"))); + gtk_box_append (situations_box, GTK_WIDGET (gtk_label_new (" rotation moteur flagellaire \n"))); + return situations_box; +} + +static GtkWidget *get_frame_objects(){ + GtkWidget *scroll = gtk_scrolled_window_new (); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); + GtkWidget *frame_objects = gtk_frame_new (" Objects"); // defines each class of object transparence + gtk_widget_set_size_request (frame_objects, 0, H_STYLES_PANE); // < utile seulement pour la largeur min/max + gtk_frame_set_child (GTK_FRAME (frame_objects), GTK_WIDGET (get_objects_box())); + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scroll), frame_objects); + return scroll; +} + +static GtkWidget *get_frame_situations(){ + GtkWidget *scroll = gtk_scrolled_window_new (); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); + GtkWidget *frame_situations = gtk_frame_new (" Situations"); // facilitates each situation identification + gtk_widget_set_size_request (GTK_WIDGET (frame_situations), 0, H_STYLES_PANE); // < utile seulement pour la largeur min/max + gtk_frame_set_child (GTK_FRAME (frame_situations), GTK_WIDGET (get_situations_box())); + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scroll), frame_situations); + return scroll; +} + +static GtkWidget *get_OBJECTS_and_SITUATIONS(){ + GtkWidget *objects_and_situations_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); + gtk_paned_set_start_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (get_frame_objects())); + gtk_paned_set_end_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (get_frame_situations())); + return objects_and_situations_horizontal_pane; +} + GtkWidget *get_window_child_STATE() { - if (0) printf("widgets.get_window_child_STATE (line 235)\n"); GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (page_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS())); gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (page_box, GTK_WIDGET (get_SPACE_VIEW_box())); gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - if (get_EXEC_EDIT ()) gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_controls_box())); - else gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box())); + if (get_EXEC_EDIT ()) gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_CONTROLS_box())); + else gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_CONTROLS_box())); return GTK_WIDGET (page_box); } GtkWidget *get_window_child_RULES() { - if (0) printf("widgets.get_window_child_RULES (line 246)\n"); GtkPaned *H_tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); // GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre des règles"); // GtkWidget *édition_de_la_règle_sélectionnée_n_1 = gtk_frame_new ("Inspection"); @@ -280,54 +360,23 @@ GtkWidget *get_window_child_RULES() { } GtkWidget *get_window_child_DATA () { - if (0) printf("widgets.get_window_child_DATA (line 279)\n"); - GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 32)); + GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 32)); - GtkWidget* frame_rule_effect = gtk_frame_new ("rule effect\n-----------"); - gtk_frame_set_label_align (GTK_FRAME (frame_rule_effect), 0.5); - GtkBox *rule_effect_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + GtkWidget* frame_rule_effect = gtk_frame_new ("rule effect"); + GtkBox *rule_effect_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8)); gtk_frame_set_child (GTK_FRAME (frame_rule_effect), GTK_WIDGET (rule_effect_box)); - GtkWidget* frame_rule_topic = gtk_frame_new ("rule topic\n----------"); - gtk_frame_set_label_align (GTK_FRAME (frame_rule_topic), 0.5); - GtkBox *rule_topic_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + GtkWidget* frame_rule_topic = gtk_frame_new ("rule topic"); + GtkBox *rule_topic_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8)); gtk_frame_set_child (GTK_FRAME (frame_rule_topic), GTK_WIDGET (rule_topic_box)); - GtkWidget* frame_data_type = gtk_frame_new ("data type\n----------"); - gtk_frame_set_label_align (GTK_FRAME (frame_data_type), 0.5); - GtkBox *data_type_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); + GtkWidget* frame_data_type = gtk_frame_new ("data type"); + GtkBox *data_type_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8)); gtk_frame_set_child (GTK_FRAME (frame_data_type), GTK_WIDGET (data_type_box)); - GtkWidget* frame_interpretations = gtk_frame_new ("interpretation\n---------------"); - gtk_frame_set_label_align (GTK_FRAME (frame_interpretations), 0.5); - GtkBox *interpretations_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); - gtk_frame_set_child (GTK_FRAME (frame_interpretations), GTK_WIDGET (interpretations_box)); - - GtkWidget* frame_discussions = gtk_frame_new ("discussion\n------------"); - gtk_frame_set_label_align (GTK_FRAME (frame_discussions), 0.5); - GtkBox *discussions_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); - gtk_frame_set_child (GTK_FRAME (frame_discussions), GTK_WIDGET (discussions_box)); - - GtkWidget* frame_separator = gtk_frame_new ("\n"); - - GtkWidget* frame_game = gtk_frame_new ("game\n------"); - gtk_frame_set_label_align (GTK_FRAME (frame_game), 0.5); - GtkBox *game_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); - gtk_frame_set_child (GTK_FRAME (frame_game), GTK_WIDGET (game_box)); - - GtkWidget* frame_help = gtk_frame_new ("help\n-----"); - gtk_frame_set_label_align (GTK_FRAME (frame_help), 0.5); - GtkBox *help_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); - gtk_frame_set_child (GTK_FRAME (frame_help), GTK_WIDGET (help_box)); - gtk_box_append (data_box, GTK_WIDGET (frame_rule_effect)); gtk_box_append (data_box, GTK_WIDGET (frame_rule_topic)); gtk_box_append (data_box, GTK_WIDGET (frame_data_type)); - gtk_box_append (data_box, GTK_WIDGET (frame_interpretations)); - gtk_box_append (data_box, GTK_WIDGET (frame_discussions)); - gtk_box_append (data_box, GTK_WIDGET (frame_separator)); - gtk_box_append (data_box, GTK_WIDGET (frame_game)); - gtk_box_append (data_box, GTK_WIDGET (frame_help)); gtk_box_append (rule_effect_box, gtk_button_new_with_label ("movement")); gtk_box_append (rule_effect_box, gtk_button_new_with_label ("transport")); @@ -336,46 +385,9 @@ GtkWidget *get_window_child_DATA () { gtk_box_append (rule_topic_box, gtk_button_new_with_label ("objects")); gtk_box_append (rule_topic_box, gtk_button_new_with_label ("situations")); - gtk_box_append (rule_topic_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (rule_topic_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (rule_topic_box, gtk_button_new_with_label ("accuracy")); - gtk_box_append (rule_topic_box, gtk_button_new_with_label ("pattern recognition")); - gtk_box_append (data_type_box, gtk_button_new_with_label ("repartitions")); gtk_box_append (data_type_box, gtk_button_new_with_label ("evolutions")); gtk_box_append (data_type_box, gtk_button_new_with_label ("correlations")); - gtk_box_append (interpretations_box, gtk_button_new_with_label ("stochastic")); - gtk_box_append (interpretations_box, gtk_button_new_with_label ("deterministic")); - - gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (interpretations_box, gtk_button_new_with_label ("physical")); - gtk_box_append (interpretations_box, gtk_button_new_with_label ("chemical")); - gtk_box_append (interpretations_box, gtk_button_new_with_label ("biological")); - gtk_box_append (interpretations_box, gtk_button_new_with_label ("social")); - gtk_box_append (interpretations_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - - gtk_box_append (discussions_box, gtk_button_new_with_label ("context")); - gtk_box_append (discussions_box, gtk_button_new_with_label ("methodology")); - gtk_box_append (discussions_box, gtk_button_new_with_label ("comparisons")); - gtk_box_append (discussions_box, gtk_button_new_with_label ("to improve")); - gtk_box_append (discussions_box, gtk_button_new_with_label ("summary")); - - gtk_box_append (game_box, gtk_button_new_with_label ("single player")); - gtk_box_append (game_box, gtk_button_new_with_label ("multiple players")); - gtk_box_append (game_box, gtk_button_new_with_label ("edition facilities")); - - gtk_box_append (help_box, gtk_button_new_with_label ("modelization")); - gtk_box_append (help_box, gtk_button_new_with_label ("measurements")); - gtk_box_append (help_box, gtk_button_new_with_label ("results")); - gtk_box_append (help_box, gtk_button_new_with_label ("data analysis")); - - gtk_box_append (help_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (help_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (help_box, gtk_button_new_with_label ("preferences")); - - //SWITCH_TO (DATA); return GTK_WIDGET (data_box); } -