From 7fbe52f835688967a6079582ed8839cb55d0f9ea Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Mar 2021 13:34:55 +1100 Subject: Make Window argument to Menu::Show const as that avoids warnings and the Window is not altered by showing a menu. --- cocoa/PlatCocoa.mm | 2 +- gtk/PlatGTK.cxx | 2 +- qt/ScintillaEditBase/PlatQt.cpp | 2 +- src/Platform.h | 2 +- win32/PlatWin.cxx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index eb7a93ef1..be9ee23cd 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -2032,7 +2032,7 @@ void Menu::Destroy() noexcept { //-------------------------------------------------------------------------------------------------- -void Menu::Show(Point, Window &) { +void Menu::Show(Point, const Window &) { // Cocoa menus are handled a bit differently. We only create the menu. The framework // takes care to show it properly. } diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index e3820aec4..b9b9ab029 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1930,7 +1930,7 @@ static void MenuPositionFunc(GtkMenu *, gint *x, gint *y, gboolean *, gpointer u } #endif -void Menu::Show(Point pt, Window &w) { +void Menu::Show(Point pt, const Window &w) { GtkMenu *widget = static_cast(mid); gtk_widget_show_all(GTK_WIDGET(widget)); #if GTK_CHECK_VERSION(3,22,0) diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 4bdd04778..9ea1d88f5 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -1125,7 +1125,7 @@ void Menu::Destroy() noexcept } mid = nullptr; } -void Menu::Show(Point pt, Window & /*w*/) +void Menu::Show(Point pt, const Window & /*w*/) { QMenu *menu = static_cast(mid); menu->exec(QPoint(pt.x, pt.y)); diff --git a/src/Platform.h b/src/Platform.h index 0ea086393..778c9a810 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -317,7 +317,7 @@ public: MenuID GetID() const noexcept { return mid; } void CreatePopUp(); void Destroy() noexcept; - void Show(Point pt, Window &w); + void Show(Point pt, const Window &w); }; #if defined(__clang__) diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index b73e7145e..63c5a30ab 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -3404,7 +3404,7 @@ void Menu::Destroy() noexcept { mid = 0; } -void Menu::Show(Point pt, Window &w) { +void Menu::Show(Point pt, const Window &w) { ::TrackPopupMenu(static_cast(mid), TPM_RIGHTBUTTON, static_cast(pt.x - 4), static_cast(pt.y), 0, HwndFromWindow(w), nullptr); -- cgit v1.2.3