LibreOffice Module sc (master) 1
SamplingDialog.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 <address.hxx>
14#include "anyrefdg.hxx"
15#include "viewdata.hxx"
16
18{
19public:
22 weld::Window* pParent, ScViewData& rViewData );
23
24 virtual ~ScSamplingDialog() override;
25
26 virtual void SetReference( const ScRange& rRef, ScDocument& rDoc ) override;
27 virtual void SetActive() override;
28 virtual void Close() override;
29
30private:
32
33 // Data
36
40
42
45
47
48 // Widgets
49 std::unique_ptr<weld::Label> mxInputRangeLabel;
50 std::unique_ptr<formula::RefEdit> mxInputRangeEdit;
51 std::unique_ptr<formula::RefButton> mxInputRangeButton;
52
53 std::unique_ptr<weld::Label> mxOutputRangeLabel;
54 std::unique_ptr<formula::RefEdit> mxOutputRangeEdit;
55 std::unique_ptr<formula::RefButton> mxOutputRangeButton;
56
57 std::unique_ptr<weld::SpinButton> mxSampleSize;
58 std::unique_ptr<weld::SpinButton> mxPeriod;
59
60 std::unique_ptr<weld::RadioButton> mxRandomMethodRadio;
61 std::unique_ptr<weld::CheckButton> mxWithReplacement;
62 std::unique_ptr<weld::CheckButton> mxKeepOrder;
63 std::unique_ptr<weld::RadioButton> mxPeriodicMethodRadio;
64
65 std::unique_ptr<weld::Button> mxButtonOk;
66 std::unique_ptr<weld::Button> mxButtonCancel;
67
68 void Init();
70 void PerformSampling();
71 sal_Int64 GetPopulationSize() const;
73
77
78 DECL_LINK( ButtonClicked, weld::Button&, void );
79 DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void );
80 DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void );
81 DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
82 DECL_LINK( LoseButtonFocusHandler, formula::RefButton&, void );
83 DECL_LINK( SamplingSizeValueModified, weld::SpinButton&, void );
84 DECL_LINK( PeriodValueModified, weld::SpinButton&, void );
86 DECL_LINK( RefInputModifyHandler, formula::RefEdit&, void );
87 DECL_LINK( CheckHdl, weld::Toggleable&, void );
89};
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int64 GetPopulationSize() const
ScViewData & mViewData
ScAddress mCurrentAddress
DECL_LINK(ButtonClicked, weld::Button &, void)
ScAddress mOutputAddress
formula::RefEdit * mpActiveEdit
std::unique_ptr< weld::Button > mxButtonCancel
DECL_LINK(LoseEditFocusHandler, formula::RefEdit &, void)
DECL_LINK(LoseButtonFocusHandler, formula::RefButton &, void)
DECL_LINK(PeriodValueModified, weld::SpinButton &, void)
std::unique_ptr< weld::RadioButton > mxPeriodicMethodRadio
virtual void SetActive() override
DECL_LINK(SamplingSizeValueModified, weld::SpinButton &, void)
sal_Int64 mnLastPeriodValue
std::unique_ptr< formula::RefEdit > mxInputRangeEdit
std::unique_ptr< weld::SpinButton > mxSampleSize
DECL_LINK(CheckHdl, weld::Toggleable &, void)
virtual void Close() override
const ScDocument & mDocument
std::unique_ptr< weld::SpinButton > mxPeriod
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
ScSamplingDialog(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData &rViewData)
DECL_LINK(GetButtonFocusHandler, formula::RefButton &, void)
virtual ~ScSamplingDialog() override
std::unique_ptr< weld::RadioButton > mxRandomMethodRadio
ScAddress::Details mAddressDetails
std::unique_ptr< weld::CheckButton > mxWithReplacement
ScRange PerformRandomSampling(ScDocShell *pDocShell)
sal_Int64 mnLastSampleSizeValue
std::unique_ptr< weld::Button > mxButtonOk
DECL_LINK(RefInputModifyHandler, formula::RefEdit &, void)
std::unique_ptr< formula::RefButton > mxOutputRangeButton
void LimitSampleSizeAndPeriod()
std::unique_ptr< weld::CheckButton > mxKeepOrder
ScRange PerformPeriodicSampling(ScDocShell *pDocShell)
std::unique_ptr< weld::Label > mxInputRangeLabel
DECL_LINK(ToggleSamplingMethod, weld::Toggleable &, void)
DECL_LINK(GetEditFocusHandler, formula::RefEdit &, void)
ScRange PerformRandomSamplingKeepOrder(ScDocShell *pDocShell)
std::unique_ptr< formula::RefEdit > mxOutputRangeEdit
std::unique_ptr< weld::Label > mxOutputRangeLabel
std::unique_ptr< formula::RefButton > mxInputRangeButton