From c21913bbbcc731f1b7b366f802f0a493a975db10 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sat, 14 Sep 2002 20:16:14 +0000 Subject: [PATCH] math matrix insert git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5305 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/QMath.C | 8 +- src/frontends/qt2/QMath.h | 5 +- src/frontends/qt2/QMathDialog.C | 17 ++- src/frontends/qt2/ui/QMathDialog.ui | 225 +++++++++++++++------------- 4 files changed, 141 insertions(+), 114 deletions(-) diff --git a/src/frontends/qt2/QMath.C b/src/frontends/qt2/QMath.C index 971551825c..6ef5ebbed7 100644 --- a/src/frontends/qt2/QMath.C +++ b/src/frontends/qt2/QMath.C @@ -68,7 +68,7 @@ void QMath::superscript() } -void QMath::insert_symbol(string const & name) +void QMath::insert(string const & name) { current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name)); } @@ -82,6 +82,12 @@ void QMath::insertCubeRoot() } +void QMath::insertMatrix() +{ + current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, "2 2")); +} + + void QMath::toggleDisplay() { current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY)); diff --git a/src/frontends/qt2/QMath.h b/src/frontends/qt2/QMath.h index e32f67e257..460619088b 100644 --- a/src/frontends/qt2/QMath.h +++ b/src/frontends/qt2/QMath.h @@ -32,11 +32,14 @@ public: virtual void build_dialog(); /// insert a math symbol into the doc - void insert_symbol(string const & name); + void insert(string const & name); /// insert a cube root void insertCubeRoot(); + /// insert a matrix + void insertMatrix(); + /// add a subscript void subscript(); diff --git a/src/frontends/qt2/QMathDialog.C b/src/frontends/qt2/QMathDialog.C index 2e5185d9a3..158fdef58b 100644 --- a/src/frontends/qt2/QMathDialog.C +++ b/src/frontends/qt2/QMathDialog.C @@ -178,13 +178,13 @@ void QMathDialog::addPanel(int num) void QMathDialog::symbol_clicked(string str) { - form_->insert_symbol(str); + form_->insert(str); } void QMathDialog::fracClicked() { - form_->insert_symbol("frac"); + form_->insert("frac"); } @@ -208,12 +208,13 @@ void QMathDialog::expandClicked() void QMathDialog::functionSelected(const QString & str) { - form_->insert_symbol(str.latin1()); + form_->insert(str.latin1()); } void QMathDialog::matrixClicked() { + form_->insertMatrix(); } @@ -246,7 +247,7 @@ void QMathDialog::insertSpace(int id) case 5: str = "qquad"; break; case 6: str = "!"; break; } - form_->insert_symbol(str); + form_->insert(str); } @@ -254,13 +255,13 @@ void QMathDialog::insertRoot(int id) { switch (id) { case 1: - form_->insert_symbol("sqrt"); + form_->insert("sqrt"); break; case 2: form_->insertCubeRoot(); break; case 3: - form_->insert_symbol("root"); + form_->insert("root"); break; } } @@ -275,7 +276,7 @@ void QMathDialog::insertStyle(int id) case 3: str = "scriptstyle"; break; case 4: str = "scriptscriptstyle"; break; } - form_->insert_symbol(str); + form_->insert(str); } @@ -293,5 +294,5 @@ void QMathDialog::insertFont(int id) case 8: str = "mathcal"; break; case 9: str = "textrm"; break; } - form_->insert_symbol(str); + form_->insert(str); } diff --git a/src/frontends/qt2/ui/QMathDialog.ui b/src/frontends/qt2/ui/QMathDialog.ui index 4033d38fe3..ec66f0a051 100644 --- a/src/frontends/qt2/ui/QMathDialog.ui +++ b/src/frontends/qt2/ui/QMathDialog.ui @@ -13,8 +13,8 @@ 0 0 - 319 - 357 + 304 + 356 @@ -161,7 +161,7 @@ QLayoutWidget name - Layout12 + Layout11 @@ -178,7 +178,7 @@ name Layout10 - + margin 0 @@ -187,68 +187,44 @@ spacing 6 - - QLabel - - name - functionsLA - - - text - &Functions - - - buddy - functionsLB - - - - QListBox + + QPushButton name - functionsLB + fracPB sizePolicy 1 - 7 + 1 - minimumSize - - 100 - 100 - + text + + + + pixmap + image4 toolTip - Selection a function or operator to insert + Insert fraction (\frac) - - - - QLayoutWidget - - name - Layout18 - - - - margin - 0 - - - spacing - 6 - - + QPushButton name - delimitersPB + equationPB + + + sizePolicy + + 1 + 1 + text @@ -256,14 +232,14 @@ pixmap - image4 + image5 toolTip - Show delimiter and bracket dialog + Toggle between display mode - + QPushButton name @@ -275,14 +251,14 @@ pixmap - image5 + image6 toolTip - Show math matrix dialog + Insert matrix - + QPushButton name @@ -294,14 +270,14 @@ pixmap - image6 + image7 toolTip Subscript - + QPushButton name @@ -313,25 +289,18 @@ pixmap - image7 + image8 toolTip Superscript - + QPushButton name - fracPB - - - sizePolicy - - 1 - 1 - + delimitersPB text @@ -339,66 +308,114 @@ pixmap - image8 + image9 toolTip - Insert fraction (\frac) + Show delimiter and bracket dialog + + + + + name + Spacer5 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + QLayoutWidget + + name + Layout12 + + + + margin + 0 + + + spacing + 6 + + + QLayoutWidget + + name + Layout10 + + + + margin + 0 + + + spacing + 6 + - QPushButton + QLabel name - equationPB - - - sizePolicy - - 1 - 1 - + functionsLA text - - - - pixmap - image9 + &Functions - toolTip - Toggle between display mode + buddy + functionsLB - - + + QListBox + name - Spacer4 + functionsLB - orientation - Vertical + sizePolicy + + 1 + 7 + - sizeType - Expanding - - - sizeHint + minimumSize - 20 - 20 + 100 + 100 - + + toolTip + Selection a function or operator to insert + + name - Spacer5 + Spacer4 orientation @@ -755,27 +772,27 @@ image4 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c8135756564608813948e289608026ae8710d7c31087e0a12b8ec55fb8c2017bb851215e6aadb900c1776f11 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54103b11c856360003105719c64d4b03abc40288105706032ce2708246e238ecc5eace4424408cf850f72f8678ad351700b4f269b9 image5 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232325000210543251d2e253d856405bffcbc54105b19c856360082b434b0141640a6b832102011087110421084c57198336a2fa9e2b5d65c00168a5f43 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c814574601d4578f4f3c110cb088c30922c57198438a7b06321c50c56badb90087fe6771 image6 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402a82cae0c0658c4f560c48088278200367120499c38c45f18e25040b238ba7b3000c9e2b5d65c00f2a86971 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232325000210543251d2e253d856405bffcbc54105b19c856360082b434b0141640a6b832102011087110421084c57198336a2fa9e2b5d65c00168a5f43 image7 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc40250c59541009b381413144f04032ce27a6082647174f740c531dc4f737188bf30c431c08089d75a7301006ff86b61 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402a82cae0c0658c4f560c48088278200367120499c38c45f18e25040b238ba7b3000c9e2b5d65c00f2a86971 image8 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54103b11c856360003105719c64d4b03abc40288105706032ce2708246e238ecc5eace4424408cf850f72f8678ad351700b4f269b9 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc40250c59541009b381413144f04032ce27a6082647174f740c531dc4f737188bf30c431c08089d75a7301006ff86b61 image9 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c814574601d4578f4f3c110cb088c30922c57198438a7b06321c50c56badb90087fe6771 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c8135756564608813948e289608026ae8710d7c31087e0a12b8ec55fb8c2017bb851215e6aadb900c1776f11 image10 -- 2.39.2