kspread

kspread_dlg_goalseek.h
1/* This file is part of the KDE project
2 Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
3 (C) 2002-2003 Philipp Mueller <philipp.mueller@gmx.de>
4 (C) 2002 Laurent Montel <montel@kde.org>
5 (C) 2002 John Dailey <dailey@vt.edu>
6 (C) 2002 Ariya Hidayat <ariya@kde.org>
7 (C) 2002 Werner Trobin <trobin@kde.org>
8 (C) 2002 Harri Porten <porten@kde.org>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19
20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24*/
25
26#ifndef __kspread_dlg_goalseek__
27#define __kspread_dlg_goalseek__
28
29#include <kdialog.h>
30#include <tqpoint.h>
31#include <tqrect.h>
32
33class TQFrame;
34class TQGridLayout;
35class TQHBoxLayout;
36class TQLabel;
37class TQLineEdit;
38class TQPushButton;
39class TQVBoxLayout;
40
41namespace KSpread
42{
43class Cell;
44class Point;
45class Sheet;
46class View;
47
48class GoalSeekDialog : public KDialog
49{
50 TQ_OBJECT
51
52
53 public:
54 GoalSeekDialog( View * parent, TQPoint const & marker, const char * name = 0,
55 bool modal = false, WFlags fl = 0 );
56 ~GoalSeekDialog();
57
61 bool eventFilter( TQObject* obj, TQEvent* ev );
62
63 public slots:
64 void buttonOkClicked();
65 void buttonCancelClicked();
66 void slotSelectionChanged();
67
68 protected:
69 virtual void closeEvent ( TQCloseEvent * );
70
71 TQGridLayout * GoalSeekDialogLayout;
72 TQGridLayout * m_startFrameLayout;
73 TQGridLayout * m_resultFrameLayout;
74
75 private:
76 View * m_pView;
77 Cell * m_sourceCell;
78 Cell * m_targetCell;
79 double m_result;
80 int m_maxIter;
81 bool m_restored;
82 double m_oldSource;
83
84 TQString m_oldText;
85 TQString m_sheetName;
86
87 TQFrame * m_startFrame;
88 TQLineEdit * m_targetValueEdit;
89 TQLineEdit * m_targetEdit;
90 TQLineEdit * m_sourceEdit;
91 TQPushButton * m_buttonOk;
92 TQPushButton * m_buttonCancel;
93 TQFrame * m_resultFrame;
94 TQLabel * m_newValueDesc;
95 TQLabel * m_currentValueLabel;
96 TQLabel * m_newValue;
97 TQLabel * m_currentValue;
98 TQLabel * m_resultText;
99
105 TQLineEdit * m_focus;
106
107 TQPoint m_anchor;
108 TQPoint m_marker;
109 TQRect m_selection;
110
111 void startCalc(double _start, double _goal);
112 void chooseCleanup();
113};
114
115} // namespace KSpread
116
117#endif
The KSpread namespace.
Definition commands.h:39