rename all GTK signals
[ardour.git] / gtk2_ardour / ardour_message.cc
1 /*
2     Copyright (C) 2004 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19
20 */
21
22 #include <gdkmm/window.h>
23
24 #include "ardour_message.h"
25 #include "i18n.h"
26
27 using namespace std;
28 using namespace Gtk;
29
30
31 ArdourMessage::ArdourMessage (Gtk::Window* parent, 
32                               string name, string msg, 
33                               bool grab_focus, bool auto_run)
34         : ArdourDialog (name),
35           ok_button (_("OK"))
36 {
37         set_keyboard_input (true);
38
39         label.set_text (msg);
40         label.set_alignment (0.5, 0.5);
41         label.set_name (X_("PrompterLabel"));
42         
43         ok_button.set_name ("EditorGTKButton"); 
44         ok_button.signal_clicked().connect (bind (mem_fun(*this, &ArdourDialog::stop), 1));
45         
46         packer.set_spacing (10);
47         packer.set_border_width (10);
48         packer.pack_start (label);
49         packer.pack_start (ok_button);
50         
51         set_name (X_("Prompter"));
52         set_position (Gtk::WIN_POS_MOUSE);
53         set_modal (true);
54         add (packer);
55         show_all ();
56         
57         realize();
58         get_window()->set_decorations (Gdk::WMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
59
60         if (grab_focus) {
61                 ok_button.grab_focus ();
62         }
63
64         if (parent) {
65                 set_transient_for (*parent);
66         }
67
68         if (auto_run) {
69                 run ();
70         }
71 }
72
73 ArdourMessage::~ArdourMessage()
74 {
75 }