Debian Codegraph @

gtk/src/dialog.ccg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <gtk/gtk.h>
18
19 namespace Gtk
20 {
21
22 Dialog::Dialog(const Glib::ustring& title, Gtk::Window& parent, bool modal)
23 :
24 _CONSTRUCT("title", title.c_str())
25 {
26 set_modal(modal);
27 set_transient_for(parent);
28 }
29
30 Dialog::Dialog(const Glib::ustring& title, bool modal)
31 :
32 _CONSTRUCT("title", title.c_str())
33 {
34 set_modal(modal);
35 }
36
37 Dialog::Dialog(const Glib::ustring& title, DialogFlags flags)
38 :
39 _CONSTRUCT("title", title.c_str(), "use-header-bar", (flags & DIALOG_USE_HEADER_BAR) != 0)
40 {
41 set_modal((flags & DIALOG_MODAL) != 0);
42 property_destroy_with_parent() = (flags & DIALOG_DESTROY_WITH_PARENT) != 0;
43 }
44
45 Dialog::Dialog(const Glib::ustring& title, Gtk::Window& parent, DialogFlags flags)
46 :
47 _CONSTRUCT("title", title.c_str(), "use-header-bar", (flags & DIALOG_USE_HEADER_BAR) != 0)
48 {
49 set_transient_for(parent);
50 set_modal((flags & DIALOG_MODAL) != 0);
51 property_destroy_with_parent() = (flags & DIALOG_DESTROY_WITH_PARENT) != 0;
52 }
53
54 _DEPRECATE_IFDEF_START
55 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
56 void Dialog::set_alternative_button_order_from_array(const std::vector<int>& new_order)
57 {
58 gtk_dialog_set_alternative_button_order_from_array(gobj(), new_order.size(), const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(new_order).data()));
59 }
60 G_GNUC_END_IGNORE_DEPRECATIONS
61 _DEPRECATE_IFDEF_END
62
63 } // namespace Gtk