Spaces menu for math dialog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5299 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-09-14 01:44:58 +00:00
parent 480b7431ff
commit ca3ee9394a
6 changed files with 42 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2002-09-14 John Levon <levon@movementarian.org>
* ui/QMathDialog.ui:
* QMathDialog.h:
* QMathDialog.C: add spaces menu
2002-09-13 John Levon <levon@movementarian.org>
* Menubar_pimpl.C:

View File

@ -9,6 +9,7 @@
#include <config.h>
#include "support/filetools.h"
#include "gettext.h"
#include "debug.h"
#include "QMathDialog.h"
@ -20,10 +21,13 @@
#include <qapplication.h>
#include <qwidgetstack.h>
#include <qcombobox.h>
#include <qpushbutton.h>
#include <qlistbox.h>
#include <qpixmap.h>
#include <qscrollview.h>
#include <qlayout.h>
#include <qpopupmenu.h>
#include <qcursor.h>
using std::min;
using std::max;
@ -96,6 +100,15 @@ QMathDialog::QMathDialog(QMath * form)
panel_initialised[0] = true;
connect(symbolsWS, SIGNAL(aboutToShow(int)), this, SLOT(showingPanel(int)));
space_menu_ = new QPopupMenu(spacePB);
space_menu_->insertItem(_("Thin space \\,"), 1);
space_menu_->insertItem(_("Medium space \\:"), 2);
space_menu_->insertItem(_("Thick space \\;"), 3);
space_menu_->insertItem(_("Quadratin space \\quad"), 4);
space_menu_->insertItem(_("Double quadratin space \\qquad"), 5);
space_menu_->insertItem(_("Negative space \\!"), 6);
connect(space_menu_, SIGNAL(activated(int)), this, SLOT(insertSpace(int)));
}
@ -134,6 +147,21 @@ void QMathDialog::addPanel(int num)
}
void QMathDialog::insertSpace(int id)
{
string str;
switch (id) {
case 1: str = ","; break;
case 2: str = ":"; break;
case 3: str = ";"; break;
case 4: str = "quad"; break;
case 5: str = "qquad"; break;
case 6: str = "!"; break;
}
form_->insert_symbol(str);
}
void QMathDialog::symbol_clicked(string str)
{
form_->insert_symbol(str);
@ -183,6 +211,7 @@ void QMathDialog::matrixClicked()
void QMathDialog::spaceClicked()
{
space_menu_->exec(QCursor::pos());
}

View File

@ -17,6 +17,7 @@
class QMath;
class IconPalette;
class QPopupMenu;
class QMathDialog : public QMathDialogBase
{
@ -37,6 +38,7 @@ public slots:
virtual void subscriptClicked();
virtual void superscriptClicked();
void symbol_clicked(string str);
void insertSpace(int id);
/// about to show a symbol panel
void showingPanel(int);
@ -53,6 +55,9 @@ private:
/// owning form
QMath * form_;
/// menu on click of space
QPopupMenu * space_menu_;
};
#endif // QMATHDIALOG_H

View File

@ -27,7 +27,6 @@ QGraphics
QLImage
- get jpeg etc. to work
- get mono/color to work
- get bgcolor and clipping to work

View File

@ -216,7 +216,7 @@
</property>
<property>
<name>toolTip</name>
<string>Show spacing dialog</string>
<string>Insert spacing</string>
</property>
</widget>
<widget row="0" column="0" >