2 * \file BulletsModule.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
15 #pragma implementation
18 #include <qpopupmenu.h>
20 #include <qtoolbutton.h>
21 #include <qlineedit.h>
22 #include <qcombobox.h>
23 #include "BulletsModule.h"
24 #include "ui/BulletsModuleBase.h"
25 #include "QBrowseBox.h"
26 #include "support/filetools.h"
27 #include "bulletstrings.h"
29 BulletsModule::BulletsModule(QWidget * parent, char const * name, WFlags fl)
30 : BulletsModuleBase(parent, name, fl), le_(bullet1LE)
32 QPopupMenu * pm = new QPopupMenu(this);
34 QPopupMenu * pm1 = new QPopupMenu(pm);
35 QPopupMenu * pm2 = new QPopupMenu(pm);
36 QPopupMenu * pm3 = new QPopupMenu(pm);
37 QPopupMenu * pm4 = new QPopupMenu(pm);
38 QPopupMenu * pm5 = new QPopupMenu(pm);
39 QPopupMenu * pm6 = new QPopupMenu(pm);
41 standard_ = new QBrowseBox(6, 6, pm1);
42 maths_ = new QBrowseBox(6, 6, pm2);
43 ding1_ = new QBrowseBox(6, 6, pm3);
44 ding2_ = new QBrowseBox(6, 6, pm4);
45 ding3_ = new QBrowseBox(6, 6, pm5);
46 ding4_ = new QBrowseBox(6, 6, pm6);
48 pm1->insertItem(standard_);
49 pm2->insertItem(maths_);
50 pm3->insertItem(ding1_);
51 pm4->insertItem(ding2_);
52 pm5->insertItem(ding3_);
53 pm6->insertItem(ding4_);
55 pm->insertItem("Standard", pm1);
56 pm->insertItem("Maths", pm2);
57 pm->insertItem("Ding 1",pm3);
58 pm->insertItem("Ding 2",pm4);
59 pm->insertItem("Ding 3",pm5);
60 pm->insertItem("Ding 4",pm6);
62 setbullet1TB->setPopup(pm);
63 setbullet2TB->setPopup(pm);
64 setbullet3TB->setPopup(pm);
65 setbullet4TB->setPopup(pm);
69 bmfile = LibFileSearch("images", "standard", "xpm");
70 standard_->insertItem(QPixmap(bmfile.c_str()));
72 bmfile = LibFileSearch("images", "amssymb", "xpm");
73 maths_->insertItem(QPixmap(bmfile.c_str()));
75 bmfile = LibFileSearch("images", "psnfss1", "xpm");
76 ding1_->insertItem(QPixmap(bmfile.c_str()));
78 bmfile = LibFileSearch("images", "psnfss2", "xpm");
79 ding2_->insertItem(QPixmap(bmfile.c_str()));
81 bmfile = LibFileSearch("images", "psnfss3", "xpm");
82 ding3_->insertItem(QPixmap(bmfile.c_str()));
84 bmfile = LibFileSearch("images", "psnfss4", "xpm");
85 ding4_->insertItem(QPixmap(bmfile.c_str()));
87 connect(standard_, SIGNAL(selected(int, int)),
88 this, SLOT(standard(int, int)));
90 connect(maths_, SIGNAL(selected(int, int)),
91 this, SLOT(maths(int, int)));
93 connect(ding1_, SIGNAL(selected(int, int)),
94 this, SLOT(ding1(int, int)));
96 connect(ding2_, SIGNAL(selected(int, int)),
97 this, SLOT(ding2(int, int)));
99 connect(ding3_, SIGNAL(selected(int, int)),
100 this, SLOT(ding3(int, int)));
102 connect(ding4_, SIGNAL(selected(int, int)),
103 this, SLOT(ding4(int, int)));
105 connect(setbullet1TB, SIGNAL(pressed()),
106 this, SLOT(setlevel1()));
108 connect(setbullet2TB, SIGNAL(pressed()),
109 this, SLOT(setlevel2()));
111 connect(setbullet3TB, SIGNAL(pressed()),
112 this, SLOT(setlevel3()));
114 connect(setbullet4TB, SIGNAL(pressed()),
115 this, SLOT(setlevel4()));
120 BulletsModule::~BulletsModule()
124 void BulletsModule::standard(int row, int col)
126 le_->setText(bullets_standard[6*row + col]);
129 void BulletsModule::maths(int row, int col)
131 le_->setText(bullets_amssymb[6*row + col]);
134 void BulletsModule::ding1(int row, int col)
136 le_->setText(bullets_psnfss1[6*row + col]);
139 void BulletsModule::ding2(int row, int col)
141 le_->setText(bullets_psnfss2[6*row + col]);
144 void BulletsModule::ding3(int row, int col)
146 le_->setText(bullets_psnfss3[6*row + col]);
149 void BulletsModule::ding4(int row, int col)
151 le_->setText(bullets_psnfss4[6*row + col]);
154 void BulletsModule::setlevel1()
159 void BulletsModule::setlevel2()
164 void BulletsModule::setlevel3()
169 void BulletsModule::setlevel4()