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
16 #include "commandtags.h"
17 #include "funcrequest.h"
19 #include "BufferView.h"
21 #include "QMathDialog.h"
24 #include "iconpalette.h"
26 // needless to say, this can't last for long
27 extern BufferView * current_view;
30 // FIXME temporary HACK !
31 void createMathPanel()
33 static QMath * dialog = 0;
36 dialog->build_dialog();
53 void QMath::build_dialog()
55 dialog_ = new QMathDialog(this);
59 void QMath::subscript()
61 current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
65 void QMath::superscript()
67 current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
71 void QMath::insert(string const & name)
73 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
77 void QMath::insertCubeRoot()
79 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, "\\root"));
80 current_view->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "3"));
81 current_view->owner()->dispatch(FuncRequest(LFUN_RIGHT));
85 void QMath::insertMatrix(string const & str)
87 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, str));
91 void QMath::insertDelim(string const & str)
93 current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DELIM, str));
97 void QMath::toggleDisplay()
99 current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY));