2024-04-27 16:16:21 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <gtk-4.0/gtk/gtk.h>
|
2024-05-08 07:50:04 +02:00
|
|
|
|
2024-04-29 23:43:04 +02:00
|
|
|
#include "warm.h"
|
|
|
|
#include "cold.h"
|
2024-05-10 06:19:20 +02:00
|
|
|
#include "display.h"
|
|
|
|
#include "contain.h"
|
2024-05-08 23:43:23 +02:00
|
|
|
#include "texts.h"
|
2024-04-29 23:43:04 +02:00
|
|
|
|
2024-05-07 10:03:31 +02:00
|
|
|
// https://forge.a-lec.org/gem-graph/gem-graph-client/src/branch/devel/Makefile
|
2024-04-30 18:59:44 +02:00
|
|
|
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
|
2024-05-08 23:43:23 +02:00
|
|
|
// https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management
|
2024-05-06 23:29:54 +02:00
|
|
|
// GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL
|
|
|
|
|
2024-05-08 23:43:23 +02:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// 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);
|
2024-05-09 00:05:48 +02:00
|
|
|
gtk_widget_set_size_request (GTK_WIDGET (scroll_speed), 2, 140);
|
2024-05-08 23:43:23 +02:00
|
|
|
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(){
|
2024-05-10 05:59:14 +02:00
|
|
|
GtkWidget *RS_label = gtk_label_new (" Step\n\n(show\nactive\n rule)");
|
2024-05-08 23:43:23 +02:00
|
|
|
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));
|
2024-05-09 00:05:48 +02:00
|
|
|
gtk_box_append (RUN_STOP_box, gtk_label_new ("\n"));
|
2024-05-08 23:43:23 +02:00
|
|
|
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());
|
2024-05-10 05:59:14 +02:00
|
|
|
gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
2024-05-08 23:43:23 +02:00
|
|
|
return RUN_STOP_box;
|
|
|
|
}
|