sc/source/ui/inc/FilterFloatingWindow.hxx | 37 +++++++++++++++++ sc/source/ui/inc/FilterListBox.hxx | 64 ++++++++++++++++++++++++++++++ sc/source/ui/inc/gridwin.hxx | 6 +- sc/source/ui/view/gridwin.cxx | 60 ---------------------------- 4 files changed, 104 insertions(+), 63 deletions(-)
New commits: commit c3d1908ee30a6f9b8653cece8c65ed0ad6f3e1c7 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Tue Sep 1 16:29:15 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Tue Sep 1 16:29:15 2020 +0200 sc: move FilterFloatingWindow and FilterListBox out of gridwin.cxx Change-Id: Ic6e4bb2be86f8c89ac1e5386eb78fe17036b4cc5 diff --git a/sc/source/ui/inc/FilterFloatingWindow.hxx b/sc/source/ui/inc/FilterFloatingWindow.hxx new file mode 100644 index 000000000000..71c13c62c864 --- /dev/null +++ b/sc/source/ui/inc/FilterFloatingWindow.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <vcl/floatwin.hxx> + +class ScFilterFloatingWindow : public FloatingWindow +{ +private: + bool m_bGridHadMouseCaptured; + +public: + ScFilterFloatingWindow(vcl::Window* pParent); + virtual ~ScFilterFloatingWindow() override; + virtual void dispose() override; + + bool MouseWasCaptured() const { return m_bGridHadMouseCaptured; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/FilterListBox.hxx b/sc/source/ui/inc/FilterListBox.hxx new file mode 100644 index 000000000000..e65c72ae1107 --- /dev/null +++ b/sc/source/ui/inc/FilterListBox.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <vcl/InterimItemWindow.hxx> +#include <gridwin.hxx> + +enum class ScFilterBoxMode +{ + DataSelect, + Scenario +}; + +class ScFilterListBox final : public InterimItemWindow +{ +private: + std::unique_ptr<weld::TreeView> xTreeView; + VclPtr<ScGridWindow> pGridWin; + SCCOL nCol; + SCROW nRow; + bool bInit; + bool bCancelled; + sal_uLong nSel; + ScFilterBoxMode eMode; + ImplSVEvent* nAsyncSelectHdl; + + DECL_LINK(SelectHdl, weld::TreeView&, bool); + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + DECL_LINK(AsyncSelectHdl, void*, void); + +public: + ScFilterListBox(vcl::Window* pParent, ScGridWindow* pGrid, SCCOL nNewCol, SCROW nNewRow, + ScFilterBoxMode eNewMode); + virtual ~ScFilterListBox() override; + virtual void dispose() override; + + weld::TreeView& get_widget() { return *xTreeView; } + + SCCOL GetCol() const { return nCol; } + SCROW GetRow() const { return nRow; } + ScFilterBoxMode GetMode() const { return eMode; } + void EndInit(); + bool IsInInit() const { return bInit; } + void SetCancelled() { bCancelled = true; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 8bdee8a55190..dc66b6ad3092 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -31,6 +31,9 @@ #include <memory> #include <vector> +#include <FilterListBox.hxx> +#include <FilterFloatingWindow.hxx> + namespace editeng { struct MisspellRanges; } @@ -46,7 +49,6 @@ struct ScTableInfo; class ScDPObject; class ScDPFieldButton; class ScOutputData; -class ScFilterListBox; class SdrObject; class SdrEditView; class ScNoteMarker; @@ -82,8 +84,6 @@ struct SpellCallbackInfo; // predefines namespace sdr::overlay { class OverlayObjectList; } -class ScFilterFloatingWindow; - class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSourceHelper { // ScFilterListBox is always used for selection list diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 296873a2ef76..f6403f88b520 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -37,7 +37,6 @@ #include <sfx2/ipclient.hxx> #include <svl/stritem.hxx> #include <svl/sharedstringpool.hxx> -#include <vcl/InterimItemWindow.hxx> #include <vcl/canvastools.hxx> #include <vcl/commandevent.hxx> #include <vcl/cursor.hxx> @@ -141,16 +140,6 @@ using namespace css; using namespace css::uno; -namespace { - -enum class ScFilterBoxMode -{ - DataSelect, - Scenario -}; - -} - struct ScGridWindow::MouseEventState { bool mbActivatePart; @@ -187,39 +176,6 @@ bool ScGridWindow::VisibleRange::set(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO return bChanged; } -class ScFilterListBox final : public InterimItemWindow -{ -private: - std::unique_ptr<weld::TreeView> xTreeView; - VclPtr<ScGridWindow> pGridWin; - SCCOL nCol; - SCROW nRow; - bool bInit; - bool bCancelled; - sal_uLong nSel; - ScFilterBoxMode eMode; - ImplSVEvent* nAsyncSelectHdl; - - DECL_LINK(SelectHdl, weld::TreeView&, bool); - DECL_LINK(KeyInputHdl, const KeyEvent&, bool); - DECL_LINK(AsyncSelectHdl, void*, void); - -public: - ScFilterListBox( vcl::Window* pParent, ScGridWindow* pGrid, - SCCOL nNewCol, SCROW nNewRow, ScFilterBoxMode eNewMode ); - virtual ~ScFilterListBox() override; - virtual void dispose() override; - - weld::TreeView& get_widget() { return *xTreeView; } - - SCCOL GetCol() const { return nCol; } - SCROW GetRow() const { return nRow; } - ScFilterBoxMode GetMode() const { return eMode; } - void EndInit(); - bool IsInInit() const { return bInit; } - void SetCancelled() { bCancelled = true; } -}; - // ListBox in a FloatingWindow (pParent) ScFilterListBox::ScFilterListBox( vcl::Window* pParent, ScGridWindow* pGrid, SCCOL nNewCol, SCROW nNewRow, ScFilterBoxMode eNewMode ) : @@ -315,22 +271,6 @@ IMPL_LINK_NOARG(ScFilterListBox, AsyncSelectHdl, void*, void) pGridWin->ClickExtern(); } -// use a System floating window for the above filter listbox -class ScFilterFloatingWindow : public FloatingWindow -{ -private: - bool m_bGridHadMouseCaptured; -public: - ScFilterFloatingWindow(vcl::Window* pParent); - virtual ~ScFilterFloatingWindow() override; - virtual void dispose() override; - - bool MouseWasCaptured() const - { - return m_bGridHadMouseCaptured; - } -}; - ScFilterFloatingWindow::ScFilterFloatingWindow(vcl::Window* pParent) : FloatingWindow( pParent, WB_BORDER | WB_SYSTEMWINDOW ) // make it a system floater , m_bGridHadMouseCaptured(pParent->IsMouseCaptured()) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits