49extern G_MODULE_EXPORT
void window_bonds (GSimpleAction *
action, GVariant * parameter, gpointer data);
50extern G_MODULE_EXPORT
void window_cuts (GSimpleAction *
action, GVariant * parameter, gpointer data);
53extern G_MODULE_EXPORT
void window_bonds (GtkWidget * widg, gpointer data);
54extern G_MODULE_EXPORT
void window_cuts (GtkWidget * widg, gpointer data);
76 m = this_proj -> nspec;
81 str = g_strdup_printf (
"%s-%s [ %f Å ]", chem ->
label[i], chem ->
label[i], chem -> cutoffs[i][i]);
87 str = g_strdup_printf (
"%s-%s [ %f Å ]", chem ->
label[i], chem ->
label[i], view -> anim -> last ->
img -> bondrad[i][i]);
91 str = g_strdup_printf (
"%s-%s [ %f Å ]", chem ->
label[i], chem ->
label[i], view -> anim -> last ->
img -> bondrad[i+m][i+m]);
95 str = g_strdup_printf (
"%s-%s [ %f pts ]", chem ->
label[i], chem ->
label[i], view -> anim -> last ->
img -> linerad[i][i]);
99 str = g_strdup_printf (
"%s-%s [ %f pts ]", chem ->
label[i], chem ->
label[i], view -> anim -> last ->
img -> linerad[i+m][i+m]);
104 mot = g_strdup_printf (
"%s", str);
108 tmp = g_strdup_printf (
"%s",
mot);
110 mot = g_strdup_printf (
"%s\n%s", tmp, str);
116 for (i=0; i < m-1; i++)
118 for (j=i+1; j < m; j++)
122 str = g_strdup_printf (
"%s-%s [ %f Å ]", chem ->
label[i], chem ->
label[j], chem -> cutoffs[i][j]);
128 str = g_strdup_printf (
"%s-%s [ %f Å ]", chem ->
label[i], chem ->
label[j], view -> anim -> last ->
img -> bondrad[i][j]);
132 str = g_strdup_printf (
"%s-%s [ %f Å ]", chem ->
label[i], chem ->
label[j], view -> anim -> last ->
img -> bondrad[i+m][j+m]);
136 str = g_strdup_printf (
"%s-%s [ %f pts ]", chem ->
label[i], chem ->
label[j], view -> anim -> last ->
img -> linerad[i][j]);
140 str = g_strdup_printf (
"%s-%s [ %f pts ]", chem ->
label[i], chem ->
label[j], view -> anim -> last ->
img -> linerad[i+m][j+m]);
146 mot = g_strdup_printf (
"%s", str);
150 tmp = g_strdup_printf (
"%s",
mot);
152 mot = g_strdup_printf (
"%s\n%s", tmp, str);
161 str = g_strdup_printf (
"Total [ %f Å ]", chem -> grtotcutoff);
162 tmp = g_strdup_printf (
"%s",
mot);
164 mot = g_strdup_printf (
"%s\n%s", tmp, str);
180GtkWidget * create_bond_menu_item (gchar * str, GtkWidget * menu)
183 gtk_menu_shell_append ((GtkMenuShell *)menu,
layout);
197GtkWidget * create_bond_layout_widget (gchar * str, GtkWidget * widg,
int va,
tint * data)
199 GtkWidget * menu = gtk_menu_new ();
200 gtk_menu_item_set_submenu ((GtkMenuItem *)widg, menu);
202 gtk_menu_shell_append ((GtkMenuShell *)menu,
layout);
233 GtkWidget * menub = gtk_menu_new ();
234 i = view -> anim -> last ->
img -> style;
240 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", view -> anim -> last ->
img -> radall[0]);
244 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", view -> anim -> last ->
img -> radall[1]);
246 view -> ogl_bonds[8*at] = create_bond_menu_item (
"Radius", menub);
247 view -> ogl_bonds[1+8*at] = create_bond_layout_widget (str, view -> ogl_bonds[8*at], 0, & view ->
colorp[2+at][0]);
249 if (at == 1 && ! view -> anim -> last ->
img -> draw_clones)
258 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", view -> anim -> last ->
img -> radall[0]);
262 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", view -> anim -> last ->
img -> radall[1]);
264 widg = create_bond_menu_item (
"Cylinder Radius(ii)", menub);
265 widg = create_bond_layout_widget (str, widg, 0, & view ->
colorp[2+at][0]);
267 if (at == 1 && ! view -> anim -> last ->
img -> draw_clones)
276 view -> ogl_bonds[2+8*at] = create_bond_menu_item (
"Radius(ii)", menub);
277 view -> ogl_bonds[3+8*at] = create_bond_layout_widget (str, view -> ogl_bonds[2+8*at], 1, & view ->
colorp[at][0]);
279 if (at == 1 && ! view -> anim -> last ->
img -> draw_clones)
287 widg = create_bond_menu_item (
"Radius(ii)", menub);
288 widg = create_bond_layout_widget (str, widg, 1, & view ->
colorp[at][0]);
290 if (at == 1 && ! view -> anim -> last ->
img -> draw_clones)
299 view -> ogl_bonds[4+8*at] = create_bond_menu_item (
"Line Width(s)", menub);
300 view -> ogl_bonds[5+8*at] = create_bond_layout_widget (str, view -> ogl_bonds[4+8*at], 1, & view ->
colorp[at][1]);
302 if (at == 1 && ! view -> anim -> last ->
img -> draw_clones)
310 widg = create_bond_menu_item (
"Line Width(s)", menub);;
311 widg = create_bond_layout_widget (str, widg, 1, & view ->
colorp[at][1]);
313 if (at == 1 && ! view -> anim -> last ->
img -> draw_clones)
324 view -> ogl_bonds[6] = create_bond_menu_item (
"Cutoff(s)", menub);
325 view -> ogl_bonds[7] = create_bond_layout_widget (str, view -> ogl_bonds[6], 2, & view ->
colorp[at][0]);
329 widg = create_bond_menu_item (
"Cutoff(s)", menub);
330 widg = create_bond_layout_widget (str, widg, 2, & view ->
colorp[at][0]);
353 GMenu * menu = g_menu_new ();
354 append_opengl_item (view, menu, str, key, popm,
id, NULL,
IMG_NONE, NULL, FALSE, handler, data, FALSE, FALSE, FALSE, sensitive);
370 gboolean sensitive = (at == 1 && ! view -> anim -> last ->
img -> draw_clones) ? FALSE : TRUE;
371 GMenu * menu = g_menu_new ();
372 switch (view -> anim -> last ->
img -> style)
377 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", view -> anim -> last ->
img -> radall[0]);
381 str = g_strdup_printf (
"Cylinder(s) [ %f Å ]", view -> anim -> last ->
img -> radall[1]);
integer(kind=c_int) function chemistry()
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Global variable declarations Global convenience function declarations Global data structure defin...
void append_submenu(GMenu *menu, const gchar *label, GMenu *submenu)
append a GMenuItem with a subenu to a GMenu, and use markup for the GMenuItem
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
project * get_project_by_id(int p)
get project pointer using id number
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
Function declarations for the creation of the OpenGL window.
void append_opengl_item(glwin *view, GMenu *menu, const gchar *name, gchar *key, int mpop, int item_id, gchar *accel, int image_format, gpointer icon, gboolean custom, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, gboolean sensitive)
G_MODULE_EXPORT void window_cuts(GtkWidget *widg, gpointer data)
adjust bond cutoffs window callback GTK3
GMenu * create_bond_layout_section(glwin *view, gchar *str, gchar *key, int popm, int id, GCallback handler, gpointer data, gboolean sensitive)
create a bond menu item GTK4
GMenu * menu_bonds(glwin *view, int popm, int at)
create the 'Bond(s)' submenu GTK4
G_MODULE_EXPORT void set_bond_parameter(GtkWidget *widg, gpointer data)
update bond parameter callback - creating the dialog GTK3
gchar * label_cutrab(project *this_proj, glwin *view, int id)
prepare the text of a menu item in the 'Model -> Bond(s)' submenu
G_MODULE_EXPORT void window_bonds(GtkWidget *widg, gpointer data)
create bond(s) configuration window(s) callback GTK3