diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-13 12:29:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-13 13:16:08 +0100 |
commit | af50fddf5e49514fd6f730521f9bd914af30fd1d (patch) | |
tree | c3a01d513d2dc60aec7bfaa62718819108c9cdbd /sd/source/ui/animations/CustomAnimationList.cxx | |
parent | 4682cd9a9409a9faa86e5d30bd778bef1459b4fc (diff) |
convert effects menu to .ui
Change-Id: I7c6d060e8d8ccd033e5093fc03cb19d9efe7877d
Diffstat (limited to 'sd/source/ui/animations/CustomAnimationList.cxx')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationList.cxx | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index ae782622bdc9..0477f54114d3 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -445,7 +445,6 @@ CustomAnimationList::CustomAnimationList( vcl::Window* pParent ) , mnLastGroupId(0) , mpLastParentEntry(nullptr) { - EnableContextMenuHandling(); SetSelectionMode( SelectionMode::Multiple ); SetOptimalImageIndent(); @@ -478,6 +477,10 @@ void CustomAnimationList::dispose() mpMainSequence->removeListener( this ); clear(); + + mxMenu.disposeAndClear(); + mxBuilder.reset(); + SvTreeListBox::dispose(); } @@ -486,8 +489,12 @@ void CustomAnimationList::KeyInput( const KeyEvent& rKEvt ) const int nKeyCode = rKEvt.GetKeyCode().GetCode(); switch( nKeyCode ) { - case KEY_DELETE: mpController->onContextMenu( CM_REMOVE ); return; - case KEY_INSERT: mpController->onContextMenu( CM_CREATE ); return; + case KEY_DELETE: + mpController->onContextMenu("remove"); + return; + case KEY_INSERT: + mpController->onContextMenu("create"); + return; case KEY_SPACE: { const Point aPos; @@ -892,7 +899,9 @@ bool CustomAnimationList::DoubleClickHdl() VclPtr<PopupMenu> CustomAnimationList::CreateContextMenu() { - VclPtrInstance<PopupMenu> pMenu(SdResId( RID_EFFECT_CONTEXTMENU )); + mxMenu.disposeAndClear(); + mxBuilder.reset(new VclBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/simpress/ui/effectmenu.ui", "")); + mxMenu.set(mxBuilder->get_menu("menu")); sal_Int16 nNodeType = -1; sal_Int16 nEntries = 0; @@ -921,18 +930,18 @@ VclPtr<PopupMenu> CustomAnimationList::CreateContextMenu() pEntry = static_cast< CustomAnimationListEntry* >(NextSelected( pEntry )); } - pMenu->CheckItem( CM_WITH_CLICK, nNodeType == EffectNodeType::ON_CLICK ); - pMenu->CheckItem( CM_WITH_PREVIOUS, nNodeType == EffectNodeType::WITH_PREVIOUS ); - pMenu->CheckItem( CM_AFTER_PREVIOUS, nNodeType == EffectNodeType::AFTER_PREVIOUS ); - pMenu->EnableItem( CM_OPTIONS, nEntries == 1 ); - pMenu->EnableItem( CM_DURATION, nEntries == 1 ); + mxMenu->CheckItem(mxMenu->GetItemId("onclick"), nNodeType == EffectNodeType::ON_CLICK); + mxMenu->CheckItem(mxMenu->GetItemId("withprev"), nNodeType == EffectNodeType::WITH_PREVIOUS); + mxMenu->CheckItem(mxMenu->GetItemId("afterprev"), nNodeType == EffectNodeType::AFTER_PREVIOUS); + mxMenu->EnableItem(mxMenu->GetItemId("options"), nEntries == 1); + mxMenu->EnableItem(mxMenu->GetItemId("timing"), nEntries == 1); - return pMenu; + return mxMenu; } void CustomAnimationList::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { - mpController->onContextMenu( nSelectedPopupEntry ); + mpController->onContextMenu(mxMenu->GetItemIdent(nSelectedPopupEntry)); } void CustomAnimationList::notify_change() |