summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/layout.hxx1
-rw-r--r--vcl/source/window/dialog.cxx34
2 files changed, 27 insertions, 8 deletions
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index be86c75cb202..6bdef038d016 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -704,7 +704,6 @@ inline bool isContainerWindow(const vcl::Window &rWindow)
{
WindowType eType = rWindow.GetType();
return eType == WINDOW_CONTAINER || eType == WINDOW_SCROLLWINDOW ||
- eType == WINDOW_TABCONTROL || eType == WINDOW_TABPAGE ||
(eType == WINDOW_DOCKINGWINDOW && ::isLayoutEnabled(&rWindow));
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e8d8d477b1ff..1849b728ab42 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -42,6 +42,8 @@
#include <vcl/button.hxx>
#include <vcl/mnemonic.hxx>
#include <vcl/dialog.hxx>
+#include <vcl/tabctrl.hxx>
+#include <vcl/tabpage.hxx>
#include <vcl/decoview.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/unowrap.hxx>
@@ -236,6 +238,16 @@ 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;
@@ -590,19 +602,27 @@ 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)
{
- Control *pControl = dynamic_cast<Control*>(pGetChild->ImplGetWindow());
- if (pControl && pControl->GetText().indexOf('~') != -1)
+ if ( pGetChild->GetType() == WINDOW_TABCONTROL )
{
- if (pCData && pCData->IsMod2())
- pControl->SetShowAccelerator(true);
- else
- pControl->SetShowAccelerator(false);
- pControl->Invalidate(InvalidateFlags::Update);
+ // 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;