3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Jürgen Spitzmüller
8 * Full author contact details are available in file CREDITS.
15 #include "QBoxDialog.h"
16 #include "qt_helpers.h"
18 #include "lengthcombo.h"
19 #include <qcombobox.h>
20 #include <qpushbutton.h>
21 #include <qlineedit.h>
24 QBoxDialog::QBoxDialog(QBox * form)
25 : QBoxDialogBase(0, 0, false, 0),
28 connect(restorePB, SIGNAL(clicked()),
29 form, SLOT(slotRestore()));
30 connect(okPB, SIGNAL(clicked()),
31 form, SLOT(slotOK()));
32 connect(applyPB, SIGNAL(clicked()),
33 form, SLOT(slotApply()));
34 connect(closePB, SIGNAL(clicked()),
35 form, SLOT(slotClose()));
39 void QBoxDialog::closeEvent(QCloseEvent * e)
46 void QBoxDialog::change_adaptor()
52 void QBoxDialog::innerBoxChanged(const QString & str)
54 bool ibox = (str != qt_("None"));
55 valignCO->setEnabled(ibox);
56 ialignCO->setEnabled(ibox);
57 halignCO->setEnabled(!ibox);
58 heightED->setEnabled(ibox);
59 heightUnitsLC->setEnabled(ibox);
60 form_->setSpecial(ibox);
64 void QBoxDialog::typeChanged(int index)
66 bool frameless = (index == 0);
68 valignCO->setEnabled(true);
69 ialignCO->setEnabled(true);
70 halignCO->setEnabled(false);
71 heightED->setEnabled(true);
72 heightUnitsLC->setEnabled(true);
73 form_->setSpecial(true);
75 int itype = innerBoxCO->currentItem();
76 form_->setInnerType(frameless, itype);
80 void QBoxDialog::restoreClicked()
82 form_->setInnerType(true, 2);
83 widthED->setText("100");
84 widthUnitsLC->setCurrentItem(LyXLength::PCW);
85 heightED->setText("1");
86 for (int j = 0; j < heightUnitsLC->count(); j++) {
87 if (heightUnitsLC->text(j) == qt_("Total Height"))
88 heightUnitsLC->setCurrentItem(j);