1 /* === S Y N F I G ========================================================= */
2 /*! \file dialog_preview.cpp
3 ** \brief Preview dialog File
5 ** $Id: dialog_preview.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === H E A D E R S ======================================================= */
32 #include "dialog_preview.h"
34 #include <gtkmm/spinbutton.h>
38 /* === U S I N G =========================================================== */
42 using namespace synfig;
43 using namespace studio;
46 /* === M A C R O S ========================================================= */
48 /* === G L O B A L S ======================================================= */
50 /* === P R O C E D U R E S ================================================= */
52 /* === M E T H O D S ======================================================= */
54 /* === E N T R Y P O I N T ================================================= */
56 //dialog_preview stuff...
57 Dialog_Preview::Dialog_Preview()
58 :Dialog(_("Preview Window"),false,true),
59 settings(this,"preview")
61 get_vbox()->pack_start(preview);
64 Dialog_Preview::~Dialog_Preview()
68 void Dialog_Preview::set_preview(handle<Preview> prev)
71 preview.set_preview(prev);
75 void Dialog_Preview::on_hide()
82 //dialog_previewoptions stuff
83 Dialog_PreviewOptions::Dialog_PreviewOptions()
84 :Dialog(_("Preview Options"),false,true),
85 adj_zoom(0.5,0.1,5.0,0.1,0.2),
86 adj_fps(15,1,120,1,5),
87 check_overbegin(_("Begin Time"),false),
88 check_overend(_("End Time"),false),
89 settings(this,"prevoptions")
94 //set the fps of the time widgets
95 Gtk::Table *ot = manage(new class Gtk::Table);
97 ot->attach(*manage(new class Gtk::Label(_("Zoom"))),0,1,0,1);
98 ot->attach(*manage(new class Gtk::Label(_("FPS"))),1,2,0,1);
100 ot->attach(*manage(new class Gtk::SpinButton(adj_zoom,0.1,2)),0,1,1,2);
101 ot->attach(*manage(new class Gtk::SpinButton(adj_fps,1,1)),1,2,1,2);
103 ot->attach(check_overbegin,0,1,2,3);
104 ot->attach(check_overend,1,2,2,3);
105 check_overbegin.signal_toggled().connect(sigc::mem_fun(*this,&Dialog_PreviewOptions::on_overbegin_toggle));
106 check_overend.signal_toggled().connect(sigc::mem_fun(*this,&Dialog_PreviewOptions::on_overend_toggle));
108 ot->attach(time_begin,0,1,3,4);
109 ot->attach(time_end,1,2,3,4);
111 Gtk::Button *okbutton = manage(new Gtk::Button(_("Preview")));
112 okbutton->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_PreviewOptions::on_ok_pressed));
113 ot->attach(*okbutton,0,2,4,5);
117 get_vbox()->pack_start(*ot);
119 time_begin.set_sensitive(false);
120 time_end.set_sensitive(false);
123 Dialog_PreviewOptions::~Dialog_PreviewOptions()
127 void Dialog_PreviewOptions::on_ok_pressed()
132 i.overbegin = get_begin_override();
133 i.overend = get_end_override();
134 if(i.overbegin) i.begintime = (float)get_begintime();
135 if(i.overend) i.endtime = (float)get_endtime();
139 signal_finish_.clear();
142 void Dialog_PreviewOptions::on_overbegin_toggle()
144 time_begin.set_sensitive(get_begin_override());
147 void Dialog_PreviewOptions::on_overend_toggle()
149 time_end.set_sensitive(get_end_override());
152 void studio::Dialog_PreviewOptions::set_global_fps(float f)
155 time_begin.set_fps(f);