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
14 #pragma implementation
19 #include "commandtags.h"
20 #include "funcrequest.h"
22 #include "BufferView.h"
24 #include "QMathDialog.h"
27 #include "iconpalette.h"
29 // needless to say, this can't last for long
30 extern BufferView * current_view;
33 // FIXME temporary HACK !
34 void createMathPanel()
36 static QMath * dialog = 0;
39 dialog->build_dialog();
56 void QMath::build_dialog()
58 dialog_ = new QMathDialog(this);
62 void QMath::subscript()
64 current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
68 void QMath::superscript()
70 current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
74 void QMath::insert(string const & name)
76 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
80 void QMath::insertCubeRoot()
82 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, "\\root"));
83 current_view->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "3"));
84 current_view->owner()->dispatch(FuncRequest(LFUN_RIGHT));
88 void QMath::insertMatrix(string const & str)
90 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, str));
94 void QMath::insertDelim(string const & str)
96 current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DELIM, str));
100 void QMath::toggleDisplay()
102 current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY));