lumiera_documentation/src/gui/dialogs/name-chooser.cpp
Michael Fisher c64de14fbf Changes to allow the gtk3 GUI to at least build.
Lots off commented out blocks of code
but most issues are related to simple function name changes,
set/get_flags calls, anything that has to do with a Gtk::Style...

Plan of attack from here is to go one-by one of each commented-out or code and update to gtk3 specs.
2014-10-05 07:49:57 +02:00

69 lines
1.9 KiB
C++

/*
name-chooser.cpp - Definition of the name chooser dialog object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "gui/gtk-lumiera.hpp"
#include "gui/dialogs/name-chooser.hpp"
#include "gui/dialogs/dialog.hpp"
using namespace Gtk;
using namespace Glib;
namespace gui {
namespace dialogs {
NameChooser::NameChooser(Window &parent, cuString title,
cuString default_name) :
Dialog::Dialog(title, parent, true),
caption(_("Name:"))
{
// Add the controls
name.set_text(default_name);
name.set_activates_default();
hBox.pack_start(caption);
hBox.pack_start(name);
hBox.set_spacing(BoxSpacing);
Box* const v_box = get_vbox();
REQUIRE(v_box != NULL);
v_box->pack_start(hBox);
// Configure the dialog
v_box->set_spacing(BoxSpacing);
set_border_width(BorderPadding);
set_resizable(false);
// Configure the Cancel and Render buttons
add_button(Stock::CANCEL, RESPONSE_CANCEL);
add_button(Stock::OK, RESPONSE_OK);
set_default_response(RESPONSE_OK);
show_all_children();
}
cuString NameChooser::get_name() const
{
return name.get_text();
}
} // namespace dialogs
} // namespace gui