3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
15 #include "commandtags.h"
16 #include "funcrequest.h"
18 #include "BufferView.h"
20 #include "QMathDialog.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;
35 dialog->build_dialog();
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));