1 /* === S Y N F I G ========================================================= */
2 /*! \file widget_filename.cpp
3 ** \brief Template File
5 ** $Id: widget_filename.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/entry.h>
32 #include <gtkmm/button.h>
33 #include "widget_filename.h"
38 /* === U S I N G =========================================================== */
41 //using namespace etl;
42 //using namespace synfig;
43 using namespace studio;
45 /* === M A C R O S ========================================================= */
51 /* === G L O B A L S ======================================================= */
53 /* === P R O C E D U R E S ================================================= */
55 /* === M E T H O D S ======================================================= */
57 Widget_Filename::Widget_Filename()
59 entry_filename=manage(new Gtk::Entry());
60 button_choose=manage(new Gtk::Button(_("Find")));
62 pack_start(*entry_filename);
63 pack_start(*button_choose);
64 entry_filename->show();
65 button_choose->show();
67 button_choose->signal_clicked().connect(sigc::mem_fun(*this, &studio::Widget_Filename::on_button_choose_pressed));
68 //entry_filename->signal_value_changed().connect(sigc::mem_fun(*this, &studio::Widget_Filename::on_value_changed));
69 entry_filename->signal_activate().connect(sigc::mem_fun(*this, &studio::Widget_Filename::on_value_changed));
72 Widget_Filename::~Widget_Filename()
77 Widget_Filename::set_has_frame(bool x)
79 entry_filename->set_has_frame(x);
84 Widget_Filename::set_value(const string &data)
86 entry_filename->set_text(data);
90 Widget_Filename::get_value() const
94 return entry_filename->get_text();
98 throw string("Caught unknown exception");
103 Widget_Filename::on_value_changed()
105 signal_value_changed()();
109 Widget_Filename::on_button_choose_pressed()
111 string filename=entry_filename->get_text();
114 if(App::dialog_open_file(_("Choose File"),filename))
115 entry_filename->set_text(filename);