gamgi_gtk_atom_config.c (gamgi-all-0.17.4x) | : | gamgi_gtk_atom_config.c (gamgi-all-0.17.5x) | ||
---|---|---|---|---|
skipping to change at line 292 | skipping to change at line 292 | |||
GtkWidget *combo; | GtkWidget *combo; | |||
GtkWidget *entry; | GtkWidget *entry; | |||
double mass, radius; | double mass, radius; | |||
float red, green, blue; | float red, green, blue; | |||
int element, color = 0; | int element, color = 0; | |||
const char *name; | const char *name; | |||
int row; | int row; | |||
atom_class = gamgi_global_copy_atom (gamgi->atom); | atom_class = gamgi_global_copy_atom (gamgi->atom); | |||
/******************************************************************* | /********************************************************************** | |||
* get element,mass,radius,red,green,blue local element parameters * | * get Element default parameters: element,mass,radius,red,green,blue * | |||
*******************************************************************/ | **********************************************************************/ | |||
/*********** | /*********** | |||
* element * | * element * | |||
***********/ | ***********/ | |||
element = -1; | element = -1; | |||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_number"); | entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_number"); | |||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_check (name) == TRUE && | if (gamgi_io_token_check (name) == TRUE && | |||
gamgi_io_token_int_scan (name, &element, 0, GAMGI_CHEM_ATOM_MAX) == FALSE) | gamgi_io_token_int_scan (name, &element, 0, GAMGI_CHEM_ATOM_MAX) == FALSE) | |||
skipping to change at line 339 | skipping to change at line 339 | |||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_check (name) == TRUE && | if (gamgi_io_token_check (name) == TRUE && | |||
gamgi_io_token_double_scan (name, &radius, | gamgi_io_token_double_scan (name, &radius, | |||
GAMGI_MATH_TOLERANCE_LENGTH, DBL_MAX) == FALSE) | GAMGI_MATH_TOLERANCE_LENGTH, DBL_MAX) == FALSE) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid radius", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid radius", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
/*************** | /****************** | |||
* temperature * | * red,green,blue * | |||
***************/ | ******************/ | |||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_red"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | ||||
if (gamgi_io_token_check (name) == TRUE) | ||||
{ | ||||
color++; | ||||
if (gamgi_io_token_float_scan (name, &red, 0.0, 1.0) == FALSE) | ||||
{ | ||||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | ||||
gamgi_global_remove_atom (atom_class); | ||||
return; | ||||
} | ||||
} | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_green"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | ||||
if (gamgi_io_token_check (name) == TRUE) | ||||
{ | ||||
color++; | ||||
if (gamgi_io_token_float_scan (name, &green, 0.0, 1.0) == FALSE) | ||||
{ | ||||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | ||||
gamgi_global_remove_atom (atom_class); | ||||
return; | ||||
} | ||||
} | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_blue"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | ||||
if (gamgi_io_token_check (name) == TRUE) | ||||
{ | ||||
color++; | ||||
if (gamgi_io_token_float_scan (name, &blue, 0.0, 1.0) == FALSE) | ||||
{ | ||||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | ||||
gamgi_global_remove_atom (atom_class); | ||||
return; | ||||
} | ||||
} | ||||
/************************************************ | ||||
* get Analysis default parameters: temperature * | ||||
************************************************/ | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_temperature") ; | entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_temperature") ; | |||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_double_scan (name, &atom_class->temperature, 0.0, DBL_MAX) == FALSE) | if (gamgi_io_token_double_scan (name, &atom_class->temperature, 0.0, DBL_MAX) == FALSE) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid temperature", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid temperature", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
/************************* | /******************************************************** | |||
* style, size, variancy * | * get View default parameters: style,size,variancy,min * | |||
*************************/ | ********************************************************/ | |||
combo = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "combo_style"); | combo = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "combo_style"); | |||
row = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); | row = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); | |||
if (row == GAMGI_MESA_WIRED - 1) atom_class->draw = gamgi_mesa_atom_draw_cross; | if (row == GAMGI_MESA_WIRED - 1) atom_class->draw = gamgi_mesa_atom_draw_cross; | |||
if (row == GAMGI_MESA_SOLID - 1) atom_class->draw = gamgi_mesa_atom_draw_sphere; | if (row == GAMGI_MESA_SOLID - 1) atom_class->draw = gamgi_mesa_atom_draw_sphere; | |||
combo = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "combo_size"); | combo = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "combo_size"); | |||
entry = gtk_bin_get_child (GTK_BIN (combo)); | entry = gtk_bin_get_child (GTK_BIN (combo)); | |||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_float_scan (name, &atom_class->size, | if (gamgi_io_token_float_scan (name, &atom_class->size, | |||
skipping to change at line 383 | skipping to change at line 426 | |||
entry = gtk_bin_get_child (GTK_BIN (combo)); | entry = gtk_bin_get_child (GTK_BIN (combo)); | |||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_float_scan (name, &atom_class->variancy, | if (gamgi_io_token_float_scan (name, &atom_class->variancy, | |||
0.0, FLT_MAX) == FALSE) | 0.0, FLT_MAX) == FALSE) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid variancy", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid variancy", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
/************************************** | entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_min"); | |||
* slices, minimum radius, line width * | ||||
**************************************/ | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_slices"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_int_scan (name, &atom_class->slices, | if (gamgi_io_token_double_scan (name, &atom_class->min, | |||
GAMGI_MESA_ATOM_SLICES_MIN, GAMGI_MESA_ATOM_SLICES_MAX) == FALSE) | GAMGI_MATH_TOLERANCE_LENGTH, DBL_MAX) == FALSE) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid slices", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid minimum radius", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_min"); | /****************************************************************************** | |||
* get Global parameters: slices (for solid spheres), width (for wired lines) * | ||||
******************************************************************************/ | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_slices"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_double_scan (name, &atom_class->min, | if (gamgi_io_token_int_scan (name, &atom_class->slices, | |||
GAMGI_MATH_TOLERANCE_LENGTH, DBL_MAX) == FALSE) | GAMGI_MESA_ATOM_SLICES_MIN, GAMGI_MESA_ATOM_SLICES_MAX) == FALSE) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid minimum radius", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid slices", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_width"); | entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_width"); | |||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | name = gtk_entry_get_text (GTK_ENTRY (entry)); | |||
if (gamgi_io_token_int_scan (name, &atom_class->width, | if (gamgi_io_token_int_scan (name, &atom_class->width, | |||
GAMGI_MESA_ATOM_WIDTH_MIN, GAMGI_MESA_ATOM_WIDTH_MAX) == FALSE) | GAMGI_MESA_ATOM_WIDTH_MIN, GAMGI_MESA_ATOM_WIDTH_MAX) == FALSE) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid line width", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid line width", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
/****************** | ||||
* red,green,blue * | ||||
******************/ | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_red"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | ||||
if (gamgi_io_token_check (name) == TRUE) | ||||
{ | ||||
color++; | ||||
if (gamgi_io_token_float_scan (name, &red, 0.0, 1.0) == FALSE) | ||||
{ | ||||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | ||||
gamgi_global_remove_atom (atom_class); | ||||
return; | ||||
} | ||||
} | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_green"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | ||||
if (gamgi_io_token_check (name) == TRUE) | ||||
{ | ||||
color++; | ||||
if (gamgi_io_token_float_scan (name, &green, 0.0, 1.0) == FALSE) | ||||
{ | ||||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | ||||
gamgi_global_remove_atom (atom_class); | ||||
return; | ||||
} | ||||
} | ||||
entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_blue"); | ||||
name = gtk_entry_get_text (GTK_ENTRY (entry)); | ||||
if (gamgi_io_token_check (name) == TRUE) | ||||
{ | ||||
color++; | ||||
if (gamgi_io_token_float_scan (name, &blue, 0.0, 1.0) == FALSE) | ||||
{ | ||||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | ||||
gamgi_global_remove_atom (atom_class); | ||||
return; | ||||
} | ||||
} | ||||
/************************************************************* | /************************************************************* | |||
* red,green,blue are coupled parameters: define all or none * | * red,green,blue are coupled parameters: define all or none * | |||
*************************************************************/ | *************************************************************/ | |||
if (color == 1 || color == 2) | if (color == 1 || color == 2) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid color", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
skipping to change at line 493 | skipping to change at line 493 | |||
* element without properties * | * element without properties * | |||
******************************/ | ******************************/ | |||
if (element != -1 && (mass == -1.0 && radius == -1.0 && color == 0)) | if (element != -1 && (mass == -1.0 && radius == -1.0 && color == 0)) | |||
{ | { | |||
gamgi_gtk_dialog_message_create ("Error", "Invalid element data", window); | gamgi_gtk_dialog_message_create ("Error", "Invalid element data", window); | |||
gamgi_global_remove_atom (atom_class); | gamgi_global_remove_atom (atom_class); | |||
return; | return; | |||
} | } | |||
/************************************* | /************************************************ | |||
* set element properties: first we * | * set element properties, after validity tests * | |||
* must ensure that element is valid * | ************************************************/ | |||
*************************************/ | ||||
if (mass != -1.0) atom_class->mass[element] = mass; | if (mass != -1.0) atom_class->mass[element] = mass; | |||
if (radius != -1.0) atom_class->radius[element] = radius; | if (radius != -1.0) atom_class->radius[element] = radius; | |||
if (color == 3) | if (color == 3) | |||
{ | { | |||
atom_class->red[element] = red; | atom_class->red[element] = red; | |||
atom_class->green[element] = green; | atom_class->green[element] = green; | |||
atom_class->blue[element] = blue; | atom_class->blue[element] = blue; | |||
} | } | |||
skipping to change at line 770 | skipping to change at line 769 | |||
g_object_set_data (G_OBJECT (dialog), "entry_radius", entry); | g_object_set_data (G_OBJECT (dialog), "entry_radius", entry); | |||
gtk_widget_show (entry); | gtk_widget_show (entry); | |||
button = gtk_toggle_button_new_with_label ("List"); | button = gtk_toggle_button_new_with_label ("List"); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), button, FALSE, FALSE, 0); | gtk_box_pack_start (GTK_BOX (hbox_left_left), button, FALSE, FALSE, 0); | |||
g_signal_connect (button, "clicked", | g_signal_connect (button, "clicked", | |||
G_CALLBACK (gamgi_gtk_atom_property_radius), window); | G_CALLBACK (gamgi_gtk_atom_property_radius), window); | |||
g_object_set_data (G_OBJECT (dialog), "button_radius", button); | g_object_set_data (G_OBJECT (dialog), "button_radius", button); | |||
gtk_widget_show (button); | gtk_widget_show (button); | |||
/********* | ||||
* color * | ||||
*********/ | ||||
hbox_center = gtk_hbox_new (TRUE, 0); | ||||
gtk_box_pack_start (GTK_BOX (vbox_top), hbox_center, FALSE, FALSE, 0); | ||||
gtk_widget_show (hbox_center); | ||||
table = gtk_table_new (1, 7, FALSE); | ||||
gtk_box_pack_start (GTK_BOX (hbox_center), table, FALSE, FALSE, 0); | ||||
gtk_widget_show (table); | ||||
label = gtk_label_new ("Color"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 5, 0 | ||||
); | ||||
gtk_widget_show (label); | ||||
label = gtk_label_new ("R"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_widget_show (label); | ||||
label = gtk_label_new ("G"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 4, 5, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_widget_show (label); | ||||
label = gtk_label_new ("B"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 6, 7, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_widget_show (label); | ||||
entry = gtk_entry_new (); | ||||
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
g_object_set_data (G_OBJECT (dialog), "entry_red", entry); | ||||
gtk_widget_show (entry); | ||||
entry = gtk_entry_new (); | ||||
gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
g_object_set_data (G_OBJECT (dialog), "entry_green", entry); | ||||
gtk_widget_show (entry); | ||||
entry = gtk_entry_new (); | ||||
gtk_table_attach (GTK_TABLE (table), entry, 5, 6, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
g_object_set_data (G_OBJECT (dialog), "entry_blue", entry); | ||||
gtk_widget_show (entry); | ||||
/***************** | /***************** | |||
* Analysis page * | * Analysis page * | |||
*****************/ | *****************/ | |||
vbox_page = gtk_vbox_new (FALSE, 5); | vbox_page = gtk_vbox_new (FALSE, 5); | |||
label = gtk_label_new ("Analysis"); | label = gtk_label_new ("Analysis"); | |||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox_page, label); | gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox_page, label); | |||
gtk_container_set_border_width (GTK_CONTAINER (vbox_page), 10); | gtk_container_set_border_width (GTK_CONTAINER (vbox_page), 10); | |||
gtk_widget_show (vbox_page); | gtk_widget_show (vbox_page); | |||
skipping to change at line 821 | skipping to change at line 869 | |||
vbox_page = gtk_vbox_new (FALSE, 5); | vbox_page = gtk_vbox_new (FALSE, 5); | |||
label = gtk_label_new (" View "); | label = gtk_label_new (" View "); | |||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox_page, label); | gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox_page, label); | |||
gtk_container_set_border_width (GTK_CONTAINER (vbox_page), 10); | gtk_container_set_border_width (GTK_CONTAINER (vbox_page), 10); | |||
gtk_widget_show (vbox_page); | gtk_widget_show (vbox_page); | |||
vbox_center = gtk_vbox_new (TRUE, 0); | vbox_center = gtk_vbox_new (TRUE, 0); | |||
gtk_box_pack_start (GTK_BOX (vbox_page), vbox_center, TRUE, TRUE, 0); | gtk_box_pack_start (GTK_BOX (vbox_page), vbox_center, TRUE, TRUE, 0); | |||
gtk_widget_show (vbox_center); | gtk_widget_show (vbox_center); | |||
vbox_top = gtk_vbox_new (FALSE, 10); | ||||
gtk_box_pack_start (GTK_BOX (vbox_center), vbox_top, FALSE, FALSE, 0); | ||||
gtk_widget_show (vbox_top); | ||||
/******************** | ||||
* style, size, min * | ||||
********************/ | ||||
hbox_center = gtk_hbox_new (TRUE, 0); | hbox_center = gtk_hbox_new (TRUE, 0); | |||
gtk_box_pack_start (GTK_BOX (vbox_top), hbox_center, FALSE, FALSE, 0); | gtk_box_pack_start (GTK_BOX (vbox_center), hbox_center, FALSE, FALSE, 0); | |||
gtk_widget_show (hbox_center); | gtk_widget_show (hbox_center); | |||
hbox_left = gtk_hbox_new (FALSE, 10); | /*************** | |||
gtk_box_pack_start (GTK_BOX (hbox_center), hbox_left, FALSE, FALSE, 0); | * left column * | |||
gtk_widget_show (hbox_left); | ***************/ | |||
vbox_top = gtk_vbox_new (TRUE, 15); | ||||
gtk_box_pack_start (GTK_BOX (hbox_center), vbox_top, FALSE, FALSE, 0); | ||||
gtk_widget_show (vbox_top); | ||||
/********* | /********* | |||
* style * | * style * | |||
*********/ | *********/ | |||
hbox_left_left = gtk_hbox_new (FALSE, 5); | hbox_left = gtk_hbox_new (FALSE, 5); | |||
gtk_box_pack_start (GTK_BOX (hbox_left), hbox_left_left, FALSE, FALSE, 0); | gtk_box_pack_start (GTK_BOX (vbox_top), hbox_left, FALSE, FALSE, 0); | |||
gtk_widget_show (hbox_left_left); | gtk_widget_show (hbox_left); | |||
label = gtk_label_new ("Style"); | ||||
gtk_box_pack_start (GTK_BOX (hbox_left_left), label, FALSE, FALSE, 0); | ||||
gtk_widget_show (label); | ||||
combo = gtk_combo_box_new (); | combo = gtk_combo_box_new (); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), combo, FALSE, FALSE, 0); | gtk_box_pack_end (GTK_BOX (hbox_left), combo, FALSE, FALSE, 0); | |||
g_object_set_data (G_OBJECT (dialog), "combo_style", combo); | g_object_set_data (G_OBJECT (dialog), "combo_style", combo); | |||
gtk_widget_show (combo); | gtk_widget_show (combo); | |||
store = gtk_list_store_new (1, G_TYPE_STRING); | store = gtk_list_store_new (1, G_TYPE_STRING); | |||
gtk_list_store_append (store, &iter); | gtk_list_store_append (store, &iter); | |||
gtk_list_store_set (store, &iter, 0, "Wired", -1); | gtk_list_store_set (store, &iter, 0, "Wired", -1); | |||
gtk_list_store_append (store, &iter); | gtk_list_store_append (store, &iter); | |||
gtk_list_store_set (store, &iter, 0, "Solid", -1); | gtk_list_store_set (store, &iter, 0, "Solid", -1); | |||
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); | gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); | |||
g_object_unref (store); | g_object_unref (store); | |||
renderer = gtk_cell_renderer_text_new (); | renderer = gtk_cell_renderer_text_new (); | |||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE); | gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE); | |||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, "text", 0, NU LL); | gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, "text", 0, NU LL); | |||
/******** | label = gtk_label_new ("Style"); | |||
* size * | gtk_box_pack_end (GTK_BOX (hbox_left), label, FALSE, FALSE, 0); | |||
********/ | gtk_widget_show (label); | |||
hbox_left_left = gtk_hbox_new (FALSE, 5); | /************ | |||
gtk_box_pack_start (GTK_BOX (hbox_left), hbox_left_left, FALSE, FALSE, 0); | * variancy * | |||
gtk_widget_show (hbox_left_left); | ************/ | |||
label = gtk_label_new ("Size"); | hbox_left = gtk_hbox_new (FALSE, 5); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), label, FALSE, FALSE, 0); | gtk_box_pack_start (GTK_BOX (vbox_top), hbox_left, FALSE, FALSE, 0); | |||
g_object_set_data (G_OBJECT (dialog), "label_size", label); | gtk_widget_show (hbox_left); | |||
gtk_widget_show (label); | ||||
combo = gtk_combo_box_entry_new (); | combo = gtk_combo_box_entry_new (); | |||
gtk_box_pack_end (GTK_BOX (hbox_left_left), combo, FALSE, FALSE, 0); | gtk_box_pack_end (GTK_BOX (hbox_left), combo, FALSE, FALSE, 0); | |||
entry = gtk_bin_get_child (GTK_BIN (combo)); | entry = gtk_bin_get_child (GTK_BIN (combo)); | |||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | |||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | |||
g_object_set_data (G_OBJECT (dialog), "combo_size", combo); | g_object_set_data (G_OBJECT (dialog), "combo_variancy", combo); | |||
gtk_widget_show (combo); | gtk_widget_show (combo); | |||
store = gtk_list_store_new (1, G_TYPE_STRING); | store = gtk_list_store_new (1, G_TYPE_STRING); | |||
gtk_list_store_append (store, &iter); | gtk_list_store_append (store, &iter); | |||
sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 0.5); | sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 0.0); | |||
gtk_list_store_set (store, &iter, 0, token, -1); | ||||
gtk_list_store_append (store, &iter); | ||||
sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 0.8); | ||||
gtk_list_store_set (store, &iter, 0, token, -1); | gtk_list_store_set (store, &iter, 0, token, -1); | |||
gtk_list_store_append (store, &iter); | gtk_list_store_append (store, &iter); | |||
sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 1.0); | sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 1.0); | |||
gtk_list_store_set (store, &iter, 0, token, -1); | gtk_list_store_set (store, &iter, 0, token, -1); | |||
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); | gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); | |||
g_object_unref (store); | g_object_unref (store); | |||
gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0); | gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0); | |||
/***************** | label = gtk_label_new ("Variancy"); | |||
* variancy, min * | gtk_box_pack_end (GTK_BOX (hbox_left), label, FALSE, FALSE, 0); | |||
*****************/ | g_object_set_data (G_OBJECT (dialog), "label_variancy", label); | |||
gtk_widget_show (label); | ||||
hbox_center = gtk_hbox_new (TRUE, 0); | ||||
gtk_box_pack_start (GTK_BOX (vbox_top), hbox_center, FALSE, FALSE, 0); | ||||
gtk_widget_show (hbox_center); | ||||
hbox_left = gtk_hbox_new (FALSE, 15); | /**************** | |||
gtk_box_pack_start (GTK_BOX (hbox_center), hbox_left, FALSE, FALSE, 0); | * right column * | |||
gtk_widget_show (hbox_left); | ****************/ | |||
/************ | vbox_top = gtk_vbox_new (TRUE, 15); | |||
* variancy * | gtk_box_pack_start (GTK_BOX (hbox_center), vbox_top, FALSE, FALSE, 0); | |||
************/ | gtk_widget_show (vbox_top); | |||
hbox_left_left = gtk_hbox_new (FALSE, 5); | /******** | |||
gtk_box_pack_start (GTK_BOX (hbox_left), hbox_left_left, FALSE, FALSE, 0); | * size * | |||
gtk_widget_show (hbox_left_left); | ********/ | |||
label = gtk_label_new ("Variancy"); | hbox_left = gtk_hbox_new (FALSE, 5); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), label, FALSE, FALSE, 0); | gtk_box_pack_start (GTK_BOX (vbox_top), hbox_left, FALSE, FALSE, 0); | |||
g_object_set_data (G_OBJECT (dialog), "label_variancy", label); | gtk_widget_show (hbox_left); | |||
gtk_widget_show (label); | ||||
combo = gtk_combo_box_entry_new (); | combo = gtk_combo_box_entry_new (); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), combo, FALSE, FALSE, 0); | gtk_box_pack_end (GTK_BOX (hbox_left), combo, FALSE, FALSE, 0); | |||
entry = gtk_bin_get_child (GTK_BIN (combo)); | entry = gtk_bin_get_child (GTK_BIN (combo)); | |||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | |||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | |||
g_object_set_data (G_OBJECT (dialog), "combo_variancy", combo); | g_object_set_data (G_OBJECT (dialog), "combo_size", combo); | |||
gtk_widget_show (combo); | gtk_widget_show (combo); | |||
store = gtk_list_store_new (1, G_TYPE_STRING); | store = gtk_list_store_new (1, G_TYPE_STRING); | |||
gtk_list_store_append (store, &iter); | gtk_list_store_append (store, &iter); | |||
sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 0.0); | sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 0.5); | |||
gtk_list_store_set (store, &iter, 0, token, -1); | ||||
gtk_list_store_append (store, &iter); | ||||
sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 0.8); | ||||
gtk_list_store_set (store, &iter, 0, token, -1); | gtk_list_store_set (store, &iter, 0, token, -1); | |||
gtk_list_store_append (store, &iter); | gtk_list_store_append (store, &iter); | |||
sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 1.0); | sprintf (token, "%.*f", GAMGI_MATH_DECIMAL_SCALE, 1.0); | |||
gtk_list_store_set (store, &iter, 0, token, -1); | gtk_list_store_set (store, &iter, 0, token, -1); | |||
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); | gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store)); | |||
g_object_unref (store); | g_object_unref (store); | |||
gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0); | gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0); | |||
/*********************************** | label = gtk_label_new ("Size"); | |||
* minimum radius (H, by default) * | gtk_box_pack_end (GTK_BOX (hbox_left), label, FALSE, FALSE, 0); | |||
***********************************/ | g_object_set_data (G_OBJECT (dialog), "label_size", label); | |||
gtk_widget_show (label); | ||||
hbox_left_left = gtk_hbox_new (FALSE, 5); | /********************************** | |||
gtk_box_pack_start (GTK_BOX (hbox_left), hbox_left_left, FALSE, FALSE, 0); | * minimum radius (H, by default) * | |||
gtk_widget_show (hbox_left_left); | **********************************/ | |||
label = gtk_label_new ("Min"); | hbox_left = gtk_hbox_new (FALSE, 5); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), label, FALSE, FALSE, 0); | gtk_box_pack_start (GTK_BOX (vbox_top), hbox_left, FALSE, FALSE, 0); | |||
gtk_widget_show (label); | gtk_widget_show (hbox_left); | |||
entry = gtk_entry_new (); | entry = gtk_entry_new (); | |||
gtk_box_pack_start (GTK_BOX (hbox_left_left), entry, FALSE, FALSE, 0); | gtk_box_pack_end (GTK_BOX (hbox_left), entry, FALSE, FALSE, 0); | |||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_7); | gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_7); | |||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_7); | gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_7); | |||
g_object_set_data (G_OBJECT (dialog), "entry_min", entry); | g_object_set_data (G_OBJECT (dialog), "entry_min", entry); | |||
gtk_widget_show (entry); | gtk_widget_show (entry); | |||
/********* | label = gtk_label_new ("Min"); | |||
* color * | gtk_box_pack_end (GTK_BOX (hbox_left), label, FALSE, FALSE, 0); | |||
*********/ | ||||
hbox_center = gtk_hbox_new (TRUE, 0); | ||||
gtk_box_pack_start (GTK_BOX (vbox_top), hbox_center, FALSE, FALSE, 0); | ||||
gtk_widget_show (hbox_center); | ||||
table = gtk_table_new (1, 7, FALSE); | ||||
gtk_box_pack_start (GTK_BOX (hbox_center), table, FALSE, FALSE, 0); | ||||
gtk_widget_show (table); | ||||
label = gtk_label_new ("Color"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 5, 0 | ||||
); | ||||
gtk_widget_show (label); | ||||
label = gtk_label_new ("R"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_widget_show (label); | ||||
label = gtk_label_new ("G"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 4, 5, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_widget_show (label); | ||||
label = gtk_label_new ("B"); | ||||
gtk_table_attach (GTK_TABLE (table), label, 6, 7, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_widget_show (label); | gtk_widget_show (label); | |||
entry = gtk_entry_new (); | ||||
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
g_object_set_data (G_OBJECT (dialog), "entry_red", entry); | ||||
gtk_widget_show (entry); | ||||
entry = gtk_entry_new (); | ||||
gtk_table_attach (GTK_TABLE (table), entry, 3, 4, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
g_object_set_data (G_OBJECT (dialog), "entry_green", entry); | ||||
gtk_widget_show (entry); | ||||
entry = gtk_entry_new (); | ||||
gtk_table_attach (GTK_TABLE (table), entry, 5, 6, 0, 1, GTK_EXPAND, GTK_FILL, 5, | ||||
0); | ||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
gtk_entry_set_max_length (GTK_ENTRY (entry), GAMGI_GTK_CHAR_5); | ||||
g_object_set_data (G_OBJECT (dialog), "entry_blue", entry); | ||||
gtk_widget_show (entry); | ||||
/*************** | /*************** | |||
* Global page * | * Global page * | |||
***************/ | ***************/ | |||
vbox_page = gtk_vbox_new (FALSE, 5); | vbox_page = gtk_vbox_new (FALSE, 5); | |||
label = gtk_label_new ("Global"); | label = gtk_label_new ("Global"); | |||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox_page, label); | gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox_page, label); | |||
gtk_container_set_border_width (GTK_CONTAINER (vbox_page), 10); | gtk_container_set_border_width (GTK_CONTAINER (vbox_page), 10); | |||
gtk_widget_show (vbox_page); | gtk_widget_show (vbox_page); | |||
End of changes. 37 change blocks. | ||||
191 lines changed or deleted | 182 lines changed or added |