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

menushell.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development 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 00023 00024 #ifndef GFC_GTK_MENU_SHELL_HH 00025 #define GFC_GTK_MENU_SHELL_HH 00026 00027 #ifndef GFC_GTK_CONTAINER_HH 00028 #include <gfc/gtk/container.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_MENU_ITEM_H 00032 #include <gfc/gtk/menuitem.hh> 00033 #endif 00034 00035 #ifndef __GTK_MENU_SHELL_H__ 00036 #include <gtk/gtkmenushell.h> 00037 #endif 00038 00039 namespace GFC { 00040 00041 namespace Gtk { 00042 00045 00046 enum MenuDirectionType 00047 { 00048 MENU_DIR_PARENT = GTK_MENU_DIR_PARENT, 00049 MENU_DIR_CHILD = GTK_MENU_DIR_CHILD, 00050 MENU_DIR_NEXT = GTK_MENU_DIR_NEXT, 00051 MENU_DIR_PREV = GTK_MENU_DIR_PREV 00052 }; 00053 00061 00062 class MenuShell : public Container 00063 { 00064 friend class G::Object; 00065 00066 MenuShell(const MenuShell&); 00067 MenuShell& operator=(const MenuShell&); 00068 00069 protected: 00072 00073 MenuShell(); 00075 00076 explicit MenuShell(GtkMenuShell *menu_shell, bool owns_reference = false); 00083 00087 00088 typedef G::Signal<void> DeactivateSignalType; 00089 typedef G::SignalProxy<TypeInstance, DeactivateSignalType> DeactivateSignalProxy; 00090 static const DeactivateSignalType deactivate_signal; 00095 00096 typedef G::Signal<void> SelectionDoneSignalType; 00097 typedef G::SignalProxy<TypeInstance, SelectionDoneSignalType> SelectionDoneSignalProxy; 00098 static const SelectionDoneSignalType selection_done_signal; 00103 00105 00106 public: 00109 00110 virtual ~MenuShell(); 00112 00116 00117 GtkMenuShell* gtk_menu_shell() const; 00119 00120 operator GtkMenuShell* () const; 00122 00123 bool children(std::vector<MenuItem*>& child_list) const; 00127 00131 00132 void append(MenuItem& item); 00135 00136 void append(MenuItem& item, const sigc::slot<void>& callback); 00140 00141 void append(MenuItem& item, const AccelKey& accel_key, const sigc::slot<void>& callback); 00149 00150 void append(MenuItem& item, const AccelKey& accel_key, AccelGroup& accel_group, const sigc::slot<void>& callback); 00156 00157 void append(const StockId& stock_id, const sigc::slot<void>& callback); 00161 00162 void prepend(MenuItem& item); 00165 00166 void prepend(MenuItem& item, const sigc::slot<void>& callback); 00170 00171 void prepend(MenuItem& item, const AccelKey& accel_key, const sigc::slot<void>& callback); 00179 00180 void prepend(MenuItem& item, const AccelKey& accel_key, AccelGroup& accel_group, const sigc::slot<void>& callback); 00186 00187 void prepend(const StockId& stock_id, const sigc::slot<void>& callback); 00191 00192 void insert(MenuItem& item, int position); 00196 00197 void insert(MenuItem& item, int position, const sigc::slot<void>& callback); 00202 00203 void insert(MenuItem& item, int position, const AccelKey& accel_key, const sigc::slot<void>& callback); 00212 00213 void insert(MenuItem& item, int position, const AccelKey& accel_key, AccelGroup& accel_group, const sigc::slot<void>& callback); 00220 00221 void insert(const StockId& stock_id, int position, const sigc::slot<void>& callback); 00226 00227 void select_item(MenuItem& item); 00230 00231 void deselect(); 00233 00234 void activate_item(MenuItem& item, bool force_deactivate); 00239 00240 void deactivate(); 00243 00244 void select_first(bool search_sensitive); 00251 00252 void cancel(); 00254 00258 00259 const DeactivateSignalProxy sig_deactivate(); 00261 00262 const SelectionDoneSignalProxy sig_selection_done(); 00265 00267 }; 00268 00269 } // namespace Gtk 00270 00271 } // namespace GFC 00272 00273 #include <gfc/gtk/inline/menushell.inl> 00274 00275 #endif // GFC_GTK_MENU_SHELL_HH 00276

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