From 9152f16b7901af6bceaa296b8e0fc171ee5fe03c Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Tue, 27 Dec 2016 17:58:09 +0100 Subject: tdf#102059 NotebookBar accessible using F6 key Change-Id: I873c49d8c0557eb3702de921fb5d2281acfed526 Reviewed-on: https://gerrit.libreoffice.org/32459 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky --- vcl/source/control/notebookbar.cxx | 27 +++++++++++++++++++++++++++ vcl/source/window/syswin.cxx | 2 ++ 2 files changed, 29 insertions(+) (limited to 'vcl') diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 40e3f8480219..1a1de0208da8 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -50,11 +51,27 @@ NotebookBar::~NotebookBar() void NotebookBar::dispose() { + if (m_pSystemWindow && m_pSystemWindow->ImplIsInTaskPaneList(this)) + { + m_pSystemWindow->GetTaskPaneList()->RemoveWindow(this); + m_pSystemWindow.clear(); + } disposeBuilder(); m_pEventListener.clear(); Control::dispose(); } +bool NotebookBar::PreNotify(NotifyEvent& rNEvt) +{ + // capture KeyEvents for taskpane cycling + if (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) + { + if (m_pSystemWindow) + return m_pSystemWindow->PreNotify(rNEvt); + } + return Window::PreNotify( rNEvt ); +} + Size NotebookBar::GetOptimalSize() const { if (isLayoutEnabled(this)) @@ -98,6 +115,16 @@ void NotebookBar::SetIconClickHdl(Link aHdl) m_pContextContainer->SetIconClickHdl(aHdl); } +void NotebookBar::SetSystemWindow(SystemWindow* pSystemWindow) +{ + if (m_pSystemWindow) + m_pSystemWindow.clear(); + + m_pSystemWindow = VclPtr(pSystemWindow); + if (!m_pSystemWindow->ImplIsInTaskPaneList(this)) + m_pSystemWindow->GetTaskPaneList()->AddWindow(this); +} + void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) throw (css::uno::RuntimeException, std::exception) { diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index c96939df8724..21cdeb38ec54 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -979,6 +979,8 @@ void SystemWindow::SetNotebookBar(const OUString& rUIXMLDescription, const css:: { static_cast(mpWindowImpl->mpBorderWindow.get())->SetNotebookBar(rUIXMLDescription, rFrame); maNotebookBarUIFile = rUIXMLDescription; + if(GetNotebookBar()) + GetNotebookBar()->SetSystemWindow(this); } } -- cgit