summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-21 16:43:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-22 13:27:41 +0200
commit78b7e1dfba4fb776db801c478a830057ff67d965 (patch)
treeefdd4185035a725f0058bab4043e5bda3bfad953 /svtools
parentaff8471dbffdd6d26e63533d7ffa8ddea6b2396b (diff)
move InterimItemWindow to vcl
Change-Id: If0a4a14708810c44d087b51961f2ecb3fda4df23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94649 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/Library_svt.mk1
-rw-r--r--svtools/source/control/InterimItemWindow.cxx98
2 files changed, 0 insertions, 99 deletions
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 568fb6a63a59..3723fe67bb42 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -90,7 +90,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/contnr/DocumentInfoPreview \
svtools/source/contnr/querydelete \
svtools/source/contnr/templwin \
- svtools/source/control/InterimItemWindow \
svtools/source/control/accessibleruler \
svtools/source/control/asynclink \
svtools/source/control/calendar \
diff --git a/svtools/source/control/InterimItemWindow.cxx b/svtools/source/control/InterimItemWindow.cxx
deleted file mode 100644
index b597276eb93c..000000000000
--- a/svtools/source/control/InterimItemWindow.cxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <svtools/InterimItemWindow.hxx>
-
-InterimItemWindow::InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription,
- const OString& rID)
- : Control(pParent, WB_TABSTOP | WB_DIALOGCONTROL)
-{
- m_xVclContentArea = VclPtr<VclVBox>::Create(this);
- m_xVclContentArea->Show();
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription));
- m_xContainer = m_xBuilder->weld_container(rID);
-
- SetBackground();
- SetPaintTransparent(true);
-}
-
-InterimItemWindow::~InterimItemWindow() { disposeOnce(); }
-
-void InterimItemWindow::dispose()
-{
- m_xContainer.reset();
- m_xBuilder.reset();
- m_xVclContentArea.disposeAndClear();
-
- Control::dispose();
-}
-
-void InterimItemWindow::Resize()
-{
- vcl::Window* pChild = GetWindow(GetWindowType::FirstChild);
- assert(pChild);
- VclContainer::setLayoutAllocation(*pChild, Point(0, 0), GetSizePixel());
- Control::Resize();
-}
-
-Size InterimItemWindow::GetOptimalSize() const
-{
- return VclContainer::getLayoutRequisition(*GetWindow(GetWindowType::FirstChild));
-}
-
-void InterimItemWindow::GetFocus()
-{
- /* let toolbox know this item window has focus so it updates its mnHighItemId to point
- to this toolitem in case tab means to move to another toolitem within
- the toolbox
- */
- vcl::Window* pToolBox = GetParent();
- NotifyEvent aNEvt(MouseNotifyEvent::GETFOCUS, this);
- pToolBox->EventNotify(aNEvt);
-}
-
-bool InterimItemWindow::ChildKeyInput(const KeyEvent& rKEvt)
-{
- sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
- if (nCode != KEY_TAB)
- return false;
-
- /* if the native widget has focus, then no vcl window has focus.
-
- We want to grab focus to this vcl widget so that pressing tab will traverse
- to the next vcl widget.
-
- But just using GrabFocus will, because no vcl widget has focus, trigger
- bringing the toplevel to front with the expectation that a suitable widget
- will be picked for focus when that happen, which is no use to us here.
-
- SetFakeFocus avoids the problem, allowing GrabFocus to do the expected thing
- then sending the Tab to our parent will do the right traversal
- */
- SetFakeFocus(true);
- GrabFocus();
-
- /* now give focus to our toolbox parent */
- vcl::Window* pToolBox = GetParent();
- pToolBox->GrabFocus();
-
- /* let toolbox know this item window has focus so it updates its mnHighItemId to point
- to this toolitem in case tab means to move to another toolitem within
- the toolbox
- */
- NotifyEvent aNEvt(MouseNotifyEvent::GETFOCUS, this);
- pToolBox->EventNotify(aNEvt);
-
- /* send parent the tab */
- pToolBox->KeyInput(rKEvt);
-
- return true;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */