2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _GTKMM_NOTEBOOK_H
4
#define _GTKMM_NOTEBOOK_H
6
#include <gtkmmconfig.h>
12
* Copyright (C) 1998-2002 The gtkmm Development Team
14
* This library is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU Lesser General Public
16
* License as published by the Free Software Foundation; either
17
* version 2.1 of the License, or (at your option) any later version.
19
* This library is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* Lesser General Public License for more details.
24
* You should have received a copy of the GNU Lesser General Public
25
* License along with this library; if not, write to the Free
26
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
#include <gtkmm/container.h>
31
#include <gtkmm/label.h>
32
//#include <gtk/gtknotebook.h>
33
#include <glibmm/helperlist.h>
36
#ifndef DOXYGEN_SHOULD_SKIP_THIS
39
typedef struct _GtkNotebookPage GtkNotebookPage;
41
#endif //DOXYGEN_SHOULD_SKIP_THIS
43
#ifndef DOXYGEN_SHOULD_SKIP_THIS
44
typedef struct _GtkNotebook GtkNotebook;
45
typedef struct _GtkNotebookClass GtkNotebookClass;
46
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
50
{ class Notebook_Class; } // namespace Gtk
55
/** @addtogroup gtkmmEnums gtkmm Enums and Flags */
69
#ifndef DOXYGEN_SHOULD_SKIP_THIS
74
class Value<Gtk::NotebookTab> : public Glib::Value_Enum<Gtk::NotebookTab>
77
static GType value_type() G_GNUC_CONST;
81
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
90
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
92
namespace Notebook_Helpers
94
/*********************************************************************
96
*********************************************************************/
100
/* Since the data stored in GtkNotebook's GList is inaccessible
101
* the iterator "PageIterator" has to hold a pointer to the Notebook
102
* that owns the list. "Page" (the value_type of "PageList")
103
* inherits "PageIterator" privately and uses Notebook-API-functions
104
* to retrieve and manipulate data.
106
* Note that PageIterator uses g_list_* functions just to step through
107
* the children and test for iterator equality instead of simply using
108
* the child index number. This is done because even if you use a
109
* child index number, you would still have to use g_list_length() to
110
* retrieve the number of elements. And using an element index results
111
* in iterators not staying valid on insertion/removal. This would only
112
* lead to fragile and unexpected behaviour.
113
* (Thanks for this explanation, Daniel!)
115
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
120
typedef std::bidirectional_iterator_tag iterator_category;
121
typedef size_t size_type;
122
typedef ptrdiff_t difference_type;
124
typedef Page value_type;
125
typedef const Page* pointer;
126
typedef const Page& reference;
128
PageIterator(Gtk::Notebook* parent, GList* node) : node_(node), parent_(parent) {}
129
PageIterator() : node_(0), parent_(0) {}
131
bool equal(const PageIterator& other) const;
132
operator bool() const;
134
PageIterator& operator++();
135
const PageIterator operator++(int);
137
PageIterator& operator--();
138
const PageIterator operator--(int);
140
inline reference operator*() const;
141
inline pointer operator->() const;
145
Gtk::Notebook* parent_;
147
friend class Gtk::Notebook_Helpers::Page;
150
/** @relates Gtk::Notebook_Helpers::PageIterator */
151
inline bool operator==(const PageIterator& lhs, const PageIterator& rhs)
152
{ return lhs.equal(rhs); }
154
/** @relates Gtk::Notebook_Helpers::PageIterator */
155
inline bool operator!=(const PageIterator& lhs, const PageIterator& rhs)
156
{ return !lhs.equal(rhs); }
158
// Page is the output class
159
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
161
class Page : public PageIterator
166
Page& operator=(const Page&);
169
#ifndef GTKMM_DISABLE_DEPRECATED
171
int get_page_num() const;
172
Widget* get_child() const;
173
Widget* get_tab_label() const;
174
void set_tab_label(Widget& tab_label);
175
void set_tab_label_text(const Glib::ustring& tab_text);
176
Glib::ustring get_tab_label_text() const;
177
Widget* get_menu_label() const;
178
void set_menu_label(Widget& menu_label);
179
void set_menu_label_text(const Glib::ustring& menu_text);
180
Glib::ustring get_menu_label_text() const;
183
/** @deprecated Query the "tab-expand" and "tab-fill" child properties instead.
185
void query_tab_label_packing(bool& expand, bool& fill, PackType& pack_type);
187
/** @deprecated Modify the "tab-expand" and "tab-fill" child properties instead.
189
void set_tab_label_packing(bool expand, bool fill, PackType pack_type);
190
#endif // GTKMM_DISABLE_DEPRECATED
194
//We don't put PageList in a deprecation ifdef because it is used by a member variable and we don't want to break ABI.
196
// Element is the input class
197
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
204
Element(Widget* child, Widget* tab, Widget* menu);
205
Element(Widget& child, Widget& tab, Widget& menu);
206
explicit Element(Widget& child);
209
friend class PageList;
215
#ifndef GTKMM_DISABLE_DEPRECATED
218
// Just a widget without a tab
219
typedef Element WidgetElem;
221
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
223
struct TabElem : public Element
225
TabElem(Widget& child, Widget& tab);
226
TabElem(Widget& child, const Glib::ustring& label, bool mnemonic = false);
229
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
231
struct MenuElem : public Element
233
MenuElem(Widget& child, Widget& menu);
236
#endif // GTKMM_DISABLE_DEPRECATED
239
/*********************************************************************
240
***** List properties
241
*********************************************************************/
243
/** An STL-style container for pages in a Gtk::Notebook.
244
* @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
250
explicit PageList(GtkNotebook* gparent);
251
PageList(const PageList& src);
253
PageList& operator=(const PageList& src);
255
typedef Page value_type;
256
typedef Page& reference;
257
typedef const Page& const_reference;
259
typedef PageIterator iterator;
260
#ifndef GTKMM_DISABLE_DEPRECATED
262
typedef Glib::List_ConstIterator<iterator> const_iterator;
263
typedef Glib::List_ReverseIterator<iterator> reverse_iterator;
264
typedef Glib::List_ConstIterator<reverse_iterator> const_reverse_iterator;
266
typedef const Element element_type;
268
typedef size_t difference_type;
269
typedef size_t size_type;
271
inline GtkNotebook* gparent()
273
inline const GtkNotebook* gparent() const
276
size_type size() const;
278
size_type max_size() const;
281
inline iterator begin()
283
inline iterator end()
286
inline const_iterator begin() const
287
{ return const_iterator(begin_()); }
288
inline const_iterator end() const
289
{ return const_iterator(end_()); }
291
inline reverse_iterator rbegin()
292
{ return reverse_iterator(end_()); }
293
inline reverse_iterator rend()
294
{ return reverse_iterator(begin_()); }
296
inline const_reverse_iterator rbegin() const
297
{ return const_reverse_iterator(reverse_iterator(end_())); }
298
inline const_reverse_iterator rend() const
299
{ return const_reverse_iterator(reverse_iterator(begin_())); }
301
value_type front() const;
302
value_type back() const;
304
value_type operator[](size_type l) const;
306
iterator insert(iterator position, element_type& e); //custom-implemented.
308
template <class InputIterator>
309
inline void insert(iterator position, InputIterator first, InputIterator last)
311
for(;first != last; ++first)
312
position = insert(position, *first);
315
inline void push_front(element_type& e)
316
{ insert(begin(), e); }
317
inline void push_back(element_type& e)
318
{ insert(end(), e); }
320
void erase(iterator start, iterator stop);
321
iterator erase(iterator);
322
void remove(const_reference child);
323
void remove(Widget& w);
325
void reorder(iterator loc, iterator page); // Non-standard
327
iterator find(int num);
328
iterator find(const_reference c);
329
iterator find(Widget& w);
330
iterator find(GtkNotebookPage* t);
332
inline void pop_front()
334
inline void pop_back()
338
#endif // GTKMM_DISABLE_DEPRECATED
342
iterator begin_() const;
343
iterator end_() const;
345
GtkNotebook* gparent_;
348
} // Notebook_Helpers
350
/** Container which shows one of its children at a time, in tabbed windows.
352
* The Gtk::Notebook widget is a Gtk::Container whose children are pages that
353
* can be switched between using tab labels along one edge.
355
* A Notebook widget looks like this:
356
* @image html notebook1.png
359
* @ingroup Containers
362
class Notebook : public Container
365
#ifndef DOXYGEN_SHOULD_SKIP_THIS
366
typedef Notebook CppObjectType;
367
typedef Notebook_Class CppClassType;
368
typedef GtkNotebook BaseObjectType;
369
typedef GtkNotebookClass BaseClassType;
370
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
374
#ifndef DOXYGEN_SHOULD_SKIP_THIS
377
friend class Notebook_Class;
378
static CppClassType notebook_class_;
381
Notebook(const Notebook&);
382
Notebook& operator=(const Notebook&);
385
explicit Notebook(const Glib::ConstructParams& construct_params);
386
explicit Notebook(GtkNotebook* castitem);
388
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
391
#ifndef DOXYGEN_SHOULD_SKIP_THIS
392
static GType get_type() G_GNUC_CONST;
395
static GType get_base_type() G_GNUC_CONST;
398
///Provides access to the underlying C GtkObject.
399
GtkNotebook* gobj() { return reinterpret_cast<GtkNotebook*>(gobject_); }
401
///Provides access to the underlying C GtkObject.
402
const GtkNotebook* gobj() const { return reinterpret_cast<GtkNotebook*>(gobject_); }
406
//C++ methods used to invoke GTK+ virtual functions:
409
//GTK+ Virtual Functions (override these to change behaviour):
411
//Default Signal Handlers::
412
virtual void on_switch_page(GtkNotebookPage* page, guint page_num);
420
//We don't put PageList in a deprecation ifdef because it is used by a member variable and we don't want to break ABI.
421
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
423
typedef Notebook_Helpers::PageList PageList;
429
/** Prepends a page to @a notebook.
430
* @param child The Gtk::Widget to use as the contents of the page.
431
* @param tab_label The Gtk::Widget to be used as the label for the page.
433
int prepend_page(Widget& child, Widget& tab_label);
434
int prepend_page(Widget& child);
436
int prepend_page(Widget& child, const Glib::ustring& tab_label, bool use_mnemonic = false);
438
/** Prepends a page to @a notebook, specifying the widget to use as the
439
* label in the popup menu.
440
* @param child The Gtk::Widget to use as the contents of the page.
441
* @param tab_label The Gtk::Widget to be used as the label for the page.
442
* @param menu_label The widget to use as a label for the page-switch
445
int prepend_page(Widget& child, Widget& tab_label, Widget& menu_label);
446
//Ignore the possible-0 menu_label version of this method. It would have the same signature as another method.
448
int prepend_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic);
451
/** Appends a page to @a notebook.
452
* @param child The Gtk::Widget to use as the contents of the page.
453
* @param tab_label The Gtk::Widget to be used as the label for the page.
455
int append_page(Widget& child, Widget& tab_label);
456
int append_page(Widget& child);
457
int append_page(Widget& child, const Glib::ustring& tab_label, bool use_mnemonic = false);
460
/** Appends a page to @a notebook, specifying the widget to use as the
461
* label in the popup menu.
462
* @param child The Gtk::Widget to use as the contents of the page.
463
* @param tab_label The Gtk::Widget to be used as the label for the page.
464
* @param menu_label The widget to use as a label for the page-switch
467
int append_page(Widget& child, Widget& tab_label, Widget& menu_label);
468
//Ignore the possible-0 menu_label version of this method. It would have the same signature as another method.
470
int append_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic = false);
473
/** Insert a page into @a notebook at the given position
474
* @param child The Gtk::Widget to use as the contents of the page.
475
* @param tab_label The Gtk::Widget to be used as the label for the page.
476
* @param position The index (starting at 0) at which to insert the page,
477
* or -1 to append the page after all other pages.
479
int insert_page(Widget& child, Widget& tab_label, int position);
480
int insert_page(Widget& child, int position);
482
int insert_page(Widget& child, const Glib::ustring& tab_label, int position, bool use_mnemonic = false);
484
/** Insert a page into @a notebook at the given position, specifying
485
* the widget to use as the label in the popup menu.
486
* @param child The Gtk::Widget to use as the contents of the page.
487
* @param tab_label The Gtk::Widget to be used as the label for the page..
488
* @param menu_label The widget to use as a label for the page-switch
490
* @param position The index (starting at 0) at which to insert the page,
491
* or -1 to append the page after all other pages.
493
int insert_page(Widget& child, Widget& tab_label, Widget& menu_label, int position);
494
//Ignore the possible-0 menu_label version of this method. It would have the same signature as another method.
496
int insert_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, int position, bool use_mnemonic = false);
499
/** Removes a page from the notebook given its index
501
* @param page_num The index of a notebook page, starting
502
* from 0. If -1, the last page will
505
void remove_page(int page_num = 0);
506
void remove_page(Widget& child);
508
#ifndef GTKMM_DISABLE_DEPRECATED
511
* Notebook* on_window_creation(Widget* page, int x, int y);
513
typedef sigc::slot<Notebook*, Widget*, int, int> SlotWindowCreation;
515
/** @deprecated Use the GtkNotebook::create-window signal instead.
517
static void set_window_creation_hook(const SlotWindowCreation& slot);
519
#endif // GTKMM_DISABLE_DEPRECATED
522
#ifndef GTKMM_DISABLE_DEPRECATED
524
/** Sets an group identificator for @a notebook, notebooks sharing
525
* the same group identificator will be able to exchange tabs
526
* via drag and drop. A notebook with group identificator -1 will
527
* not be able to exchange tabs with any other notebook.
530
* Deprecated: 2.12: use set_group_name() instead.
531
* @param group_id A group identificator, or -1 to unset it.
533
void set_group_id(int group_id);
534
#endif // GTKMM_DISABLE_DEPRECATED
537
#ifndef GTKMM_DISABLE_DEPRECATED
539
/** Gets the current group identificator for @a notebook.
542
* Deprecated: 2.12: use get_group_name() instead.
543
* @return The group identificator, or -1 if none is set.
545
int get_group_id() const;
546
#endif // GTKMM_DISABLE_DEPRECATED
549
//TODO: Use something nicer than void*/gpointer?
551
#ifndef GTKMM_DISABLE_DEPRECATED
553
/** Sets a group identificator pointer for @a notebook, notebooks sharing
554
* the same group identificator pointer will be able to exchange tabs
555
* via drag and drop. A notebook with a <tt>0</tt> group identificator will
556
* not be able to exchange tabs with any other notebook.
560
* Deprecated: 2.24: Use set_group_name() instead
561
* @param group A pointer to identify the notebook group, or <tt>0</tt> to unset it.
563
void set_group(void* group);
564
#endif // GTKMM_DISABLE_DEPRECATED
567
#ifndef GTKMM_DISABLE_DEPRECATED
569
/** Gets the current group identificator pointer for @a notebook.
573
* Deprecated: 2.24: Use get_group_name() instead
574
* @return The group identificator,
575
* or <tt>0</tt> if none is set.
578
#endif // GTKMM_DISABLE_DEPRECATED
581
#ifndef GTKMM_DISABLE_DEPRECATED
583
/** Gets the current group identificator pointer for @a notebook.
587
* Deprecated: 2.24: Use get_group_name() instead
588
* @return The group identificator,
589
* or <tt>0</tt> if none is set.
591
const void* get_group() const;
592
#endif // GTKMM_DISABLE_DEPRECATED
595
/** Sets a group name for @a notebook.
597
* Notebooks with the same name will be able to exchange tabs
598
* via drag and drop. A notebook with a <tt>0</tt> group name will
599
* not be able to exchange tabs with any other notebook.
602
* @param name The name of the notebook group, or <tt>0</tt> to unset it.
604
void set_group_name(const Glib::ustring& group_name);
606
/** Gets the current group name for @a notebook.
608
* Note that this funtion can emphasis not be used
609
* together with set_group() or
612
* Return Value: (transfer none): the group name,
613
* or <tt>0</tt> if none is set.
617
Glib::ustring get_group_name() const;
620
/** Returns the page number of the current page.
621
* @return The index (starting from 0) of the current
622
* page in the notebook. If the notebook has no pages, then
623
* -1 will be returned.
625
int get_current_page() const;
627
/** Returns the child widget contained in page number @a page_num.
628
* @param page_num The index of a page in the notebook, or -1
629
* to get the last page.
630
* @return The child widget, or <tt>0</tt> if @a page_num is
633
Widget* get_nth_page(int page_num);
635
/** Returns the child widget contained in page number @a page_num.
636
* @param page_num The index of a page in the notebook, or -1
637
* to get the last page.
638
* @return The child widget, or <tt>0</tt> if @a page_num is
641
const Widget* get_nth_page(int page_num) const;
643
#ifndef GTKMM_DISABLE_DEPRECATED
645
/** Gets the number of pages in a notebook.
648
* @deprecated Use the const method.
649
* @return The number of pages in the notebook.
652
#endif // GTKMM_DISABLE_DEPRECATED
655
/** Gets the number of pages in a notebook.
658
* @return The number of pages in the notebook.
660
int get_n_pages() const;
661
/*Widget* get_current_page();*/ /*inconsistency with set_current_page*/
663
#ifndef GTKMM_DISABLE_DEPRECATED
665
/** Finds the index of the page which contains the given child
667
* @deprecated Use the const method.
668
* @param child A Gtk::Widget.
669
* @return The index of the page containing @a child, or
670
* -1 if @a child is not in the notebook.
672
int page_num(const Widget& child);
673
#endif // GTKMM_DISABLE_DEPRECATED
676
/** Finds the index of the page which contains the given child
678
* @param child A Gtk::Widget.
679
* @return The index of the page containing @a child, or
680
* -1 if @a child is not in the notebook.
682
int page_num(const Widget& child) const;
685
/** Switches to the page number @a page_num.
687
* Note that due to historical reasons, GtkNotebook refuses
688
* to switch to a page unless the child widget is visible.
689
* Therefore, it is recommended to show child widgets before
690
* adding them to a notebook.
691
* @param page_num Index of the page to switch to, starting from 0.
692
* If negative, the last page will be used. If greater
693
* than the number of pages in the notebook, nothing
696
void set_current_page(int page_num);
698
/** Switches to the next page. Nothing happens if the current page is
703
/** Switches to the previous page. Nothing happens if the current page
709
/** Sets whether a bevel will be drawn around the notebook pages.
710
* This only has a visual effect when the tabs are not shown.
711
* See set_show_tabs().
712
* @param show_border <tt>true</tt> if a bevel should be drawn around the notebook.
714
void set_show_border(bool show_border = true);
717
/** Returns whether a bevel will be drawn around the notebook pages. See
719
* @return <tt>true</tt> if the bevel is drawn.
721
bool get_show_border() const;
723
/** Sets whether to show the tabs for the notebook or not.
724
* @param show_tabs <tt>true</tt> if the tabs should be shown.
726
void set_show_tabs(bool show_tabs = true);
728
/** Returns whether the tabs of the notebook are shown. See
730
* @return <tt>true</tt> if the tabs are shown.
732
bool get_show_tabs() const;
735
/** Sets the edge at which the tabs for switching pages in the
736
* notebook are drawn.
737
* @param pos The edge to draw the tabs at.
739
void set_tab_pos(PositionType pos);
741
/** Gets the edge at which the tabs for switching pages in the
742
* notebook are drawn.
743
* @return The edge at which the tabs are drawn.
745
PositionType get_tab_pos() const;
748
/** Sets whether the tab label area will have arrows for scrolling if
749
* there are too many tabs to fit in the area.
750
* @param scrollable <tt>true</tt> if scroll arrows should be added.
752
void set_scrollable(bool scrollable = true);
754
/** Returns whether the tab label area has arrows for scrolling. See
756
* @return <tt>true</tt> if arrows for scrolling are present.
758
bool get_scrollable() const;
761
/** Returns the horizontal width of a tab border.
764
* @return Horizontal width of a tab border.
766
guint16 get_tab_hborder() const;
768
/** Returns the vertical width of a tab border.
771
* @return Vertical width of a tab border.
773
guint16 get_tab_vborder() const;
776
/** Enables the popup menu: if the user clicks with the right mouse button on
777
* the tab labels, a menu with all the pages will be popped up.
782
/** Disables the popup menu.
784
void popup_disable();
787
/** Returns the tab label widget for the page @a child. <tt>0</tt> is returned
788
* if @a child is not in @a notebook or if no tab label has specifically
789
* been set for @a child.
790
* @param child The page.
791
* @return The tab label.
793
Widget* get_tab_label(Widget& child);
795
/** Returns the tab label widget for the page @a child. <tt>0</tt> is returned
796
* if @a child is not in @a notebook or if no tab label has specifically
797
* been set for @a child.
798
* @param child The page.
799
* @return The tab label.
801
const Widget* get_tab_label(Widget& child) const;
803
/** Changes the tab label for @a child. If <tt>0</tt> is specified
804
* for @a tab_label, then the page will have the label 'page N'.
805
* @param child The page.
806
* @param tab_label The tab label widget to use, or <tt>0</tt> for default tab
809
void set_tab_label(Widget& child, Widget& tab_label);
811
/** Creates a new label and sets it as the tab label for the page
812
* containing @a child.
813
* @param child The page.
814
* @param tab_text The label text.
816
void set_tab_label_text(Widget& child, const Glib::ustring& tab_text);
818
/** Retrieves the text of the tab label for the page containing
820
* @param child A widget contained in a page of @a notebook.
821
* @return Value: the text of the tab label.
823
Glib::ustring get_tab_label_text(Widget& child) const;
825
/** Retrieves the menu label widget of the page containing @a child.
826
* @param child A widget contained in a page of @a notebook.
827
* @return The menu label, or <tt>0</tt> if the
828
* notebook page does not have a menu label other than the
829
* default (the tab label).
831
Widget* get_menu_label(Widget& child);
833
/** Retrieves the menu label widget of the page containing @a child.
834
* @param child A widget contained in a page of @a notebook.
835
* @return The menu label, or <tt>0</tt> if the
836
* notebook page does not have a menu label other than the
837
* default (the tab label).
839
const Widget* get_menu_label(Widget& child) const;
841
/** Changes the menu label for the page containing @a child.
842
* @param child The child widget.
843
* @param menu_label The menu label, or <tt>0</tt> for default.
845
void set_menu_label(Widget& child, Widget& menu_label);
847
/** Creates a new label and sets it as the menu label of @a child.
848
* @param child The child widget.
849
* @param menu_text The label text.
851
void set_menu_label_text(Widget& child, const Glib::ustring& menu_text);
853
/** Retrieves the text of the menu label for the page containing
855
* @param child The child widget of a page of the notebook.
856
* @return Value: the text of the tab label.
858
Glib::ustring get_menu_label_text(Widget& child) const;
860
#ifndef GTKMM_DISABLE_DEPRECATED
862
/** @deprecated Modify the "tab-expand" and "tab-fill" child properties instead.
864
void query_tab_label_packing(Widget& child, bool& expand, bool& fill, PackType& pack_type);
866
#endif // GTKMM_DISABLE_DEPRECATED
869
#ifndef GTKMM_DISABLE_DEPRECATED
871
/** Sets the packing parameters for the tab label of the page
872
* containing @a child. See Gtk::Box::pack_start() for the exact meaning
875
* Deprecated: 2.20: Modify the Gtk::Notebook:tab-expand and
876
* Gtk::Notebook:tab-fill child properties instead.
877
* Modifying the packing of the tab label is a deprecated feature and
878
* shouldn't be done anymore.
879
* @param child The child widget.
880
* @param expand Whether to expand the tab label or not.
881
* @param fill Whether the tab label should fill the allocated area or not.
882
* @param pack_type The position of the tab label.
884
void set_tab_label_packing(Widget& child, bool expand, bool fill, PackType pack_type);
885
#endif // GTKMM_DISABLE_DEPRECATED
888
/** Reorders the page containing @a child, so that it appears in position
889
* @a position. If @a position is greater than or equal to the number of
890
* children in the list or negative, @a child will be moved to the end
892
* @param child The child to move.
893
* @param position The new position, or -1 to move to the end.
895
void reorder_child(Widget& child, int position);
898
/** Gets whether the tab can be reordered via drag and drop or not.
901
* @param child A child Gtk::Widget.
902
* @return <tt>true</tt> if the tab is reorderable.
904
bool get_tab_reorderable(Widget& child) const;
906
/** Sets whether the notebook tab can be reordered
907
* via drag and drop or not.
910
* @param child A child Gtk::Widget.
911
* @param reorderable Whether the tab is reorderable or not.
913
void set_tab_reorderable(Widget& child, bool reorderable = true);
915
/** Returns whether the tab contents can be detached from @a notebook.
918
* @param child A child Gtk::Widget.
919
* @return <tt>true</tt> if the tab is detachable.
921
bool get_tab_detachable(Widget& child) const;
923
/** Sets whether the tab can be detached from @a notebook to another
924
* notebook or widget.
926
* Note that 2 notebooks must share a common group identificator
927
* (see set_group_id()) to allow automatic tabs
928
* interchange between them.
930
* If you want a widget to interact with a notebook through DnD
931
* (i.e.: accept dragged tabs from it) it must be set as a drop
932
* destination and accept the target "GTK_NOTEBOOK_TAB". The notebook
933
* will fill the selection with a GtkWidget** pointing to the child
934
* widget that corresponds to the dropped tab.
937
* on_drop_zone_drag_data_received (GtkWidget *widget,
938
* GdkDragContext *context,
941
* GtkSelectionData *selection_data,
942
* <tt>unsigned int</tt> info,
943
* <tt>unsigned int</tt> time,
944
* gpointer user_data)
946
* GtkWidget *notebook;
949
* notebook = gtk_drag_get_source_widget (context);
950
* child = (void*) selection_data->data;
952
* process_widget (*child);
953
* gtk_container_remove (GTK_CONTAINER (notebook), *child);
957
* If you want a notebook to accept drags from other widgets,
958
* you will have to set your own DnD code to do it.
961
* @param child A child Gtk::Widget.
962
* @param detachable Whether the tab is detachable or not.
964
void set_tab_detachable(Widget& child, bool detachable = true);
967
/** Gets one of the action widgets. See set_action_widget().
970
* @param pack_type Pack type of the action widget to receive.
971
* @return The action widget with the given @a pack_type
972
* or <tt>0</tt> when this action widget has not been set.
974
Widget* get_action_widget(PackType pack_type = PACK_START);
976
/** Sets @a widget as one of the action widgets. Depending on the pack type
977
* the widget will be placed before or after the tabs. You can use
978
* a Gtk::Box if you need to pack more than one widget on the same side.
980
* Note that action widgets are "internal" children of the notebook and thus
981
* not included in the list returned from Gtk::Container::foreach().
984
* @param widget A Gtk::Widget.
985
* @param pack_type Pack type of the action widget.
987
void set_action_widget(Widget* widget, PackType pack_type = PACK_START);
989
#ifndef GTKMM_DISABLE_DEPRECATED
991
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
993
PageList::iterator get_current();
995
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
999
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
1001
const PageList& pages() const;
1002
#endif // GTKMM_DISABLE_DEPRECATED
1007
* <tt>void on_my_%switch_page(GtkNotebookPage* page, guint page_num)</tt>
1010
Glib::SignalProxy2< void,GtkNotebookPage*,guint > signal_switch_page();
1015
* <tt>void on_my_%page_reordered(Widget* page, guint page_num)</tt>
1018
Glib::SignalProxy2< void,Widget*,guint > signal_page_reordered();
1023
* <tt>void on_my_%page_removed(Widget* page, guint page_num)</tt>
1026
Glib::SignalProxy2< void,Widget*,guint > signal_page_removed();
1031
* <tt>void on_my_%page_added(Widget* page, guint page_num)</tt>
1034
Glib::SignalProxy2< void,Widget*,guint > signal_page_added();
1037
//Key-binding signals:
1040
//This doesn't seem generally useful:
1043
#ifdef GLIBMM_PROPERTIES_ENABLED
1044
/** Which side of the notebook holds the tabs.
1046
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1047
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1048
* the value of the property changes.
1050
Glib::PropertyProxy<PositionType> property_tab_pos() ;
1051
#endif //#GLIBMM_PROPERTIES_ENABLED
1053
#ifdef GLIBMM_PROPERTIES_ENABLED
1054
/** Which side of the notebook holds the tabs.
1056
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1057
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1058
* the value of the property changes.
1060
Glib::PropertyProxy_ReadOnly<PositionType> property_tab_pos() const;
1061
#endif //#GLIBMM_PROPERTIES_ENABLED
1063
#ifdef GLIBMM_PROPERTIES_ENABLED
1064
/** Whether tabs should be shown or not.
1066
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1067
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1068
* the value of the property changes.
1070
Glib::PropertyProxy<bool> property_show_tabs() ;
1071
#endif //#GLIBMM_PROPERTIES_ENABLED
1073
#ifdef GLIBMM_PROPERTIES_ENABLED
1074
/** Whether tabs should be shown or not.
1076
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1077
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1078
* the value of the property changes.
1080
Glib::PropertyProxy_ReadOnly<bool> property_show_tabs() const;
1081
#endif //#GLIBMM_PROPERTIES_ENABLED
1083
#ifdef GLIBMM_PROPERTIES_ENABLED
1084
/** Whether the border should be shown or not.
1086
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1087
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1088
* the value of the property changes.
1090
Glib::PropertyProxy<bool> property_show_border() ;
1091
#endif //#GLIBMM_PROPERTIES_ENABLED
1093
#ifdef GLIBMM_PROPERTIES_ENABLED
1094
/** Whether the border should be shown or not.
1096
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1097
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1098
* the value of the property changes.
1100
Glib::PropertyProxy_ReadOnly<bool> property_show_border() const;
1101
#endif //#GLIBMM_PROPERTIES_ENABLED
1103
#ifdef GLIBMM_PROPERTIES_ENABLED
1104
/** If TRUE, scroll arrows are added if there are too many tabs to fit.
1106
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1107
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1108
* the value of the property changes.
1110
Glib::PropertyProxy<bool> property_scrollable() ;
1111
#endif //#GLIBMM_PROPERTIES_ENABLED
1113
#ifdef GLIBMM_PROPERTIES_ENABLED
1114
/** If TRUE, scroll arrows are added if there are too many tabs to fit.
1116
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1117
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1118
* the value of the property changes.
1120
Glib::PropertyProxy_ReadOnly<bool> property_scrollable() const;
1121
#endif //#GLIBMM_PROPERTIES_ENABLED
1123
#ifdef GLIBMM_PROPERTIES_ENABLED
1124
/** Width of the border around the tab labels.
1126
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1127
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1128
* the value of the property changes.
1130
Glib::PropertyProxy_WriteOnly<guint> property_tab_border() ;
1131
#endif //#GLIBMM_PROPERTIES_ENABLED
1134
#ifdef GLIBMM_PROPERTIES_ENABLED
1135
/** Width of the horizontal border of tab labels.
1137
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1138
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1139
* the value of the property changes.
1141
Glib::PropertyProxy<guint> property_tab_hborder() ;
1142
#endif //#GLIBMM_PROPERTIES_ENABLED
1144
#ifdef GLIBMM_PROPERTIES_ENABLED
1145
/** Width of the horizontal border of tab labels.
1147
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1148
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1149
* the value of the property changes.
1151
Glib::PropertyProxy_ReadOnly<guint> property_tab_hborder() const;
1152
#endif //#GLIBMM_PROPERTIES_ENABLED
1154
#ifdef GLIBMM_PROPERTIES_ENABLED
1155
/** Width of the vertical border of tab labels.
1157
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1158
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1159
* the value of the property changes.
1161
Glib::PropertyProxy<guint> property_tab_vborder() ;
1162
#endif //#GLIBMM_PROPERTIES_ENABLED
1164
#ifdef GLIBMM_PROPERTIES_ENABLED
1165
/** Width of the vertical border of tab labels.
1167
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1168
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1169
* the value of the property changes.
1171
Glib::PropertyProxy_ReadOnly<guint> property_tab_vborder() const;
1172
#endif //#GLIBMM_PROPERTIES_ENABLED
1174
#ifdef GLIBMM_PROPERTIES_ENABLED
1175
/** The index of the current page.
1177
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1178
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1179
* the value of the property changes.
1181
Glib::PropertyProxy<int> property_page() ;
1182
#endif //#GLIBMM_PROPERTIES_ENABLED
1184
#ifdef GLIBMM_PROPERTIES_ENABLED
1185
/** The index of the current page.
1187
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1188
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1189
* the value of the property changes.
1191
Glib::PropertyProxy_ReadOnly<int> property_page() const;
1192
#endif //#GLIBMM_PROPERTIES_ENABLED
1194
#ifdef GLIBMM_PROPERTIES_ENABLED
1195
/** If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page.
1197
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1198
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1199
* the value of the property changes.
1201
Glib::PropertyProxy<bool> property_enable_popup() ;
1202
#endif //#GLIBMM_PROPERTIES_ENABLED
1204
#ifdef GLIBMM_PROPERTIES_ENABLED
1205
/** If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page.
1207
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1208
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1209
* the value of the property changes.
1211
Glib::PropertyProxy_ReadOnly<bool> property_enable_popup() const;
1212
#endif //#GLIBMM_PROPERTIES_ENABLED
1214
#ifdef GLIBMM_PROPERTIES_ENABLED
1215
/** Whether tabs should have homogeneous sizes.
1217
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1218
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1219
* the value of the property changes.
1221
Glib::PropertyProxy<bool> property_homogeneous() ;
1222
#endif //#GLIBMM_PROPERTIES_ENABLED
1224
#ifdef GLIBMM_PROPERTIES_ENABLED
1225
/** Whether tabs should have homogeneous sizes.
1227
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1228
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1229
* the value of the property changes.
1231
Glib::PropertyProxy_ReadOnly<bool> property_homogeneous() const;
1232
#endif //#GLIBMM_PROPERTIES_ENABLED
1234
#ifdef GLIBMM_PROPERTIES_ENABLED
1235
/** Group ID for tabs drag and drop.
1237
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1238
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1239
* the value of the property changes.
1241
Glib::PropertyProxy<int> property_group_id() ;
1242
#endif //#GLIBMM_PROPERTIES_ENABLED
1244
#ifdef GLIBMM_PROPERTIES_ENABLED
1245
/** Group ID for tabs drag and drop.
1247
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1248
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1249
* the value of the property changes.
1251
Glib::PropertyProxy_ReadOnly<int> property_group_id() const;
1252
#endif //#GLIBMM_PROPERTIES_ENABLED
1254
#ifdef GLIBMM_PROPERTIES_ENABLED
1255
/** Group for tabs drag and drop.
1257
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1258
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1259
* the value of the property changes.
1261
Glib::PropertyProxy<void*> property_group() ;
1262
#endif //#GLIBMM_PROPERTIES_ENABLED
1264
#ifdef GLIBMM_PROPERTIES_ENABLED
1265
/** Group for tabs drag and drop.
1267
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1268
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1269
* the value of the property changes.
1271
Glib::PropertyProxy_ReadOnly<void*> property_group() const;
1272
#endif //#GLIBMM_PROPERTIES_ENABLED
1273
//TODO: What is this?
1276
#ifndef DOXYGEN_SHOULD_SKIP_THIS
1277
/** @deprecated Use Notebook::get_current_page(), Notebook::get_nth_page(), etc. instead.
1279
mutable PageList pages_proxy_;
1280
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
1285
#ifndef DOXYGEN_SHOULD_SKIP_THIS
1287
namespace Notebook_Helpers
1290
/**** PageIterator **************************************************/
1293
PageIterator::reference PageIterator::operator*() const
1295
return static_cast<const Page&>(*this);
1299
PageIterator::pointer PageIterator::operator->() const
1301
return static_cast<const Page*>(this);
1304
} // namespace Notebook_Helpers
1306
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
1313
/** A Glib::wrap() method for this object.
1315
* @param object The C instance.
1316
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
1317
* @result A C++ instance that wraps this C instance.
1319
* @relates Gtk::Notebook
1321
Gtk::Notebook* wrap(GtkNotebook* object, bool take_copy = false);
1325
#endif /* _GTKMM_NOTEBOOK_H */