| 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 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 18 |
|
| 19 |
#include <gtkmm/container.h> |
| 20 |
#include <gtkmm/label.h> |
| 21 |
|
| 22 |
_DEFS(gtkmm,gtk) |
| 23 |
_PINCLUDE(gtkmm/private/container_p.h) |
| 24 |
#m4 _CONVERSION(guint,PositionType,`$2($3)') |
| 25 |
|
| 26 |
namespace Gtk |
| 27 |
{ |
| 28 |
|
| 29 |
_CC_INCLUDE(gtk/gtk.h) |
| 30 |
_WRAP_ENUM(NotebookTab, GtkNotebookTab, decl_prefix GTKMM_API) |
| 31 |
|
| 32 |
/** Container which shows one of its children at a time, in tabbed windows. |
| 33 |
* |
| 34 |
* The Gtk::Notebook widget is a Gtk::Container whose children are pages that |
| 35 |
* can be switched between using tab labels along one edge. |
| 36 |
* |
| 37 |
* A Notebook widget looks like this: |
| 38 |
* @image html notebook1.png |
| 39 |
* |
| 40 |
* @ingroup Widgets |
| 41 |
* @ingroup Containers |
| 42 |
*/ |
| 43 |
class GTKMM_API Notebook : public Container |
| 44 |
{ |
| 45 |
_CLASS_GTKOBJECT(Notebook,GtkNotebook,GTK_NOTEBOOK,Gtk::Container,GtkContainer,,,GTKMM_API) |
| 46 |
|
| 47 |
public: |
| 48 |
|
| 49 |
_CTOR_DEFAULT |
| 50 |
|
| 51 |
_WRAP_METHOD(int prepend_page(Widget& child, Widget& tab_label), gtk_notebook_prepend_page) |
| 52 |
int prepend_page(Widget& child); |
| 53 |
|
| 54 |
int prepend_page(Widget& child, const Glib::ustring& tab_label, bool use_mnemonic = false); |
| 55 |
_WRAP_METHOD(int prepend_page(Widget& child, Widget& tab_label, Widget& menu_label), gtk_notebook_prepend_page_menu) |
| 56 |
//Ignore the possible-0 menu_label version of this method. It would have the same signature as another method. |
| 57 |
|
| 58 |
int prepend_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic); |
| 59 |
|
| 60 |
_WRAP_METHOD(int append_page(Widget& child, Widget& tab_label), gtk_notebook_append_page) |
| 61 |
int append_page(Widget& child); |
| 62 |
int append_page(Widget& child, const Glib::ustring& tab_label, bool use_mnemonic = false); |
| 63 |
|
| 64 |
_WRAP_METHOD(int append_page(Widget& child, Widget& tab_label, Widget& menu_label), gtk_notebook_append_page_menu) |
| 65 |
//Ignore the possible-0 menu_label version of this method. It would have the same signature as another method. |
| 66 |
|
| 67 |
int append_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic = false); |
| 68 |
|
| 69 |
_WRAP_METHOD(int insert_page(Widget& child, Widget& tab_label, int position), gtk_notebook_insert_page) |
| 70 |
int insert_page(Widget& child, int position); |
| 71 |
|
| 72 |
int insert_page(Widget& child, const Glib::ustring& tab_label, int position, bool use_mnemonic = false); |
| 73 |
_WRAP_METHOD(int insert_page(Widget& child, Widget& tab_label, Widget& menu_label, int position), gtk_notebook_insert_page_menu) |
| 74 |
//Ignore the possible-0 menu_label version of this method. It would have the same signature as another method. |
| 75 |
|
| 76 |
int insert_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, int position, bool use_mnemonic = false); |
| 77 |
|
| 78 |
_WRAP_METHOD(void remove_page(int page_number = 0), gtk_notebook_remove_page) |
| 79 |
void remove_page(Widget& child); |
| 80 |
|
| 81 |
_WRAP_METHOD(void set_group_name(const Glib::ustring& group_name), gtk_notebook_set_group_name) |
| 82 |
_WRAP_METHOD(Glib::ustring get_group_name() const, gtk_notebook_get_group_name) |
| 83 |
|
| 84 |
_WRAP_METHOD(int get_current_page() const, gtk_notebook_get_current_page) |
| 85 |
_WRAP_METHOD(Widget* get_nth_page(int page_number), gtk_notebook_get_nth_page) |
| 86 |
_WRAP_METHOD(const Widget* get_nth_page(int page_number) const, gtk_notebook_get_nth_page, constversion) |
| 87 |
_WRAP_METHOD(int get_n_pages() const, gtk_notebook_get_n_pages) |
| 88 |
/*Widget* get_current_page();*/ /*inconsistency with set_current_page*/ |
| 89 |
_WRAP_METHOD(int page_num(const Widget& child) const, gtk_notebook_page_num) |
| 90 |
|
| 91 |
_WRAP_METHOD(void set_current_page(int page_number), gtk_notebook_set_current_page) |
| 92 |
_WRAP_METHOD(void next_page(), gtk_notebook_next_page) |
| 93 |
_WRAP_METHOD(void prev_page(), gtk_notebook_prev_page) |
| 94 |
|
| 95 |
_WRAP_METHOD(void set_show_border(bool show_border = true), gtk_notebook_set_show_border) |
| 96 |
|
| 97 |
_WRAP_METHOD(bool get_show_border() const, gtk_notebook_get_show_border) |
| 98 |
_WRAP_METHOD(void set_show_tabs(bool show_tabs = true), gtk_notebook_set_show_tabs) |
| 99 |
_WRAP_METHOD(bool get_show_tabs() const, gtk_notebook_get_show_tabs) |
| 100 |
|
| 101 |
|
| 102 |
_WRAP_METHOD(void set_tab_pos(PositionType pos), gtk_notebook_set_tab_pos) |
| 103 |
_WRAP_METHOD(PositionType get_tab_pos() const, gtk_notebook_get_tab_pos) |
| 104 |
|
| 105 |
_WRAP_METHOD(void set_scrollable(bool scrollable = true), gtk_notebook_set_scrollable) |
| 106 |
_WRAP_METHOD(bool get_scrollable() const, gtk_notebook_get_scrollable) |
| 107 |
|
| 108 |
_WRAP_METHOD(guint16 get_tab_hborder() const, gtk_notebook_get_tab_hborder, deprecated "This method now returns zero.") |
| 109 |
_WRAP_METHOD(guint16 get_tab_vborder() const, gtk_notebook_get_tab_vborder, deprecated "This method now returns zero.") |
| 110 |
|
| 111 |
_WRAP_METHOD(void popup_enable(), gtk_notebook_popup_enable) |
| 112 |
|
| 113 |
_WRAP_METHOD(void popup_disable(), gtk_notebook_popup_disable) |
| 114 |
|
| 115 |
_WRAP_METHOD(Widget* get_tab_label(Widget& child), gtk_notebook_get_tab_label) |
| 116 |
_WRAP_METHOD(const Widget* get_tab_label(Widget& child) const, gtk_notebook_get_tab_label, constversion) |
| 117 |
_WRAP_METHOD(void set_tab_label(Widget& child, Widget& tab_label), gtk_notebook_set_tab_label) |
| 118 |
_WRAP_METHOD(void set_tab_label_text(Widget& child, const Glib::ustring& tab_text), gtk_notebook_set_tab_label_text) |
| 119 |
_WRAP_METHOD(Glib::ustring get_tab_label_text(Widget& child) const, gtk_notebook_get_tab_label_text) |
| 120 |
_WRAP_METHOD(Widget* get_menu_label(Widget& child), gtk_notebook_get_menu_label) |
| 121 |
_WRAP_METHOD(const Widget* get_menu_label(Widget& child) const, gtk_notebook_get_menu_label, constversion) |
| 122 |
_WRAP_METHOD(void set_menu_label(Widget& child, Widget& menu_label), gtk_notebook_set_menu_label) |
| 123 |
_WRAP_METHOD(void set_menu_label_text(Widget& child, const Glib::ustring& menu_text), gtk_notebook_set_menu_label_text) |
| 124 |
_WRAP_METHOD(Glib::ustring get_menu_label_text(Widget& child) const, gtk_notebook_get_menu_label_text) |
| 125 |
|
| 126 |
_WRAP_METHOD(void reorder_child(Widget& child, int position), gtk_notebook_reorder_child) |
| 127 |
|
| 128 |
_WRAP_METHOD(bool get_tab_reorderable(Widget& child) const, gtk_notebook_get_tab_reorderable) |
| 129 |
_WRAP_METHOD(void set_tab_reorderable(Widget& child, bool reorderable = true), gtk_notebook_set_tab_reorderable) |
| 130 |
_WRAP_METHOD(bool get_tab_detachable(Widget& child) const, gtk_notebook_get_tab_detachable) |
| 131 |
_WRAP_METHOD(void set_tab_detachable(Widget& child, bool detachable = true), gtk_notebook_set_tab_detachable) |
| 132 |
_WRAP_METHOD(void detach_tab(Widget& child), gtk_notebook_detach_tab) |
| 133 |
|
| 134 |
_WRAP_METHOD(Widget* get_action_widget(PackType pack_type = PACK_START), gtk_notebook_get_action_widget) |
| 135 |
_WRAP_METHOD(void set_action_widget(Widget* widget, PackType pack_type = PACK_START), gtk_notebook_set_action_widget) |
| 136 |
|
| 137 |
_WRAP_SIGNAL(void switch_page(Widget* page, guint page_number), "switch_page") |
| 138 |
_WRAP_SIGNAL(void page_reordered(Widget* page, guint page_num), "page_reordered", no_default_handler) |
| 139 |
_WRAP_SIGNAL(void page_removed(Widget* page, guint page_num), "page_removed", no_default_handler) |
| 140 |
_WRAP_SIGNAL(void page_added(Widget* page, guint page_num), "page_added", no_default_handler) |
| 141 |
|
| 142 |
//Key-binding signals: |
| 143 |
_IGNORE_SIGNAL("move_focus_out") |
| 144 |
_IGNORE_SIGNAL("select_page") |
| 145 |
_IGNORE_SIGNAL("focus_tab") |
| 146 |
_IGNORE_SIGNAL("change_current_page") |
| 147 |
_IGNORE_SIGNAL("reorder_tab") |
| 148 |
|
| 149 |
//This doesn't seem generally useful: |
| 150 |
_IGNORE_SIGNAL("create-window") |
| 151 |
|
| 152 |
_WRAP_PROPERTY("tab-pos", PositionType) |
| 153 |
_WRAP_PROPERTY("show-tabs", bool) |
| 154 |
_WRAP_PROPERTY("show-border", bool) |
| 155 |
_WRAP_PROPERTY("scrollable", bool) |
| 156 |
_WRAP_PROPERTY("page", int) |
| 157 |
_WRAP_PROPERTY("group-name", Glib::ustring) |
| 158 |
_WRAP_PROPERTY("enable-popup", bool) |
| 159 |
|
| 160 |
_WRAP_CHILD_PROPERTY("tab-label", Glib::ustring) |
| 161 |
_WRAP_CHILD_PROPERTY("menu-label", Glib::ustring) |
| 162 |
_WRAP_CHILD_PROPERTY("position", int) |
| 163 |
_WRAP_CHILD_PROPERTY("tab-expand", bool) |
| 164 |
_WRAP_CHILD_PROPERTY("tab-fill", bool) |
| 165 |
_WRAP_CHILD_PROPERTY("reorderable", bool) |
| 166 |
_WRAP_CHILD_PROPERTY("detachable", bool) |
| 167 |
}; |
| 168 |
|
| 169 |
} // namespace Gtk |