From a9ea920dfbb7e065ef3f5b5f204732ee2ece47db Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Apr 2020 14:19:40 +0100 Subject: move InterimItemWindow to svtools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I058b1d96a3ddfaa1aa96f66d0ebc6fa68900a48c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92697 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svtools/Library_svt.mk | 1 + svtools/source/control/InterimItemWindow.cxx | 98 ++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 svtools/source/control/InterimItemWindow.cxx (limited to 'svtools') diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index afa07288f2da..a2c968306bd9 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -90,6 +90,7 @@ $(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 new file mode 100644 index 000000000000..b597276eb93c --- /dev/null +++ b/svtools/source/control/InterimItemWindow.cxx @@ -0,0 +1,98 @@ +/* -*- 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 + +InterimItemWindow::InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, + const OString& rID) + : Control(pParent, WB_TABSTOP | WB_DIALOGCONTROL) +{ + m_xVclContentArea = VclPtr::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: */ -- cgit ro/collabora/libreoffice-7-5+backports'>distro/collabora/libreoffice-7-5+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-13Update remaining DevGuide wiki links.Ilmari Lauhakangas
My Kate editor decided to do some whitespace cleanup, but maybe it's fine as the main changes are not targeting functional bits anyway. Change-Id: I5292e77e43055f94a6256a7f72d49fd59287d194 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132928 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-02-04Revert typo fix, 'stringly typed' is the intended formIlmari Lauhakangas
Change-Id: I46cba870cd90d02c3dbaa60e9b1291ef751db377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129485 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-01-27Fix typosAndrea Gelmini
Change-Id: I49d514a5977ef46a4ade52d53a9a47d56c718052 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129041 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-26ucb: add more webdav-curl doc to READMEMichael Stahl
Change-Id: I50a56f9f5b0126c46133129d62464e0171dc40f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128422 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-12-22ucb: webdav-curl: update READMEThorsten Behrens
Change-Id: I3b72183fc367875f8ebce6f3fffc7efc32ca6c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127285 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-12-15ucb: remove --with-webdav=neonMichael Stahl
Remove code in ucb/source/ucp/webdav-neon, and now unused external neon. The --with-webdav=no option is retained for now. Change-Id: I4ce429587e3991fa82009da2f8e4a068abe36435 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126839 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>