dbaccess/source/ui/inc/TableWindowListBox.hxx | 1 + dbaccess/source/ui/querydesign/TableWindowListBox.cxx | 9 +++++++++ 2 files changed, 10 insertions(+)
New commits: commit 932441bfc7953198dd8db4cf929857f63e05c207 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Feb 16 10:17:14 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Feb 16 14:44:04 2021 +0100 show context menu on right click in treeview Change-Id: I2a124d63309130b0488e30169aa54ffbc736999f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110983 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index d41cdbc3e285..0d3890cf26c7 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -55,6 +55,7 @@ namespace dbaui std::unique_ptr<TableWindowListBoxHelper> m_xDragDropTargetHelper; DECL_LINK( OnDoubleClick, weld::TreeView&, bool ); + DECL_LINK(CommandHdl, const CommandEvent&, bool); DECL_LINK( DropHdl, void*, void ); DECL_LINK( LookForUiHdl, void*, void ); DECL_LINK( DragBeginHdl, bool&, bool ); diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index a289f185683f..a1a8a17c4735 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -50,6 +50,7 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent) { m_xTreeView->connect_row_activated(LINK(this, OTableWindowListBox, OnDoubleClick)); m_xTreeView->connect_visible_range_changed(LINK(this, OTableWindowListBox, ScrollHdl)); + m_xTreeView->connect_popup_menu(LINK(this, OTableWindowListBox, CommandHdl)); m_xHelper.set(new OJoinExchObj); rtl::Reference<TransferDataContainer> xHelper(m_xHelper); @@ -57,6 +58,14 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent) m_xTreeView->connect_drag_begin(LINK(this, OTableWindowListBox, DragBeginHdl)); } +IMPL_LINK(OTableWindowListBox, CommandHdl, const CommandEvent&, rCEvt, bool) +{ + if (rCEvt.GetCommand() != CommandEventId::ContextMenu) + return false; + m_pTabWin->Command(rCEvt); + return true; +} + void OTableWindowListBox::dragFinished() { // first show the error msg when existing _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits