summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/helpids.h3
-rw-r--r--sc/inc/scres.hrc4
-rw-r--r--sc/source/ui/navipi/navipi.src19
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx22
-rw-r--r--sc/uiconfig/scalc/ui/scenariomenu.ui25
6 files changed, 34 insertions, 40 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 4237274aaa67..d6dccd0ef937 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -188,6 +188,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/samplingdialog \
sc/uiconfig/scalc/ui/standardfilterdialog \
sc/uiconfig/scalc/ui/scenariodialog \
+ sc/uiconfig/scalc/ui/scenariomenu \
sc/uiconfig/scalc/ui/scgeneralpage \
sc/uiconfig/scalc/ui/searchresults \
sc/uiconfig/scalc/ui/selectdatasource \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 39df049390db..87fe34b4cc97 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -46,9 +46,6 @@
#define HID_SC_ADD_AUTOFMT "SC_HID_SC_ADD_AUTOFMT"
#define HID_SC_AUTOFMT_NAME "SC_HID_SC_AUTOFMT_NAME"
-#define HID_SC_SCENARIO_DELETE "SC_HID_SC_SCENARIO_DELETE"
-#define HID_SC_SCENARIO_EDIT "SC_HID_SC_SCENARIO_EDIT"
-
#define HID_FUNCTION_BOX "SC_HID_FUNCTION_BOX"
// wrong group - HID_SC_DLG_START is full
diff --git a/sc/inc/scres.hrc b/sc/inc/scres.hrc
index 499a19de6fb5..9bf03fa7a163 100644
--- a/sc/inc/scres.hrc
+++ b/sc/inc/scres.hrc
@@ -441,10 +441,6 @@
#define RID_SCDLG_HFEDIT_HEADER (SC_DIALOGS_START + 68)
#define RID_SCDLG_HFEDIT_FOOTER (SC_DIALOGS_START + 69)
-#define RID_POPUP_NAVIPI_SCENARIO (SC_DIALOGS_START + 120)
-#define RID_NAVIPI_SCENARIO_DELETE (SC_DIALOGS_START + 121)
-#define RID_NAVIPI_SCENARIO_EDIT (SC_DIALOGS_START + 122)
-
#define RID_CELLSTYLEFAMILY (SC_DIALOGS_START + 138)
#define RID_PAGESTYLEFAMILY (SC_DIALOGS_START + 139)
#define BMP_STYLES_FAMILY_CELL (SC_DIALOGS_START + 140)
diff --git a/sc/source/ui/navipi/navipi.src b/sc/source/ui/navipi/navipi.src
index a51d48f10fed..4da7b17d911b 100644
--- a/sc/source/ui/navipi/navipi.src
+++ b/sc/source/ui/navipi/navipi.src
@@ -176,23 +176,4 @@ String SCSTR_QHLP_SCEN_COMMENT
Text [ en-US ] = "Comment";
};
-Menu RID_POPUP_NAVIPI_SCENARIO
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = RID_NAVIPI_SCENARIO_DELETE ;
- HelpId = HID_SC_SCENARIO_DELETE ;
- Text [ en-US ] = "Delete" ;
- };
- MenuItem
- {
- Identifier = RID_NAVIPI_SCENARIO_EDIT ;
- HelpId = HID_SC_SCENARIO_EDIT ;
- Text [ en-US ] = "Properties..." ;
- };
- };
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 71c40d913146..b9ae59960e7f 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -135,20 +135,14 @@ bool ScScenarioListBox::EventNotify( NotifyEvent& rNEvt )
{
if( !pEntry->mbProtected )
{
- ScopedVclPtrInstance<ScPopupMenu> aPopup( ScResId( RID_POPUP_NAVIPI_SCENARIO ) );
- aPopup->Execute( this, pCEvt->GetMousePosPixel() );
- if (aPopup->WasHit())
- {
- switch( aPopup->GetSelected() )
- {
- case RID_NAVIPI_SCENARIO_DELETE:
- DeleteScenario();
- break;
- case RID_NAVIPI_SCENARIO_EDIT:
- EditScenario();
- break;
- }
- }
+ VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/scalc/ui/scenariomenu.ui", "");
+ VclPtr<PopupMenu> aPopup(aBuilder.get_menu("menu"));
+ sal_uInt16 nId = aPopup->Execute(this, pCEvt->GetMousePosPixel());
+ OString sIdent(aPopup->GetItemIdent(nId));
+ if (sIdent == "delete")
+ DeleteScenario();
+ else if (sIdent == "edit")
+ EditScenario();
}
}
bHandled = true;
diff --git a/sc/uiconfig/scalc/ui/scenariomenu.ui b/sc/uiconfig/scalc/ui/scenariomenu.ui
new file mode 100644
index 000000000000..834a2b2c61cd
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/scenariomenu.ui
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+ <requires lib="gtk+" version="3.10"/>
+ <object class="GtkMenu" id="menu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="delete">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Delete</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="edit">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Properties...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+</interface>