From a2ca4e29e49cdb77f86db1de08f7421483e4adbb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicol=C3=A1s=20Dimov?= Date: Fri, 24 Oct 2003 05:33:10 +0000 Subject: [PATCH] popup del carajo, el unico que esta implementado es el de rotar. --- Constructor/canio.cpp | 8 ++++++++ Constructor/canio.h | 1 + Constructor/codo.cpp | 7 +++++++ Constructor/codo.h | 1 + Constructor/item.cpp | 8 ++++---- Constructor/item.h | 2 +- Constructor/y.cpp | 8 ++++++++ Constructor/y.h | 1 + 8 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Constructor/canio.cpp b/Constructor/canio.cpp index 0afb2bc..c458079 100644 --- a/Constructor/canio.cpp +++ b/Constructor/canio.cpp @@ -39,3 +39,11 @@ bool Canio::on_button_press_event(GdkEventButton *event) } return true; } + +void Canio::on_menu_popup_generic() +{ + GdkEventButton event; + event.type = GDK_BUTTON_PRESS; + event.button = 2; + Canio::on_button_press_event(&event); +} diff --git a/Constructor/canio.h b/Constructor/canio.h index b014b5d..7093d39 100644 --- a/Constructor/canio.h +++ b/Constructor/canio.h @@ -9,6 +9,7 @@ class Canio : public CItem { Canio(); virtual ~Canio(); virtual bool on_button_press_event(GdkEventButton *event); + virtual void on_menu_popup_generic(); private: int imgActual; diff --git a/Constructor/codo.cpp b/Constructor/codo.cpp index 75c9d26..f3466a8 100644 --- a/Constructor/codo.cpp +++ b/Constructor/codo.cpp @@ -45,3 +45,10 @@ bool Codo::on_button_press_event(GdkEventButton *event) } return true; } +void Codo::on_menu_popup_generic() +{ + GdkEventButton event; + event.type = GDK_BUTTON_PRESS; + event.button = 2; + Codo::on_button_press_event(&event); +} diff --git a/Constructor/codo.h b/Constructor/codo.h index edbed25..d3d546a 100644 --- a/Constructor/codo.h +++ b/Constructor/codo.h @@ -9,6 +9,7 @@ class Codo : public CItem { Codo(); virtual ~Codo(); virtual bool on_button_press_event(GdkEventButton *event); + virtual void on_menu_popup_generic(); private: int imgActual; diff --git a/Constructor/item.cpp b/Constructor/item.cpp index 15c3930..9e97bef 100644 --- a/Constructor/item.cpp +++ b/Constructor/item.cpp @@ -11,9 +11,9 @@ CItem::CItem() { menu_image.set(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU); Gtk::Menu::MenuList& menulist = menu_popup.items(); - menulist.push_back( Gtk::Menu_Helpers::MenuElem("Opcion", SigC::slot(*this, &CItem::on_menu_file_popup_generic) ) ); - menulist.push_back( Gtk::Menu_Helpers::MenuElem("Rotar", Gtk::Menu::AccelKey("r"),SigC::slot(*this, &CItem::on_menu_file_popup_generic) ) ); - menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Eliminar", menu_image,SigC::slot(*this, &CItem::on_menu_file_popup_generic) ) ) ; + menulist.push_back( Gtk::Menu_Helpers::MenuElem("Opcion", SigC::slot(*this, &CItem::on_menu_popup_generic) ) ); + menulist.push_back( Gtk::Menu_Helpers::MenuElem("Rotar", Gtk::Menu::AccelKey("r"),SigC::slot(*this, &CItem::on_menu_popup_generic) ) ); + menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Eliminar", menu_image,SigC::slot(*this, &CItem::on_menu_popup_generic) ) ) ; menu_popup.accelerate(*this); } @@ -32,7 +32,7 @@ bool CItem::on_expose_event(GdkEventExpose* event) return true; } -void CItem::on_menu_file_popup_generic() +void CItem::on_menu_popup_generic() { std::cout << "A popup menu item was selected." << std::endl; } diff --git a/Constructor/item.h b/Constructor/item.h index 7a2f35b..0b51b30 100644 --- a/Constructor/item.h +++ b/Constructor/item.h @@ -15,7 +15,7 @@ public: CItem(const char *filename); ~CItem(); virtual bool on_expose_event(GdkEventExpose* event); - virtual void on_menu_file_popup_generic(); + virtual void on_menu_popup_generic(); Glib::RefPtr get_image() { return image; } protected: Gtk::Menu menu_popup; diff --git a/Constructor/y.cpp b/Constructor/y.cpp index 9c4e197..afc5e8c 100644 --- a/Constructor/y.cpp +++ b/Constructor/y.cpp @@ -47,3 +47,11 @@ bool Y::on_button_press_event(GdkEventButton *event) } return true; } + +void Y::on_menu_popup_generic() +{ + GdkEventButton event; + event.type = GDK_BUTTON_PRESS; + event.button = 2; + Y::on_button_press_event(&event); +} diff --git a/Constructor/y.h b/Constructor/y.h index 9ce089f..eaf4911 100644 --- a/Constructor/y.h +++ b/Constructor/y.h @@ -9,6 +9,7 @@ class Y : public CItem { Y(); virtual ~Y(); virtual bool on_button_press_event(GdkEventButton *event); + virtual void on_menu_popup_generic(); private: int imgActual; -- 2.43.0