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

menu.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 00025 00026 #ifndef GFC_GTK_MENU_HH 00027 #define GFC_GTK_MENU_HH 00028 00029 #ifndef GFC_GTK_MENU_SHELL_HH 00030 #include <gfc/gtk/menushell.hh> 00031 #endif 00032 00033 #ifndef __GTK_MENU_H__ 00034 #include <gtk/gtkmenu.h> 00035 #endif 00036 00037 namespace GFC { 00038 00039 namespace Gdk { 00040 class Screen; 00041 } 00042 00043 namespace Gtk { 00044 00045 class MenuClass; 00046 class MenuItem; 00047 00081 00082 class Menu : public MenuShell 00083 { 00084 friend class G::Object; 00085 friend class MenuClass; 00086 00087 Menu(const Menu&); 00088 Menu& operator=(const Menu&); 00089 00090 protected: 00093 00094 explicit Menu(GtkMenu *menu, bool owns_reference = false); 00101 00105 00106 virtual void on_menu_detach(Widget& attach_widget); 00110 00112 00113 public: 00114 typedef sigc::slot<void, int*, int*, bool*> MenuPositionSlot; 00125 00128 00129 Menu(); 00131 00132 Menu(const AccelGroup& accel_group); 00139 00140 virtual ~Menu(); 00142 00146 00147 GtkMenu* gtk_menu() const; 00149 00150 operator GtkMenu* () const; 00152 00153 MenuItem* get_active() const; 00159 00160 AccelGroup* get_accel_group() const; 00162 00163 Widget* get_attach_widget() const; 00165 00166 bool get_tearoff_state() const; 00169 00170 String get_title() const; 00173 00177 00178 void popup(MenuShell& parent_shell, MenuItem& parent_item, unsigned int button, const MenuPositionSlot& position, 00179 unsigned int activate_time = GDK_CURRENT_TIME); 00188 00189 void popup(unsigned int button, const MenuPositionSlot& position, unsigned int activate_time = GDK_CURRENT_TIME); 00196 00197 void popup(unsigned int button, unsigned int activate_time = GDK_CURRENT_TIME); 00205 00206 void reposition(); 00208 00209 void popdown(); 00211 00212 void set_active(unsigned int index); 00217 00218 void set_accel_group(const AccelGroup *accel_group); 00225 00226 void set_accel_path(const char *accel_path); 00227 void set_accel_path(const String& accel_path); 00244 00245 void attach_to_widget(Widget& attach_widget); 00251 00252 void detach(); 00255 00256 void set_tearoff_state(bool torn_off); 00263 00264 void set_title(const char *title); 00265 void set_title(const String& title); 00270 00271 void reorder_child(const MenuItem& child, int position); 00275 00276 void set_screen(const Gdk::Screen *screen); 00280 00281 void attach(MenuItem &child, unsigned int left_attach, unsigned int right_attach, 00282 unsigned int top_attach, unsigned int bottom_attach); 00294 00295 void set_monitor(int monitor_num); 00305 00307 }; 00308 00309 } // namespace Gtk 00310 00311 } // namespace GFC 00312 00313 #include <gfc/gtk/inline/menu.inl> 00314 00315 #endif // GFC_GTK_MENU_HH 00316

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