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> 2002-09-13 John Levon <levon@movementarian.org>
* Menubar_pimpl.C: * Menubar_pimpl.C:

View File

@ -9,6 +9,7 @@
#include <config.h> #include <config.h>
#include "support/filetools.h" #include "support/filetools.h"
#include "gettext.h"
#include "debug.h" #include "debug.h"
#include "QMathDialog.h" #include "QMathDialog.h"
@ -20,10 +21,13 @@
#include <qapplication.h> #include <qapplication.h>
#include <qwidgetstack.h> #include <qwidgetstack.h>
#include <qcombobox.h> #include <qcombobox.h>
#include <qpushbutton.h>
#include <qlistbox.h> #include <qlistbox.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qscrollview.h> #include <qscrollview.h>
#include <qlayout.h> #include <qlayout.h>
#include <qpopupmenu.h>
#include <qcursor.h>
using std::min; using std::min;
using std::max; using std::max;
@ -96,6 +100,15 @@ QMathDialog::QMathDialog(QMath * form)
panel_initialised[0] = true; panel_initialised[0] = true;
connect(symbolsWS, SIGNAL(aboutToShow(int)), this, SLOT(showingPanel(int))); 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) void QMathDialog::symbol_clicked(string str)
{ {
form_->insert_symbol(str); form_->insert_symbol(str);
@ -183,6 +211,7 @@ void QMathDialog::matrixClicked()
void QMathDialog::spaceClicked() void QMathDialog::spaceClicked()
{ {
space_menu_->exec(QCursor::pos());
} }

View File

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

View File

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

View File

@ -135,7 +135,7 @@ qfont_loader::font_info const * qfont_loader::getfontinfo(LyXFont const & f)
if (fi) { if (fi) {
return fi; return fi;
} else { } else {
fi = new font_info(f); fi = new font_info(f);
fontinfo_[f.family()][f.series()][f.realShape()][f.size()].reset(fi); fontinfo_[f.family()][f.series()][f.realShape()][f.size()].reset(fi);
return fi; return fi;
} }

View File

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