LibreOffice Module sc (master) 1
RandomNumberGeneratorDialog.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 */
10
11#pragma once
12
13#include <sal/config.h>
14
15#include <optional>
16
17#include <address.hxx>
18#include "anyrefdg.hxx"
19#include "viewdata.hxx"
20
22{
23public:
26 weld::Window* pParent, ScViewData& rViewData );
27
28 virtual ~ScRandomNumberGeneratorDialog() override;
29
30 virtual void SetReference( const ScRange& rRef, ScDocument& rDoc ) override;
31 virtual void SetActive() override;
32 virtual void Close() override;
33
34private:
35 // Data
38
40
42
43 // Widgets
44 std::unique_ptr<weld::Label> mxInputRangeText;
45 std::unique_ptr<formula::RefEdit> mxInputRangeEdit;
46 std::unique_ptr<formula::RefButton> mxInputRangeButton;
47 std::unique_ptr<weld::ComboBox> mxDistributionCombo;
48 std::unique_ptr<weld::Label> mxParameter1Text;
49 std::unique_ptr<weld::SpinButton> mxParameter1Value;
50 std::unique_ptr<weld::Label> mxParameter2Text;
51 std::unique_ptr<weld::SpinButton> mxParameter2Value;
52 std::unique_ptr<weld::SpinButton> mxSeed;
53 std::unique_ptr<weld::CheckButton> mxEnableSeed;
54 std::unique_ptr<weld::SpinButton> mxDecimalPlaces;
55 std::unique_ptr<weld::CheckButton> mxEnableRounding;
56 std::unique_ptr<weld::Button> mxButtonApply;
57 std::unique_ptr<weld::Button> mxButtonOk;
58 std::unique_ptr<weld::Button> mxButtonClose;
59
60 void Init();
62
63 template<class RNG>
64
65 void GenerateNumbers(RNG& randomGenerator, TranslateId pDistributionStringId, const std::optional<sal_Int8> aDecimalPlaces);
66
68
69 DECL_LINK( OkClicked, weld::Button&, void );
70 DECL_LINK( CloseClicked, weld::Button&, void );
71 DECL_LINK( ApplyClicked, weld::Button&, void );
72 DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void );
73 DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void );
74 DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
75 DECL_LINK( LoseButtonFocusHandler, formula::RefButton&, void );
76
77 DECL_LINK( InputRangeModified, formula::RefEdit&, void );
78 DECL_LINK( Parameter1ValueModified, weld::SpinButton&, void );
79 DECL_LINK( Parameter2ValueModified, weld::SpinButton&, void );
80 DECL_LINK( DistributionChanged, weld::ComboBox&, void );
81 DECL_LINK( CheckChanged, weld::Toggleable&, void );
82
83};
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DECL_LINK(GetEditFocusHandler, formula::RefEdit &, void)
DECL_LINK(InputRangeModified, formula::RefEdit &, void)
std::unique_ptr< weld::CheckButton > mxEnableSeed
DECL_LINK(LoseEditFocusHandler, formula::RefEdit &, void)
std::unique_ptr< weld::Button > mxButtonApply
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
std::unique_ptr< weld::CheckButton > mxEnableRounding
std::unique_ptr< weld::ComboBox > mxDistributionCombo
DECL_LINK(Parameter2ValueModified, weld::SpinButton &, void)
DECL_LINK(DistributionChanged, weld::ComboBox &, void)
std::unique_ptr< weld::Label > mxInputRangeText
std::unique_ptr< weld::Button > mxButtonOk
std::unique_ptr< weld::SpinButton > mxParameter2Value
DECL_LINK(LoseButtonFocusHandler, formula::RefButton &, void)
std::unique_ptr< weld::Label > mxParameter1Text
DECL_LINK(GetButtonFocusHandler, formula::RefButton &, void)
std::unique_ptr< weld::Button > mxButtonClose
std::unique_ptr< weld::SpinButton > mxDecimalPlaces
DECL_LINK(OkClicked, weld::Button &, void)
DECL_LINK(CloseClicked, weld::Button &, void)
std::unique_ptr< weld::SpinButton > mxParameter1Value
std::unique_ptr< formula::RefButton > mxInputRangeButton
DECL_LINK(CheckChanged, weld::Toggleable &, void)
std::unique_ptr< formula::RefEdit > mxInputRangeEdit
ScRandomNumberGeneratorDialog(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData &rViewData)
void GenerateNumbers(RNG &randomGenerator, TranslateId pDistributionStringId, const std::optional< sal_Int8 > aDecimalPlaces)
DECL_LINK(Parameter1ValueModified, weld::SpinButton &, void)
std::unique_ptr< weld::SpinButton > mxSeed
std::unique_ptr< weld::Label > mxParameter2Text
DECL_LINK(ApplyClicked, weld::Button &, void)