57G_MODULE_EXPORT
void turn_rebuild_on (GtkCheckButton * but, gpointer data)
73 i = gtk_check_button_get_active (but);
76 i = gtk_toggle_button_get_active (but);
78 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)
get_project_by_id(dat ->
a) -> modelgl -> rbuild[i], i);
91G_MODULE_EXPORT
void turn_bonding_on (GtkCheckButton * but, gpointer data)
107 i = gtk_check_button_get_active (but);
109 i = gtk_toggle_button_get_active (but);
111 asearch -> recompute_bonding = i;
124 gchar * appl[5] = {
" Move atom(s)",
" Replace atom(s)",
" Remove atom(s)",
" Insert atom(s)",
" Move atom(s)"};
132 i = (this_proj -> modelgl -> search_widg[aid+1] != NULL) ? this_proj -> modelgl -> search_widg[aid+1] -> in_selection : 0;
136 i = this_proj -> nspec;
140 i = this_proj -> modelgl -> search_widg[aid+1] -> todo_size;
143 if (aid == 1 || aid == 5)
145 int j = (aid == 1) ? 0 : 1;
148 this_proj -> modelgl -> atom_win -> edition_but[j] =
check_button(
"Extract/rebuild the object(s) to be moved, ie. cut/clean bonds with nearest neighbor(s)",
149 -1, 25, this_proj -> modelgl -> rebuild[0][j], G_CALLBACK(
turn_rebuild_on), & this_proj -> modelgl ->
colorp[0][j]);
150 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, this_proj -> modelgl -> atom_win -> edition_but[j], FALSE, FALSE, 50);
152 if (aid == 1 || aid == 3 || aid == 5)
156 widg =
check_button(
"Recompute bonding information using bond cutoff(s)",
157 -1, 25, this_proj -> modelgl -> search_widg[aid+1] -> recompute_bonding, G_CALLBACK(
turn_bonding_on), this_proj -> modelgl -> search_widg[aid+1]);
161 if (aid > 1 && aid < 6)
168 layout_add_widget (lay,
spin_button (G_CALLBACK(
repeat_move), 1, 1, 1000, 1, 0, 100, this_proj), 275, 20);
190 i = gtk_combo_box_get_active (box);
191 this_proj -> modelgl -> search_widg[
id ->
c] ->
status = i;
196 gtk_combo_box_set_active (GTK_COMBO_BOX(this_proj -> modelgl -> atom_win -> axis_combo[j]), this_proj -> modelgl -> atom_win ->
axis[j]);
199 gtk_range_set_value (GTK_RANGE(this_proj -> modelgl -> atom_win -> edit_scale[k]), this_proj -> modelgl -> atom_win -> new_param[i][j][k]);
219 if (
id == 3 ||
id == 5)
222 combo = gtk_combo_box_new_with_model (
model);
223 g_object_unref (
model);
224 GtkCellRenderer * renderer = gtk_cell_renderer_combo_new ();
225 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
226 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"text", 0, NULL);
227 g_signal_connect (G_OBJECT(combo),
"changed", G_CALLBACK(
set_atoms_to_insert), & this_proj -> modelgl -> search_widg[
id+2] -> pointer[0]);
228 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), 0);
229 GList * cell_list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(combo));
230 if(cell_list && cell_list -> data)
232 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), cell_list -> data,
"markup", 0, NULL);
234 set_atoms_to_insert (GTK_COMBO_BOX(combo), & this_proj -> modelgl -> search_widg[
id+2] -> pointer[0]);
241 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), this_proj -> modelgl -> search_widg[
id+2] ->
status);
242 g_signal_connect (G_OBJECT (combo),
"changed", G_CALLBACK(
set_atoms_for_action), & this_proj -> modelgl -> search_widg[
id+2] -> pointer[0]);
263 if (i != dat ->
c - 1)
265 if (gtk_expander_get_expanded (GTK_EXPANDER (this_proj -> modelgl -> atom_win -> at_expand[i])))
267 gtk_expander_set_expanded (GTK_EXPANDER (this_proj -> modelgl -> atom_win -> at_expand[i]), FALSE);
283 gchar *
action[7] = {
"moved",
"replaced",
"removed",
"inserted",
"moved randomly",
" ",
"passivated"};
285 atom_search * asearch = this_proj -> modelgl -> search_widg[aid+2];
291 gchar * str = g_strdup_printf (
"<u>Select the object(s) to be %s in:</u> ",
action[aid]);
294 this_proj -> modelgl -> atom_win -> atom_combo[aid] =
create_action_combo (aid, this_proj);
295 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, this_proj -> modelgl -> atom_win -> atom_combo[aid], FALSE, FALSE, 20);
301 gchar * exp_name[3] = {
"<b>Atom selection:</b>",
"<b>Translate:</b>",
"<b>Rotate:</b>"};
305 this_proj -> modelgl -> atom_win -> at_expand[i] =
create_expander (exp_name[i], NULL);
306 add_box_child_start (GTK_ORIENTATION_VERTICAL, sbox, this_proj -> modelgl -> atom_win -> at_expand[i], TRUE, TRUE, 10);
310 gtk_expander_set_expanded (GTK_EXPANDER(this_proj -> modelgl -> atom_win -> at_expand[i]), TRUE);
315 gtk_expander_set_expanded (GTK_EXPANDER(this_proj -> modelgl -> atom_win -> at_expand[i]), FALSE);
316 if (i == 2)
widget_set_sensitive (this_proj -> modelgl -> atom_win -> at_expand[2], asearch ->
object);
319 g_signal_connect (G_OBJECT(this_proj -> modelgl -> atom_win -> at_expand[i]),
"activate", G_CALLBACK(
expanding_atoms), & asearch -> pointer[0]);
329 gtk_combo_box_set_active (GTK_COMBO_BOX(asearch -> mode_box), 0);
330 g_signal_connect (G_OBJECT (asearch -> mode_box),
"changed", G_CALLBACK(
set_search_mode), asearch);
334 gchar * type_of[2]={
"Replace: ",
"Remove: "};
336 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, box, asearch -> mode_box, FALSE, FALSE, 5);
341 if (! aid || aid == 4)
G_MODULE_EXPORT void take_action(GtkButton *but, gpointer data)
take edition action
G_MODULE_EXPORT void set_reset_transformation(GtkToggleButton *but, gpointer data)
reset model transformation toggle callback GTK3
Function declarations for the mode edition window.
GtkTreeModel * replace_combo_tree(gboolean insert, int proj)
replace combo box in the tree view
GtkWidget * selection_tab(atom_search *asearch, int nats)
create the search widget
G_MODULE_EXPORT void repeat_move(GtkSpinButton *res, gpointer data)
repeat motion callback
void update_search_tree(atom_search *asearch)
update search tree
GtkWidget * add_motion_interaction(atom_search *asearch, int axd, project *this_proj)
add motion interaction widgets
G_MODULE_EXPORT void set_atoms_to_insert(GtkComboBox *box, gpointer data)
change the object to insert
void clean_picked_and_labelled(atom_search *asearch, gboolean clean_msd)
initialize atom search data buffers
void update_range_and_entry(project *this_proj, int i, int j, int k)
update motion range
G_MODULE_EXPORT void set_search_mode(GtkComboBox *box, gpointer data)
change search mode
G_MODULE_EXPORT void expanding_atoms(GtkWidget *exp, gpointer data)
expanding motion callback
GtkWidget * action_tab(int aid, project *this_proj)
create model edtion action tab
G_MODULE_EXPORT void set_atoms_for_action(GtkComboBox *box, gpointer data)
change selection status
GtkWidget * create_search_box(int aid, project *this_proj)
create the action search widget
G_MODULE_EXPORT void turn_rebuild_on(GtkToggleButton *but, gpointer data)
rebuild toggle callback GTK3
GtkWidget * create_action_combo(int id, project *this_proj)
create action combo box
G_MODULE_EXPORT void turn_bonding_on(GtkToggleButton *but, gpointer data)
update bonding toggle callback GTK3
void layout_add_widget(GtkWidget *layout, GtkWidget *child, int x_pos, int y_pos)
Add a GtkWidget in a GtkLayout.
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
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.
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * create_layout(int x, int y)
create a GtkLayout / GtkFixed widget
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
GtkWidget * create_expander(gchar *name, gchar *file_img)
create GtkExpander
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number