Unverified Commit 90cf6540 authored by Murray Cumming's avatar Murray Cumming
Browse files

Use Gtk::Menu::popup_at_pointer() instead of (deprecated) popup().

Strangely, popup() is not deprecated in GTK+ 4.
parent 0bc8bf73
...@@ -521,7 +521,7 @@ void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *b ...@@ -521,7 +521,7 @@ void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *b
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return; //handled. return; //handled.
} }
else else
......
...@@ -87,10 +87,11 @@ bool ButtonGlom::on_button_press_event(GdkEventButton *button_event) ...@@ -87,10 +87,11 @@ bool ButtonGlom::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_popup_menu_utils->popup(button_event->button, button_event->time); m_popup_menu_utils->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
return Gtk::Button::on_button_press_event(button_event); return Gtk::Button::on_button_press_event(button_event);
} }
#endif #endif
......
...@@ -61,7 +61,7 @@ bool CheckButton::on_button_press_event(GdkEventButton *button_event) ...@@ -61,7 +61,7 @@ bool CheckButton::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -324,7 +324,7 @@ g_warning("ComboGlom::on_button_press_event()"); ...@@ -324,7 +324,7 @@ g_warning("ComboGlom::on_button_press_event()");
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -272,7 +272,7 @@ void ComboAsRadioButtons::show_context_menu(GdkEventButton *button_event) ...@@ -272,7 +272,7 @@ void ComboAsRadioButtons::show_context_menu(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
} }
} }
} }
......
...@@ -442,7 +442,7 @@ bool DataWidget::on_button_press_event(GdkEventButton *button_event) ...@@ -442,7 +442,7 @@ bool DataWidget::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -201,7 +201,7 @@ bool Entry::on_button_press_event(GdkEventButton *button_event) ...@@ -201,7 +201,7 @@ bool Entry::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -105,7 +105,7 @@ bool Label::on_button_press_event(GdkEventButton *button_event) ...@@ -105,7 +105,7 @@ bool Label::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_popup_menu_utils->popup(button_event->button, button_event->time); m_popup_menu_utils->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -160,7 +160,7 @@ bool TextView::on_button_press_event(GdkEventButton *button_event) ...@@ -160,7 +160,7 @@ bool TextView::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -292,7 +292,7 @@ bool DbAddDel::on_button_press_event_Popup(GdkEventButton *button_event) ...@@ -292,7 +292,7 @@ bool DbAddDel::on_button_press_event_Popup(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
return true; //handled. return true; //handled.
} }
else else
......
...@@ -1318,7 +1318,7 @@ bool FlowTableWithFields::on_button_press_event(GdkEventButton *button_event) ...@@ -1318,7 +1318,7 @@ bool FlowTableWithFields::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_popup_menu_utils->popup(button_event->button, button_event->time); m_popup_menu_utils->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
...@@ -726,13 +726,13 @@ bool Window_PrintLayout_Edit::on_canvas_motion_notify_event(GdkEventMotion* moti ...@@ -726,13 +726,13 @@ bool Window_PrintLayout_Edit::on_canvas_motion_notify_event(GdkEventMotion* moti
return false; return false;
} }
void Window_PrintLayout_Edit::on_canvas_show_context_menu(guint button, guint32 activate_time) void Window_PrintLayout_Edit::on_canvas_show_context_menu(GdkEventButton* event)
{ {
//TODO: This is never called when right-clicking on the canvas. //TODO: This is never called when right-clicking on the canvas.
//std::cout << G_STRFUNC << ": debug\n"; //std::cout << G_STRFUNC << ": debug\n";
if(m_context_menu) if(m_context_menu)
m_context_menu->popup(button, activate_time); m_context_menu->popup_at_pointer((GdkEvent*)event);
} }
bool Window_PrintLayout_Edit::get_is_item_at(double x, double y) const bool Window_PrintLayout_Edit::get_is_item_at(double x, double y) const
......
...@@ -93,7 +93,7 @@ private: ...@@ -93,7 +93,7 @@ private:
void on_menu_align_right(); void on_menu_align_right();
bool on_canvas_motion_notify_event(GdkEventMotion* motion_event); bool on_canvas_motion_notify_event(GdkEventMotion* motion_event);
void on_canvas_show_context_menu(guint button, guint32 activate_time); void on_canvas_show_context_menu(GdkEventButton* event);
void on_context_menu_insert_field(); void on_context_menu_insert_field();
void on_context_menu_insert_text(); void on_context_menu_insert_text();
......
...@@ -406,7 +406,7 @@ void Window_RelationshipsOverview::on_table_moved(const Glib::RefPtr<CanvasItemM ...@@ -406,7 +406,7 @@ void Window_RelationshipsOverview::on_table_moved(const Glib::RefPtr<CanvasItemM
draw_lines(); draw_lines();
} }
void Window_RelationshipsOverview::on_table_show_context(guint button, guint32 activate_time, const Glib::WeakRef<CanvasGroupDbTable>& table_weak) void Window_RelationshipsOverview::on_table_show_context(GdkEventButton* event, const Glib::WeakRef<CanvasGroupDbTable>& table_weak)
{ {
const auto table = table_weak.get(); const auto table = table_weak.get();
if (!table) if (!table)
...@@ -426,7 +426,7 @@ void Window_RelationshipsOverview::on_table_show_context(guint button, guint32 a ...@@ -426,7 +426,7 @@ void Window_RelationshipsOverview::on_table_show_context(guint button, guint32 a
} }
if(m_context_menu) if(m_context_menu)
m_context_menu->popup(button, activate_time); m_context_menu->popup_at_pointer((GdkEvent*)event);
} }
void Window_RelationshipsOverview::setup_context_menu() void Window_RelationshipsOverview::setup_context_menu()
......
...@@ -69,7 +69,7 @@ private: ...@@ -69,7 +69,7 @@ private:
void on_menu_view_showgrid(const Glib::VariantBase& /* parameter */); void on_menu_view_showgrid(const Glib::VariantBase& /* parameter */);
void on_table_moved(const Glib::RefPtr<CanvasItemMovable>& item, double x_offset, double y_offset); void on_table_moved(const Glib::RefPtr<CanvasItemMovable>& item, double x_offset, double y_offset);
void on_table_show_context(guint button, guint32 activate_time, const Glib::WeakRef<CanvasGroupDbTable>& table); void on_table_show_context(GdkEventButton* event, const Glib::WeakRef<CanvasGroupDbTable>& table);
void on_context_menu_edit_fields(const Glib::VariantBase& parameter, const Glib::WeakRef<CanvasGroupDbTable>& table); void on_context_menu_edit_fields(const Glib::VariantBase& parameter, const Glib::WeakRef<CanvasGroupDbTable>& table);
void on_context_menu_edit_relationships(const Glib::VariantBase& parameter, const Glib::WeakRef<CanvasGroupDbTable>& table); void on_context_menu_edit_relationships(const Glib::VariantBase& parameter, const Glib::WeakRef<CanvasGroupDbTable>& table);
......
...@@ -291,7 +291,7 @@ void Canvas_PrintLayout::setup_context_menu() ...@@ -291,7 +291,7 @@ void Canvas_PrintLayout::setup_context_menu()
} }
void Canvas_PrintLayout::on_item_show_context_menu(guint button, guint32 activate_time, const Glib::WeakRef<CanvasLayoutItem>& item_weak) void Canvas_PrintLayout::on_item_show_context_menu(GdkEventButton* event, const Glib::WeakRef<CanvasLayoutItem>& item_weak)
{ {
const auto item = item_weak.get(); const auto item = item_weak.get();
if(!item) if(!item)
...@@ -312,7 +312,7 @@ void Canvas_PrintLayout::on_item_show_context_menu(guint button, guint32 activat ...@@ -312,7 +312,7 @@ void Canvas_PrintLayout::on_item_show_context_menu(guint button, guint32 activat
m_action_formatting->set_enabled(enable_formatting); m_action_formatting->set_enabled(enable_formatting);
m_context_menu->popup(button, activate_time); m_context_menu->popup_at_pointer((GdkEvent*)event);
} }
bool Canvas_PrintLayout::on_background_button_press_event(const Glib::RefPtr<Goocanvas::Item>& /* target */, GdkEventButton* /* event */) bool Canvas_PrintLayout::on_background_button_press_event(const Glib::RefPtr<Goocanvas::Item>& /* target */, GdkEventButton* /* event */)
......
...@@ -120,7 +120,7 @@ private: ...@@ -120,7 +120,7 @@ private:
std::shared_ptr<LayoutItem_Line> offer_line(const std::shared_ptr<LayoutItem_Line>& portal, Gtk::Window* parent); std::shared_ptr<LayoutItem_Line> offer_line(const std::shared_ptr<LayoutItem_Line>& portal, Gtk::Window* parent);
//TODO: Make the signal send the item, so we can pass it by const reference: //TODO: Make the signal send the item, so we can pass it by const reference:
void on_item_show_context_menu(guint button, guint32 activate_time, const Glib::WeakRef<CanvasLayoutItem>& item); void on_item_show_context_menu(GdkEventButton* event, const Glib::WeakRef<CanvasLayoutItem>& item);
void on_context_menu_edit(); void on_context_menu_edit();
void on_context_menu_formatting(); void on_context_menu_formatting();
void on_context_menu_delete(); void on_context_menu_delete();
......
...@@ -224,7 +224,7 @@ bool AddDel::on_button_press_event_Popup(GdkEventButton *button_event) ...@@ -224,7 +224,7 @@ bool AddDel::on_button_press_event_Popup(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_menu_popup->popup(button_event->button, button_event->time); m_menu_popup->popup_at_pointer((GdkEvent*)button_event);
} }
else else
{ {
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
//TODO: Actually emit this, so we actually show the context menu when clicking on blank space: //TODO: Actually emit this, so we actually show the context menu when clicking on blank space:
/** void on_show_context(guint button, guint32 activate_time); /** void on_show_context(guint button, guint32 activate_time);
*/ */
typedef sigc::signal<void(guint, guint32)> type_signal_show_context; typedef sigc::signal<void(GdkEventButton*)> type_signal_show_context;
type_signal_show_context signal_show_context(); type_signal_show_context signal_show_context();
......
...@@ -111,7 +111,7 @@ bool CanvasItemMovable::on_button_press_event(const Glib::RefPtr<Goocanvas::Item ...@@ -111,7 +111,7 @@ bool CanvasItemMovable::on_button_press_event(const Glib::RefPtr<Goocanvas::Item
} }
case 3: case 3:
{ {
m_signal_show_context.emit(event->button, event->time); m_signal_show_context.emit(event);
return false; // Not fully Handled. return false; // Not fully Handled.
} }
default: default:
......
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
/** void on_show_context(guint button, guint32 activate_time); /** void on_show_context(guint button, guint32 activate_time);
*/ */
typedef sigc::signal<void(guint, guint32)> type_signal_show_context; typedef sigc::signal<void(GdkEventButton*)> type_signal_show_context;
type_signal_show_context signal_show_context(); type_signal_show_context signal_show_context();
/** For instance, /** For instance,
......
...@@ -153,7 +153,7 @@ private: ...@@ -153,7 +153,7 @@ private:
void on_show_context_menu(guint button, guint32 activate_time) void on_show_context_menu(guint button, guint32 activate_time)
{ {
if(m_context_menu) if(m_context_menu)
m_context_menu->popup(button, activate_time); m_context_menu->popup_at_pointer((GdkEvent*)event);
} }
*/ */
......
...@@ -177,7 +177,7 @@ bool ImageGlom::on_button_press_event(GdkEventButton *button_event) ...@@ -177,7 +177,7 @@ bool ImageGlom::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
popup_menu(button_event->button, button_event->time); popup_menu(button_event);
return true; //We handled this event. return true; //We handled this event.
} }
...@@ -189,7 +189,7 @@ bool ImageGlom::on_button_press_event(GdkEventButton *button_event) ...@@ -189,7 +189,7 @@ bool ImageGlom::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
popup_menu(button_event->button, button_event->time); popup_menu(button_event);
return true; //We handled this event. return true; //We handled this event.
} }
...@@ -986,7 +986,7 @@ void ImageGlom::set_read_only(bool read_only) ...@@ -986,7 +986,7 @@ void ImageGlom::set_read_only(bool read_only)
m_read_only = read_only; m_read_only = read_only;
} }
void ImageGlom::popup_menu(guint button, guint32 activate_time) void ImageGlom::popup_menu(GdkEventButton* event)
{ {
if(!m_menu_popup_user_mode) if(!m_menu_popup_user_mode)
{ {
...@@ -994,7 +994,7 @@ void ImageGlom::popup_menu(guint button, guint32 activate_time) ...@@ -994,7 +994,7 @@ void ImageGlom::popup_menu(guint button, guint32 activate_time)
return; return;
} }
m_menu_popup_user_mode->popup(button, activate_time); m_menu_popup_user_mode->popup_at_pointer((GdkEvent*)event);
m_action_select_file->set_enabled(); m_action_select_file->set_enabled();
} }
......
...@@ -89,7 +89,7 @@ private: ...@@ -89,7 +89,7 @@ private:
void setup_menu_usermode(); void setup_menu_usermode();
void show_image_data(); void show_image_data();
void popup_menu(guint button, guint32 activate_time); void popup_menu(GdkEventButton* event);
const GdaBinary* get_binary() const; const GdaBinary* get_binary() const;
......
...@@ -131,7 +131,7 @@ bool NotebookLabel::on_button_press_event(GdkEventButton *button_event) ...@@ -131,7 +131,7 @@ bool NotebookLabel::on_button_press_event(GdkEventButton *button_event)
if(mods & GDK_BUTTON3_MASK) if(mods & GDK_BUTTON3_MASK)
{ {
//Give user choices of actions on this item: //Give user choices of actions on this item:
m_popup_menu->popup(button_event->button, button_event->time); m_popup_menu->popup_at_pointer((GdkEvent*)button_event);
return true; //We handled this event. return true; //We handled this event.
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment