summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-11 13:01:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-07-11 13:25:15 +0100
commit545d5157f26b7fd3c5648ae6e727b1e1addca68f (patch)
tree247694e633cdc735d058cbf79f20cfe5b4839eac
parent89a5464a21046821648ec77f03db8316ceb4e6f8 (diff)
Resolves: tdf#95729 move 'alt' accel enable/disable down to systemwindow
from dialog and send the 'alt' to the active floating window, if there is one, before trying the menubar. so popups like the calc autofilter one can display their accelerators when alt is pressed Change-Id: I52e45b72885b1b0a7362cecc30e41d218a48a58d
-rw-r--r--include/vcl/dialog.hxx1
-rw-r--r--include/vcl/syswin.hxx1
-rw-r--r--sc/source/ui/src/scstring.src2
-rw-r--r--vcl/source/window/dialog.cxx48
-rw-r--r--vcl/source/window/syswin.cxx51
-rw-r--r--vcl/source/window/winproc.cxx17
6 files changed, 64 insertions, 56 deletions
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index ecf086d8e508..466b3e36d8d8 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -105,7 +105,6 @@ public:
private:
bool ImplStartExecuteModal();
static void ImplEndExecuteModal();
- bool ImplHandleCmdEvent ( const CommandEvent& rCEvent );
public:
// Dialog::Execute replacement API
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 3ea4dcb6589e..eb2e82a79649 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -179,6 +179,7 @@ public:
private:
SAL_DLLPRIVATE void ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, vcl::Window* i_pConfigureWin );
virtual void setPosSizeOnContainee(Size aSize, Window &rBox);
+ bool ImplHandleCmdEvent ( const CommandEvent& rCEvent );
DECL_DLLPRIVATE_LINK_TYPED( ImplHandleLayoutTimerHdl, Idle*, void );
protected:
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 82e5e62b222d..2da99e27decb 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -98,7 +98,7 @@ String SCSTR_MULTIPLE
String SCSTR_STDFILTER
{
- Text [ en-US ] = "~Standard Filter..." ;
+ Text [ en-US ] = "Standard Filter..." ;
};
String SCSTR_TOP10FILTER
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 9a872bd2db55..63657f5c1557 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -240,16 +240,6 @@ void ImplWindowAutoMnemonic( vcl::Window* pWindow )
}
}
-void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow )
-{
- Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow());
- if (pControl && pControl->GetText().indexOf('~') != -1)
- {
- pControl->SetShowAccelerator( bShow );
- pControl->Invalidate(InvalidateFlags::Update);
- }
-}
-
static VclButtonBox* getActionArea(Dialog *pDialog)
{
VclButtonBox *pButtonBox = nullptr;
@@ -597,39 +587,6 @@ IMPL_LINK_NOARG_TYPED(Dialog, ImplAsyncCloseHdl, void*, void)
Close();
}
-bool Dialog::ImplHandleCmdEvent( const CommandEvent& rCEvent )
-{
- if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
- {
- const CommandModKeyData *pCData = rCEvent.GetModKeyData ();
- bool bShowAccel = pCData && pCData->IsMod2();
-
- Window *pGetChild = firstLogicalChildOfParent(this);
- while (pGetChild)
- {
- if ( pGetChild->GetType() == WINDOW_TABCONTROL )
- {
- // find currently shown tab page
- TabControl* pTabControl = static_cast<TabControl*>( pGetChild );
- TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() );
- vcl::Window* pTabPageChild = firstLogicalChildOfParent( pTabPage );
-
- // and go through its children
- while ( pTabPageChild )
- {
- ImplHandleControlAccelerator(pTabPageChild, bShowAccel);
- pTabPageChild = nextLogicalChildOfParent(pTabPage, pTabPageChild);
- }
- }
-
- ImplHandleControlAccelerator( pGetChild, bShowAccel );
- pGetChild = nextLogicalChildOfParent(this, pGetChild);
- }
- return true;
- }
- return false;
-}
-
bool Dialog::Notify( NotifyEvent& rNEvt )
{
// first call the base class due to Tab control
@@ -672,11 +629,6 @@ bool Dialog::Notify( NotifyEvent& rNEvt )
}
}
- else if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
- {
- if (ImplHandleCmdEvent( *rNEvt.GetCommandEvent()))
- return true;
- }
}
return bRet;
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 242b98a1826c..8e8e5fbf4c01 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -31,6 +31,9 @@
#include <vcl/syswin.hxx>
#include <vcl/taskpanelist.hxx>
#include <vcl/unowrap.hxx>
+#include <vcl/tabctrl.hxx>
+#include <vcl/tabpage.hxx>
+#include <vcl/mnemonic.hxx>
#include <rtl/strbuf.hxx>
@@ -116,6 +119,49 @@ void SystemWindow::dispose()
Window::dispose();
}
+void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow )
+{
+ Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow());
+ if (pControl && pControl->GetText().indexOf('~') != -1)
+ {
+ pControl->SetShowAccelerator( bShow );
+ pControl->Invalidate(InvalidateFlags::Update);
+ }
+}
+
+bool SystemWindow::ImplHandleCmdEvent( const CommandEvent& rCEvent )
+{
+ if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
+ {
+ const CommandModKeyData *pCData = rCEvent.GetModKeyData ();
+ bool bShowAccel = pCData && pCData->IsMod2();
+
+ Window *pGetChild = firstLogicalChildOfParent(this);
+ while (pGetChild)
+ {
+ if ( pGetChild->GetType() == WINDOW_TABCONTROL )
+ {
+ // find currently shown tab page
+ TabControl* pTabControl = static_cast<TabControl*>( pGetChild );
+ TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() );
+ vcl::Window* pTabPageChild = firstLogicalChildOfParent( pTabPage );
+
+ // and go through its children
+ while ( pTabPageChild )
+ {
+ ImplHandleControlAccelerator(pTabPageChild, bShowAccel);
+ pTabPageChild = nextLogicalChildOfParent(pTabPage, pTabPageChild);
+ }
+ }
+
+ ImplHandleControlAccelerator( pGetChild, bShowAccel );
+ pGetChild = nextLogicalChildOfParent(this, pGetChild);
+ }
+ return true;
+ }
+ return false;
+}
+
bool SystemWindow::Notify( NotifyEvent& rNEvt )
{
// capture KeyEvents for menu handling
@@ -139,6 +185,11 @@ bool SystemWindow::Notify( NotifyEvent& rNEvt )
}
if (bDone)
return true;
+ if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
+ {
+ if (ImplHandleCmdEvent( *rNEvt.GetCommandEvent()))
+ return true;
+ }
}
return Window::Notify( rNEvt );
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index f3da016429a7..720ee3a705e3 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2091,14 +2091,19 @@ static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent* pEvent )
// Alt pressed or released => give SystemWindow a chance to handle auto-accelerator
if ( pEvent->mnCode == KEY_MOD2 || (pEvent->mnModKeyCode & MODKEY_MOD2) != 0 )
{
- // find window - first look to see if the system window is available
- pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
+ // find window - first look to see a popup is open and send it there
+ pChild = pSVData->maWinData.mpFirstFloat.get();
- while ( pChild )
+ if (!pChild)
{
- if ( pChild->ImplGetWindowImpl()->mbSysWin )
- break;
- pChild = pChild->ImplGetWindowImpl()->mpNext;
+ // find window - then look to see if the system window is available
+ pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
+ while ( pChild )
+ {
+ if ( pChild->ImplGetWindowImpl()->mbSysWin )
+ break;
+ pChild = pChild->ImplGetWindowImpl()->mpNext;
+ }
}
}