Commit 930d7c67 authored by Murray Cumming's avatar Murray Cumming
Browse files

event handlers: Rename the event parameters.

Because they shadow an event() method in gtkmm.
parent 041d8dd0
......@@ -538,7 +538,7 @@ void Box_Data_Calendar_Related::setup_menu(Gtk::Widget* /* this */)
#endif // !GLOM_ENABLE_CLIENT_ONLY
}
void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *event)
void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *button_event)
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Enable/Disable items.
......@@ -552,16 +552,16 @@ void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *e
#endif
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return; //handled.
}
else
{
if(event->type == GDK_2BUTTON_PRESS)
if(button_event->type == GDK_2BUTTON_PRESS)
{
//Double-click means edit.
//Don't do this usually, because users sometimes double-click by accident when they just want to edit a cell.
......
......@@ -82,21 +82,21 @@ void ButtonGlom::on_menu_properties_activate()
delete dialog;
}
bool ButtonGlom::on_button_press_event(GdkEventButton *event)
bool ButtonGlom::on_button_press_event(GdkEventButton *button_event)
{
AppWindow* pApp = get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pPopupMenuUtils->popup(event->button, event->time);
m_pPopupMenuUtils->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
return Gtk::Button::on_button_press_event(event);
return Gtk::Button::on_button_press_event(button_event);
}
#endif
......
......@@ -51,7 +51,7 @@ void CheckButton::init()
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool CheckButton::on_button_press_event(GdkEventButton *event)
bool CheckButton::on_button_press_event(GdkEventButton *button_event)
{
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
......@@ -70,16 +70,16 @@ bool CheckButton::on_button_press_event(GdkEventButton *event)
if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
}
return Gtk::CheckButton::on_button_press_event(event);
return Gtk::CheckButton::on_button_press_event(button_event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -311,7 +311,7 @@ Gnome::Gda::Value ComboGlom::get_value() const
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool ComboGlom::on_button_press_event(GdkEventButton *event)
bool ComboGlom::on_button_press_event(GdkEventButton *button_event)
{
g_warning("ComboGlom::on_button_press_event()");
......@@ -332,18 +332,18 @@ g_warning("ComboGlom::on_button_press_event()");
if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
}
return Gtk::ComboBox::on_button_press_event(event);
return Gtk::ComboBox::on_button_press_event(button_event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -259,7 +259,7 @@ Glib::ustring ComboAsRadioButtons::get_text() const
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void ComboAsRadioButtons::show_context_menu(GdkEventButton *event)
void ComboAsRadioButtons::show_context_menu(GdkEventButton *button_event)
{
std::cout << "ComboAsRadioButtons::show_context_menu()" << std::endl;
AppWindow* pApp = get_appwindow();
......@@ -279,27 +279,27 @@ void ComboAsRadioButtons::show_context_menu(GdkEventButton *event)
if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
}
}
}
}
bool ComboAsRadioButtons::on_radiobutton_button_press_event(GdkEventButton *event)
bool ComboAsRadioButtons::on_radiobutton_button_press_event(GdkEventButton *button_event)
{
show_context_menu(event);
show_context_menu(button_event);
return false; //Let other signal handlers handle it too.
}
bool ComboAsRadioButtons::on_button_press_event(GdkEventButton *event)
bool ComboAsRadioButtons::on_button_press_event(GdkEventButton *button_event)
{
show_context_menu(event);
show_context_menu(button_event);
return Gtk::Box::on_button_press_event(event);
return Gtk::Box::on_button_press_event(button_event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -420,7 +420,7 @@ void DataWidget::set_editable(bool editable)
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool DataWidget::on_button_press_event(GdkEventButton *event)
bool DataWidget::on_button_press_event(GdkEventButton *button_event)
{
//g_warning("DataWidget::on_button_press_event_popup");
......@@ -442,17 +442,17 @@ bool DataWidget::on_button_press_event(GdkEventButton *event)
if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
}
return Gtk::EventBox::on_button_press_event(event);
return Gtk::EventBox::on_button_press_event(button_event);
}
std::shared_ptr<LayoutItem_Field> DataWidget::offer_field_list(const Glib::ustring& table_name)
......
......@@ -95,7 +95,7 @@ private:
//Overrides of default signal handlers:
void on_widget_edited(); //From Gtk::Entry, or Gtk::CheckButton.
#ifndef GLOM_ENABLE_CLIENT_ONLY
virtual bool on_button_press_event(GdkEventButton* event) override;
virtual bool on_button_press_event(GdkEventButton* button_event) override;
virtual void on_child_user_requested_layout();
virtual void on_child_user_requested_layout_properties();
virtual void on_child_layout_item_added(LayoutWidgetBase::enumType item_type);
......
......@@ -118,9 +118,9 @@ void Entry::check_for_change()
}
}
bool Entry::on_focus_out_event(GdkEventFocus* event)
bool Entry::on_focus_out_event(GdkEventFocus* focus_event)
{
const auto result = Gtk::Entry::on_focus_out_event(event);
const auto result = Gtk::Entry::on_focus_out_event(focus_event);
//The user has finished editing.
check_for_change();
......@@ -188,7 +188,7 @@ Gnome::Gda::Value Entry::get_value() const
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool Entry::on_button_press_event(GdkEventButton *event)
bool Entry::on_button_press_event(GdkEventButton *button_event)
{
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
......@@ -207,18 +207,18 @@ bool Entry::on_button_press_event(GdkEventButton *event)
if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
}
return Gtk::Entry::on_button_press_event(event);
return Gtk::Entry::on_button_press_event(button_event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -68,7 +68,7 @@ private:
//Overrides of default signal handlers:
virtual void on_changed() override; //From Gtk::Entry.
virtual void on_activate() override; //From Gtk::Entry.
virtual bool on_focus_out_event(GdkEventFocus* event) override; //From Gtk::Widget
virtual bool on_focus_out_event(GdkEventFocus* focus_event) override; //From Gtk::Widget
void check_for_change();
......
......@@ -102,22 +102,22 @@ void Label::on_menu_properties_activate()
delete dialog;
}
bool Label::on_button_press_event(GdkEventButton *event)
bool Label::on_button_press_event(GdkEventButton *button_event)
{
AppWindow* pApp = get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pPopupMenuUtils->popup(event->button, event->time);
m_pPopupMenuUtils->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
return Gtk::EventBox::on_button_press_event(event);
return Gtk::EventBox::on_button_press_event(button_event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -111,10 +111,10 @@ void TextView::check_for_change()
}
}
bool TextView::on_textview_focus_out_event(GdkEventFocus* event)
bool TextView::on_textview_focus_out_event(GdkEventFocus* focus_event)
{
//Call base class:
bool result = Gtk::ScrolledWindow::on_focus_out_event(event);
bool result = Gtk::ScrolledWindow::on_focus_out_event(focus_event);
//The user has finished editing.
check_for_change();
......@@ -175,7 +175,7 @@ Gnome::Gda::Value TextView::get_value() const
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool TextView::on_button_press_event(GdkEventButton *event)
bool TextView::on_button_press_event(GdkEventButton *button_event)
{
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
......@@ -194,18 +194,18 @@ bool TextView::on_button_press_event(GdkEventButton *event)
if(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
}
return Gtk::ScrolledWindow::on_button_press_event(event);
return Gtk::ScrolledWindow::on_button_press_event(button_event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -70,7 +70,7 @@ private:
//Overrides of default signal handlers:
void on_buffer_changed();
//virtual void on_activate() override; //From Gtk::Entry.
bool on_textview_focus_out_event(GdkEventFocus* event);
bool on_textview_focus_out_event(GdkEventFocus* focus_event);
//virtual void on_insert_text(const Glib::ustring& text, int* position); //From Gtk::Editable
virtual void check_for_change();
......
......@@ -283,7 +283,7 @@ void DbAddDel::setup_menu(Gtk::Widget* /* widget */)
#endif // !GLOM_ENABLE_CLIENT_ONLY
}
bool DbAddDel::on_button_press_event_Popup(GdkEventButton *event)
bool DbAddDel::on_button_press_event_Popup(GdkEventButton *button_event)
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Enable/Disable items.
......@@ -297,16 +297,16 @@ bool DbAddDel::on_button_press_event_Popup(GdkEventButton *event)
#endif
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //handled.
}
else
{
if(event->type == GDK_2BUTTON_PRESS)
if(button_event->type == GDK_2BUTTON_PRESS)
{
//Double-click means edit.
//Don't do this usually, because users sometimes double-click by accident when they just want to edit a cell.
......@@ -1532,18 +1532,17 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
}
}
void DbAddDel::on_treeview_button_press_event(GdkEventButton* event)
void DbAddDel::on_treeview_button_press_event(GdkEventButton* button_event)
{
on_button_press_event_Popup(event);
on_button_press_event_Popup(button_event);
}
bool DbAddDel::on_treeview_columnheader_button_press_event(GdkEventButton* event)
bool DbAddDel::on_treeview_columnheader_button_press_event(GdkEventButton* button_event)
{
//If this is a right-click with the mouse:
if( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) )
if( (button_event->type == GDK_BUTTON_PRESS) && (button_event->button == 3) )
{
//TODO: Is something supposed to happen here?
}
return false;
......
......@@ -331,8 +331,8 @@ private:
bool on_treeview_column_drop(Gtk::TreeView* treeview, Gtk::TreeViewColumn* column, Gtk::TreeViewColumn* prev_column, Gtk::TreeViewColumn* next_column);
void on_treeview_columns_changed();
bool on_button_press_event_Popup(GdkEventButton* event);
void on_treeview_button_press_event(GdkEventButton* event);
bool on_button_press_event_Popup(GdkEventButton* button_event);
void on_treeview_button_press_event(GdkEventButton* button_event);
void on_treeview_selection_changed();
protected:
......@@ -347,7 +347,7 @@ private:
void on_MenuPopup_activate_layout();
#endif
bool on_treeview_columnheader_button_press_event(GdkEventButton* event);
bool on_treeview_columnheader_button_press_event(GdkEventButton* button_event);
void on_treeview_column_clicked(int model_column_index);
//void on_treeview_column_resized(int model_column_index, DbTreeViewColumnGlom* view_column);
void on_idle_row_edit();
......
......@@ -1307,21 +1307,21 @@ void FlowTableWithFields::on_menu_delete_activate()
}
}
bool FlowTableWithFields::on_button_press_event(GdkEventButton *event)
bool FlowTableWithFields::on_button_press_event(GdkEventButton *button_event)
{
AppWindow* pApp = AppWindow::get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pPopupMenuUtils->popup(event->button, event->time);
m_pPopupMenuUtils->popup(button_event->button, button_event->time);
return true; //We handled this event.
}
}
return Gtk::Widget::on_button_press_event(event);
return Gtk::Widget::on_button_press_event(button_event);
}
//TODO: Rename this? It's not a simpler getter. It does UI.
......
......@@ -713,12 +713,12 @@ void Window_PrintLayout_Edit::setup_context_menu()
m_context_menu->attach_to_widget(*this);
}
bool Window_PrintLayout_Edit::on_canvas_motion_notify_event(GdkEventMotion* event)
bool Window_PrintLayout_Edit::on_canvas_motion_notify_event(GdkEventMotion* motion_event)
{
//Notice that, unlike drag-motion, motion-notify-event's x/y position already
//seems to have the scrolling taken into account.
double x = event->x;
double y = event->y;
double x = motion_event->x;
double y = motion_event->y;
canvas_convert_from_drag_pixels(x, y, false /* do not adjust for scrolling */);
gimp_ruler_set_position(m_hruler, x);
......@@ -1334,9 +1334,9 @@ void Window_PrintLayout_Edit::on_scroll_value_changed()
gimp_ruler_set_range(m_vruler, y, y + height, y + height);
}
bool Window_PrintLayout_Edit::on_configure_event(GdkEventConfigure* event)
bool Window_PrintLayout_Edit::on_configure_event(GdkEventConfigure* configure_event)
{
const auto result = Gtk::Window::on_configure_event(event);
const auto result = Gtk::Window::on_configure_event(configure_event);
//If we are in fit-page-width then rescale the canvas:
int percent = 0;
......@@ -1595,9 +1595,9 @@ void Window_PrintLayout_Edit::on_spinbutton_height()
m_spinbutton_height->get_value());
}
bool Window_PrintLayout_Edit::on_hruler_button_press_event(GdkEventButton* event)
bool Window_PrintLayout_Edit::on_hruler_button_press_event(GdkEventButton* button_event)
{
if(event->button != 1)
if(button_event->button != 1)
return true;
m_temp_rule_horizontal = true;
......@@ -1605,9 +1605,9 @@ bool Window_PrintLayout_Edit::on_hruler_button_press_event(GdkEventButton* event
return false;
}
bool Window_PrintLayout_Edit::on_vruler_button_press_event(GdkEventButton* event)
bool Window_PrintLayout_Edit::on_vruler_button_press_event(GdkEventButton* button_event)
{
if(event->button != 1)
if(button_event->button != 1)
return true;
m_temp_rule_horizontal = false; //vertical.
......
......@@ -92,7 +92,7 @@ private:
void on_menu_align_left();
void on_menu_align_right();
bool on_canvas_motion_notify_event(GdkEventMotion* event);
bool on_canvas_motion_notify_event(GdkEventMotion* motion_event);
void on_canvas_show_context_menu(guint button, guint32 activate_time);
void on_context_menu_insert_field();
void on_context_menu_insert_text();
......@@ -115,11 +115,11 @@ private:
void on_spinbutton_width();
void on_spinbutton_height();
bool on_hruler_button_press_event(GdkEventButton* event);
bool on_vruler_button_press_event(GdkEventButton* event);
bool on_hruler_button_press_event(GdkEventButton* button_event);
bool on_vruler_button_press_event(GdkEventButton* button_event);
//override:
virtual bool on_configure_event(GdkEventConfigure* event) override;
virtual bool on_configure_event(GdkEventConfigure* configure_event) override;
void do_menu_view_show_grid(bool active);
void do_menu_view_show_rules(bool active);
......
......@@ -124,7 +124,7 @@ private:
void on_context_menu_edit();
void on_context_menu_formatting();
void on_context_menu_delete();
bool on_background_button_press_event(const Glib::RefPtr<Goocanvas::Item>& target, GdkEventButton* event);
bool on_background_button_press_event(const Glib::RefPtr<Goocanvas::Item>& target, GdkEventButton* button_event);
void on_dialog_format_hide();
#endif
......
......@@ -254,18 +254,18 @@ void AddDel::setup_menu(Gtk::Widget* /* widget */)
m_pMenuPopup->attach_to_widget(*this);
}
bool AddDel::on_button_press_event_Popup(GdkEventButton *event)
bool AddDel::on_button_press_event_Popup(GdkEventButton *button_event)
{
GdkModifierType mods;
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), event->device, 0, 0, &mods );
gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
m_pMenuPopup->popup(event->button, event->time);
m_pMenuPopup->popup(button_event->button, button_event->time);
}
else
{
if(event->type == GDK_2BUTTON_PRESS)
if(button_event->type == GDK_2BUTTON_PRESS)
{
//Double-click means edit.
//Disable this, because it is confusing when single-click activates editable cells too.
......@@ -1310,9 +1310,9 @@ AddDel::type_signal_user_reordered_columns AddDel::signal_user_reordered_columns
return m_signal_user_reordered_columns;
}
void AddDel::on_treeview_button_press_event(GdkEventButton* event)
void AddDel::on_treeview_button_press_event(GdkEventButton* button_event)
{
on_button_press_event_Popup(event);
on_button_press_event_Popup(button_event);
}
bool AddDel::on_treeview_column_drop(Gtk::TreeView* /* treeview */, Gtk::TreeViewColumn* /* column */, Gtk::TreeViewColumn* /* prev_column */, Gtk::TreeViewColumn* /* next_column */)
......
......@@ -263,9 +263,9 @@ private:
bool on_treeview_column_drop(Gtk::TreeView* treeview, Gtk::TreeViewColumn* column, Gtk::TreeViewColumn* prev_column, Gtk::TreeViewColumn* next_column);
void on_treeview_columns_changed();
bool on_button_press_event_Popup(GdkEventButton* event);
bool on_button_press_event_Popup(GdkEventButton* button_event);
void on_treeview_button_press_event(GdkEventButton* event);
void on_treeview_button_press_event(GdkEventButton* button_event);
/** Set the menu to popup when the user right-clicks on the column titles.
* This method does not take ownership of the Gtk::Menu.
......
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