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

menuitem.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_ITEM_HH 00025 #define GFC_GTK_MENU_ITEM_HH 00026 00027 #ifndef GFC_GTK_ITEM_HH 00028 #include <gfc/gtk/item.hh> 00029 #endif 00030 00031 #ifndef __GTK_MENU_ITEM_H__ 00032 #include <gtk/gtkmenuitem.h> 00033 #endif 00034 00035 namespace GFC { 00036 00037 namespace Gtk { 00038 00039 class Menu; 00040 00047 00048 class MenuItem : public Item 00049 { 00050 friend class G::Object; 00051 00052 MenuItem(const MenuItem&); 00053 MenuItem& operator=(const MenuItem&); 00054 00055 protected: 00058 00059 explicit MenuItem(GtkMenuItem *menu_item, bool owns_reference = false); 00066 00070 00071 void add_label(const char *label, bool use_underline); 00072 void add_label(const String& label, bool use_underline); 00079 00083 00084 typedef G::Signal<void> ActivateSignalType; 00085 typedef G::SignalProxy<TypeInstance, ActivateSignalType> ActivateSignalProxy; 00086 static const ActivateSignalType activate_signal; 00091 00092 typedef G::Signal<void> ActivateItemSignalType; 00093 typedef G::SignalProxy<TypeInstance, ActivateItemSignalType> ActivateItemSignalProxy; 00094 static const ActivateItemSignalType activate_item_signal; 00099 00100 typedef G::Signal<void, int*> ToggleSizeRequestSignalType; 00101 typedef G::SignalProxy<TypeInstance, ToggleSizeRequestSignalType> ToggleSizeRequestSignalProxy; 00102 static const ToggleSizeRequestSignalType toggle_size_request_signal; 00108 00109 typedef G::Signal<void, int> ToggleSizeAllocateSignalType; 00110 typedef G::SignalProxy<TypeInstance, ToggleSizeAllocateSignalType> ToggleSizeAllocateSignalProxy; 00111 static const ToggleSizeAllocateSignalType toggle_size_allocate_signal; 00117 00119 00120 public: 00123 00124 MenuItem(); 00126 00127 explicit MenuItem(const char *label, bool use_underline = false); 00128 explicit MenuItem(const String& label, bool use_underline = false); 00132 00133 MenuItem(const char *label, Menu& submenu, bool use_underline = false); 00134 MenuItem(const String& label, Menu& submenu, bool use_underline = false); 00139 00140 virtual ~MenuItem(); 00142 00146 00147 GtkMenuItem* gtk_menu_item() const; 00149 00150 operator GtkMenuItem* () const; 00152 00153 bool has_submenu() const; 00155 00156 bool get_right_justified() const; 00159 00160 Menu* get_submenu() const; 00163 00167 00168 void set_label(const char *label, bool use_underline = false); 00169 void set_label(const String& label, bool use_underline = false); 00176 00177 void set_submenu(Menu& submenu); 00180 00181 void remove_submenu(); 00183 00184 void activate(); 00186 00187 void toggle_size_request(int *requisition); 00189 00190 void toggle_size_allocate(int allocation); 00192 00193 void set_right_justified(bool right_justified); 00200 00201 void set_accel_path(const char *accel_path); 00202 void set_accel_path(const String& accel_path); 00218 00222 00223 const ActivateSignalProxy sig_activate(); 00225 00226 const ActivateItemSignalProxy sig_activate_item(); 00230 00231 const ToggleSizeRequestSignalProxy sig_toggle_size_request(); 00234 00235 const ToggleSizeAllocateSignalProxy sig_toggle_size_allocate(); 00238 00240 }; 00241 00242 } // namespace Gtk 00243 00244 } // namespace GFC 00245 00246 #include <gfc/gtk/inline/menuitem.inl> 00247 00248 #endif // GFC_GTK_MENU_ITEM_HH 00249

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