3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
12 #pragma implementation
17 #include "commandtags.h"
18 #include "funcrequest.h"
20 #include "BufferView.h"
22 #include "QMathDialog.h"
25 #include "iconpalette.h"
27 // FIXME temporary HACK !
28 void createMathPanel()
30 static QMath * dialog = 0;
33 dialog->build_dialog();
50 void QMath::build_dialog()
52 dialog_ = new QMathDialog(this);
56 // needless to say, this can't last for long
57 extern BufferView * current_view;
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()
87 current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, "2 2"));
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));