From 975440b9189602b5a10059d892cb09e6849148f7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 14 Apr 2017 15:55:34 +0100 Subject: convert group sort context menu to .ui Change-Id: I8ad51ef49cc0f869efd09b95d3dc11f201e8ee61 --- reportdesign/UIConfig_dbreport.mk | 1 + reportdesign/inc/RptResId.hrc | 1 - reportdesign/source/ui/dlg/GroupsSorting.cxx | 7 ++++--- reportdesign/source/ui/dlg/GroupsSorting.src | 12 ------------ reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui | 17 +++++++++++++++++ 5 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk index 84327116ecb4..b1b8a326e2db 100644 --- a/reportdesign/UIConfig_dbreport.mk +++ b/reportdesign/UIConfig_dbreport.mk @@ -47,6 +47,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/dbreport,\ reportdesign/uiconfig/dbreport/ui/floatingfield \ reportdesign/uiconfig/dbreport/ui/floatingnavigator \ reportdesign/uiconfig/dbreport/ui/floatingsort \ + reportdesign/uiconfig/dbreport/ui/groupsortmenu \ reportdesign/uiconfig/dbreport/ui/pagedialog \ reportdesign/uiconfig/dbreport/ui/pagenumberdialog \ )) diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc index a095b3b26c1a..8535390c59c2 100644 --- a/reportdesign/inc/RptResId.hrc +++ b/reportdesign/inc/RptResId.hrc @@ -192,7 +192,6 @@ #define RID_STR_PARAADJUST (RID_STRING_START + 161) // menu ----------------------------------------------------------------------- -#define RID_GROUPSROWPOPUPMENU ( RID_MENU_START + 0 ) #define RID_MENU_NAVIGATOR ( RID_MENU_START + 1 ) // bitmaps #define RID_SVXBMP_SELECT_REPORT (RID_BITMAP_START + 0 ) diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 6bb15689d36c..d60b07c557e8 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -709,7 +709,6 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) if ( nColId == HANDLE_ID ) { - ScopedVclPtrInstance aContextMenu(ModuleRes(RID_GROUPSROWPOPUPMENU)); bool bEnable = false; long nIndex = FirstSelectedRow(); while( nIndex >= 0 && !bEnable ) @@ -718,8 +717,10 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) bEnable = true; nIndex = NextSelectedRow(); } - aContextMenu->EnableItem(SID_DELETE, IsDeleteAllowed() && bEnable); - if (aContextMenu->Execute(this, rEvt.GetMousePosPixel()) == SID_DELETE) + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/dbreport/ui/groupsortmenu.ui", ""); + VclPtr aContextMenu(aBuilder.get_menu("menu")); + aContextMenu->EnableItem(aContextMenu->GetItemId("delete"), IsDeleteAllowed() && bEnable); + if (aContextMenu->Execute(this, rEvt.GetMousePosPixel())) { if( m_nDeleteEvent ) Application::RemoveUserEvent( m_nDeleteEvent ); diff --git a/reportdesign/source/ui/dlg/GroupsSorting.src b/reportdesign/source/ui/dlg/GroupsSorting.src index 21148dbd571e..9ae6ebda573a 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.src +++ b/reportdesign/source/ui/dlg/GroupsSorting.src @@ -105,16 +105,4 @@ String STR_RPT_HELP_SORT Text [ en-US ] = "Select ascending or descending sort order. Ascending means from A to Z or 0 to 9" ; }; -Menu RID_GROUPSROWPOPUPMENU -{ - ItemList = - { - MenuItem - { - Identifier = SID_DELETE ; - Text [ en-US ] = "~Delete FOO" ; - }; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui b/reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui new file mode 100644 index 000000000000..b9df6f291084 --- /dev/null +++ b/reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui @@ -0,0 +1,17 @@ + + + + + + True + False + + + True + False + _Delete + True + + + + -- cgit