mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 13:40:19 +00:00
some math dialog non-improvements
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5216 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ee8815b5cf
commit
f75f152e5b
@ -1,3 +1,15 @@
|
||||
2002-09-06 John Levon <levon@movementarian.org>
|
||||
|
||||
* QMath.h:
|
||||
* QMath.C: add sub/superscript
|
||||
|
||||
* ui/QMathDialog.ui:
|
||||
* QMathDialog.h:
|
||||
* QMathDialog.C: add dots. Use a completely broken :(
|
||||
scrollview.
|
||||
|
||||
* iconpalette.C: increase size
|
||||
|
||||
2002-09-04 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* QLyXKeySym.C: using std::endl directive.
|
||||
|
@ -30,7 +30,7 @@ class QTempListBox : public QListBox {
|
||||
public:
|
||||
QTempListBox()
|
||||
: QListBox(0, 0,
|
||||
WType_Popup | WDestructiveClose) {
|
||||
WType_Modal | WType_Popup | WDestructiveClose) {
|
||||
setHScrollBarMode(AlwaysOff);
|
||||
}
|
||||
|
||||
|
@ -53,10 +53,22 @@ void QMath::build_dialog()
|
||||
}
|
||||
|
||||
|
||||
// needless to say, this can't last for long
|
||||
extern BufferView * current_view;
|
||||
|
||||
void QMath::subscript()
|
||||
{
|
||||
current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
|
||||
}
|
||||
|
||||
|
||||
void QMath::superscript()
|
||||
{
|
||||
current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
|
||||
}
|
||||
|
||||
|
||||
void QMath::insert_symbol(string const & name)
|
||||
{
|
||||
// needless to say, this can't last for long
|
||||
extern BufferView * current_view;
|
||||
|
||||
current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
|
||||
}
|
||||
|
@ -34,6 +34,12 @@ public:
|
||||
/// insert a math symbol into the doc
|
||||
void insert_symbol(string const & name);
|
||||
|
||||
/// add a subscript
|
||||
void subscript();
|
||||
|
||||
/// add a superscript
|
||||
void superscript();
|
||||
|
||||
private:
|
||||
/// Apply changes
|
||||
virtual void apply() {};
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "support/filetools.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "QMathDialog.h"
|
||||
#include "QMath.h"
|
||||
@ -20,6 +21,8 @@
|
||||
#include <qcombobox.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qscrollview.h>
|
||||
#include <qlayout.h>
|
||||
|
||||
QMathDialog::QMathDialog(QMath * form)
|
||||
: QMathDialogBase(0, 0, false, 0),
|
||||
@ -36,6 +39,7 @@ QMathDialog::QMathDialog(QMath * form)
|
||||
addPanel("relations", latex_brel);
|
||||
addPanel("greek", latex_greek);
|
||||
addPanel("arrows", latex_arrow);
|
||||
addPanel("dots", latex_dots);
|
||||
addPanel("misc", latex_misc);
|
||||
addPanel("amsoperators", latex_ams_ops);
|
||||
addPanel("amsrelations", latex_ams_rel);
|
||||
@ -50,13 +54,19 @@ void QMathDialog::addPanel(string const & name, char const ** entries)
|
||||
{
|
||||
static int id = 0;
|
||||
|
||||
IconPalette * p = new IconPalette(this, name.c_str());
|
||||
QScrollView * view = new QScrollView(symbolsWS);
|
||||
view->setHScrollBarMode(QScrollView::AlwaysOff);
|
||||
view->setVScrollBarMode(QScrollView::AlwaysOn);
|
||||
|
||||
IconPalette * p = new IconPalette(view->viewport(), name.c_str());
|
||||
view->addChild(p);
|
||||
for (int i = 0; *entries[i]; ++i) {
|
||||
string xpm_name = LibFileSearch("images/math/", entries[i], "xpm");
|
||||
p->add(QPixmap(xpm_name.c_str()), entries[i], string("\\") + entries[i]);
|
||||
}
|
||||
connect(p, SIGNAL(button_clicked(string)), this, SLOT(symbol_clicked(string)));
|
||||
symbolsWS->addWidget(p, id++);
|
||||
|
||||
symbolsWS->addWidget(view, id++);
|
||||
}
|
||||
|
||||
|
||||
@ -122,9 +132,11 @@ void QMathDialog::styleClicked()
|
||||
|
||||
void QMathDialog::subscriptClicked()
|
||||
{
|
||||
form_->subscript();
|
||||
}
|
||||
|
||||
|
||||
void QMathDialog::superscriptClicked()
|
||||
{
|
||||
form_->superscript();
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ QPrintDialog::QPrintDialog(QPrint * f)
|
||||
form_, SLOT(slotClose()));
|
||||
}
|
||||
|
||||
|
||||
void QPrintDialog::change_adaptor()
|
||||
{
|
||||
form_->changed();
|
||||
|
@ -21,9 +21,7 @@ IconPalette::IconPalette(QWidget * parent, char const * name)
|
||||
QVBoxLayout * top = new QVBoxLayout(this);
|
||||
QHBoxLayout * row = new QHBoxLayout(top);
|
||||
layout_ = new QGridLayout(row);
|
||||
//row->addLayout(layout_);
|
||||
row->addStretch(0);
|
||||
//top->addLayout(row);
|
||||
top->addStretch(0);
|
||||
}
|
||||
|
||||
@ -31,14 +29,15 @@ IconPalette::IconPalette(QWidget * parent, char const * name)
|
||||
void IconPalette::add(QPixmap const & pixmap, string name, string tooltip)
|
||||
{
|
||||
QPushButton * p = new QPushButton(this);
|
||||
p->setFixedSize(35, 35);
|
||||
p->setFixedSize(40, 40);
|
||||
p->setPixmap(pixmap);
|
||||
QToolTip::add(p, tooltip.c_str());
|
||||
layout_->addWidget(p, crow_, ccol_);
|
||||
if (++ccol_ == 6) {
|
||||
if (++ccol_ == 5) {
|
||||
ccol_ = 0;
|
||||
++crow_;
|
||||
}
|
||||
resize(5 * 40, crow_ * 40);
|
||||
button_map_[p] = name;
|
||||
connect(p, SIGNAL(clicked()), this, SLOT(clicked()));
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>356</width>
|
||||
<width>348</width>
|
||||
<height>357</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -403,6 +403,12 @@
|
||||
<string>Arrows</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property>
|
||||
<name>text</name>
|
||||
<string>Dots</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property>
|
||||
<name>text</name>
|
||||
@ -506,8 +512,8 @@
|
||||
<property stdset="1">
|
||||
<name>minimumSize</name>
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
|
Loading…
x
Reference in New Issue
Block a user