Compare commits
No commits in common. "c6ed3c5c0f2bf4e5f2f942d3dad7f06cb0a884ad" and "3d5e5d2d696fb93a4e1cb104b1110da7f5cbc256" have entirely different histories.
c6ed3c5c0f
...
3d5e5d2d69
|
@ -162,11 +162,3 @@ void on_something_else (GtkWidget *btt, gpointer data);
|
|||
void on_closing_page (GtkWidget *btt, gpointer data);
|
||||
|
||||
void on_start_new_engine (GtkWidget *btt, gpointer data);
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* R U L E S */
|
||||
/******************************************************************************/
|
||||
|
||||
void on_entry_name_insert_after (GtkWidget *entry, gpointer data);
|
||||
void on_entry_name_delete_after (GtkWidget *entry, gpointer data);
|
||||
|
|
|
@ -170,7 +170,7 @@ void widget_state_XYZ_reset_all();
|
|||
// def: widget / rules / selected / dispatch.c (= right)
|
||||
|
||||
void *widget_get_rules_tree_tools_pane();
|
||||
void *widget_get_single_selected_rule_pane();
|
||||
void *widget_get_rules_selected_pane();
|
||||
|
||||
|
||||
// call: widget / rules / tree_tools / dispatch.c / widget_get_rules_tree_tools_pane()
|
||||
|
@ -182,7 +182,7 @@ void *widget_get_rules_tree_tools(); // pilot_box.c
|
|||
void *widget_get_rules_use(); // freq.c
|
||||
|
||||
|
||||
// call: widget / rules / selected / dispatch.c / widget_get_single_selected_rule_pane()
|
||||
// call: widget / rules / selected / dispatch.c / widget_get_rules_selected_pane()
|
||||
// def: widget / rules / selected / dispatch.c
|
||||
// def: widget / rules / selected / edit.c
|
||||
// def: widget / rules / selected / enquire.c
|
||||
|
@ -202,7 +202,7 @@ void *widget_get_btt_assignations_list();
|
|||
void *widget_get_btt_rule_identity();
|
||||
|
||||
// def: widget / rules / selected / wip_menu.c
|
||||
GtkEntry widget_set_item_text (GtkWidget *list_box, const char *text, bool editable);
|
||||
GtkEntry widget_set_one_item_text_in_list (GtkWidget *list_box, const char *text);
|
||||
|
||||
/******************************************************************************/
|
||||
/* D A T A */
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
static void
|
||||
setup_listitem_cb (GtkListItemFactory *factory,
|
||||
GtkListItem *list_item)
|
||||
|
@ -81,8 +79,6 @@ activate_cb (GtkListView *list,
|
|||
g_app_info_launch (app_info, NULL, NULL, NULL);
|
||||
g_object_unref (app_info);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
static void
|
||||
|
|
16
src/signal.c
16
src/signal.c
|
@ -453,19 +453,3 @@ void on_measure_third_event_occurences_in_between (GtkWidget *btt, gpointer data
|
|||
GTK_WIDGET (widget_measure_third_event_occurences_in_between()));
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* R U L E S */
|
||||
/******************************************************************************/
|
||||
|
||||
void on_entry_name_insert_after (GtkWidget *entry, gpointer data)
|
||||
{
|
||||
printf("on_entry_name_insert_after(.)\n");
|
||||
}
|
||||
|
||||
void on_entry_name_delete_after (GtkWidget *entry, gpointer data)
|
||||
{
|
||||
printf("on_entry_name_delete_after(.)\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,14 +34,14 @@
|
|||
|
||||
void *widget_get_rules_page()
|
||||
{
|
||||
GtkPaned *tree_vs_selected_one = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
|
||||
gtk_paned_set_start_child (tree_vs_selected_one, GTK_WIDGET (widget_get_rules_tree_tools_pane()));
|
||||
gtk_paned_set_end_child (tree_vs_selected_one, GTK_WIDGET (widget_get_single_selected_rule_pane()));
|
||||
gtk_paned_set_position (tree_vs_selected_one, 340); // WARNING : c'est une position "absolue"
|
||||
gtk_paned_set_wide_handle (tree_vs_selected_one, TRUE);
|
||||
gtk_paned_set_shrink_start_child (tree_vs_selected_one, FALSE);
|
||||
gtk_paned_set_shrink_end_child (tree_vs_selected_one, FALSE);
|
||||
GtkPaned *tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL));
|
||||
gtk_paned_set_start_child (tree_vs_selected, GTK_WIDGET (widget_get_rules_tree_tools_pane()));
|
||||
gtk_paned_set_end_child (tree_vs_selected, GTK_WIDGET (widget_get_rules_selected_pane()));
|
||||
gtk_paned_set_position (tree_vs_selected, 340); // WARNING : c'est une position "absolue"
|
||||
gtk_paned_set_wide_handle (tree_vs_selected, TRUE);
|
||||
gtk_paned_set_shrink_start_child (tree_vs_selected, FALSE);
|
||||
gtk_paned_set_shrink_end_child (tree_vs_selected, FALSE);
|
||||
|
||||
return GTK_WIDGET (tree_vs_selected_one);
|
||||
return GTK_WIDGET (tree_vs_selected);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#include "../../../../include/signal.h"
|
||||
|
||||
|
||||
void *widget_get_selected_rule()
|
||||
{
|
||||
void *widget_get_selected_rule() {
|
||||
|
||||
GtkBox *images_and_texts = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||
gtk_box_append (images_and_texts, GTK_WIDGET (widget_get_selected_rule_geometry ()));
|
||||
gtk_box_append (images_and_texts, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
|
||||
|
@ -42,7 +42,7 @@ void *widget_get_selected_rule()
|
|||
return GTK_WIDGET (images_and_texts);
|
||||
}
|
||||
|
||||
void *widget_get_single_selected_rule_pane()
|
||||
void *widget_get_rules_selected_pane()
|
||||
{
|
||||
GtkPaned *rule_itself_vs_explore_edit_pane = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_VERTICAL));
|
||||
gtk_paned_set_start_child (rule_itself_vs_explore_edit_pane, GTK_WIDGET (widget_get_selected_rule()));
|
||||
|
@ -59,4 +59,3 @@ void *widget_get_single_selected_rule_pane()
|
|||
}
|
||||
|
||||
|
||||
|
|
@ -36,30 +36,11 @@
|
|||
#define LIST_W 190
|
||||
#define LIST_H 114
|
||||
|
||||
|
||||
static void widget_let_us_play_with_events (GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_icon_from_icon_name (entry, 0, "text-editor-symbolic");
|
||||
gtk_entry_set_icon_activatable (entry, GTK_ENTRY_ICON_PRIMARY, TRUE);
|
||||
// https://docs.gtk.org/gtk4/input-handling.html
|
||||
// https://docs.gtk.org/gdk4/enum.EventType.html
|
||||
// https://docs.gtk.org/gtk4/method.IMContext.filter_keypress.html
|
||||
// g_signal_connect (entry, "clicked", G_CALLBACK (on_clicked_topbar_right_home), NULL);
|
||||
g_signal_connect_after( entry, "insert-text", G_CALLBACK (on_entry_name_insert_after), NULL );
|
||||
g_signal_connect_after( entry, "delete-text", G_CALLBACK (on_entry_name_delete_after), NULL );
|
||||
// icon_press (entry, GTK_ENTRY_ICON_PRIMARY, NULL);
|
||||
}
|
||||
|
||||
GtkEntry widget_set_item_text (GtkWidget *list_box,
|
||||
const char *text,
|
||||
bool editable)
|
||||
GtkEntry widget_set_one_item_text_in_list (GtkWidget *list_box, const char *text)
|
||||
{
|
||||
int text_length = 40;
|
||||
GtkEntryBuffer *entry_buffer = gtk_entry_buffer_new (text, text_length);
|
||||
GtkEntry *entry = GTK_ENTRY (gtk_entry_new ());
|
||||
gtk_entry_set_overwrite_mode (entry, editable);
|
||||
if (! editable) widget_let_us_play_with_events (entry);
|
||||
gtk_entry_get_buffer (entry);
|
||||
gtk_entry_set_buffer (GTK_ENTRY (entry), GTK_ENTRY_BUFFER (entry_buffer));
|
||||
gtk_list_box_append (GTK_LIST_BOX (list_box), GTK_WIDGET (entry));
|
||||
return *entry;
|
||||
|
@ -70,7 +51,7 @@ void *widget_get_btt_conditions_list()
|
|||
GtkWidget *list_box = gtk_list_box_new();
|
||||
GtkWidget *scrolled_list_box = GTK_WIDGET (gtk_scrolled_window_new ());
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_list_box), list_box);
|
||||
gtk_widget_set_size_request (GTK_WIDGET (scrolled_list_box), LIST_W, LIST_H);
|
||||
gtk_widget_set_size_request (GTK_WIDGET (scrolled_list_box), LIST_W, LIST_H); // OK (provisoire)
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
|
@ -80,7 +61,7 @@ void *widget_get_btt_conditions_list()
|
|||
char str4[5]; sprintf(str4, "%d, ", rand() % 10); strcat(str1, str4);
|
||||
char str5[8]; sprintf(str5, "%d) == ", rand() % 10); strcat(str1, str5);
|
||||
char str6[5]; sprintf(str6, "%d)", rand() % 10); strcat(str1, str6);
|
||||
widget_set_item_text (list_box, str1, TRUE);
|
||||
widget_set_one_item_text_in_list (list_box, str1);
|
||||
}
|
||||
GtkWidget *pop = gtk_popover_new ();
|
||||
gtk_popover_set_child (GTK_POPOVER (pop), scrolled_list_box);
|
||||
|
@ -101,7 +82,7 @@ void *widget_get_btt_assignations_list()
|
|||
GtkWidget *list_box = gtk_list_box_new();
|
||||
GtkWidget *scrolled_list_box = GTK_WIDGET (gtk_scrolled_window_new ());
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_list_box), list_box);
|
||||
gtk_widget_set_size_request (GTK_WIDGET (scrolled_list_box), LIST_W, LIST_H);
|
||||
gtk_widget_set_size_request (GTK_WIDGET (scrolled_list_box), LIST_W, LIST_H); // OK (provisoire)
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
|
@ -111,7 +92,7 @@ void *widget_get_btt_assignations_list()
|
|||
char str4[5]; sprintf(str4, "%d, ", rand() % 10); strcat(str1, str4);
|
||||
char str5[8]; sprintf(str5, "%d) = ", rand() % 10); strcat(str1, str5);
|
||||
char str6[5]; sprintf(str6, "%d", rand() % 10); strcat(str1, str6);
|
||||
widget_set_item_text (list_box, str1, TRUE);
|
||||
widget_set_one_item_text_in_list (list_box, str1);
|
||||
}
|
||||
GtkWidget *pop = gtk_popover_new ();
|
||||
gtk_popover_set_child (GTK_POPOVER (pop), scrolled_list_box);
|
||||
|
@ -129,22 +110,15 @@ void *widget_get_btt_assignations_list()
|
|||
|
||||
void *widget_get_btt_rule_identity()
|
||||
{
|
||||
GtkWidget *list_box = gtk_list_box_new();
|
||||
GtkWidget *scrolled_list_box = GTK_WIDGET (gtk_scrolled_window_new ());
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_list_box), list_box);
|
||||
gtk_widget_set_size_request (GTK_WIDGET (scrolled_list_box), LIST_W + 100, LIST_H);
|
||||
|
||||
widget_set_item_text (list_box, "AMP > ADP", TRUE);
|
||||
widget_set_item_text (list_box, " > AMP-activated protein kinase", FALSE);
|
||||
widget_set_item_text (list_box, "date", TRUE);
|
||||
widget_set_item_text (list_box, "author", TRUE);
|
||||
widget_set_item_text (list_box, "status", TRUE);
|
||||
widget_set_item_text (list_box, "activity", TRUE);
|
||||
widget_set_item_text (list_box, "group", TRUE);
|
||||
widget_set_item_text (list_box, "last edition date", TRUE);
|
||||
GtkWidget* list_box = gtk_list_box_new();
|
||||
GtkWidget *label_A = GTK_WIDGET (gtk_label_new("AMP > ADP")); gtk_list_box_append (GTK_LIST_BOX (list_box), label_A);
|
||||
GtkWidget *label_B = GTK_WIDGET (gtk_label_new("AMP-activated protein kinase")); gtk_list_box_append (GTK_LIST_BOX (list_box), label_B);
|
||||
GtkWidget *label_C = GTK_WIDGET (gtk_label_new("date")); gtk_list_box_append (GTK_LIST_BOX (list_box), label_C);
|
||||
GtkWidget *label_D = GTK_WIDGET (gtk_label_new("author")); gtk_list_box_append (GTK_LIST_BOX (list_box), label_D);
|
||||
GtkWidget *label_E = GTK_WIDGET (gtk_label_new("status, activity")); gtk_list_box_append (GTK_LIST_BOX (list_box), label_E);
|
||||
|
||||
GtkWidget *pop = gtk_popover_new ();
|
||||
gtk_popover_set_child (GTK_POPOVER (pop), scrolled_list_box);
|
||||
gtk_popover_set_child (GTK_POPOVER (pop), list_box);
|
||||
gtk_popover_present (GTK_POPOVER (pop));
|
||||
gtk_popover_set_autohide (GTK_POPOVER (pop), FALSE);
|
||||
gtk_popover_set_cascade_popdown (GTK_POPOVER (pop), TRUE);
|
||||
|
@ -153,6 +127,7 @@ void *widget_get_btt_rule_identity()
|
|||
gtk_menu_button_set_label (GTK_MENU_BUTTON (identity), "identity");
|
||||
gtk_menu_button_set_always_show_arrow (identity, TRUE);
|
||||
gtk_menu_button_set_popover (identity, GTK_WIDGET (pop));
|
||||
// gtk_widget_set_halign (GTK_WIDGET (identity), GTK_ALIGN_START);
|
||||
|
||||
return identity;
|
||||
}
|
|
@ -85,7 +85,7 @@ static void display_widgets_at_the_right_side (GtkWidget *header_bar)
|
|||
// https://stackoverflow.com/questions/69135934/creating-a-simple-menubar-menu-and-menu-item-in-c-using-gtk4
|
||||
|
||||
|
||||
//static void callback_aa () {puts("callback_aa() > menu item A clicked.\n");}
|
||||
static void callback_aa () {puts("callback_aa() > menu item A clicked.\n");}
|
||||
static void action_a (GSimpleAction *action, GVariant *parameter, gpointer app) {puts("menu item A clicked.\n");}
|
||||
static void connect(GApplication *app, gpointer *data) { puts("Connect menu item clicked.\n"); }
|
||||
|
||||
|
@ -94,7 +94,7 @@ void window_design_topbar_right (GtkWidget *header_bar, GtkApplication *app)
|
|||
display_widgets_at_the_right_side (header_bar);
|
||||
|
||||
GSimpleActionGroup *ga = g_simple_action_group_new ();
|
||||
// GtkShortcutAction *aa = gtk_named_action_new ("aa");
|
||||
GtkShortcutAction *aa = gtk_named_action_new ("aa");
|
||||
gtk_widget_insert_action_group (btt_A, "aa", G_ACTION_GROUP (ga)); // GActionGroup* group
|
||||
// GtkShortcutAction *act_aa = gtk_callback_action_new (callback_aa, NULL, NULL);
|
||||
|
||||
|
@ -140,4 +140,3 @@ void window_design_topbar_right (GtkWidget *header_bar, GtkApplication *app)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue