premières images dans la page 'rules'

This commit is contained in:
Jean Sirmai 2024-05-11 23:08:59 +02:00
parent e05411f80d
commit eaf924974f
Signed by: jean
GPG Key ID: FB3115C340E057E3
13 changed files with 57 additions and 24 deletions

View File

@ -79,7 +79,7 @@ GtkWidget *get_run_rules_page_new(){ @see hot.c 2024-05-11 } (line 166)
GtkWidget *get_edit_space_page_new(){
GtkWidget *space_grid = gtk_grid_new();
gtk_grid_attach (GTK_GRID(space_grid), get_SPACE_IMAGE(), 0, 0, 1, 3);
gtk_grid_attach (GTK_GRID(space_grid), get_image_ALL_SPACE(), 0, 0, 1, 3);
gtk_grid_attach (GTK_GRID(space_grid), get_OBJECTS_and_SITUATIONS(), 0, 4, 1, 1);
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_XYZ_box()), 1, 0, 1, 2);
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ZOOM_box()), 1, 2, 1, 2);
@ -102,7 +102,7 @@ GtkWidget *get_run_space_top_box(){
GtkWidget *get_run_space_left_box(){
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 (get_image_ALL_SPACE()));
gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
return GTK_WIDGET (left_box);
}

View File

@ -9,9 +9,12 @@
#define W 1920
#define H 960
#define W_IMAGE 1920 - 320
#define H_IMAGE 960 - 126
#define W_IMAGE W - 320
#define H_IMAGE H - 126
#define H_STYLES_PANE 30
#define W_IMAGE_LOCAL W / 3
#define H_IMAGE_LOCAL H / 3
void activate (GtkApplication *app, gpointer user_data);

BIN
contain.o

Binary file not shown.

View File

@ -8,7 +8,7 @@
//------------------------------------------------------------------------------
GtkWidget *get_SPACE_IMAGE(){
GtkWidget *get_image_ALL_SPACE(){
GtkWidget *image;
// forget > GTK_WIDGET(get_scrolled_gl_area());
// Use GtkImage if you want to display a fixed-size icon
@ -20,6 +20,18 @@ GtkWidget *get_SPACE_IMAGE(){
return image;
}
GtkWidget *get_image_GLUTAMATE(){
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamate.png");
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
return image;
}
GtkWidget *get_image_GLUTAMINE(){
GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamine.png");
gtk_widget_set_size_request (GTK_WIDGET (image), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
return image;
}
//------------------------------------------------------------------------------
// TODO cliquer sur "RUN" --> affiche "STOP" (et inversement)

View File

@ -10,7 +10,8 @@
GtkWidget *get_text_view();
GtkFrame *get_frame_with_label();
GtkWidget *get_SPACE_IMAGE();
GtkWidget *get_image_ALL_SPACE();
GtkWidget *get_image_GLUTAMATE();
GtkProgressBar *get_ELAPSED_TIME_ProgressBar();
GtkBox *get_RUN_STOP_box();
GtkBox *get_ZOOM_box();

BIN
display.o

Binary file not shown.

52
hot.c
View File

@ -16,41 +16,57 @@
GtkWidget *get_selected_rules_vpaned_new(){
GtkPaned *vpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
GtkPaned *V_selected_1_vs_2 = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
GtkWidget *règle_sélectionnée_n_1 = gtk_frame_new ("(1)");
GtkWidget *règle_sélectionnée_n_2 = gtk_frame_new ("(2)");
gtk_paned_set_start_child (vpaned, GTK_WIDGET (règle_sélectionnée_n_1));
gtk_paned_set_end_child (vpaned, GTK_WIDGET (règle_sélectionnée_n_2));
// gtk_paned_set_wide_handle (vpaned, TRUE);
return GTK_WIDGET (vpaned);
GtkBox *up_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (up_box, GTK_WIDGET (get_image_GLUTAMATE()));
GtkBox *down_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (down_box, GTK_WIDGET (get_image_GLUTAMINE()));
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 (down_box));
// gtk_paned_set_wide_handle (V_selected_1_vs_2, TRUE);
/* GtkWidget *picture_before = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamine");
GtkWidget *picture_after = gtk_picture_new_for_filename ("/home/jean/01/Gtk4/Getting_Started_with_GTK/image glutamate");
gtk_widget_set_size_request (GTK_WIDGET (picture_before), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
gtk_widget_set_size_request (GTK_WIDGET (picture_after), W_IMAGE_LOCAL, H_IMAGE_LOCAL);*/
// gtk_window_set_child (GTK_WINDOW (règle_sélectionnée_n_1), GTK_WIDGET(up_box));
// gtk_window_set_child (GTK_WINDOW (up_box), GTK_WIDGET(picture_before));
return GTK_WIDGET (V_selected_1_vs_2);
}
GtkWidget *get_rules_tree_hpaned_new(){
GtkPaned *hpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
GtkPaned *H_tree_vs_comparison = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre");
GtkWidget *comparaison_des_règles_sélectionnées = gtk_frame_new ("Sélection");
gtk_paned_set_start_child (hpaned, GTK_WIDGET (arbre_des_règles));
gtk_paned_set_end_child (hpaned, GTK_WIDGET (comparaison_des_règles_sélectionnées));
gtk_paned_set_position (hpaned, 300);
gtk_paned_set_wide_handle (hpaned, TRUE);
return GTK_WIDGET (hpaned);
gtk_paned_set_start_child (H_tree_vs_comparison, GTK_WIDGET (arbre_des_règles));
gtk_paned_set_end_child (H_tree_vs_comparison, GTK_WIDGET (comparaison_des_règles_sélectionnées));
gtk_paned_set_position (H_tree_vs_comparison, 300);
gtk_paned_set_wide_handle (H_tree_vs_comparison, TRUE);
gtk_paned_set_shrink_start_child (H_tree_vs_comparison, FALSE);
gtk_paned_set_shrink_end_child (H_tree_vs_comparison, FALSE);
return GTK_WIDGET (H_tree_vs_comparison);
}
GtkWidget *get_run_rules_page_new(){
GtkPaned *hpaned = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
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");
gtk_paned_set_start_child (hpaned, GTK_WIDGET (get_rules_tree_hpaned_new()));
gtk_paned_set_end_child (hpaned, GTK_WIDGET (get_selected_rules_vpaned_new()));
gtk_paned_set_position (hpaned, 600);
gtk_paned_set_wide_handle (hpaned, TRUE);
// gtk_widget_set_size_request (GTK_WIDGET (hpaned), W, H); // inutile... ?
return GTK_WIDGET (hpaned);
gtk_paned_set_start_child (H_tree_vs_selected, GTK_WIDGET (get_rules_tree_hpaned_new()));
gtk_paned_set_end_child (H_tree_vs_selected, GTK_WIDGET (get_selected_rules_vpaned_new()));
gtk_paned_set_position (H_tree_vs_selected, 600); // WARNING : c'est une position "absolue"
gtk_paned_set_wide_handle (H_tree_vs_selected, TRUE);
// gtk_widget_set_size_request (GTK_WIDGET (H_tree_vs_selected), W, H); // inutile... ?
return GTK_WIDGET (H_tree_vs_selected);
}

1
hot.h
View File

@ -13,3 +13,4 @@
#include "contain.h"
GtkWidget *get_run_rules_page_new();
GtkWidget *get_image_GLUTAMATE();

BIN
hot.o

Binary file not shown.

BIN
image glutamate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
image glutamine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
main.o

Binary file not shown.

BIN
myprogram

Binary file not shown.