RUN/STOP horizontal, à droite du buffer DO/UNDO (1er essai)
This commit is contained in:
parent
0806ddfd87
commit
45048498a9
32
contain.c
32
contain.c
|
@ -98,30 +98,40 @@ GtkWidget *get_edit_space_page_new(){
|
||||||
return space_grid;
|
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(){
|
GtkWidget *get_run_space_left_box(){
|
||||||
GtkBox *left_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
|
GtkBox *left_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||||
gtk_box_append (left_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar()));
|
|
||||||
gtk_box_append (left_box, GTK_WIDGET (get_SPACE_IMAGE()));
|
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()));
|
gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
|
||||||
return GTK_WIDGET (left_box);
|
return GTK_WIDGET (left_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *get_run_space_right_box(){
|
GtkWidget *get_run_space_right_box(){
|
||||||
GtkBox *right_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
|
GtkBox *right_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||||
gtk_box_append (right_box, GTK_WIDGET (get_RUN_STOP_box()));
|
|
||||||
gtk_box_append (right_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
|
||||||
gtk_box_append (right_box, GTK_WIDGET (get_XYZ_box()));
|
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()));
|
gtk_box_append (right_box, GTK_WIDGET (get_ZOOM_box()));
|
||||||
return GTK_WIDGET (right_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(){
|
GtkWidget *get_run_space_page_new(){
|
||||||
GtkBox *page_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
|
GtkBox *page_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||||
gtk_box_append (page_box, GTK_WIDGET (get_run_space_left_box()));
|
gtk_box_append (page_box, GTK_WIDGET (get_run_space_top_box()));
|
||||||
gtk_box_append (page_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
|
gtk_box_append (page_box, GTK_WIDGET (get_run_space_bottom_box()));
|
||||||
gtk_box_append (page_box, GTK_WIDGET (get_run_space_right_box()));
|
|
||||||
return GTK_WIDGET (page_box);
|
return GTK_WIDGET (page_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
#define W 1920
|
#define W 1920
|
||||||
#define H 960
|
#define H 960
|
||||||
#define W_IMAGE 1920 - 64
|
#define W_IMAGE 1920 - 20
|
||||||
#define H_IMAGE 960 - 46
|
#define H_IMAGE 960 - 126
|
||||||
#define H_STYLES_PANE 60
|
#define H_STYLES_PANE 60
|
||||||
|
|
||||||
void activate (GtkApplication *app, gpointer user_data);
|
void activate (GtkApplication *app, gpointer user_data);
|
||||||
|
|
22
display.c
22
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_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 gg sketch.png");
|
||||||
image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image E coli (Goodsell).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;
|
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 *get_ZOOM_box(){
|
||||||
GtkBox *ZOOM_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
|
GtkBox *ZOOM_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
|
||||||
GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\
|
GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\
|
||||||
"\n TOOLS\n ---\n zoom\n ---\n (space\n struct.)\n\
|
"\n TOOLS\n ---\n zoom\n ---\n (space\n struct.)\n\
|
||||||
---\n (arrows\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);
|
gtk_box_append (ZOOM_box, ZOOM_Label);
|
||||||
return ZOOM_box;
|
return ZOOM_box;
|
||||||
}
|
}
|
||||||
|
|
38
hot.c
38
hot.c
|
@ -13,41 +13,3 @@
|
||||||
// GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL
|
// 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;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue