2002-10-09 08:59:02 +00:00
|
|
|
/**
|
2002-11-12 10:12:06 +00:00
|
|
|
* \file BulletsModule.C
|
2002-10-09 08:59:02 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include "gettext.h"
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <qpopupmenu.h>
|
|
|
|
#include <qpixmap.h>
|
|
|
|
#include <qtoolbutton.h>
|
2002-11-12 10:12:06 +00:00
|
|
|
#include <qlineedit.h>
|
|
|
|
#include <qcombobox.h>
|
2002-10-09 08:59:02 +00:00
|
|
|
#include "BulletsModule.h"
|
|
|
|
#include "ui/BulletsModuleBase.h"
|
|
|
|
#include "QBrowseBox.h"
|
2002-11-08 00:09:00 +00:00
|
|
|
#include "support/filetools.h"
|
2002-11-12 10:12:06 +00:00
|
|
|
#include "bulletstrings.h"
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
BulletsModule::BulletsModule(QWidget * parent, char const * name, WFlags fl)
|
2002-11-12 10:12:06 +00:00
|
|
|
: BulletsModuleBase(parent, name, fl), le_(bullet1LE)
|
2002-10-09 08:59:02 +00:00
|
|
|
{
|
2002-11-08 00:09:00 +00:00
|
|
|
QPopupMenu * pm = new QPopupMenu(this);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
QPopupMenu * pm1 = new QPopupMenu(pm);
|
|
|
|
QPopupMenu * pm2 = new QPopupMenu(pm);
|
2002-11-08 00:09:00 +00:00
|
|
|
QPopupMenu * pm3 = new QPopupMenu(pm);
|
|
|
|
QPopupMenu * pm4 = new QPopupMenu(pm);
|
|
|
|
QPopupMenu * pm5 = new QPopupMenu(pm);
|
|
|
|
QPopupMenu * pm6 = new QPopupMenu(pm);
|
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
standard_ = new QBrowseBox(6, 6, pm1);
|
|
|
|
maths_ = new QBrowseBox(6, 6, pm2);
|
|
|
|
ding1_ = new QBrowseBox(6, 6, pm3);
|
|
|
|
ding2_ = new QBrowseBox(6, 6, pm4);
|
|
|
|
ding3_ = new QBrowseBox(6, 6, pm5);
|
|
|
|
ding4_ = new QBrowseBox(6, 6, pm6);
|
2002-11-08 00:09:00 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
pm1->insertItem(standard_);
|
|
|
|
pm2->insertItem(maths_);
|
|
|
|
pm3->insertItem(ding1_);
|
|
|
|
pm4->insertItem(ding2_);
|
|
|
|
pm5->insertItem(ding3_);
|
|
|
|
pm6->insertItem(ding4_);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
pm->insertItem("Standard", pm1);
|
|
|
|
pm->insertItem("Maths", pm2);
|
2002-11-08 00:09:00 +00:00
|
|
|
pm->insertItem("Ding 1",pm3);
|
|
|
|
pm->insertItem("Ding 2",pm4);
|
|
|
|
pm->insertItem("Ding 3",pm5);
|
|
|
|
pm->insertItem("Ding 4",pm6);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
setbullet1TB->setPopup(pm);
|
2002-11-08 00:09:00 +00:00
|
|
|
setbullet2TB->setPopup(pm);
|
|
|
|
setbullet3TB->setPopup(pm);
|
|
|
|
setbullet4TB->setPopup(pm);
|
|
|
|
|
|
|
|
// insert pixmaps
|
|
|
|
string bmfile;
|
|
|
|
bmfile = LibFileSearch("images", "standard", "xpm");
|
2002-11-12 10:12:06 +00:00
|
|
|
standard_->insertItem(QPixmap(bmfile.c_str()));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
bmfile = LibFileSearch("images", "amssymb", "xpm");
|
2002-11-12 10:12:06 +00:00
|
|
|
maths_->insertItem(QPixmap(bmfile.c_str()));
|
2002-11-08 00:09:00 +00:00
|
|
|
|
|
|
|
bmfile = LibFileSearch("images", "psnfss1", "xpm");
|
2002-11-12 10:12:06 +00:00
|
|
|
ding1_->insertItem(QPixmap(bmfile.c_str()));
|
2002-11-08 00:09:00 +00:00
|
|
|
|
|
|
|
bmfile = LibFileSearch("images", "psnfss2", "xpm");
|
2002-11-12 10:12:06 +00:00
|
|
|
ding2_->insertItem(QPixmap(bmfile.c_str()));
|
2002-11-08 00:09:00 +00:00
|
|
|
|
|
|
|
bmfile = LibFileSearch("images", "psnfss3", "xpm");
|
2002-11-12 10:12:06 +00:00
|
|
|
ding3_->insertItem(QPixmap(bmfile.c_str()));
|
2002-11-08 00:09:00 +00:00
|
|
|
|
|
|
|
bmfile = LibFileSearch("images", "psnfss4", "xpm");
|
2002-11-12 10:12:06 +00:00
|
|
|
ding4_->insertItem(QPixmap(bmfile.c_str()));
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(standard_, SIGNAL(selected(int, int)),
|
|
|
|
this, SLOT(standard(int, int)));
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(maths_, SIGNAL(selected(int, int)),
|
|
|
|
this, SLOT(maths(int, int)));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(ding1_, SIGNAL(selected(int, int)),
|
|
|
|
this, SLOT(ding1(int, int)));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(ding2_, SIGNAL(selected(int, int)),
|
|
|
|
this, SLOT(ding2(int, int)));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(ding3_, SIGNAL(selected(int, int)),
|
|
|
|
this, SLOT(ding3(int, int)));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(ding4_, SIGNAL(selected(int, int)),
|
|
|
|
this, SLOT(ding4(int, int)));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(setbullet1TB, SIGNAL(pressed()),
|
|
|
|
this, SLOT(setlevel1()));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(setbullet2TB, SIGNAL(pressed()),
|
|
|
|
this, SLOT(setlevel2()));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(setbullet3TB, SIGNAL(pressed()),
|
|
|
|
this, SLOT(setlevel3()));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
connect(setbullet4TB, SIGNAL(pressed()),
|
|
|
|
this, SLOT(setlevel4()));
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
BulletsModule::~BulletsModule()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
void BulletsModule::standard(int row, int col)
|
|
|
|
{
|
|
|
|
le_->setText(bullets_standard[6*row + col]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BulletsModule::maths(int row, int col)
|
|
|
|
{
|
|
|
|
le_->setText(bullets_amssymb[6*row + col]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BulletsModule::ding1(int row, int col)
|
|
|
|
{
|
|
|
|
le_->setText(bullets_psnfss1[6*row + col]);
|
|
|
|
}
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
void BulletsModule::ding2(int row, int col)
|
2002-10-09 08:59:02 +00:00
|
|
|
{
|
2002-11-12 10:12:06 +00:00
|
|
|
le_->setText(bullets_psnfss2[6*row + col]);
|
2002-10-09 08:59:02 +00:00
|
|
|
}
|
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
void BulletsModule::ding3(int row, int col)
|
|
|
|
{
|
|
|
|
le_->setText(bullets_psnfss3[6*row + col]);
|
|
|
|
}
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-11-12 10:12:06 +00:00
|
|
|
void BulletsModule::ding4(int row, int col)
|
2002-10-09 08:59:02 +00:00
|
|
|
{
|
2002-11-12 10:12:06 +00:00
|
|
|
le_->setText(bullets_psnfss4[6*row + col]);
|
2002-10-09 08:59:02 +00:00
|
|
|
}
|
2002-11-12 10:12:06 +00:00
|
|
|
|
|
|
|
void BulletsModule::setlevel1()
|
|
|
|
{
|
|
|
|
le_ = bullet1LE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BulletsModule::setlevel2()
|
|
|
|
{
|
|
|
|
le_ = bullet2LE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BulletsModule::setlevel3()
|
|
|
|
{
|
|
|
|
le_ = bullet3LE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BulletsModule::setlevel4()
|
|
|
|
{
|
|
|
|
le_ = bullet4LE;
|
|
|
|
}
|