64extern G_MODULE_EXPORT
void set_data_aspect (GtkComboBox * box, gpointer data);
65extern G_MODULE_EXPORT
void update_axis (GtkComboBox * widg, gpointer data);
68extern G_MODULE_EXPORT
void choose_set (GtkComboBox * box, gpointer data);
79extern char *
ctext[2];
107 str = g_strdup_printf (
"%s - %s",
prepare_for_title(this_proj -> name), this_proj -> curves[l][m] -> name);
110 CurveExtra * ctmp = this_proj -> curves[l][m] -> extrac -> first;
111 for ( i=0 ; i < this_proj -> curves[l][m] -> extrac -> extras ; i++ )
117 str = g_strdup_printf (
"%s - %s",
prepare_for_title(extra_proj -> name), extra_proj -> curves[o][p] -> name);
120 if (ctmp -> next != NULL) ctmp = ctmp -> next;
122 if (this_proj -> curves[l][m] -> extrac -> extras > 0)
131 gtk_combo_box_set_active (GTK_COMBO_BOX (
setcolorbox), 0);
167static void fill_proj_model (GtkTreeStore * store)
169 GtkTreeIter projlevel;
170 GtkTreeIter calclevel;
171 GtkTreeIter curvelevel;
174 int start, end,
step;
185 gtk_tree_store_append (store, & projlevel, NULL);
186 gtk_tree_store_set (store, & projlevel, 0, 0, 1,
prepare_for_title(this_proj -> name), 2, TRUE, 3, -1, -1);
187 ppath[
i] = gtk_tree_model_get_path ((GtkTreeModel *)store, & projlevel);
208 if (this_proj -> initok[j])
210 gtk_tree_store_append (store, & calclevel, & projlevel);
211 gtk_tree_store_set (store, & calclevel, 0, 0, 1,
graph_name[j], 2, TRUE, 3, -1, -1);
214 cpath[
i] = gtk_tree_model_get_path ((GtkTreeModel *)store, & calclevel);
216 for (k = 0 ;
k < this_proj -> numc[
j] ;
k++)
219 if (i !=
activeg && this_proj -> curves[j][k] -> ndata != 0)
223 else if (((i !=
activeg) || (j !=
activer || k !=
activec)) && this_proj -> curves[j][k] -> ndata != 0)
229 gtk_tree_store_append (store, & curvelevel, & calclevel);
230 gtk_tree_store_set (store, & curvelevel,
232 1, this_proj -> curves[j][k] -> name,
255G_MODULE_EXPORT
void toggle_curve (GtkCellRendererToggle * cell_renderer, gchar * string_path, gpointer data)
260 GtkTreePath *
path = gtk_tree_path_new_from_string (string_path);
261 gtk_tree_model_get_iter (GTK_TREE_MODEL(
projmodel), & iter,
path);
262 gtk_tree_model_get (GTK_TREE_MODEL(
projmodel), & iter, 2, &
status, 3, & i, 4, & j, 5, & k, -1);
281 gtk_tree_model_get (mod, iter, 0, & m, -1);
282 gtk_cell_renderer_set_visible (renderer, m);
293 GtkTreeViewColumn * projcol[6];
294 GtkCellRenderer * projcell[6];
295 gchar * col_title[6] = {
" ",
"Data sets",
"Select",
" ",
" ",
" "};
296 gchar * ctype[6]={
"text",
"text",
"active",
"text",
"text",
"text"};
297 GType
col_type[6] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT};
304 projcell[i] = gtk_cell_renderer_toggle_new ();
305 projcol[i] = gtk_tree_view_column_new_with_attributes(col_title[i], projcell[i], ctype[i], i, NULL);
306 g_signal_connect (G_OBJECT(projcell[i]),
"toggled", G_CALLBACK(
toggle_curve), NULL);
311 projcell[i] = gtk_cell_renderer_text_new();
312 projcol[i] = gtk_tree_view_column_new_with_attributes(col_title[i], projcell[i], ctype[i], i, NULL);
314 gtk_tree_view_append_column(GTK_TREE_VIEW(
projtree), projcol[i]);
315 if (i == 0 || i > 2) gtk_tree_view_column_set_visible (projcol[i], FALSE);
319 gtk_tree_view_expand_all (GTK_TREE_VIEW(
projtree));
332G_MODULE_EXPORT
void run_curve_edit (GtkDialog * dial, gint response_id, gpointer data)
336 for (i=0 ; i<2; i++)
xyp[i] = NULL;
353 GtkWidget * scrollsets;
363 g_debug (
"CEDIT: a= %d, b= %d, c= %d",
a,
b,
c);
368 ctext[0] =
"x ∈ [0.0, 1.0]";
369 ctext[1] =
"y ∈ [0.0, 1.0]";
371 gtk_window_set_resizable (GTK_WINDOW (
edit_box), FALSE);
376 enoote = gtk_notebook_new ();
380 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_1 (data), gtk_label_new (
"Graph"));
384 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_2 (data), gtk_label_new (
"Data"));
388 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_3 (data), gtk_label_new (
"Legend"));
392 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_4 (data), gtk_label_new (
"Axis"));
398 scrollsets =
create_scroll (dbox, 250, 525, GTK_SHADOW_ETCHED_IN);
400 gtk_notebook_append_page (GTK_NOTEBOOK(enoote), dbox, gtk_label_new (
"Add data set"));
405 if (gtk_combo_box_get_active (GTK_COMBO_BOX(
data_aspect)))
Callback declarations for main window.
G_MODULE_EXPORT void update_axis(GtkComboBox *widg, gpointer data)
change the axis
GtkWidget * create_tab_2(gpointer data)
handle the creation of the 2nd tab of the curve edition dialog
G_MODULE_EXPORT void choose_set(GtkComboBox *box, gpointer data)
change the data set to customize
G_MODULE_EXPORT void set_data_aspect(GtkComboBox *box, gpointer data)
change data aspect (x/y or histogram bars)
G_MODULE_EXPORT void toggle_curve(GtkCellRendererToggle *cell_renderer, gchar *string_path, gpointer data)
show / hide curve cellrenderer toggle callback
G_MODULE_EXPORT void run_curve_edit(GtkDialog *dial, gint response_id, gpointer data)
curve edition dialog callback
GtkWidget * create_projects_tree()
curve edition create the project(s) / curves tree model
void set_visible_curve_data(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
show / hide cell renderer
GtkWidget * create_tab_1(gpointer data)
handle the creation of the 1st tab of the curve edition dialog
void edit_curve(gpointer data)
create the curve edition dialog
void set_set(int a, int b, int c)
addjust widgets to handle the new curve
gboolean was_not_added(ExtraSets *sets, int a, int b, int c)
test if already in the menu or not
GtkWidget * create_org_list(gpointer data)
create the data set organisation widget
GtkWidget * create_tab_4(gpointer data)
handle the creation of the 4th tab of the curve edition dialog
GtkWidget * create_tab_3(gpointer data)
handle the creation of the 3rd tab of the curve edition dialog
void action_to_plot(gpointer data)
add to plot, or, remove curve from plot
void prepbox(int k, int l, int m)
prepare the curve selection combo box
Variable declarations for the curve widget Functions for interactions with the curve widget.
GType col_type[MAXDATA][12]
GMainLoop * Event_loop[5]
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
G_MODULE_EXPORT gboolean destroy_this_window(GtkWidget *win, GdkEvent *event, gpointer data)
destroy a GtkWindow
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
char * graph_name[NGRAPHS]
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
gboolean append(atom_search *asearch, project *this_proj, int i, int j)
test if the atom 'i' of species 'j' must be added to the tree store or not