]> git.lyx.org Git - features.git/commitdiff
math matrix insert
authorJohn Levon <levon@movementarian.org>
Sat, 14 Sep 2002 20:16:14 +0000 (20:16 +0000)
committerJohn Levon <levon@movementarian.org>
Sat, 14 Sep 2002 20:16:14 +0000 (20:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5305 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/QMath.C
src/frontends/qt2/QMath.h
src/frontends/qt2/QMathDialog.C
src/frontends/qt2/ui/QMathDialog.ui

index 971551825c5df138ff32aa1b6fec2282b8e54784..6ef5ebbed73d764052f0e90b12ff2221eb304656 100644 (file)
@@ -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));
index e32f67e2579ced72d39e28dff82013e80873eb47..460619088b494c4a0d3e3ddbdb19218490091c21 100644 (file)
@@ -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();
 
index 2e5185d9a3a436aecbca9b664c38e19817c0ffd3..158fdef58b68481aff93fdcf957ef4659a67132c 100644 (file)
@@ -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);
 }
index 4033d38fe380df8f5eea7f4f3524037f594c82a0..ec66f0a051265bcff56fdd27a71e9110dbfaffef 100644 (file)
@@ -13,8 +13,8 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>319</width>
-            <height>357</height>
+            <width>304</width>
+            <height>356</height>
         </rect>
     </property>
     <property stdset="1">
                             <class>QLayoutWidget</class>
                             <property stdset="1">
                                 <name>name</name>
-                                <cstring>Layout12</cstring>
+                                <cstring>Layout11</cstring>
                             </property>
                             <hbox>
                                 <property stdset="1">
                                         <name>name</name>
                                         <cstring>Layout10</cstring>
                                     </property>
-                                    <vbox>
+                                    <grid>
                                         <property stdset="1">
                                             <name>margin</name>
                                             <number>0</number>
                                             <name>spacing</name>
                                             <number>6</number>
                                         </property>
-                                        <widget>
-                                            <class>QLabel</class>
-                                            <property stdset="1">
-                                                <name>name</name>
-                                                <cstring>functionsLA</cstring>
-                                            </property>
-                                            <property stdset="1">
-                                                <name>text</name>
-                                                <string>&amp;Functions</string>
-                                            </property>
-                                            <property>
-                                                <name>buddy</name>
-                                                <cstring>functionsLB</cstring>
-                                            </property>
-                                        </widget>
-                                        <widget>
-                                            <class>QListBox</class>
+                                        <widget row="1"  column="1" >
+                                            <class>QPushButton</class>
                                             <property stdset="1">
                                                 <name>name</name>
-                                                <cstring>functionsLB</cstring>
+                                                <cstring>fracPB</cstring>
                                             </property>
                                             <property stdset="1">
                                                 <name>sizePolicy</name>
                                                 <sizepolicy>
                                                     <hsizetype>1</hsizetype>
-                                                    <vsizetype>7</vsizetype>
+                                                    <vsizetype>1</vsizetype>
                                                 </sizepolicy>
                                             </property>
                                             <property stdset="1">
-                                                <name>minimumSize</name>
-                                                <size>
-                                                    <width>100</width>
-                                                    <height>100</height>
-                                                </size>
+                                                <name>text</name>
+                                                <string></string>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>pixmap</name>
+                                                <pixmap>image4</pixmap>
                                             </property>
                                             <property>
                                                 <name>toolTip</name>
-                                                <string>Selection a function or operator to insert</string>
+                                                <string>Insert fraction (\frac)</string>
                                             </property>
                                         </widget>
-                                    </vbox>
-                                </widget>
-                                <widget>
-                                    <class>QLayoutWidget</class>
-                                    <property stdset="1">
-                                        <name>name</name>
-                                        <cstring>Layout18</cstring>
-                                    </property>
-                                    <vbox>
-                                        <property stdset="1">
-                                            <name>margin</name>
-                                            <number>0</number>
-                                        </property>
-                                        <property stdset="1">
-                                            <name>spacing</name>
-                                            <number>6</number>
-                                        </property>
-                                        <widget>
+                                        <widget row="1"  column="0" >
                                             <class>QPushButton</class>
                                             <property stdset="1">
                                                 <name>name</name>
-                                                <cstring>delimitersPB</cstring>
+                                                <cstring>equationPB</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizePolicy</name>
+                                                <sizepolicy>
+                                                    <hsizetype>1</hsizetype>
+                                                    <vsizetype>1</vsizetype>
+                                                </sizepolicy>
                                             </property>
                                             <property stdset="1">
                                                 <name>text</name>
                                             </property>
                                             <property stdset="1">
                                                 <name>pixmap</name>
-                                                <pixmap>image4</pixmap>
+                                                <pixmap>image5</pixmap>
                                             </property>
                                             <property>
                                                 <name>toolTip</name>
-                                                <string>Show delimiter and bracket dialog</string>
+                                                <string>Toggle between display mode</string>
                                             </property>
                                         </widget>
-                                        <widget>
+                                        <widget row="0"  column="1" >
                                             <class>QPushButton</class>
                                             <property stdset="1">
                                                 <name>name</name>
                                             </property>
                                             <property stdset="1">
                                                 <name>pixmap</name>
-                                                <pixmap>image5</pixmap>
+                                                <pixmap>image6</pixmap>
                                             </property>
                                             <property>
                                                 <name>toolTip</name>
-                                                <string>Show math matrix dialog</string>
+                                                <string>Insert matrix</string>
                                             </property>
                                         </widget>
-                                        <widget>
+                                        <widget row="0"  column="2" >
                                             <class>QPushButton</class>
                                             <property stdset="1">
                                                 <name>name</name>
                                             </property>
                                             <property stdset="1">
                                                 <name>pixmap</name>
-                                                <pixmap>image6</pixmap>
+                                                <pixmap>image7</pixmap>
                                             </property>
                                             <property>
                                                 <name>toolTip</name>
                                                 <string>Subscript</string>
                                             </property>
                                         </widget>
-                                        <widget>
+                                        <widget row="1"  column="2" >
                                             <class>QPushButton</class>
                                             <property stdset="1">
                                                 <name>name</name>
                                             </property>
                                             <property stdset="1">
                                                 <name>pixmap</name>
-                                                <pixmap>image7</pixmap>
+                                                <pixmap>image8</pixmap>
                                             </property>
                                             <property>
                                                 <name>toolTip</name>
                                                 <string>Superscript</string>
                                             </property>
                                         </widget>
-                                        <widget>
+                                        <widget row="0"  column="0" >
                                             <class>QPushButton</class>
                                             <property stdset="1">
                                                 <name>name</name>
-                                                <cstring>fracPB</cstring>
-                                            </property>
-                                            <property stdset="1">
-                                                <name>sizePolicy</name>
-                                                <sizepolicy>
-                                                    <hsizetype>1</hsizetype>
-                                                    <vsizetype>1</vsizetype>
-                                                </sizepolicy>
+                                                <cstring>delimitersPB</cstring>
                                             </property>
                                             <property stdset="1">
                                                 <name>text</name>
                                             </property>
                                             <property stdset="1">
                                                 <name>pixmap</name>
-                                                <pixmap>image8</pixmap>
+                                                <pixmap>image9</pixmap>
                                             </property>
                                             <property>
                                                 <name>toolTip</name>
-                                                <string>Insert fraction (\frac)</string>
+                                                <string>Show delimiter and bracket dialog</string>
                                             </property>
                                         </widget>
+                                    </grid>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer5</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout12</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLayoutWidget</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Layout10</cstring>
+                                    </property>
+                                    <vbox>
+                                        <property stdset="1">
+                                            <name>margin</name>
+                                            <number>0</number>
+                                        </property>
+                                        <property stdset="1">
+                                            <name>spacing</name>
+                                            <number>6</number>
+                                        </property>
                                         <widget>
-                                            <class>QPushButton</class>
+                                            <class>QLabel</class>
                                             <property stdset="1">
                                                 <name>name</name>
-                                                <cstring>equationPB</cstring>
-                                            </property>
-                                            <property stdset="1">
-                                                <name>sizePolicy</name>
-                                                <sizepolicy>
-                                                    <hsizetype>1</hsizetype>
-                                                    <vsizetype>1</vsizetype>
-                                                </sizepolicy>
+                                                <cstring>functionsLA</cstring>
                                             </property>
                                             <property stdset="1">
                                                 <name>text</name>
-                                                <string></string>
-                                            </property>
-                                            <property stdset="1">
-                                                <name>pixmap</name>
-                                                <pixmap>image9</pixmap>
+                                                <string>&amp;Functions</string>
                                             </property>
                                             <property>
-                                                <name>toolTip</name>
-                                                <string>Toggle between display mode</string>
+                                                <name>buddy</name>
+                                                <cstring>functionsLB</cstring>
                                             </property>
                                         </widget>
-                                        <spacer>
-                                            <property>
+                                        <widget>
+                                            <class>QListBox</class>
+                                            <property stdset="1">
                                                 <name>name</name>
-                                                <cstring>Spacer4</cstring>
+                                                <cstring>functionsLB</cstring>
                                             </property>
                                             <property stdset="1">
-                                                <name>orientation</name>
-                                                <enum>Vertical</enum>
+                                                <name>sizePolicy</name>
+                                                <sizepolicy>
+                                                    <hsizetype>1</hsizetype>
+                                                    <vsizetype>7</vsizetype>
+                                                </sizepolicy>
                                             </property>
                                             <property stdset="1">
-                                                <name>sizeType</name>
-                                                <enum>Expanding</enum>
-                                            </property>
-                                            <property>
-                                                <name>sizeHint</name>
+                                                <name>minimumSize</name>
                                                 <size>
-                                                    <width>20</width>
-                                                    <height>20</height>
+                                                    <width>100</width>
+                                                    <height>100</height>
                                                 </size>
                                             </property>
-                                        </spacer>
+                                            <property>
+                                                <name>toolTip</name>
+                                                <string>Selection a function or operator to insert</string>
+                                            </property>
+                                        </widget>
                                     </vbox>
                                 </widget>
                                 <spacer>
                                     <property>
                                         <name>name</name>
-                                        <cstring>Spacer5</cstring>
+                                        <cstring>Spacer4</cstring>
                                     </property>
                                     <property stdset="1">
                                         <name>orientation</name>
     </image>
     <image>
         <name>image4</name>
-        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c8135756564608813948e289608026ae8710d7c31087e0a12b8ec55fb8c2017bb851215e6aadb900c1776f11</data>
+        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54103b11c856360003105719c64d4b03abc40288105706032ce2708246e238ecc5eace4424408cf850f72f8678ad351700b4f269b9</data>
     </image>
     <image>
         <name>image5</name>
-        <data format="XPM.GZ" length="554">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232325000210543251d2e253d856405bffcbc54105b19c856360082b434b0141640a6b832102011087110421084c57198336a2fa9e2b5d65c00168a5f43</data>
+        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c814574601d4578f4f3c110cb088c30922c57198438a7b06321c50c56badb90087fe6771</data>
     </image>
     <image>
         <name>image6</name>
-        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402a82cae0c0658c4f560c48088278200367120499c38c45f18e25040b238ba7b3000c9e2b5d65c00f2a86971</data>
+        <data format="XPM.GZ" length="554">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232325000210543251d2e253d856405bffcbc54105b19c856360082b434b0141640a6b832102011087110421084c57198336a2fa9e2b5d65c00168a5f43</data>
     </image>
     <image>
         <name>image7</name>
-        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc40250c59541009b381413144f04032ce27a6082647174f740c531dc4f737188bf30c431c08089d75a7301006ff86b61</data>
+        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402a82cae0c0658c4f560c48088278200367120499c38c45f18e25040b238ba7b3000c9e2b5d65c00f2a86971</data>
     </image>
     <image>
         <name>image8</name>
-        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54103b11c856360003105719c64d4b03abc40288105706032ce2708246e238ecc5eace4424408cf850f72f8678ad351700b4f269b9</data>
+        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc40250c59541009b381413144f04032ce27a6082647174f740c531dc4f737188bf30c431c08089d75a7301006ff86b61</data>
     </image>
     <image>
         <name>image9</name>
-        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c814574601d4578f4f3c110cb088c30922c57198438a7b06321c50c56badb90087fe6771</data>
+        <data format="XPM.GZ" length="569">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232500022630543251d2e253d856405bffcbc54105b19c856360003103711c64d4b03abc402c8135756564608813948e289608026ae8710d7c31087e0a12b8ec55fb8c2017bb851215e6aadb900c1776f11</data>
     </image>
     <image>
         <name>image10</name>