]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QMath.C
better selection and scrolling behaviour
[lyx.git] / src / frontends / qt2 / QMath.C
index 89e85de6d49fc73cba2a061cae65b566449b9974..cd0e4170474208cf7e8454077d59ab8d82d1312c 100644 (file)
@@ -1,9 +1,11 @@
 /**
  * \file QMath.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 #endif
 
 #include "debug.h"
+
 #include "commandtags.h"
 #include "funcrequest.h"
 #include "LyXView.h"
 #include "BufferView.h"
+
 #include "QMathDialog.h"
 #include "QMath.h"
 
 #include "iconpalette.h"
 
-// FIXME temporary HACK ! 
+// needless to say, this can't last for long
+extern BufferView * current_view;
+
+
+// FIXME temporary HACK !
 void createMathPanel()
 {
-       static QMath * dialog = 0; 
+       static QMath * dialog = 0;
        if (!dialog) {
-               dialog = new QMath();
+               dialog = new QMath;
                dialog->build_dialog();
        }
        dialog->do_show();
 }
+
+
 QMath::QMath()
 {
 }
@@ -45,16 +51,13 @@ void QMath::do_show()
 {
        dialog_->show();
 }
+
+
 void QMath::build_dialog()
 {
        dialog_ = new QMathDialog(this);
 }
 
-// needless to say, this can't last for long
-extern BufferView * current_view;
 
 void QMath::subscript()
 {
@@ -72,7 +75,7 @@ void QMath::insert(string const & name)
 {
        current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
 }
+
 
 void QMath::insertCubeRoot()
 {
@@ -82,18 +85,18 @@ void QMath::insertCubeRoot()
 }
 
 
-void QMath::insertMatrix()
+void QMath::insertMatrix(string const & str)
 {
-       current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, "2 2"));
+       current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, str));
 }
 
+
 void QMath::insertDelim(string const & str)
 {
        current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DELIM, str));
 }
 
+
 void QMath::toggleDisplay()
 {
        current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY));