Introducing the measuring process (click on the new icon in the top right-hand bar)

This commit is contained in:
Jean Sirmai 2024-08-06 16:29:41 +02:00
parent a844995c08
commit 9a2cb4ec8b
Signed by: jean
GPG Key ID: FB3115C340E057E3
24 changed files with 125 additions and 22 deletions

BIN
data/image/xyz icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
data/stamp/balance icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
data/stamp/camera icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -121,7 +121,7 @@ void on_axis_value_change (GtkAdjustment *adjustment, gpointer data);
void on_clicked_home (GtkWidget *btt_reset, gpointer data);
void on_clicked_search (GtkWidget *btt_menu, gpointer list_box);
void on_clicked_measure (GtkWidget *btt_measure, gpointer data);
/******************************************************************************/

View File

@ -41,17 +41,6 @@
#define H_TEXT_WINDOW H_MY_SCREEN
// called in widget / dispatch.c / on_windows_activation()
// defined in widget / topbar / dispatch.c
// - widget / topbar / dialog.c
// - widget / topbar / polytext.c
// after gtk_application_window_new (app) x 3
void widget_design_main_window (GtkWindow *main_window);
void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window);
void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window);
// called in signal.c / switch_state_rules_data() / gtk_window_set_child()
// defined in widget / dispatch.c
@ -60,6 +49,17 @@ void *widget_get_dialog_window();
void *widget_get_text_window();
// called in widget / dispatch.c / on_windows_activation()
// defined in widget / topbar / dispatch.c
// - widget / topbar / dialog.c
// - widget / topbar / polytext.c
// (after gtk_application_window_new (app) x 3)
void widget_design_main_window (GtkWindow *main_window);
void widget_design_dialog_window (GtkWindow *main_window, GtkWindow *dialog_window);
void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window);
/******************************************************************************/
/* W I D G E T S */
/******************************************************************************/
@ -99,11 +99,13 @@ void window_design_header_bar_right (GtkWidget *header_bar);
// - widget / state / dispatch.c
// - widget / rules / dispatch.c
// - widget / data / dispatch.c
// - widget / measure / dispatch.c
void *widget_get_synth_page(); // in : widget / synth / dispatch.c
void *widget_get_state_page(); // in : widget / state / dispatch.c
void *widget_get_rules_page(); // in : widget / rules / dispatch.c
void *widget_get_data_page(); // in : widget / data / dispatch.c
void *widget_get_measure_page();// in : widget / measure / dispatch.c
/******************************************************************************/
@ -243,3 +245,11 @@ void widget_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_
/* M E N U */
/******************************************************************************/
/******************************************************************************/
/* M E A S U R E S */
/******************************************************************************/
// called by : signal.c
// defined in : widget / measure / dispatch.c
void *widget_measure_new ();

View File

@ -359,3 +359,13 @@ void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrol
}
/******************************************************************************/
/* M E A S U R E S */
/******************************************************************************/
void on_clicked_measure (GtkWidget *btt_measure, gpointer data)
{
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
GTK_WIDGET (widget_get_measure_page()));
}

View File

@ -0,0 +1,74 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Gem-graph client *
* *
* Windows && Headers *
* *
* Copyright © 2021 Libre en Communs <contact@a-lec.org> *
* Copyright © 2021 Adrien Bourmault <neox@a-lec.org> *
* Copyright © 2021 Jean Sirmai <jean@a-lec.org> *
* *
* This file is part of Gem-graph. *
* *
* This program is free software: you can redistribute it and/or modify it *
* under the terms of the GNU Affero General Public License *
* as published by the Free Software Foundation, *
* either version 3 of the License, *
* or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; *
* without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "../../../include/base.h"
#include "../../../include/signal.h"
#include "../../../include/widget.h"
/******************************************************************************/
/* M E A S U R E S */
/******************************************************************************/
#define PARTITION_MEASURE 500
void *widget_measure_new ()
{
printf("on_clicked_measure() >> dispatch.c / widget_measure_new()\n");
GtkBox *results_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (results_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure caliper icon.png")));
return results_box;
}
void *widget_measure_II ()
{
printf("on_clicked_measure() >> dispatch.c / widget_measure_II()\n");
GtkBox *measure_II_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (measure_II_box, GTK_WIDGET (gtk_picture_new_for_filename
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure pressure icon.png")));
return measure_II_box;
}
void *widget_get_measure_page()
{
printf("dispatch.c / widget_measure_new() >> dispatch.c / widget_get_measure_page()\n");
GtkWidget *anything = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_paned_set_start_child (GTK_PANED (anything),
GTK_WIDGET (widget_measure_new()));
gtk_paned_set_end_child (GTK_PANED (anything),
GTK_WIDGET (widget_measure_II()));
gtk_paned_set_position (GTK_PANED (anything), PARTITION_MEASURE);
gtk_paned_set_shrink_start_child (GTK_PANED (anything), FALSE);
gtk_paned_set_shrink_end_child (GTK_PANED (anything), FALSE);
gtk_widget_set_size_request (anything, 0, H_MY_SCREEN); // OK (required))
return anything;
}

View File

@ -45,7 +45,7 @@ void widget_state_XYZ_reset_all()
gtk_adjustment_set_value (Z_adjust, 0);
}
static GtkBox *rec_XYZ_box()
static void *get_XYZ_box()
{
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));
@ -77,13 +77,12 @@ static GtkBox *rec_XYZ_box()
return XYZ_labels_box;
}
static GtkBox *rec_ZOOM_box()
static void *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 ---\n orient\n state\n in space\n"));
// gtk_widget_set_size_request (GTK_WIDGET (ZOOM_box), 10, 80);
gtk_box_append (ZOOM_box, ZOOM_Label);
return ZOOM_box;
}
@ -100,9 +99,9 @@ void *widget_get_space_view()
// TODO replace this image by >> ui_setup_glarea (0, GTK_WIDGET (~));
GtkBox *camera = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
gtk_box_append (camera, GTK_WIDGET (rec_XYZ_box()));
gtk_box_append (camera, GTK_WIDGET (get_XYZ_box()));
gtk_box_append (camera, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
gtk_box_append (camera, GTK_WIDGET (rec_ZOOM_box()));
gtk_box_append (camera, GTK_WIDGET (get_ZOOM_box()));
GtkWidget *view_space_vs_camera = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_set_start_child (GTK_PANED (view_space_vs_camera), GTK_WIDGET (E_coli));
@ -111,6 +110,11 @@ void *widget_get_space_view()
gtk_paned_set_shrink_end_child (GTK_PANED (view_space_vs_camera), FALSE);
gtk_paned_set_position (GTK_PANED (view_space_vs_camera), PARTITION_SPACE_VS_CAMERA);
/* GtkBox *un_essai = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6));
gtk_box_append (GTK_BOX (un_essai), GTK_WIDGET (E_coli));
gtk_box_append (GTK_BOX (un_essai), GTK_WIDGET (camera));
return GTK_WIDGET (un_essai); <<< Ça devrait suffire ? */
return GTK_WIDGET (view_space_vs_camera);
}

View File

@ -57,8 +57,8 @@ static void *widget_get_space_vs_non_time_dependent_analysis()
gtk_paned_set_end_child (GTK_PANED (space_vs_non_time_dependent_analysis),
GTK_WIDGET (widget_get_non_time_dependent_analysis_elements()));
gtk_paned_set_position (GTK_PANED (space_vs_non_time_dependent_analysis), PARTITION_SYNTH);
gtk_paned_set_shrink_start_child (GTK_PANED (space_vs_non_time_dependent_analysis), TRUE);
gtk_paned_set_shrink_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), TRUE);
gtk_paned_set_shrink_start_child (GTK_PANED (space_vs_non_time_dependent_analysis), FALSE);
gtk_paned_set_shrink_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), FALSE); // TRUE
return space_vs_non_time_dependent_analysis;
}

View File

@ -54,6 +54,11 @@ void window_design_header_bar_right (GtkWidget *header_bar)
g_signal_connect (search, "clicked", G_CALLBACK (on_clicked_search), no_local_data);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (search));
GtkButton *measure = GTK_BUTTON (gtk_button_new ());
gtk_button_set_icon_name (measure, "color-select-symbolic");
g_signal_connect (measure, "clicked", G_CALLBACK (on_clicked_measure), no_local_data);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), GTK_WIDGET (measure));