Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / RandomNumberGeneratorDialog.hxx
blob377f8dc93e5a15fa9989dc3eb30e1256aad469ea
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 */
11 #ifndef RANDOM_NUMBER_GENERATION_HXX
12 #define RANDOM_NUMBER_GENERATION_HXX
14 #include "global.hxx"
15 #include "address.hxx"
16 #include "anyrefdg.hxx"
19 #include <vcl/fixed.hxx>
20 #include <vcl/group.hxx>
21 #include <vcl/lstbox.hxx>
23 class ScRandomNumberGeneratorDialog : public ScAnyRefDlg
25 public:
26 ScRandomNumberGeneratorDialog(
27 SfxBindings* pB, SfxChildWindow* pCW,
28 Window* pParent, ScViewData* pViewData );
30 virtual ~ScRandomNumberGeneratorDialog();
32 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
33 virtual void SetActive();
34 virtual sal_Bool Close();
36 private:
37 // Widgets
38 FixedText* mpInputRangeText;
39 formula::RefEdit* mpInputRangeEdit;
40 formula::RefButton* mpInputRangeButton;
41 ListBox* mpDistributionCombo;
42 FixedText* mpParameter1Text;
43 NumericField* mpParameter1Value;
44 FixedText* mpParameter2Text;
45 NumericField* mpParameter2Value;
46 NumericField* mpSeed;
47 CheckBox* mpEnableSeed;
48 PushButton* mpButtonApply;
49 OKButton* mpButtonOk;
50 CloseButton* mpButtonClose;
52 // Data
53 ScViewData* mViewData;
54 ScDocument* mDocument;
56 ScRange mInputRange;
57 ScAddress::Details mAddressDetails;
59 bool mDialogLostFocus;
61 void Init();
62 void GetRangeFromSelection();
64 template<class RNG>
65 void GenerateNumbers(RNG randomGenerator, OUString aDistributionName);
67 void SelectGeneratorAndGenerateNumbers();
69 DECL_LINK( OkClicked, PushButton* );
70 DECL_LINK( CloseClicked, PushButton* );
71 DECL_LINK( ApplyClicked, PushButton* );
72 DECL_LINK( GetFocusHandler, Control* );
73 DECL_LINK( LoseFocusHandler, void* );
75 DECL_LINK( Parameter1ValueModified, void* );
76 DECL_LINK( Parameter2ValueModified, void* );
77 DECL_LINK( DistributionChanged, void* );
78 DECL_LINK( SeedCheckChanged, void* );
82 #endif // SC_SOLVRDLG_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */