1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
11 #ifndef INCLUDED_SC_SOURCE_UI_INC_RANDOMNUMBERGENERATORDIALOG_HXX
12 #define INCLUDED_SC_SOURCE_UI_INC_RANDOMNUMBERGENERATORDIALOG_HXX
15 #include "address.hxx"
16 #include "anyrefdg.hxx"
18 #include <vcl/fixed.hxx>
19 #include <vcl/group.hxx>
20 #include <vcl/lstbox.hxx>
22 #include <boost/optional.hpp>
24 class ScRandomNumberGeneratorDialog
: public ScAnyRefDlg
27 ScRandomNumberGeneratorDialog(
28 SfxBindings
* pB
, SfxChildWindow
* pCW
,
29 vcl::Window
* pParent
, ScViewData
* pViewData
);
31 virtual ~ScRandomNumberGeneratorDialog();
32 virtual void dispose() SAL_OVERRIDE
;
34 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
) SAL_OVERRIDE
;
35 virtual void SetActive() SAL_OVERRIDE
;
36 virtual bool Close() SAL_OVERRIDE
;
40 VclPtr
<FixedText
> mpInputRangeText
;
41 VclPtr
<formula::RefEdit
> mpInputRangeEdit
;
42 VclPtr
<formula::RefButton
> mpInputRangeButton
;
43 VclPtr
<ListBox
> mpDistributionCombo
;
44 VclPtr
<FixedText
> mpParameter1Text
;
45 VclPtr
<NumericField
> mpParameter1Value
;
46 VclPtr
<FixedText
> mpParameter2Text
;
47 VclPtr
<NumericField
> mpParameter2Value
;
48 VclPtr
<NumericField
> mpSeed
;
49 VclPtr
<CheckBox
> mpEnableSeed
;
50 VclPtr
<NumericField
> mpDecimalPlaces
;
51 VclPtr
<CheckBox
> mpEnableRounding
;
52 VclPtr
<PushButton
> mpButtonApply
;
53 VclPtr
<OKButton
> mpButtonOk
;
54 VclPtr
<CloseButton
> mpButtonClose
;
57 ScViewData
* mpViewData
;
62 bool mbDialogLostFocus
;
65 void GetRangeFromSelection();
69 void GenerateNumbers(RNG
& randomGenerator
, const sal_Int16 aDistributionStringId
, const boost::optional
<sal_Int8
> aDecimalPlaces
);
71 void SelectGeneratorAndGenerateNumbers();
73 DECL_LINK( OkClicked
, PushButton
* );
74 DECL_LINK( CloseClicked
, PushButton
* );
75 DECL_LINK( ApplyClicked
, PushButton
* );
76 DECL_LINK( GetFocusHandler
, Control
* );
77 DECL_LINK( LoseFocusHandler
, void* );
79 DECL_LINK( InputRangeModified
, void* );
80 DECL_LINK( Parameter1ValueModified
, void* );
81 DECL_LINK( Parameter2ValueModified
, void* );
82 DECL_LINK( DistributionChanged
, void* );
83 DECL_LINK( CheckChanged
, void* );
87 #endif // INCLUDED_SC_SOURCE_UI_INC_RANDOMNUMBERGENERATORDIALOG_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */