コード例 #1
0
void pressed_preferences( GtkMenuItem *menu_item, gpointer user_data )
{
	int i;
#ifdef U_NLS
	int j;
	GSList *radio_group;
#endif


	GtkWidget *vbox3, *hbox4, *table3, *table4, *table5, *drawingarea_tablet, *frame;
	GtkWidget *button1, *button2, *notebook1, *vbox_1, *vbox_2, *vbox_3, *label;
	GtkAccelGroup* ag = gtk_accel_group_new();

	char *tab_tex[] = { _("Max memory used for undo (MB)"), _("Greyscale backdrop"),
		_("Selection nudge pixels"), _("Max Pan Window Size") };
	char *tab_tex2[] = { _("XPM/PNG transparency index"), _("XBM X hotspot"), _("XBM Y hotspot"),
		_("JPEG Save Quality (100=High)   "), _("Recently Used Files") };
	char *tab_tex3[] = { _("Minimum grid zoom"), _("Grid colour RGB") };
	char *stat_tex[] = { _("Colour A & B"), _("Canvas Geometry"), _("Cursor X,Y"),
		_("Pixel [I] {RGB}"), _("Zoom %"), _("Selection Geometry"), _("Continuous Mode"),
		_("Undo / Redo"), _("Opacity %"), _("Opacity Mode") },
		*tablet_txt[] = { _("Size"), _("Flow"), _("Opacity") };
	char txt[64];


	men_item_state( menu_prefs, FALSE );	// Make sure the user can only open 1 prefs window

	prefs_window = add_a_window( GTK_WINDOW_TOPLEVEL, _("Preferences"), GTK_WIN_POS_CENTER, FALSE );

	vbox3 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox3);
	gtk_container_add (GTK_CONTAINER (prefs_window), vbox3);

///	SETUP NOTEBOOK

	notebook1 = gtk_notebook_new ();
	gtk_box_pack_start (GTK_BOX (vbox3), notebook1, TRUE, TRUE, 0);
	gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook1), GTK_POS_TOP);
	gtk_widget_show (notebook1);

///	---- TAB1 - GENERAL

	vbox_1 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_1);
	gtk_container_add (GTK_CONTAINER (notebook1), vbox_1);

	label = gtk_label_new( _("General") );
	gtk_widget_show (label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK (notebook1),
		gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label);


	table3 = add_a_table( 3, 2, 10, vbox_1 );

///	TABLE TEXT
	for ( i=0; i<4; i++ ) add_to_table( tab_tex[i], table3, i, 0, 0, GTK_JUSTIFY_LEFT, 0, 0.5 );

///	TABLE SPINBUTTONS
	spin_to_table( table3, &spinbutton_maxmem, 0, 1, 5, inifile_get_gint32("undoMBlimit", 32 ), 1, 1000 );
	spin_to_table( table3, &spinbutton_greys, 1, 1, 5, inifile_get_gint32("backgroundGrey", 180 ), 0, 255 );
	spin_to_table( table3, &spinbutton_nudge, 2, 1, 5, inifile_get_gint32("pixelNudge", 8 ), 2, 512 );
	spin_to_table( table3, &spinbutton_pan, 3, 1, 5, inifile_get_gint32("panSize", 128 ), 64, 256 );

	checkbutton_paste = add_a_toggle( _("Display clipboard while pasting"),
		vbox_1, inifile_get_gboolean("pasteToggle", TRUE) );
	checkbutton_cursor = add_a_toggle( _("Mouse cursor = Tool"),
		vbox_1, inifile_get_gboolean("cursorToggle", TRUE) );
	checkbutton_exit = add_a_toggle( _("Confirm Exit"),
		vbox_1, inifile_get_gboolean("exitToggle", FALSE) );
	checkbutton_quit = add_a_toggle( _("Q key quits mtPaint"),
		vbox_1, inifile_get_gboolean("quitToggle", TRUE) );
	checkbutton_commit = add_a_toggle( _("Changing tool commits paste"),
		vbox_1, inifile_get_gboolean("pasteCommit", FALSE) );


///	---- TAB2 - FILES

	vbox_2 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_2);
	gtk_container_add (GTK_CONTAINER (notebook1), vbox_2);

	label = gtk_label_new( _("Files") );
	gtk_widget_show (label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK (notebook1),
		gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label);

	table4 = add_a_table( 5, 2, 10, vbox_2 );

	for ( i=0; i<5; i++ ) add_to_table( tab_tex2[i], table4, i, 0, 0, GTK_JUSTIFY_LEFT, 0, 0.5 );

	spin_to_table( table4, &spinbutton_trans, 0, 1, 5, mem_xpm_trans, -1, mem_cols-1 );
	spin_to_table( table4, &spinbutton_hotx, 1, 1, 5, mem_xbm_hot_x, -1, mem_width-1 );
	spin_to_table( table4, &spinbutton_hoty, 2, 1, 5, mem_xbm_hot_y, -1, mem_height-1 );
	spin_to_table( table4, &spinbutton_jpeg, 3, 1, 5, mem_jpeg_quality, 0, 100 );
	spin_to_table( table4, &spinbutton_recent, 4, 1, 5, recent_files, 0, MAX_RECENT );

	add_hseparator( vbox_2, -2, 10 );
	label = gtk_label_new( _("Clipboard Files") );
	gtk_widget_show( label );
	gtk_box_pack_start( GTK_BOX(vbox_2), label, FALSE, FALSE, 0 );

	clipboard_entry = gtk_entry_new();
	gtk_widget_show( clipboard_entry );
	gtk_box_pack_start( GTK_BOX(vbox_2), clipboard_entry, FALSE, FALSE, 0 );
	gtk_entry_set_text( GTK_ENTRY(clipboard_entry), mem_clip_file[0] );
	strncpy( mem_clip_file[1], mem_clip_file[0], 250 );

	button1 = add_a_button( _("Browse"), 4, vbox_2, FALSE );
	gtk_signal_connect(GTK_OBJECT(button1), "clicked",
		GTK_SIGNAL_FUNC(clip_file_browse), NULL);

///	---- TAB3 - STATUS BAR

	hbox4 = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox4);
	gtk_container_add (GTK_CONTAINER (notebook1), hbox4);

	vbox_3 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_3);
	gtk_box_pack_start (GTK_BOX (hbox4), vbox_3, FALSE, FALSE, 0);

	label = gtk_label_new( _("Status Bar") );
	gtk_widget_show (label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK (notebook1),
		gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label);

	for ( i=0; i<STATUS_ITEMS; i++ )
	{
		if (i==5)
		{
			vbox_3 = gtk_vbox_new (FALSE, 0);
			gtk_widget_show (vbox_3);
			gtk_box_pack_start (GTK_BOX (hbox4), vbox_3, FALSE, FALSE, 0);
		}
		sprintf(txt, "status%iToggle", i);
		prefs_status[i] = add_a_toggle( stat_tex[i], vbox_3, inifile_get_gboolean(txt, TRUE) );
	}

///	---- TAB4 - ZOOM

	hbox4 = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox4);
	gtk_container_add (GTK_CONTAINER (notebook1), hbox4);

	vbox_3 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_3);
	gtk_box_pack_start (GTK_BOX (hbox4), vbox_3, FALSE, FALSE, 0);

	label = gtk_label_new( _("Zoom") );
	gtk_widget_show (label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK (notebook1),
		gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label);
	table5 = add_a_table( 2, 4, 10, vbox_3 );

///	TABLE TEXT
	for ( i=0; i<2; i++ ) add_to_table( tab_tex3[i], table5, i, 0, 0, GTK_JUSTIFY_LEFT, 0, 0.5 );

///	TABLE SPINBUTTONS
	spin_to_table( table5, &spinbutton_grid[0], 0, 1, 5, mem_grid_min, 2, 12 );
	spin_to_table( table5, &spinbutton_grid[1], 1, 1, 5, mem_grid_rgb[0], 0, 255 );
	spin_to_table( table5, &spinbutton_grid[2], 1, 2, 5, mem_grid_rgb[1], 0, 255 );
	spin_to_table( table5, &spinbutton_grid[3], 1, 3, 5, mem_grid_rgb[2], 0, 255 );

	checkbutton_zoom = add_a_toggle( _("New image sets zoom to 100%"),
		vbox_3, inifile_get_gboolean("zoomToggle", FALSE) );
#if GTK_MAJOR_VERSION == 2
	checkbutton_wheel = add_a_toggle( _("Mouse Scroll Wheel = Zoom"),
		vbox_3, inifile_get_gboolean("scrollwheelZOOM", TRUE) );
#endif



///	---- TAB5 - TABLET

	hbox4 = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox4);
	gtk_container_add (GTK_CONTAINER (notebook1), hbox4);

	vbox_3 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_3);
	gtk_box_pack_start (GTK_BOX (hbox4), vbox_3, FALSE, FALSE, 0);

	label = gtk_label_new( _("Tablet") );
	gtk_widget_show (label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK (notebook1),
		gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 4), label);



	frame = gtk_frame_new (_("Device Settings"));
	gtk_widget_show (frame);
	gtk_box_pack_start (GTK_BOX (vbox_3), frame, FALSE, FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (frame), 5);

	vbox_2 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_2);
	gtk_container_add (GTK_CONTAINER (frame), vbox_2);
	gtk_container_set_border_width (GTK_CONTAINER (vbox_2), 5);

	label_tablet_device = gtk_label_new ("");
	gtk_widget_show (label_tablet_device);
	gtk_box_pack_start (GTK_BOX (vbox_2), label_tablet_device, FALSE, FALSE, 0);
	gtk_misc_set_alignment (GTK_MISC (label_tablet_device), 0, 0.5);
	gtk_misc_set_padding (GTK_MISC (label_tablet_device), 5, 5);

	button1 = add_a_button( _("Configure Device"), 0, vbox_2, FALSE );
	gtk_signal_connect(GTK_OBJECT(button1), "clicked", GTK_SIGNAL_FUNC(conf_tablet), NULL);

	table3 = gtk_table_new (4, 2, FALSE);
	gtk_widget_show (table3);
	gtk_box_pack_start (GTK_BOX (vbox_2), table3, TRUE, TRUE, 0);

	label = add_to_table( _("Tool Variable"), table3, 0, 0, 0, 0, 0, 0 );
	gtk_misc_set_padding (GTK_MISC (label), 5, 5);
	label = add_to_table( _("Factor"), table3, 0, 1, 0, 0, 0, 0 );
	gtk_misc_set_padding (GTK_MISC (label), 5, 5);
	gtk_misc_set_alignment (GTK_MISC (label), 0.4, 0.5);

	for ( i=0; i<3; i++ )
	{
		check_tablet[i] = gtk_check_button_new_with_label (tablet_txt[i]);
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_tablet[i]),
			tablet_tool_use[i] );
		gtk_widget_show (check_tablet[i]);
		gtk_table_attach (GTK_TABLE (table3), check_tablet[i], 0, 1, i+1, i+2,
			(GtkAttachOptions) (GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);

//	Size/Flow/Opacity sliders

		hscale_tablet[i] = add_slider2table( 0, -1, 1, table3, 1+i, 1, 200, -2 );
		gtk_adjustment_set_value( GTK_HSCALE(hscale_tablet[i])->scale.range.adjustment,
			tablet_tool_factor[i] );
		gtk_scale_set_value_pos (GTK_SCALE (hscale_tablet[i]), GTK_POS_RIGHT);
		gtk_scale_set_digits (GTK_SCALE (hscale_tablet[i]), 2);
		gtk_scale_set_draw_value (GTK_SCALE (hscale_tablet[i]), TRUE);
	}


	frame = gtk_frame_new (_("Test Area"));
	gtk_widget_show (frame);
	gtk_box_pack_start (GTK_BOX (vbox_3), frame, FALSE, FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (frame), 5);

	vbox_2 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_2);
	gtk_container_add (GTK_CONTAINER (frame), vbox_2);
	gtk_container_set_border_width (GTK_CONTAINER (vbox_2), 5);

	drawingarea_tablet = gtk_drawing_area_new ();
	gtk_widget_show (drawingarea_tablet);
	gtk_box_pack_start (GTK_BOX (vbox_2), drawingarea_tablet, TRUE, TRUE, 0);
	gtk_widget_set_usize (drawingarea_tablet, 128, 64);
	gtk_signal_connect( GTK_OBJECT(drawingarea_tablet), "expose_event",
		GTK_SIGNAL_FUNC (expose_tablet_preview), (gpointer) drawingarea_tablet );

	gtk_signal_connect (GTK_OBJECT (drawingarea_tablet), "motion_notify_event",
		GTK_SIGNAL_FUNC (tablet_preview_motion), NULL);
	gtk_signal_connect (GTK_OBJECT (drawingarea_tablet), "button_press_event",
		GTK_SIGNAL_FUNC (tablet_preview_button), NULL);

	gtk_widget_set_events (drawingarea_tablet, GDK_EXPOSURE_MASK
		| GDK_LEAVE_NOTIFY_MASK
		| GDK_BUTTON_PRESS_MASK
		| GDK_POINTER_MOTION_MASK
		| GDK_POINTER_MOTION_HINT_MASK);

	gtk_widget_set_extension_events (drawingarea_tablet, GDK_EXTENSION_EVENTS_CURSOR);



	label_tablet_pressure = gtk_label_new ("");
	gtk_widget_show (label_tablet_pressure);
	gtk_box_pack_start (GTK_BOX (vbox_2), label_tablet_pressure, FALSE, FALSE, 0);
	gtk_misc_set_alignment (GTK_MISC (label_tablet_pressure), 0, 0.5);



///	---- TAB6 - LANGUAGE

#ifdef U_NLS

	pref_lang_ini[1] = _("Default System Language");
	pref_lang_ini[3] = _("Czech");
	pref_lang_ini[5] = _("English (UK)");
	pref_lang_ini[7] = _("French");
	pref_lang_ini[9] = _("Portuguese");
	pref_lang_ini[11] = _("Portuguese (Brazilian)");
	pref_lang_ini[13] = _("Spanish");

	vbox_2 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_2);
	gtk_container_add (GTK_CONTAINER (notebook1), vbox_2);
	gtk_container_set_border_width( GTK_CONTAINER(vbox_2), 10 );

	label = gtk_label_new( _("Language") );
	gtk_widget_show (label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK (notebook1),
		gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 5), label);

	add_hseparator( vbox_2, 200, 10 );
	label = gtk_label_new( _("Select preferred language translation\n\n"
				"You will need to restart mtPaint\nfor this to take full effect") );
	pref_lang_label = label;
	gtk_widget_show (label);
	gtk_box_pack_start( GTK_BOX(vbox_2), label, FALSE, FALSE, 0 );
	add_hseparator( vbox_2, 200, 10 );

	pref_lang_radio[0] = add_radio_button( pref_lang_ini[1], NULL,  NULL, vbox_2, 0 );
	radio_group = gtk_radio_button_group( GTK_RADIO_BUTTON(pref_lang_radio[0]) );
	pref_lang_radio[1] = add_radio_button( pref_lang_ini[3], radio_group, NULL, vbox_2, 1 );
	for ( i=2; i<PREF_LANGS; i++ )
		pref_lang_radio[i] = add_radio_button(
					pref_lang_ini[i*2+1], NULL, pref_lang_radio[1], vbox_2, i );

	for ( i=0; i<PREF_LANGS; i++ )
		gtk_container_set_border_width( GTK_CONTAINER(pref_lang_radio[i]), 5 );

	j = 0;
	for ( i = PREF_LANGS - 1; i>0; i-- )
	{
		if ( strcmp( pref_lang_ini[i*2], inifile_get( "languageSETTING", "system" ) ) == 0 )
			j = i;
	}
	gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(pref_lang_radio[j]), TRUE );

#endif



///	Bottom of Prefs window

	hbox4 = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox4);
	gtk_box_pack_start (GTK_BOX (vbox3), hbox4, FALSE, FALSE, 0);

	button1 = add_a_button(_("Cancel"), 5, hbox4, TRUE);
	gtk_signal_connect(GTK_OBJECT(button1), "clicked", GTK_SIGNAL_FUNC(delete_prefs), NULL);
	gtk_widget_add_accelerator (button1, "clicked", ag, GDK_Escape, 0, (GtkAccelFlags) 0);

	button1 = add_a_button(_("Apply"), 5, hbox4, TRUE);
	gtk_signal_connect(GTK_OBJECT(button1), "clicked", GTK_SIGNAL_FUNC(prefs_apply), NULL);

	button2 = add_a_button(_("OK"), 5, hbox4, TRUE);
	gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(prefs_ok), NULL);
	gtk_widget_add_accelerator (button2, "clicked", ag, GDK_Return, 0, (GtkAccelFlags) 0);
	gtk_widget_add_accelerator (button2, "clicked", ag, GDK_KP_Enter, 0, (GtkAccelFlags) 0);


	gtk_signal_connect_object (GTK_OBJECT (prefs_window), "delete_event",
		GTK_SIGNAL_FUNC (delete_prefs), NULL);

	gtk_window_set_transient_for( GTK_WINDOW(prefs_window), GTK_WINDOW(main_window) );
	gtk_widget_show (prefs_window);
	gtk_window_add_accel_group(GTK_WINDOW (prefs_window), ag);

	if ( tablet_working )
	{
		tablet_update_device( tablet_device->name );
	} else	tablet_update_device( "NONE" );
}
コード例 #2
0
void gui_animate_dialog(void)
{
    gchar *tmp, *title;
    gpointer dialog;
    GtkWidget *window, *frame, *vbox, *hbox, *hbox2, *anim_box;
    GtkWidget *notebook, *page, *button, *label, *entry, *scale;
    GSList *group=NULL;
    struct model_pak *data;

    /* checks */
    data = sysenv.active_model;
    if (!data)
        return;
    if (!data->animation)
        return;

    /* CURRENT */
    /*
    anim_read_all_frames(data);
    */

    /* prevent recording whilst in animation */
    gui_mode_switch(FREE);

    /* dialog setup */
    title = g_strdup_printf("Animation: %s", data->basename);
    dialog = dialog_request(ANIM, title, NULL, animate_cleanup, data);
    g_free(title);
    if (!dialog)
        return;
    window = dialog_window(dialog);

    /* notebook frame */
    frame = gtk_frame_new(NULL);
    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), frame, FALSE, FALSE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(frame), PANEL_SPACING);

    /* create notebook */
    notebook = gtk_notebook_new();
    gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
    gtk_container_add(GTK_CONTAINER(frame), notebook);
    gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), TRUE);

    /* page 1 */
    page = gtk_vbox_new(FALSE, PANEL_SPACING);
    label = gtk_label_new("Control");
    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label);

    /* general animation stuff */
    frame = gtk_frame_new(NULL);
    gtk_box_pack_start(GTK_BOX(page),frame,FALSE,FALSE,0);
    /* create a vbox in the frame */
    vbox = gtk_vbox_new(TRUE, PANEL_SPACING);
    gtk_container_add(GTK_CONTAINER(frame), vbox);

    /* num frames */
    hbox = gtk_hbox_new(FALSE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(hbox), PANEL_SPACING);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
    label = gtk_label_new("Number of frames:");
    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
    tmp = g_strdup_printf("%9d", data->num_frames);
    label = gtk_label_new(tmp);
    g_free(tmp);
    gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 0);

    /* desired delay */
    gui_direct_spin("Animation delay", &data->anim_speed,
                    1.0, 40.0, 1.0, NULL, NULL, vbox);

    gui_direct_spin("Animation step size ", &data->anim_step,
                    1.0, data->num_frames, 1.0, NULL, NULL, vbox);

    gui_direct_check("Don't recalculate connectivity", &data->anim_fix, NULL, NULL, vbox);

    gui_direct_check("Don't recalculate scale", &data->anim_noscale, NULL, NULL, vbox);

    gui_direct_check("Loop", &data->anim_loop, NULL, NULL, vbox);


    /* page 2 */
    page = gtk_vbox_new(FALSE, PANEL_SPACING);
    label = gtk_label_new("Processing");
    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label);

    /* cycle options */
    frame = gtk_frame_new(NULL);
    gtk_box_pack_start(GTK_BOX(page),frame,FALSE,FALSE,0);

    vbox = gtk_vbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(frame), vbox);
    gtk_container_set_border_width(GTK_CONTAINER(vbox), PANEL_SPACING);

    /* actions at start of each cycle */
    new_radio_group(0, vbox, FF);

    button = add_radio_button("Confine atoms to PBC", (gpointer) atom_pbc, data);
    if (data->anim_confine == PBC_CONFINE_ATOMS)
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);

    button = add_radio_button("Confine mols to PBC", (gpointer) mol_pbc, data);
    if (data->anim_confine == PBC_CONFINE_MOLS)
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);

    button = add_radio_button("Cell confinement off", (gpointer) no_pbc, data);
    if (data->anim_confine == PBC_CONFINE_NONE)
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);


    /* page 3 */
    page = gtk_vbox_new(FALSE, PANEL_SPACING);
    label = gtk_label_new("Rendering");
    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label);

    /* cycle options */
    frame = gtk_frame_new(NULL);
    gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0);

    vbox = gtk_vbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(frame), vbox);
    gtk_container_set_border_width(GTK_CONTAINER(vbox), PANEL_SPACING);


    anim_box = gtk_vbox_new(TRUE, 0);
    gui_direct_check("Create movie", &sysenv.render.animate,
                     anim_render, anim_box, vbox);
    gtk_box_pack_end(GTK_BOX(vbox), anim_box, TRUE, TRUE, 0);


    /* sensitive box */
    vbox = gtk_vbox_new(FALSE,0);
    gtk_box_pack_start(GTK_BOX(anim_box), vbox, TRUE, TRUE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(vbox), PANEL_SPACING);


    /* start off with a button */
    button = gtk_radio_button_new_with_label (NULL, "Animated GIF");
    g_signal_connect(GTK_OBJECT(button), "clicked",
                     GTK_SIGNAL_FUNC(event_render_modify), (gpointer) button);
    gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, TRUE, 0);
    g_object_set_data(G_OBJECT(button), "id", (gpointer) ANIM_GIF);

    /* make a radio group */
    group = gtk_radio_button_group(GTK_RADIO_BUTTON(button));
    /* do the rest of the buttons */
    button = gtk_radio_button_new_with_label(group, "MPEG");
    g_signal_connect(GTK_OBJECT(button), "clicked",
                     GTK_SIGNAL_FUNC(event_render_modify), (gpointer) button);
    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, TRUE, 0);
    g_object_set_data(G_OBJECT(button), "id", (gpointer) ANIM_MPEG);

    /* movie creation parameters */
    gui_direct_spin("MPEG quality",
                    &sysenv.render.mpeg_quality, 1, 100, 1,
                    NULL, NULL, vbox);
    gui_direct_spin("Delay (ms)",
                    &sysenv.render.delay, 0, 100, 5,
                    NULL, NULL, vbox);

    /* file entry */
    hbox = gtk_hbox_new (FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,TRUE,0);
    label = gtk_label_new("Filename ");
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
    entry = gtk_entry_new();
    gtk_box_pack_end(GTK_BOX (hbox), entry, FALSE, TRUE, 0);
    gtk_entry_set_text(GTK_ENTRY(entry), sysenv.render.animate_file);

    /* update hook */
    g_signal_connect(GTK_OBJECT(entry), "changed",
                     GTK_SIGNAL_FUNC(event_render_modify), (gpointer) entry);
    g_object_set_data(G_OBJECT(entry), "id", (gpointer) ANIM_NAME);

    /* misc options */
    /*
    gui_direct_check("Create povray input files then stop",
                       &sysenv.render.no_povray_exec,
                       NULL, NULL, vbox);
    gui_direct_check("Delete intermediate input/image files",
                       &sysenv.render.no_keep_tempfiles,
                       NULL, NULL, vbox);
    */


    /* set initial state */
    if (!sysenv.render.animate)
        gtk_widget_set_sensitive(anim_box, FALSE);


    /* NEW - slider for current frame */
    frame = gtk_frame_new(NULL);
    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), frame, FALSE, FALSE, 0);

    vbox = gtk_vbox_new(FALSE, PANEL_SPACING);
    gtk_container_add(GTK_CONTAINER(frame), vbox);

    scale = gui_direct_hscale(0, data->num_frames-1, 1, &data->cur_frame, select_frame, data, vbox);
    gtk_range_set_update_policy(GTK_RANGE(scale), GTK_UPDATE_DISCONTINUOUS);

    /* control buttons */
    hbox2 = gtk_hbox_new(FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, PANEL_SPACING);
    hbox = gtk_hbox_new(TRUE, PANEL_SPACING);
    gtk_box_pack_start(GTK_BOX(hbox2), hbox, TRUE, FALSE, 0);

    gui_icon_button("GDIS_REWIND", NULL,
                    anim_rewind, dialog,
                    hbox);

    gui_icon_button("GDIS_STEP_BACKWARD", NULL,
                    anim_step_backward, dialog,
                    hbox);

    gui_icon_button("GDIS_PLAY", NULL,
                    anim_start, dialog,
                    hbox);

    gui_icon_button("GDIS_PAUSE", NULL,
                    anim_stop, dialog,
                    hbox);

    gui_icon_button("GDIS_STEP_FORWARD", NULL,
                    anim_step_forward, dialog,
                    hbox);

    gui_icon_button("GDIS_FASTFORWARD", NULL,
                    anim_fastforward, dialog,
                    hbox);

    gui_stock_button(GTK_STOCK_CLOSE, dialog_destroy, dialog,
                     GTK_DIALOG(window)->action_area);

    /* display the dialog */
    gtk_widget_show_all(window);

    gui_relation_update(data);
}