65extern G_MODULE_EXPORT
void update_axis (GtkComboBox * widg, gpointer data);
68extern G_MODULE_EXPORT
void choose_set (GtkComboBox *
box, gpointer data);
95 str = g_strdup_printf (
"%s - %s",
prepare_for_title(this_proj -> name), this_curve -> name);
98 CurveExtra * ctmp = this_curve -> extrac -> first;
99 for ( i=0 ; i < this_curve -> extrac -> extras ; i++ )
105 str = g_strdup_printf (
"%s - %s",
prepare_for_title(extra_proj -> name), extra_proj -> analysis[o] -> curves[p] -> name);
108 if (ctmp -> next != NULL) ctmp = ctmp -> next;
110 if (this_curve -> extrac -> extras > 0)
118 gtk_widget_set_size_request (cedit -> setcolorbox, -1, 30);
120 g_signal_connect (G_OBJECT(cedit -> setcolorbox),
"changed", G_CALLBACK(
choose_set), data);
133void set_set (
int a,
int b,
int c, gpointer data)
139 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, cedit -> thesetbox, cedit -> setcolorbox, FALSE, FALSE, 0);
144 choose_set (GTK_COMBO_BOX(cedit -> setcolorbox), data);
160static void fill_proj_model (
curve_edition * cedit, GtkTreeStore * store, gpointer data)
162 GtkTreeIter projlevel;
163 GtkTreeIter calclevel;
164 GtkTreeIter curvelevel;
168 int pid = ((
tint *)data) -> a;
169 int rid = ((
tint *)data) -> b;
170 int cid = ((
tint *)data) ->
c;
173 if (cedit -> ppath != NULL) g_free (cedit -> ppath);
174 if (cedit -> cpath != NULL) g_free (cedit -> cpath);
175 cedit -> ppath = g_malloc0(
nprojects*
sizeof*cedit -> ppath);
176 cedit -> cpath = g_malloc0(
nprojects*
sizeof*cedit -> cpath);
182 gtk_tree_store_append (store, & projlevel, NULL);
183 gtk_tree_store_set (store, & projlevel, 0, 0, 1,
prepare_for_title(this_proj -> name), 2, TRUE, 3, -1, -1);
184 cedit -> ppath[
i] = gtk_tree_model_get_path ((GtkTreeModel *)store, & projlevel);
185 for (j=0;
j<the_proj -> analysis[rid] -> c_sets;
j++)
187 k = the_proj -> analysis[rid] -> compat_id[
j];
188 if (this_proj -> analysis[k] -> calc_ok)
190 gtk_tree_store_append (store, & calclevel, & projlevel);
191 gtk_tree_store_set (store, & calclevel, 0, 0, 1,
graph_name[k], 2, TRUE, 3, -1, -1);
194 cedit -> cpath[
i] = gtk_tree_model_get_path ((GtkTreeModel *)store, & calclevel);
196 for (l = 0 ;
l < this_proj -> analysis[
k] -> numc ;
l++)
199 if (i != pid && this_proj -> analysis[k] -> curves[l] -> ndata != 0)
203 else if (((i != pid) || (k != rid || l != cid)) && this_proj -> analysis[k] -> curves[l] -> ndata != 0)
213 if (cid < the_proj -> skt_sets && l > this_proj -> skt_sets-1)
217 else if (cid > the_proj -> skt_sets-1 && l < this_proj -> skt_sets)
225 gtk_tree_store_append (store, & curvelevel, & calclevel);
226 gtk_tree_store_set (store, & curvelevel,
228 1, this_proj -> analysis[k] -> curves[l] -> name,
251G_MODULE_EXPORT
void toggle_curve (GtkCellRendererToggle * cell_renderer, gchar * string_path, gpointer data)
256 GtkTreePath *
path = gtk_tree_path_new_from_string (string_path);
257 gtk_tree_model_get_iter (GTK_TREE_MODEL(
projmodel), & iter,
path);
258 gtk_tree_model_get (GTK_TREE_MODEL(
projmodel), & iter, 2, &
status, 3, & i, 4, & j, 5, & k, -1);
277 gtk_tree_model_get (mod, iter, 0, & m, -1);
278 gtk_cell_renderer_set_visible (renderer, m);
292 GtkTreeViewColumn * projcol[6];
293 GtkCellRenderer * projcell[6];
294 gchar * col_title[6] = {
" ",
i18n(
"Data sets"),
i18n(
"Select"),
" ",
" ",
" "};
295 gchar * ctype[6]={
"text",
"text",
"active",
"text",
"text",
"text"};
296 GType
col_type[6] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT};
298 cedit -> projtree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(
projmodel));
303 projcell[i] = gtk_cell_renderer_toggle_new ();
304 projcol[i] = gtk_tree_view_column_new_with_attributes(_(col_title[i]), projcell[i], ctype[i], i, NULL);
305 g_signal_connect (G_OBJECT(projcell[i]),
"toggled", G_CALLBACK(
toggle_curve), data);
310 projcell[i] = gtk_cell_renderer_text_new();
311 projcol[i] = gtk_tree_view_column_new_with_attributes(_(col_title[i]), projcell[i], ctype[i], i, NULL);
313 gtk_tree_view_append_column(GTK_TREE_VIEW(cedit -> projtree), projcol[i]);
314 if (i == 0 || i > 2) gtk_tree_view_column_set_visible (projcol[i], FALSE);
316 fill_proj_model (cedit,
projmodel, data);
318 gtk_tree_view_expand_all (GTK_TREE_VIEW(cedit -> projtree));
319 return cedit -> projtree;
331G_MODULE_EXPORT
void run_curve_edit (GtkDialog * dial, gint response_id, gpointer data)
353 GtkWidget * scrollsets;
359 this_curve -> curve_edit = g_malloc0(
sizeof*this_curve -> curve_edit);
362 this_cedit -> win =
dialogmodal (_(
"Edit curve"), GTK_WINDOW(this_curve -> window));
363 gtk_window_set_resizable (GTK_WINDOW (this_cedit -> win), FALSE);
365 gtk_window_set_icon (GTK_WINDOW (this_cedit -> win),
THETD);
368 enoote = gtk_notebook_new ();
372 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_1 (this_cedit, data), gtk_label_new (_(
"Graph")));
376 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_2 (this_cedit, data), gtk_label_new (_(
"Data")));
380 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_3 (this_cedit, data), gtk_label_new (_(
"Legend")));
384 gtk_notebook_append_page (GTK_NOTEBOOK(enoote),
create_tab_4 (this_cedit, data), gtk_label_new (_(
"Axis")));
389 add_box_child_start (GTK_ORIENTATION_VERTICAL, dbox,
markup_label(_(
"<b>Add data set(s) to the active window</b>"), -1, 30, 0.5, 0.5), FALSE, FALSE, 0);
390 scrollsets =
create_scroll (dbox, 250, 525, GTK_SHADOW_ETCHED_IN);
392 gtk_notebook_append_page (GTK_NOTEBOOK(enoote), dbox, gtk_label_new (_(
"Add data set")));
397 g_signal_connect (G_OBJECT(this_cedit -> win),
"response", G_CALLBACK(
run_curve_edit), data);
Callback declarations for main window.
G_MODULE_EXPORT void update_axis(GtkComboBox *widg, gpointer data)
change the axis
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)
void prepbox(gpointer data)
prepare the curve selection combo box
G_MODULE_EXPORT void run_curve_edit(GtkDialog *dial, gint response_id, gpointer data)
curve edition dialog callback
void set_visible_curve_data(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
show / hide cell renderer
GtkWidget * create_tab_4(curve_edition *cedit, gpointer data)
handle the creation of the 4th tab of the curve edition dialog
void edit_curve(gpointer data)
create the curve edition dialog
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_projects_tree(curve_edition *cedit, gpointer data)
curve edition create the project(s) / curves tree model
G_MODULE_EXPORT void toggle_curve(GtkCellRendererToggle *cell_renderer, gchar *string_path, gpointer data)
show / hide curve cellrenderer toggle callback
GtkWidget * create_tab_3(curve_edition *cedit, gpointer data)
handle the creation of the 3rd tab of the curve edition dialog
GtkWidget * create_tab_2(curve_edition *cedit, gpointer data)
handle the creation of the 2nd tab of the curve edition dialog
GtkWidget * create_tab_1(curve_edition *cedit, gpointer data)
handle the creation of the 1st tab of the curve edition dialog
void action_to_plot(gpointer data)
add to plot, or, remove curve from plot
void set_set(int a, int b, int c, gpointer data)
addjust widgets to handle the new curve
Curve * get_curve_from_pointer(gpointer data)
get Curve pointer from pointer
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.
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
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)
create a GtkLabel with pango markup
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
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.
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.
double precision, dimension(98), parameter c
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