GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

notebook.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Develeopement Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GTK_NOTEBOOK_HH 00026 #define GFC_GTK_NOTEBOOK_HH 00027 00028 #ifndef GFC_GTK_CONTAINER_HH 00029 #include <gfc/gtk/container.hh> 00030 #endif 00031 00032 #ifndef __GTK_NOTEBOOK_H__ 00033 #include <gtk/gtknotebook.h> 00034 #endif 00035 00036 namespace GFC { 00037 00038 namespace Gtk { 00039 00040 class Label; 00041 00045 00046 enum NotebookTab 00047 { 00048 NOTEBOOK_TAB_FIRST = GTK_NOTEBOOK_TAB_FIRST, 00050 00051 NOTEBOOK_TAB_LAST = GTK_NOTEBOOK_TAB_LAST 00053 }; 00054 00065 00066 class Notebook : public Container 00067 { 00068 friend class G::Object; 00069 00070 Notebook(const Notebook&); 00071 Notebook& operator=(const Notebook&); 00072 00073 protected: 00076 00077 explicit Notebook(GtkNotebook *notebook, bool owns_reference = false); 00084 00087 00088 typedef G::Signal<void, Widget&, unsigned int> SwitchPageSignalType; 00089 typedef G::SignalProxy<TypeInstance, SwitchPageSignalType> SwitchPageSignalProxy; 00090 static const SwitchPageSignalType switch_page_signal; 00097 00099 00100 public: 00103 00104 Notebook(); 00106 00107 virtual ~Notebook(); 00109 00113 00114 GtkNotebook* gtk_notebook() const; 00116 00117 operator GtkNotebook* () const; 00119 00120 int get_current_page() const; 00125 00126 Widget* get_current_nth_page() const; 00129 00130 Widget* get_nth_page(int page_num) const; 00134 00135 int get_n_pages() const; 00137 00138 int page_num(const Widget& child) const; 00142 00143 bool get_show_border() const; 00146 00147 bool get_show_tabs() const; 00150 00151 PositionType get_tab_pos() const; 00154 00155 bool get_scrollable() const; 00158 00159 Label* get_tab_label(const Widget& child) const; 00166 00167 Label* get_tab_label(int page_num) const; 00174 00175 String get_tab_label_text(const Widget& child) const; 00179 00180 String get_tab_label_text(int page_num) const; 00184 00185 Label* get_menu_label(const Widget& child) const; 00189 00190 Label* get_menu_label(int page_num) const; 00194 00195 String get_menu_label_text(const Widget& child) const; 00200 00201 String get_menu_label_text(int page_num) const; 00206 00207 void query_tab_label_packing(const Widget& child, bool *expand, bool *fill, PackType *pack_type) const; 00213 00217 00218 int append_page(Widget& child, Widget *tab_label = 0, Widget *menu_label = 0); 00230 00231 int append_page(Widget& child, const char *tab_label, const char *menu_label = 0); 00232 int append_page(Widget& child, const String& tab_label, const String& menu_label = 0); 00240 00241 int prepend_page(Widget& child, Widget *tab_label = 0, Widget *menu_label = 0); 00253 00254 int prepend_page(Widget& child, const char *tab_label, const char *menu_label = 0); 00255 int prepend_page(Widget& child, const String& tab_label, const String& menu_label = 0); 00263 00264 int insert_page(Widget& child, int position, Widget *tab_label = 0, Widget *menu_label = 0); 00278 00279 int insert_page(Widget& child, int position, const char *tab_label, const char *menu_label = 0); 00280 int insert_page(Widget& child, int position, const String& tab_label, const String& menu_label = 0); 00291 00292 void remove_page(int page_num); 00295 00296 void set_current_page(int page_num); 00302 00303 void next_page(); 00305 00306 void prev_page(); 00308 00309 void set_show_border(bool show_border); 00314 00315 void set_show_tabs(bool show_tabs); 00318 00319 void set_tab_pos(PositionType pos); 00322 00323 void set_scrollable(bool scrollable); 00327 00328 void popup_enable(); 00331 00332 void popup_disable(); 00334 00335 void set_tab_label(Widget& child, Widget *tab_label); 00339 00340 void set_tab_label_text(Widget& child, const char *tab_text); 00341 void set_tab_label_text(Widget& child, const String& tab_text); 00345 00346 void set_menu_label(Widget& child, Widget *menu_label); 00350 00351 void set_menu_label_text(Widget& child, const char *menu_text); 00352 void set_menu_label_text(Widget& child, const String& menu_text); 00356 00357 void set_tab_label_packing(Widget& child, bool expand, bool fill, PackType pack_type); 00364 00365 void reorder_child(Widget& child, int position); 00372 00376 00377 const SwitchPageSignalProxy sig_switch_page(); 00380 00382 }; 00383 00384 } // namespace Gtk 00385 00386 } // namespace GFC 00387 00388 #include <gfc/gtk/inline/notebook.inl> 00389 00390 #endif // GFC_GTK_NOTEBOOK_HH 00391

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8