2006-03-05 17:24:44 +00:00
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
|
* \file GuiBox.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna (Minipage stuff)
|
|
|
|
|
* \author Martin Vermeer
|
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiBox.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
#include "ControlBox.h"
|
|
|
|
|
|
2007-04-26 03:53:02 +00:00
|
|
|
|
#include "LengthCombo.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
|
#include "lengthcommon.h"
|
2007-04-26 04:41:58 +00:00
|
|
|
|
#include "LyXRC.h" // to set the default length values
|
2007-04-26 03:53:02 +00:00
|
|
|
|
#include "Validator.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
#include "controllers/ControlBox.h"
|
2007-04-25 17:53:54 +00:00
|
|
|
|
#include "controllers/frontend_helpers.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "insets/InsetBox.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
|
2006-05-04 07:31:46 +00:00
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QLineEdit>
|
2007-04-24 10:56:22 +00:00
|
|
|
|
#include <QCloseEvent>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using lyx::support::getStringFromVector;
|
|
|
|
|
using lyx::support::isStrDbl;
|
|
|
|
|
using lyx::support::subst;
|
|
|
|
|
using std::string;
|
|
|
|
|
|
2007-04-24 10:56:22 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-04-24 10:56:22 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
GuiBoxDialog::GuiBoxDialog(LyXView & lv)
|
|
|
|
|
: GuiDialog(lv, "box")
|
2007-04-24 10:56:22 +00:00
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
setViewTitle(_("Box Settings"));
|
|
|
|
|
setController(new ControlBox(*this));
|
|
|
|
|
|
|
|
|
|
// fill the box type choice
|
|
|
|
|
box_gui_tokens(ids_, gui_names_);
|
|
|
|
|
for (unsigned int i = 0; i < gui_names_.size(); ++i)
|
|
|
|
|
typeCO->addItem(toqstr(gui_names_[i]));
|
|
|
|
|
|
|
|
|
|
// add the special units to the height choice
|
|
|
|
|
// width needs different handling
|
|
|
|
|
box_gui_tokens_special_length(ids_spec_, gui_names_spec_);
|
|
|
|
|
for (unsigned int i = 1; i < gui_names_spec_.size(); ++i)
|
|
|
|
|
heightUnitsLC->addItem(toqstr(gui_names_spec_[i]));
|
|
|
|
|
|
|
|
|
|
connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
|
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
|
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
|
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
2007-04-24 10:56:22 +00:00
|
|
|
|
|
|
|
|
|
connect(widthED, SIGNAL(textChanged(const QString &)),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
2007-04-28 12:58:49 +00:00
|
|
|
|
connect(widthUnitsLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
|
2007-04-24 10:56:22 +00:00
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(valignCO, SIGNAL(highlighted(const QString &)),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(heightED, SIGNAL(textChanged(const QString &)),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
2007-04-28 12:58:49 +00:00
|
|
|
|
connect(heightUnitsLC, SIGNAL(selectionChanged(lyx::Length::UNIT) ),
|
2007-04-24 10:56:22 +00:00
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(restorePB, SIGNAL(clicked()), this, SLOT(restoreClicked()));
|
|
|
|
|
connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(typeCO, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
|
|
|
|
|
connect(halignCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(ialignCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(innerBoxCO, SIGNAL(activated(const QString&)),
|
|
|
|
|
this, SLOT(innerBoxChanged(const QString &)));
|
|
|
|
|
connect(innerBoxCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
|
|
|
|
|
|
heightED->setValidator(unsignedLengthValidator(heightED));
|
|
|
|
|
widthED->setValidator(unsignedLengthValidator(widthED));
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
|
|
bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
|
|
|
|
|
|
|
|
|
|
bc().addReadOnly(typeCO);
|
|
|
|
|
bc().addReadOnly(innerBoxCO);
|
|
|
|
|
bc().addReadOnly(valignCO);
|
|
|
|
|
bc().addReadOnly(ialignCO);
|
|
|
|
|
bc().addReadOnly(halignCO);
|
|
|
|
|
bc().addReadOnly(widthED);
|
|
|
|
|
bc().addReadOnly(heightED);
|
|
|
|
|
bc().addReadOnly(widthUnitsLC);
|
|
|
|
|
bc().addReadOnly(heightUnitsLC);
|
|
|
|
|
|
|
|
|
|
bc().setRestore(restorePB);
|
|
|
|
|
bc().setOK(okPB);
|
|
|
|
|
bc().setApply(applyPB);
|
|
|
|
|
bc().setCancel(closePB);
|
|
|
|
|
|
|
|
|
|
// initialize the length validator
|
|
|
|
|
bc().addCheckedLineEdit(widthED, widthLA);
|
|
|
|
|
bc().addCheckedLineEdit(heightED, heightLA);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ControlBox & GuiBoxDialog::controller() const
|
|
|
|
|
{
|
|
|
|
|
return static_cast<ControlBox &>(Dialog::controller());
|
2007-04-24 10:56:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBoxDialog::closeEvent(QCloseEvent * e)
|
2007-04-24 10:56:22 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
slotWMHide();
|
2007-04-24 10:56:22 +00:00
|
|
|
|
e->accept();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBoxDialog::change_adaptor()
|
2007-04-24 10:56:22 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
changed();
|
2007-04-24 10:56:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBoxDialog::innerBoxChanged(const QString & str)
|
2007-04-24 10:56:22 +00:00
|
|
|
|
{
|
|
|
|
|
bool const ibox = (str != qt_("None"));
|
|
|
|
|
valignCO->setEnabled(ibox);
|
|
|
|
|
ialignCO->setEnabled(ibox);
|
|
|
|
|
halignCO->setEnabled(!ibox);
|
|
|
|
|
heightED->setEnabled(ibox);
|
|
|
|
|
heightUnitsLC->setEnabled(ibox);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
setSpecial(ibox);
|
2007-04-24 10:56:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBoxDialog::typeChanged(int index)
|
2007-04-24 10:56:22 +00:00
|
|
|
|
{
|
|
|
|
|
bool const frameless = (index == 0);
|
|
|
|
|
if (frameless) {
|
|
|
|
|
valignCO->setEnabled(true);
|
|
|
|
|
ialignCO->setEnabled(true);
|
|
|
|
|
halignCO->setEnabled(false);
|
|
|
|
|
heightED->setEnabled(true);
|
|
|
|
|
heightUnitsLC->setEnabled(true);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
setSpecial(true);
|
2007-04-24 10:56:22 +00:00
|
|
|
|
}
|
|
|
|
|
int itype = innerBoxCO->currentIndex();
|
2007-09-05 20:33:29 +00:00
|
|
|
|
setInnerType(frameless, itype);
|
2007-04-24 10:56:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBoxDialog::restoreClicked()
|
2007-04-24 10:56:22 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
setInnerType(true, 2);
|
2007-04-24 10:56:22 +00:00
|
|
|
|
widthED->setText("100");
|
2007-04-28 12:58:49 +00:00
|
|
|
|
widthUnitsLC->setCurrentItem(Length::PCW);
|
2007-04-24 10:56:22 +00:00
|
|
|
|
heightED->setText("1");
|
|
|
|
|
for (int j = 0; j < heightUnitsLC->count(); j++) {
|
|
|
|
|
if (heightUnitsLC->itemText(j) == qt_("Total Height"))
|
|
|
|
|
heightUnitsLC->setCurrentItem(j);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiBoxDialog::update_contents()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
string type(controller().params().type);
|
|
|
|
|
for (unsigned int i = 0; i < gui_names_.size(); ++i) {
|
|
|
|
|
if (type == ids_[i])
|
2007-09-05 20:33:29 +00:00
|
|
|
|
typeCO->setCurrentIndex(i);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// default: minipage
|
|
|
|
|
unsigned int inner_type = 2;
|
|
|
|
|
if (!controller().params().inner_box)
|
|
|
|
|
// none
|
|
|
|
|
inner_type = 0;
|
|
|
|
|
if (controller().params().use_parbox)
|
|
|
|
|
// parbox
|
|
|
|
|
inner_type = 1;
|
|
|
|
|
bool frameless = (controller().params().type == "Frameless");
|
|
|
|
|
setInnerType(frameless, inner_type);
|
|
|
|
|
|
|
|
|
|
char c = controller().params().pos;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
valignCO->setCurrentIndex(string("tcb").find(c, 0));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
c = controller().params().inner_pos;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
ialignCO->setCurrentIndex(string("tcbs").find(c, 0));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
c = controller().params().hor_pos;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
halignCO->setCurrentIndex(string("lcrs").find(c, 0));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
bool ibox = controller().params().inner_box;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
valignCO->setEnabled(ibox);
|
|
|
|
|
ialignCO->setEnabled(ibox);
|
|
|
|
|
halignCO->setEnabled(!ibox);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
setSpecial(ibox);
|
|
|
|
|
|
2007-04-28 12:58:49 +00:00
|
|
|
|
Length::UNIT default_unit =
|
|
|
|
|
(lyxrc.default_papersize > 3) ? Length::CM : Length::IN;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
lengthToWidgets(widthED, widthUnitsLC,
|
2006-03-05 17:24:44 +00:00
|
|
|
|
(controller().params().width).asString(), default_unit);
|
|
|
|
|
|
|
|
|
|
string const special(controller().params().special);
|
|
|
|
|
if (!special.empty() && special != "none") {
|
|
|
|
|
QString spc;
|
|
|
|
|
for (unsigned int i = 0; i < gui_names_spec_.size(); i++) {
|
|
|
|
|
if (special == ids_spec_[i])
|
|
|
|
|
spc = toqstr(gui_names_spec_[i].c_str());
|
|
|
|
|
}
|
2007-09-05 20:33:29 +00:00
|
|
|
|
for (int j = 0; j < widthUnitsLC->count(); j++) {
|
|
|
|
|
if (widthUnitsLC->itemText(j) == spc)
|
|
|
|
|
widthUnitsLC->setCurrentIndex(j);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
lengthToWidgets(heightED, heightUnitsLC,
|
2006-03-05 17:24:44 +00:00
|
|
|
|
(controller().params().height).asString(), default_unit);
|
|
|
|
|
|
|
|
|
|
string const height_special(controller().params().height_special);
|
|
|
|
|
if (!height_special.empty() && height_special != "none") {
|
|
|
|
|
QString hspc;
|
|
|
|
|
for (unsigned int i = 0; i < gui_names_spec_.size(); i++) {
|
|
|
|
|
if (height_special == ids_spec_[i]) {
|
|
|
|
|
hspc = toqstr(gui_names_spec_[i].c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-09-05 20:33:29 +00:00
|
|
|
|
for (int j = 0; j < heightUnitsLC->count(); j++) {
|
|
|
|
|
if (heightUnitsLC->itemText(j) == hspc) {
|
|
|
|
|
heightUnitsLC->setCurrentIndex(j);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
heightED->setEnabled(ibox);
|
|
|
|
|
heightUnitsLC->setEnabled(ibox);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiBoxDialog::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
controller().params().type =
|
2007-09-05 20:33:29 +00:00
|
|
|
|
ids_[typeCO->currentIndex()];
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
controller().params().inner_box =
|
2007-09-05 20:33:29 +00:00
|
|
|
|
innerBoxCO->currentText() != qt_("None");
|
2006-03-05 17:24:44 +00:00
|
|
|
|
controller().params().use_parbox =
|
2007-09-05 20:33:29 +00:00
|
|
|
|
innerBoxCO->currentText() == qt_("Parbox");
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
controller().params().pos =
|
2007-09-05 20:33:29 +00:00
|
|
|
|
"tcb"[valignCO->currentIndex()];
|
2006-03-05 17:24:44 +00:00
|
|
|
|
controller().params().inner_pos =
|
2007-09-05 20:33:29 +00:00
|
|
|
|
"tcbs"[ialignCO->currentIndex()];
|
2006-03-05 17:24:44 +00:00
|
|
|
|
controller().params().hor_pos =
|
2007-09-05 20:33:29 +00:00
|
|
|
|
"lcrs"[halignCO->currentIndex()];
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
bool spec = false;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
QString special = widthUnitsLC->currentText();
|
|
|
|
|
QString value = widthED->text();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
if (special == qt_("Height")) {
|
|
|
|
|
i = 1;
|
|
|
|
|
spec = true;
|
|
|
|
|
} else if (special == qt_("Depth")) {
|
|
|
|
|
i = 2;
|
|
|
|
|
spec = true;
|
|
|
|
|
} else if (special == qt_("Total Height")) {
|
|
|
|
|
i = 3;
|
|
|
|
|
spec = true;
|
|
|
|
|
} else if (special == qt_("Width")) {
|
|
|
|
|
i = 4;
|
|
|
|
|
spec = true;
|
|
|
|
|
}
|
|
|
|
|
// the user might insert a non-special value in the line edit
|
|
|
|
|
if (isValidLength(fromqstr(value))) {
|
|
|
|
|
i = 0;
|
|
|
|
|
spec = false;
|
|
|
|
|
}
|
|
|
|
|
controller().params().special = ids_spec_[i];
|
|
|
|
|
|
|
|
|
|
string width;
|
|
|
|
|
if (spec) {
|
|
|
|
|
width = fromqstr(value);
|
|
|
|
|
// beware: bogosity! the unit is simply ignored in this case
|
|
|
|
|
width += "in";
|
|
|
|
|
} else
|
2007-09-05 20:33:29 +00:00
|
|
|
|
width = widgetsToLength(widthED, widthUnitsLC);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-04-28 12:58:49 +00:00
|
|
|
|
controller().params().width = Length(width);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
spec = false;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
special = heightUnitsLC->currentText();
|
|
|
|
|
value = heightED->text();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
if (special == qt_("Height")) {
|
|
|
|
|
i = 1;
|
|
|
|
|
spec = true;
|
|
|
|
|
} else if (special == qt_("Depth")) {
|
|
|
|
|
i = 2;
|
|
|
|
|
spec = true;
|
|
|
|
|
} else if (special == qt_("Total Height")) {
|
|
|
|
|
i = 3;
|
|
|
|
|
spec = true;
|
|
|
|
|
} else if (special == qt_("Width")) {
|
|
|
|
|
i = 4;
|
|
|
|
|
spec = true;
|
|
|
|
|
}
|
|
|
|
|
// the user might insert a non-special value in the line edit
|
|
|
|
|
if (isValidLength(fromqstr(value))) {
|
|
|
|
|
i = 0;
|
|
|
|
|
spec = false;
|
|
|
|
|
}
|
|
|
|
|
controller().params().height_special = ids_spec_[i];
|
|
|
|
|
|
|
|
|
|
string height;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (spec && !isValidLength(fromqstr(heightED->text()))) {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
height = fromqstr(value);
|
|
|
|
|
// beware: bogosity! the unit is simply ignored in this case
|
|
|
|
|
height += "in";
|
|
|
|
|
} else
|
2007-09-05 20:33:29 +00:00
|
|
|
|
height = widgetsToLength(heightED, heightUnitsLC);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-04-28 12:58:49 +00:00
|
|
|
|
controller().params().height = Length(height);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiBoxDialog::setSpecial(bool ibox)
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
box_gui_tokens_special_length(ids_spec_, gui_names_spec_);
|
|
|
|
|
// check if the widget contains the special units
|
2007-09-05 20:33:29 +00:00
|
|
|
|
int count = widthUnitsLC->count();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
bool has_special = false;
|
|
|
|
|
for (int i = 0; i < count; i++)
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (widthUnitsLC->itemText(i).contains(qt_("Total Height")) > 0)
|
2006-03-05 17:24:44 +00:00
|
|
|
|
has_special = true;
|
|
|
|
|
// insert 'em if needed...
|
|
|
|
|
if (!ibox && !has_special) {
|
|
|
|
|
for (unsigned int i = 1; i < gui_names_spec_.size(); i++)
|
2007-09-05 20:33:29 +00:00
|
|
|
|
widthUnitsLC->addItem(toqstr(gui_names_spec_[i]));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
// ... or remove 'em if needed
|
|
|
|
|
} else if (ibox && has_special) {
|
2007-09-05 20:33:29 +00:00
|
|
|
|
widthUnitsLC->clear();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
for (int i = 0; i < num_units; i++)
|
2007-09-05 20:33:29 +00:00
|
|
|
|
widthUnitsLC->addItem(qt_(unit_name_gui[i]));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiBoxDialog::setInnerType(bool frameless, int i)
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
// with "frameless" boxes, inner box is mandatory (i.e. is the actual box)
|
|
|
|
|
// we have to remove "none" then and adjust the combo
|
|
|
|
|
if (frameless) {
|
2007-09-05 20:33:29 +00:00
|
|
|
|
innerBoxCO->clear();
|
|
|
|
|
innerBoxCO->addItem(qt_("Parbox"));
|
|
|
|
|
innerBoxCO->addItem(qt_("Minipage"));
|
|
|
|
|
innerBoxCO->setCurrentIndex(i - 1);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
} else {
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (innerBoxCO->count() == 2)
|
2006-03-05 17:24:44 +00:00
|
|
|
|
i += 1;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
innerBoxCO->clear();
|
|
|
|
|
innerBoxCO->addItem(qt_("None"));
|
|
|
|
|
innerBoxCO->addItem(qt_("Parbox"));
|
|
|
|
|
innerBoxCO->addItem(qt_("Minipage"));
|
|
|
|
|
innerBoxCO->setCurrentIndex(i);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
2007-04-24 10:56:22 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiBox_moc.cpp"
|