diff --git a/contain.c b/contain.c index 96f3ed0..6a54147 100644 --- a/contain.c +++ b/contain.c @@ -98,30 +98,40 @@ GtkWidget *get_edit_space_page_new(){ return space_grid; } +//------------------------------------------------------------------------------ + +GtkWidget *get_run_space_top_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 (get_RUN_STOP_box())); + return GTK_WIDGET (top_box); +} + GtkWidget *get_run_space_left_box(){ - GtkBox *left_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); - gtk_box_append (left_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar())); + GtkBox *left_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (left_box, GTK_WIDGET (get_SPACE_IMAGE())); - gtk_box_append (left_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS())); return GTK_WIDGET (left_box); } GtkWidget *get_run_space_right_box(){ - GtkBox *right_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); - gtk_box_append (right_box, GTK_WIDGET (get_RUN_STOP_box())); - gtk_box_append (right_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); + GtkBox *right_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (right_box, GTK_WIDGET (get_XYZ_box())); - gtk_box_append (right_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (right_box, GTK_WIDGET (get_ZOOM_box())); return GTK_WIDGET (right_box); } +GtkWidget *get_run_space_bottom_box(){ + GtkBox *bottom_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); + gtk_box_append (bottom_box, GTK_WIDGET (get_run_space_left_box())); + gtk_box_append (bottom_box, GTK_WIDGET (get_run_space_right_box())); + return GTK_WIDGET (bottom_box); +} + GtkWidget *get_run_space_page_new(){ - GtkBox *page_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); - gtk_box_append (page_box, GTK_WIDGET (get_run_space_left_box())); - gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); - gtk_box_append (page_box, GTK_WIDGET (get_run_space_right_box())); + GtkBox *page_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); + gtk_box_append (page_box, GTK_WIDGET (get_run_space_top_box())); + gtk_box_append (page_box, GTK_WIDGET (get_run_space_bottom_box())); return GTK_WIDGET (page_box); } diff --git a/contain.h b/contain.h index 215fbdc..1b2b391 100644 --- a/contain.h +++ b/contain.h @@ -9,8 +9,8 @@ #define W 1920 #define H 960 -#define W_IMAGE 1920 - 64 -#define H_IMAGE 960 - 46 +#define W_IMAGE 1920 - 20 +#define H_IMAGE 960 - 126 #define H_STYLES_PANE 60 void activate (GtkApplication *app, gpointer user_data); diff --git a/contain.o b/contain.o index abe3ee8..398af04 100644 Binary files a/contain.o and b/contain.o differ diff --git a/display.c b/display.c index 77fe073..e823a0b 100644 --- a/display.c +++ b/display.c @@ -16,18 +16,36 @@ GtkWidget *get_SPACE_IMAGE(){ image = gtk_image_new_from_file("/home/jean/01/Gtk4/Getting_Started_with_GTK/image aXoris.png"); image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image gg sketch.png"); image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image E coli (Goodsell).png"); - gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE, 0); + gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE, H_IMAGE); return image; } //------------------------------------------------------------------------------ +// TODO cliquer sur "RUN" --> affiche "STOP" (et inversement) +static GtkWidget *get_scroll_speed(){ + GtkAdjustment *speed_adjust = gtk_adjustment_new (0, 0, 100, 1, 0, 0); + GtkWidget *scroll_speed = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, speed_adjust); + gtk_widget_set_size_request (GTK_WIDGET (scroll_speed), 140, 2); + return scroll_speed; +} +GtkBox *get_RUN_STOP_box(){ + GtkBox *RUN_STOP_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20)); +// gtk_box_append (RUN_STOP_box, gtk_label_new ("\n")); + gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_label_new (" R U N\n S T O P"))); + gtk_box_append (RUN_STOP_box, get_scroll_speed()); + gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_label_new (" STEP\n(show active rule) "))); +// gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_VERTICAL))); + return RUN_STOP_box; +} +//------------------------------------------------------------------------------ + GtkBox *get_ZOOM_box(){ GtkBox *ZOOM_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\ "\n TOOLS\n ---\n zoom\n ---\n (space\n struct.)\n\ ---\n (arrows\n struct.)\n")); -// gtk_widget_set_size_request (GTK_WIDGET (ZOOM_box), 30, 80); + gtk_widget_set_size_request (GTK_WIDGET (ZOOM_box), 30, 80); gtk_box_append (ZOOM_box, ZOOM_Label); return ZOOM_box; } diff --git a/display.o b/display.o index 4416ec4..bd8ba06 100644 Binary files a/display.o and b/display.o differ diff --git a/hot.c b/hot.c index 1938b8b..6f95185 100644 --- a/hot.c +++ b/hot.c @@ -13,41 +13,3 @@ // GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL -//------------------------------------------------------------------------------ - -// TODO cliquer sur "RUN" --> affiche "STOP" (et inversement) -static GtkWidget *get_RUN_STOP_label(){ - GtkWidget *RS_label = gtk_label_new (" R U N\n S T O P"); - gtk_widget_set_size_request (GTK_WIDGET (RS_label), 20, 30); - return RS_label; -} - -static GtkWidget *get_scroll_speed(){ - GtkAdjustment *speed_adjust = gtk_adjustment_new (0, 0, 100, 1, 0, 0); - GtkWidget *scroll_speed = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, speed_adjust); - gtk_widget_set_size_request (GTK_WIDGET (scroll_speed), 2, 140); - return scroll_speed; -} - -static GtkBox *get_speed_scrolling_box(){ - GtkBox *speed_scrolling_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2 - gtk_box_append (speed_scrolling_box, GTK_WIDGET (gtk_label_new (" "))); // AD HOC (pour "centrer") - gtk_box_append (speed_scrolling_box, get_scroll_speed()); - return speed_scrolling_box; -} - -static GtkWidget *get_STEP_by_STEP_Label(){ - GtkWidget *RS_label = gtk_label_new (" Step\n\n(show\nactive\n rule)"); - gtk_widget_set_size_request (GTK_WIDGET (RS_label), 20, 30); - return RS_label; -} - -GtkBox *get_RUN_STOP_box(){ - GtkBox *RUN_STOP_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 20)); - gtk_box_append (RUN_STOP_box, gtk_label_new ("\n")); - gtk_box_append (RUN_STOP_box, get_RUN_STOP_label()); - gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_speed_scrolling_box())); - gtk_box_append (RUN_STOP_box, get_STEP_by_STEP_Label()); - gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - return RUN_STOP_box; -} diff --git a/hot.o b/hot.o index b130f1b..a1a8098 100644 Binary files a/hot.o and b/hot.o differ diff --git a/myprogram b/myprogram index 3303f1c..0e76cd5 100755 Binary files a/myprogram and b/myprogram differ diff --git a/warm.o b/warm.o index 457afbf..d24cb86 100644 Binary files a/warm.o and b/warm.o differ