the usual blob of fixes. note the requirement for ComboBoxText::set_active_text()
[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 <gtkmm/stock.h>
23
24 #include "ardour_message.h"
25 #include "i18n.h"
26
27 using namespace std;
28 using namespace Gtk;
29
30 ArdourMessage::ArdourMessage (Gtk::Window* parent, 
31                               string name, string msg, 
32                               bool grab_focus, bool auto_run)
33         : ArdourDialog (name),
34           label (msg, 0.5, 0.5)
35 {
36         label.set_name (X_("PrompterLabel"));
37         label.show ();
38
39         get_vbox()->pack_start (label);
40         
41         Button* ok_button = add_button (Stock::OK, RESPONSE_ACCEPT);
42         
43         set_name (X_("Prompter"));
44         set_position (Gtk::WIN_POS_MOUSE);
45         set_modal (true);
46         set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
47
48         if (grab_focus) {
49                 ok_button->grab_focus ();
50         }
51
52         if (parent) {
53                 set_transient_for (*parent);
54         }
55
56         if (auto_run) {
57                 run ();
58         }
59 }
60
61 ArdourMessage::~ArdourMessage()
62 {
63 }