summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc/SparklineDialog.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-03-11 20:49:09 +0900
committerTomaž Vajngerl <quikee@gmail.com>2022-04-03 09:06:44 +0200
commitc61aa2dea120cc083f3cd51f0347284f47a9d566 (patch)
tree169305bd5f4fac8792c0b6bdda8c3a1514c755a3 /sc/source/ui/inc/SparklineDialog.hxx
parentca5f7efcd92c8bdf36bf64f0c78fd2e112206cfc (diff)
sc: SparklineDialog and "Insert Sparkline" to context menu
This adds a SparklineDialog, which is used to add/edit the Sparkline input/output ranges. The command for the context menu "Insert Sparkline" calls the SparklineDialog for inserting a new sparkline into cells. Currently the SparklineDialog include the properties for the SparklineGroup, which will be added in a later commit. Change-Id: I9036d788fdf2a035f1ce10fc7413327a92144137 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132465 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc/source/ui/inc/SparklineDialog.hxx')
-rw-r--r--sc/source/ui/inc/SparklineDialog.hxx64
1 files changed, 64 insertions, 0 deletions
diff --git a/sc/source/ui/inc/SparklineDialog.hxx b/sc/source/ui/inc/SparklineDialog.hxx
new file mode 100644
index 000000000000..a4a03f33491d
--- /dev/null
+++ b/sc/source/ui/inc/SparklineDialog.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/.
+ */
+
+#pragma once
+
+#include <address.hxx>
+#include "anyrefdg.hxx"
+#include <viewdata.hxx>
+
+namespace sc
+{
+class SparklineDialog : public ScAnyRefDlgController
+{
+private:
+ ScViewData& mrViewData;
+ ScDocument& mrDocument;
+
+ ScRange maInputRange;
+ ScRange maOutputRange;
+
+ formula::RefEdit* mpActiveEdit;
+ bool mbDialogLostFocus;
+
+ std::unique_ptr<weld::Button> mxButtonOk;
+ std::unique_ptr<weld::Button> mxButtonCancel;
+
+ std::unique_ptr<weld::Label> mxInputRangeText;
+ std::unique_ptr<formula::RefEdit> mxInputRangeEdit;
+ std::unique_ptr<formula::RefButton> mxInputRangeButton;
+
+ std::unique_ptr<weld::Label> mxOutputRangeLabel;
+ std::unique_ptr<formula::RefEdit> mxOutputRangeEdit;
+ std::unique_ptr<formula::RefButton> mxOutputRangeButton;
+
+ void GetRangeFromSelection();
+
+ DECL_LINK(ButtonClicked, weld::Button&, void);
+ DECL_LINK(EditFocusHandler, formula::RefEdit&, void);
+ DECL_LINK(ButtonFocusHandler, formula::RefButton&, void);
+ DECL_LINK(LoseEditFocusHandler, formula::RefEdit&, void);
+ DECL_LINK(LoseButtonFocusHandler, formula::RefButton&, void);
+ DECL_LINK(RefInputModifyHandler, formula::RefEdit&, void);
+
+ void perform();
+ bool checkValidInputOutput();
+
+public:
+ SparklineDialog(SfxBindings* pBindings, SfxChildWindow* pChildWindow, weld::Window* pWindow,
+ ScViewData& rViewData);
+ virtual ~SparklineDialog() override;
+
+ virtual void SetReference(const ScRange& rRef, ScDocument& rDocument) override;
+ virtual void SetActive() override;
+ virtual void Close() override;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */