Où mettre le curseur entre containers et displayers ? < les actions (connect)

This commit is contained in:
Jean Sirmai 2024-05-10 08:19:35 +02:00
parent 599937e013
commit 0806ddfd87
Signed by: jean
GPG Key ID: FB3115C340E057E3
6 changed files with 20 additions and 24 deletions

View File

@ -86,26 +86,24 @@ GtkWidget *get_run_rules_page_new(){
GtkWidget *get_edit_space_page_new(){ GtkWidget *get_edit_space_page_new(){
GtkWidget *space_grid = gtk_grid_new(); GtkWidget *space_grid = gtk_grid_new();
gtk_grid_attach (GTK_GRID(space_grid), get_test_image(), 0, 0, 1, 3); gtk_grid_attach (GTK_GRID(space_grid), get_SPACE_IMAGE(), 0, 0, 1, 3);
gtk_grid_attach (GTK_GRID(space_grid), get_objects_and_situations_horizontal_pane(), 0, 4, 1, 1); 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_XYZ_box()), 1, 0, 1, 2);
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ZOOM_box()), 1, 2, 1, 2); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_ZOOM_box()), 1, 2, 1, 2);
gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_edit_TOOL_box()), 1, 3, 1, 2); gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(get_edit_TOOL_box()), 1, 3, 1, 2);
gtk_widget_set_size_request (space_grid, W, H); gtk_widget_set_size_request (space_grid, W, H);
// How to use gtk_separators ? // How to use gtk_separators ?
// gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)), 1, 1, 1, 1); // gtk_grid_attach (GTK_GRID(space_grid), GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)), 1, 1, 1, 1);
return space_grid; return space_grid;
} }
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, 0));
gtk_box_append (left_box, GTK_WIDGET (get_ELAPSED_TIME_box())); gtk_box_append (left_box, GTK_WIDGET (get_ELAPSED_TIME_ProgressBar()));
gtk_box_append (left_box, GTK_WIDGET (get_test_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 (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (left_box, GTK_WIDGET (get_objects_and_situations_horizontal_pane())); gtk_box_append (left_box, GTK_WIDGET (get_OBJECTS_and_SITUATIONS()));
return GTK_WIDGET (left_box); return GTK_WIDGET (left_box);
} }

BIN
contain.o

Binary file not shown.

View File

@ -8,7 +8,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
GtkWidget *get_test_image(){ GtkWidget *get_SPACE_IMAGE(){
GtkWidget *image; GtkWidget *image;
// forget > GTK_WIDGET(get_scrolled_gl_area()); // forget > GTK_WIDGET(get_scrolled_gl_area());
// Use GtkImage if you want to display a fixed-size icon // Use GtkImage if you want to display a fixed-size icon
@ -24,7 +24,9 @@ GtkWidget *get_test_image(){
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 ("ZOOM\n ---\n(space\nstruct.)")); 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); gtk_box_append (ZOOM_box, ZOOM_Label);
return ZOOM_box; return ZOOM_box;
@ -44,7 +46,7 @@ GtkBox *get_edit_TOOL_box(){
GtkBox *get_XYZ_box(){ GtkBox *get_XYZ_box(){
GtkBox *XYZ_labels_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); // spacing = 2 GtkBox *XYZ_labels_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); // spacing = 2
GtkBox *XYZ_scrollbar_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2 GtkBox *XYZ_scrollbar_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2q
// GtkWidget *scale_X = gtk_scale_button_new (0, 360, 10, NULL); < à étudier // GtkWidget *scale_X = gtk_scale_button_new (0, 360, 10, NULL); < à étudier
// (double min, double max, double step, const char** icons) // (double min, double max, double step, const char** icons)
GtkAdjustment *X_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0); GtkAdjustment *X_adjust = gtk_adjustment_new (0, 0, 380, 1, 0, 0);
@ -60,8 +62,9 @@ GtkBox *get_XYZ_box(){
gtk_box_append (XYZ_scrollbar_box, scroll_Y); gtk_box_append (XYZ_scrollbar_box, scroll_Y);
gtk_box_append (XYZ_scrollbar_box, scroll_Z); gtk_box_append (XYZ_scrollbar_box, scroll_Z);
gtk_box_append (XYZ_labels_box, GTK_WIDGET (gtk_label_new ("X Y Z"))); gtk_box_append (XYZ_labels_box, GTK_WIDGET (gtk_label_new ("\nX Y Z")));
gtk_box_append (XYZ_labels_box, GTK_WIDGET (XYZ_scrollbar_box)); gtk_box_append (XYZ_labels_box, GTK_WIDGET (XYZ_scrollbar_box));
gtk_box_append (XYZ_labels_box, GTK_WIDGET (gtk_label_new ("")));
// gtk_box_set_baseline_position (XYZ_scrollbar_box, GTK_BASELINE_POSITION_BOTTOM); // gtk_box_set_baseline_position (XYZ_scrollbar_box, GTK_BASELINE_POSITION_BOTTOM);
@ -70,22 +73,16 @@ GtkBox *get_XYZ_box(){
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static GtkProgressBar *get_simulation_time_extent_buffer(){ GtkProgressBar *get_ELAPSED_TIME_ProgressBar(){ // TODO ? <> rename : DO - UNDO - REDO ?
GtkProgressBar *buffer = GTK_PROGRESS_BAR (gtk_progress_bar_new ()); GtkProgressBar *buffer = GTK_PROGRESS_BAR (gtk_progress_bar_new ());
gtk_progress_bar_set_text (buffer, "<--- [buffer] (simulation extensive time) --->\n\ gtk_progress_bar_set_text (buffer,\
supports DO - UNDO - REDO functions"); "\n<--- [buffer] (simulation extensive time) --->\n\
supports DO - UNDO - REDO functions\n");
gtk_progress_bar_set_show_text (buffer, TRUE); gtk_progress_bar_set_show_text (buffer, TRUE);
gtk_widget_set_size_request (GTK_WIDGET (buffer), W_IMAGE, 0); gtk_widget_set_size_request (GTK_WIDGET (buffer), W_IMAGE, 0);
return buffer; return buffer;
} }
GtkBox *get_ELAPSED_TIME_box(){
GtkBox *ELAPSED_TIME_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_widget_set_size_request (GTK_WIDGET (ELAPSED_TIME_box), W_IMAGE, 50);
gtk_box_append (ELAPSED_TIME_box, GTK_WIDGET(get_simulation_time_extent_buffer()));
return ELAPSED_TIME_box;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static GtkBox *get_objects_box(){ static GtkBox *get_objects_box(){
@ -124,7 +121,7 @@ static GtkWidget *get_frame_situations(){
return frame_situations; return frame_situations;
} }
GtkWidget *get_objects_and_situations_horizontal_pane(){ GtkWidget *get_OBJECTS_and_SITUATIONS(){
GtkWidget *objects_and_situations_horizontal_pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); 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_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())); gtk_paned_set_end_child (GTK_PANED(objects_and_situations_horizontal_pane), GTK_WIDGET (get_frame_situations()));

View File

@ -7,10 +7,11 @@
/* */ /* */
/******************************************************************************/ /******************************************************************************/
GtkWidget *get_test_image(); GtkWidget *get_SPACE_IMAGE();
GtkWidget *get_text_view(); GtkWidget *get_text_view();
GtkFrame *get_frame_with_label(); GtkFrame *get_frame_with_label();
GtkScrolledWindow *get_scrolled_gl_area(); GtkScrolledWindow *get_scrolled_gl_area();
GtkProgressBar *get_ELAPSED_TIME_ProgressBar();
GtkBox *get_RUN_STOP_box(); GtkBox *get_RUN_STOP_box();
//GtkBox *get_CONTROL_box(); //GtkBox *get_CONTROL_box();
@ -19,7 +20,7 @@ GtkBox *get_edit_TOOL_box();
GtkBox *get_XYZ_box(); GtkBox *get_XYZ_box();
void window_bar(GtkWindow *window, char *title); void window_bar(GtkWindow *window, char *title);
GtkWidget *get_objects_and_situations_horizontal_pane(); GtkWidget *get_OBJECTS_and_SITUATIONS();
GtkBox *get_ELAPSED_TIME_box(); GtkBox *get_ELAPSED_TIME_box();
// https://docs.gtk.org/gtk4/section-text-widget.html // https://docs.gtk.org/gtk4/section-text-widget.html

BIN
display.o

Binary file not shown.

BIN
myprogram

Binary file not shown.