diff options
Diffstat (limited to 'vcl/source/window/dialog.cxx')
-rw-r--r-- | vcl/source/window/dialog.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index b6679d10189b..5f3acda65a3c 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -585,6 +585,31 @@ IMPL_LINK_NOARG(Dialog, ImplAsyncCloseHdl) return 0; } +bool Dialog::ImplHandleCmdEvent( const CommandEvent& rCEvent ) +{ + if (rCEvent.GetCommand() == CommandEventId::ModKeyChange) + { + const CommandModKeyData *pCData = rCEvent.GetModKeyData (); + + Window *pGetChild = firstLogicalChildOfParent(this); + while (pGetChild) + { + Control *pControl = dynamic_cast<Control*>(pGetChild->ImplGetWindow()); + if (pControl && pControl->GetText().indexOf('~') != -1) + { + if (pCData && pCData->IsMod2()) + pControl->SetShowAccelerator(true); + else + pControl->SetShowAccelerator(false); + pControl->Invalidate(InvalidateFlags::Update); + } + pGetChild = nextLogicalChildOfParent(this, pGetChild); + } + return true; + } + return false; +} + bool Dialog::Notify( NotifyEvent& rNEvt ) { // first call the base class due to Tab control @@ -628,6 +653,11 @@ bool Dialog::Notify( NotifyEvent& rNEvt ) } } + else if (rNEvt.GetType() == MouseNotifyEvent::COMMAND) + { + if (ImplHandleCmdEvent( *rNEvt.GetCommandEvent())) + return true; + } } return nRet; |