Source Code (Use browser search to find items of interest.)
Class Index
killustrator'OptionDialog (./koffice/killustrator/share/OptionDialog.h:38)
class OptionDialog : public QTabDialog {
Q_OBJECT
public:
OptionDialog (QWidget* parent = 0L, const char* name = 0L);
static int setup ();
protected:
QWidget* createGeneralWidget (QWidget* parent);
QWidget* createEditWidget (QWidget* parent);
private slots:
void applyPressed ();
void helpPressed ();
private:
QComboBox* unit;
UnitBox *horiz, *vert;
UnitBox *smallStep, *bigStep;
};
killustrator'OptionDialog::OptionDialog() (./koffice/killustrator/share/OptionDialog.cc:38)
OptionDialog::OptionDialog (QWidget* parent, const char* name) :
QTabDialog (parent, name, true) {
QWidget* widget;
setCaption (i18n ("Option"));
widget = createGeneralWidget (this);
addTab (widget, i18n ("General"));
widget = createEditWidget (this);
addTab (widget, i18n ("Edit"));
setOkButton (i18n ("OK"));
setCancelButton (i18n ("Cancel"));
adjustSize ();
setMinimumSize (300, 310);
setMaximumSize (300, 310);
}
killustrator'OptionDialog::createGeneralWidget() (./koffice/killustrator/share/OptionDialog.cc:59)
QWidget* OptionDialog::createGeneralWidget (QWidget* parent) {
QWidget* w;
QLabel* label;
w = new QWidget (parent);
label = new QLabel (w);
label->setAlignment (AlignLeft | AlignVCenter);
label->setText (i18n ("Unit:"));
label->setFixedHeight (label->sizeHint ().height ());
label->move (10, 20);
unit = new QComboBox (w);
unit->insertItem (unitToString (UnitPoint));
unit->insertItem (unitToString (UnitMillimeter));
unit->insertItem (unitToString (UnitInch));
unit->insertItem (unitToString (UnitPica));
unit->insertItem (unitToString (UnitCentimeter));
unit->insertItem (unitToString (UnitDidot));
unit->insertItem (unitToString (UnitCicero));
unit->move (80, 20);
unit->setCurrentItem ((int)
PStateManager::instance ()->defaultMeasurementUnit ());
return w;
}
killustrator'OptionDialog::createEditWidget() (./koffice/killustrator/share/OptionDialog.cc:87)
QWidget* OptionDialog::createEditWidget (QWidget* parent) {
QWidget* w;
QLabel* label;
QGroupBox* box;
w = new QWidget (parent);
box = new QGroupBox (w);
box->setTitle (i18n ("Duplicate Offset"));
box->move (20, 15);
label = new QLabel (box);
label->setAlignment (AlignLeft | AlignVCenter);
label->setText (i18n ("Horizontal:"));
label->move (20, 20);
horiz = new UnitBox (box);
horiz->setRange (-1000.0, 1000.0);
horiz->setStep (0.1);
horiz->setEditable (true);
horiz->move (90, 20);
label = new QLabel (box);
label->setAlignment (AlignLeft | AlignVCenter);
label->setText (i18n ("Vertical:"));
label->move (20, 50);
vert = new UnitBox (box);
vert->setRange (-1000.0, 1000.0);
vert->setStep (0.1);
vert->setEditable (true);
vert->move (90, 50);
box->adjustSize ();
box = new QGroupBox (w);
box->setTitle (i18n ("Step Distance"));
box->move (20, 120);
label = new QLabel (box);
label->setAlignment (AlignLeft | AlignVCenter);
label->setText (i18n ("Small step:"));
label->move (20, 20);
smallStep = new UnitBox (box);
smallStep->setRange (-1000.0, 1000.0);
smallStep->setStep (0.1);
smallStep->setEditable (true);
smallStep->move (90, 20);
label = new QLabel (box);
label->setAlignment (AlignLeft | AlignVCenter);
label->setText (i18n ("Big step:"));
label->move (20, 50);
bigStep = new UnitBox (box);
bigStep->setRange (-1000.0, 1000.0);
bigStep->setStep (0.1);
bigStep->setEditable (true);
bigStep->move (90, 50);
PStateManager *psm = PStateManager::instance ();
horiz->setValue (psm->duplicateXOffset ());
vert->setValue (psm->duplicateYOffset ());
smallStep->setValue (psm->smallStepSize ());
bigStep->setValue (psm->bigStepSize ());
box->adjustSize ();
return w;
}
killustrator'OptionDialog::applyPressed() (./koffice/killustrator/share/OptionDialog.cc:156)
void OptionDialog::applyPressed () {
accept ();
}
killustrator'OptionDialog::helpPressed() (./koffice/killustrator/share/OptionDialog.cc:160)
void OptionDialog::helpPressed () {
}
killustrator'OptionDialog::setup() (./koffice/killustrator/share/OptionDialog.cc:163)
int OptionDialog::setup () {
int res;
OptionDialog dialog (0L, "Options");
res = dialog.exec ();
if (res == QDialog::Accepted) {
int selection = dialog.unit->currentItem ();
PStateManager* psm = PStateManager::instance ();
switch (selection) {
case 0:
psm->setDefaultMeasurementUnit (UnitPoint);
break;
case 1:
psm->setDefaultMeasurementUnit (UnitMillimeter);
break;
case 2:
psm->setDefaultMeasurementUnit (UnitInch);
break;
case 3:
psm->setDefaultMeasurementUnit (UnitPica);
break;
case 4:
psm->setDefaultMeasurementUnit (UnitCentimeter);
break;
case 5:
psm->setDefaultMeasurementUnit (UnitDidot);
break;
case 6:
psm->setDefaultMeasurementUnit (UnitCicero);
break;
default:
break;
}
psm->setStepSizes (dialog.smallStep->getValue (),
dialog.bigStep->getValue ());
psm->setDuplicateOffsets (dialog.horiz->getValue (),
dialog.vert->getValue ());
}
return res;
}