rules explore controls (first approach)

This commit is contained in:
Jean Sirmai 2024-07-27 20:55:50 +02:00
parent 1173689ae2
commit ddf96045bd
Signed by: jean
GPG Key ID: FB3115C340E057E3
5 changed files with 95 additions and 22 deletions

View File

@ -65,7 +65,7 @@ void *widget_get_stock_page(); // in : src/widget/stock.c
/******************************************************************************/
/* S T A T E */
/******************************************************************************/
// called in : src/widget/state/distrib.c
// called in : src/widget/state/distribvoid *widget_get_rule_edit_control().c
void *widget_get_space_view(); // middle
void *widget_get_graph_view_control(); // middle
@ -86,9 +86,11 @@ int widget_get_object_transparency (int i); // top
/******************************************************************************/
// called in : src/widget/rules/distrib.c
void *get_selected_rule();
void *get_rules_tree();
void *widget_get_selected_rule();
void *widget_get_rules_tree();
void *widget_get_rules_page();
void *widget_get_rule_edit_control();
//void *widget_get_rule_explore_control();
/******************************************************************************/

View File

@ -32,14 +32,35 @@
#include "../../../include/signal.h"
static void *widget_get_rule_explore_control()
{
return gtk_label_new
("_______________\n RULE EXPLORE\n controls\n'''''''''''''''''''''''''");
}
static void *widget_rule_itself_vs_explore_edit () {
GtkPaned *rule_itself_vs_explore_edit = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
gtk_paned_set_start_child (rule_itself_vs_explore_edit, GTK_WIDGET (widget_get_selected_rule ()));
gtk_paned_set_end_child (rule_itself_vs_explore_edit, GTK_WIDGET (widget_get_rule_explore_control ()));
gtk_paned_set_position (rule_itself_vs_explore_edit, 800); // WARNING : c'est une position "absolue"
gtk_paned_set_wide_handle (rule_itself_vs_explore_edit, TRUE);
gtk_paned_set_shrink_start_child (rule_itself_vs_explore_edit, FALSE);
gtk_paned_set_shrink_end_child (rule_itself_vs_explore_edit, FALSE);
return GTK_WIDGET (rule_itself_vs_explore_edit);
}
void *widget_get_rules_page () {
GtkPaned *H_tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
gtk_paned_set_start_child (H_tree_vs_selected, GTK_WIDGET (get_rules_tree()));
gtk_paned_set_end_child (H_tree_vs_selected, GTK_WIDGET (get_selected_rule()));
gtk_paned_set_start_child (H_tree_vs_selected, GTK_WIDGET (widget_get_rules_tree ()));
gtk_paned_set_end_child (H_tree_vs_selected, GTK_WIDGET (widget_rule_itself_vs_explore_edit ()));
gtk_paned_set_position (H_tree_vs_selected, 340); // WARNING : c'est une position "absolue"
gtk_paned_set_wide_handle (H_tree_vs_selected, TRUE);
gtk_paned_set_shrink_start_child (H_tree_vs_selected, FALSE);
gtk_paned_set_shrink_end_child (H_tree_vs_selected, FALSE);
return GTK_WIDGET (H_tree_vs_selected);
}

View File

@ -0,0 +1,47 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Gem-graph client *
* *
* Rules *
* *
* Copyright © 2021 Libre en Communs <contact@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/fsm.h"
#include "../../../include/widget.h"
#include "../../../include/signal.h"
void *widget_get_rule_edit_control()
{
return gtk_label_new
("_____________\n RULE EDIT\n controls\n'''''''''''''''''''''''");
}
/*
void *widget_get_rule_explore_control()
{
return gtk_label_new
("_____________\n RULE EXPLORE\n controls\n'''''''''''''''''''''''");
}
*/

View File

@ -36,11 +36,11 @@ static void *get_under_rule_before()
{
GtkBox *under_rule_before_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (under_rule_before_box,
GTK_WIDGET (gtk_label_new (" - - - - - - - - - (some widget here) - - - - - - - - - ")));
GTK_WIDGET (gtk_label_new ("\n\n - - - - - - - (some widgets here) - - - - - - - ")));
gtk_box_append (under_rule_before_box,
GTK_WIDGET (gtk_label_new ("| <> [ rule_before ] <> |")));
GTK_WIDGET (gtk_label_new ("\n\n| [ rule_before ] |")));
gtk_box_append (under_rule_before_box,
GTK_WIDGET (gtk_label_new (" - - - - - - - - - (some other widget there) - - - - - - - - - ")));
GTK_WIDGET (gtk_label_new ("\n\n - - - - - - - (some other widgets there) - - - - - - - ")));
return GTK_WIDGET (under_rule_before_box);
}
@ -49,11 +49,11 @@ static void *get_under_rule_after()
{
GtkBox *under_rule_after_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (under_rule_after_box,
GTK_WIDGET (gtk_label_new (" - - - - - - - - - (some widget here) - - - - - - - - - ")));
GTK_WIDGET (gtk_label_new ("\n\n - - - - - - - (some widgets here) - - - - - - - ")));
gtk_box_append (under_rule_after_box,
GTK_WIDGET (gtk_label_new ("| <> [ rule_after ] <> |")));
GTK_WIDGET (gtk_label_new ("\n\n| [ rule_after ] |")));
gtk_box_append (under_rule_after_box,
GTK_WIDGET (gtk_label_new (" - - - - - - - - - (some other widget there) - - - - - - - - - ")));
GTK_WIDGET (gtk_label_new ("\n\n - - - - - - - (some other widgets there) - - - - - - - ")));
return GTK_WIDGET (under_rule_after_box);
}
@ -78,19 +78,22 @@ static void *get_rule_after()
("/home/jean/Gem-Graph/gem-graph-client/data/image/ADP.png")));
gtk_box_append (rule_after, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (rule_after, GTK_WIDGET (get_under_rule_after()));
gtk_widget_set_size_request (GTK_WIDGET (rule_after), W_IMAGE_LOCAL / 2, H_IMAGE_LOCAL / 2);
// gtk_widget_set_size_request (GTK_WIDGET (rule_after), W_IMAGE_LOCAL / 2, H_IMAGE_LOCAL / 2);
return GTK_WIDGET (rule_after);
}
void *get_selected_rule() {
void *widget_get_selected_rule() {
GtkBox *selected_rule = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
gtk_box_append (selected_rule, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (selected_rule, GTK_WIDGET (get_rule_before()));
gtk_box_append (selected_rule, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL)));
gtk_box_append (selected_rule, GTK_WIDGET (get_rule_after()));
gtk_widget_set_size_request (GTK_WIDGET (selected_rule), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
GtkPaned *before_vs_after = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
gtk_paned_set_start_child (before_vs_after, GTK_WIDGET (get_rule_before ()));
gtk_paned_set_end_child (before_vs_after, GTK_WIDGET (get_rule_after ()));
gtk_paned_set_wide_handle (before_vs_after, TRUE);
gtk_paned_set_shrink_start_child (before_vs_after, TRUE);
gtk_paned_set_shrink_end_child (before_vs_after, TRUE);
return GTK_WIDGET (selected_rule);
gtk_paned_set_position (before_vs_after, 785); // WARNING : c'est une position "absolue"
// gtk_widget_set_size_request (GTK_WIDGET (before_vs_after), W_IMAGE_LOCAL, H_IMAGE_LOCAL);
return GTK_WIDGET (before_vs_after);
}

View File

@ -32,7 +32,7 @@
#include "../../../include/signal.h"
void *get_rules_tree(){
void *widget_get_rules_tree (){
GtkPaned *H_tree_vs_comparison = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
// GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre");