Lumiera  0.pre.03
»edit your freedom«
name-chooser.cpp
Go to the documentation of this file.
1 /*
2  NameChooser - dialog to enter a string name
3 
4  Copyright (C)
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
24 #include "stage/gtk-base.hpp"
26 #include "stage/dialog/dialog.hpp"
27 
28 using namespace Gtk;
29 using namespace Glib;
30 
31 namespace stage {
32 namespace dialog {
33 
34  NameChooser::NameChooser (Window &parent,
35  cuString title,
36  cuString defaultName)
37  : Dialog::Dialog(title, parent, true)
38  , caption_(_("Name:"))
39  {
40  // Add the controls
41  name_.set_text (defaultName);
42  name_.set_activates_default();
43 
44  hBox_.pack_start (caption_);
45  hBox_.pack_start (name_);
46  hBox_.set_spacing (BoxSpacing);
47 
48  Box* const v_box = get_vbox();
49  REQUIRE (v_box != NULL);
50  v_box->pack_start (hBox_);
51 
52  // Configure the dialog
53  v_box->set_spacing (BoxSpacing);
54  set_border_width (BorderPadding);
55  set_resizable (false);
56 
57  // Configure the Cancel and Render buttons
58  add_button (Stock::CANCEL, RESPONSE_CANCEL);
59  add_button (Stock::OK, RESPONSE_OK);
60  set_default_response (RESPONSE_OK);
61 
62  show_all_children();
63  }
64 
65 
66 
67 }} // namespace stage::dialog
static const int BorderPadding
The space in pixels to pad the border of Lumiera dialog boxes.
Definition: dialog.hpp:29
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
static const int BoxSpacing
The spacing for VBoxes and HBoxes in Lumiera dialogs.
Definition: dialog.hpp:34
Global constants and definitions for dialogs.
Dialog to enter a string name.
A set of basic GTK includes for the UI.