Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

menu.h

Go to the documentation of this file.
00001 /*  Inti: Integrated Foundation Classes
00002  *  Copyright (C) 2002-2003 The Inti 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 INTI_GTK_MENU_H
00027 #define INTI_GTK_MENU_H
00028 
00029 #ifndef INTI_GTK_MENU_SHELL_H
00030 #include <inti/gtk/menushell.h>
00031 #endif
00032 
00033 #ifndef __GTK_MENU_H__
00034 #include <gtk/gtkmenu.h>
00035 #endif
00036 
00037 namespace Inti {
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 reference = false);
00101 
00105 
00106         virtual void on_menu_detach(Widget& attach_widget) {}
00110 
00112 //  Properties
00113 
00114         typedef G::Property<String> TearoffTitlePropertyType;
00115         typedef G::PropertyProxy<G::Object, TearoffTitlePropertyType> TearoffTitlePropertyProxy;
00116         static const TearoffTitlePropertyType tearoff_title_property;
00117 
00118 public:
00119         typedef Slot3<void, int*, int*, bool*> MenuPositionSlot;
00130 
00133 
00134         Menu();
00136 
00137         Menu(const AccelGroup& accel_group);
00144 
00145         virtual ~Menu();
00147         
00151 
00152         GtkMenu* gtk_menu() const { return (GtkMenu*)instance; }
00154 
00155         GtkMenuClass* gtk_menu_class() const;
00157 
00158         operator GtkMenu* () const;
00160 
00161         MenuItem* get_active() const;
00167 
00168         AccelGroup* get_accel_group() const;
00170         
00171         Widget* get_attach_widget() const;
00173         
00174         bool get_tearoff_state() const;
00177 
00178         String get_title() const;
00181 
00185 
00186         void popup(MenuShell& parent_shell, MenuItem& parent_item, unsigned int button, const MenuPositionSlot *position,
00187                    unsigned int activate_time = GDK_CURRENT_TIME);
00196 
00197         void popup(unsigned int button, const MenuPositionSlot *position, unsigned int activate_time = GDK_CURRENT_TIME);
00204 
00205         void popup(unsigned int button, unsigned int activate_time = GDK_CURRENT_TIME);
00213 
00214         void reposition();
00216 
00217         void popdown();
00219 
00220         void set_active(unsigned int index);
00225 
00226         void set_accel_group(const AccelGroup *accel_group);
00233 
00234         void set_accel_path(const char *accel_path);
00251 
00252         void attach_to_widget(Widget& attach_widget);
00258 
00259         void detach();
00262 
00263         void set_tearoff_state(bool torn_off);
00270 
00271         void set_title(const String& title);
00276 
00277         void reorder_child(const MenuItem& child, int position);
00281 
00282         void set_screen(const Gdk::Screen *screen);
00286 
00290 
00291         const TearoffTitlePropertyProxy prop_tearoff_title()
00292         {
00293                 return TearoffTitlePropertyProxy(this, &tearoff_title_property);
00294         }
00296 
00298 };
00299 
00300 } // namespace Gtk
00301 
00302 } // namespace Inti
00303 
00304 #endif // INTI_GTK_MENU_H
00305 
Main Page - Footer


Generated on Sun Sep 14 20:08:03 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002