This commit was manufactured by cvs2svn to create tag 'lyx-1_3_7'.
[lyx.git] / src / frontends / qt2 / QMath.C
blob8c1ae40f207364e7cabefd7a645786e0f8f55786
1 /**
2  * \file QMath.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
11 #include <config.h>
13 #include "debug.h"
15 #include "commandtags.h"
16 #include "funcrequest.h"
17 #include "LyXView.h"
18 #include "BufferView.h"
20 #include "QMathDialog.h"
21 #include "QMath.h"
23 #include "iconpalette.h"
25 // needless to say, this can't last for long
26 extern BufferView * current_view;
29 // FIXME temporary HACK !
30 void createMathPanel()
32         static QMath * dialog = 0;
33         if (!dialog) {
34                 dialog = new QMath;
35                 dialog->build_dialog();
36         }
37         dialog->do_show();
41 QMath::QMath()
46 void QMath::do_show()
48         dialog_->show();
52 void QMath::build_dialog()
54         dialog_ = new QMathDialog(this);
58 void QMath::subscript()
60         current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
64 void QMath::superscript()
66         current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
70 void QMath::insert(string const & name)
72         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
76 void QMath::insertCubeRoot()
78         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, "\\root"));
79         current_view->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "3"));
80         current_view->owner()->dispatch(FuncRequest(LFUN_RIGHT));
84 void QMath::insertMatrix(string const & str)
86         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, str));
90 void QMath::insertDelim(string const & str)
92         current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DELIM, str));
96 void QMath::toggleDisplay()
98         current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY));