remove the paperpackage widgets from the qt and xforms frontend (bug 1929). John S., could you please do this in the gtk document dialog, too?

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10342 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2005-07-20 06:51:24 +00:00
parent c273557259
commit 56eb1dbdb1
8 changed files with 435 additions and 466 deletions

View File

@ -1,3 +1,9 @@
2005-07-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QDocument.C:
* QDocumentDialog.[Ch]:
* ui/MarginsModuleBase.ui: remove the paperpackage widgets (bug 1929)
2005-07-18 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* QPrefsDialog.C (switch_copierLB, switch_copierCO): remove debug

View File

@ -167,8 +167,6 @@ void QDocument::build_dialog()
dialog_->textLayoutModule->lspacingCO->insertItem(
qt_("Custom"), Spacing::Other);
// margins
dialog_->setMargins(0);
// Manage the restore, ok, apply, restore and cancel/close buttons
bcview().setOK(dialog_->okPB);
@ -387,13 +385,9 @@ void QDocument::apply()
// margins
params.use_geometry =
(dialog_->marginsModule->marginCO->currentItem() == 1
(!dialog_->marginsModule->marginCB->isChecked()
|| geom_papersize);
int margin = dialog_->marginsModule->marginCO->currentItem();
if (margin > 0) {
margin = margin - 1;
}
MarginsModuleBase const * m(dialog_->marginsModule);
params.leftmargin = widgetsToLength(m->innerLE, m->innerUnit);
@ -555,7 +549,6 @@ void QDocument::update_contents()
case Spacing::Default: case Spacing::Single: nitem = 0; break;
}
// layout
dialog_->latexModule->classCO->setCurrentItem(params.textclass);
@ -628,7 +621,6 @@ void QDocument::update_contents()
// paper
int const psize = params.papersize;
dialog_->pageLayoutModule->papersizeCO->setCurrentItem(psize);
dialog_->setMargins(psize);
dialog_->setCustomPapersize(psize);
bool const landscape =
@ -648,11 +640,9 @@ void QDocument::update_contents()
dialog_->pageLayoutModule->paperheightUnitCO, params.paperheight, defaultUnit);
// margins
MarginsModuleBase * m = dialog_->marginsModule;
m->marginCO->setCurrentItem(0);
dialog_->setCustomMargins(0);
dialog_->setMargins(!params.use_geometry);
lengthToWidgets(m->topLE, m->topUnit,
params.topmargin, defaultUnit);

View File

@ -132,8 +132,8 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
connect(textLayoutModule->twoColumnCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
// margins
connect(marginsModule->marginCO, SIGNAL(activated(int)), this, SLOT(setCustomMargins(int)));
connect(marginsModule->marginCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(setCustomMargins(bool)));
connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(marginsModule->topLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(marginsModule->topUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(marginsModule->bottomLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
@ -150,7 +150,6 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
connect(marginsModule->footskipUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
// page layout
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setMargins(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
connect(pageLayoutModule->portraitRB, SIGNAL(toggled(bool)), this, SLOT(portraitChanged()));
@ -266,23 +265,10 @@ void QDocumentDialog::portraitChanged()
setMargins(pageLayoutModule->papersizeCO->currentItem());
}
void QDocumentDialog::setMargins(int papersize)
void QDocumentDialog::setMargins(bool custom)
{
int olditem = marginsModule->marginCO->currentItem();
marginsModule->marginCO->clear();
marginsModule->marginCO->insertItem(qt_("Default"));
marginsModule->marginCO->insertItem(qt_("Custom"));
bool a4size = (papersize == 6 || papersize == 0
&& lyxrc.default_papersize == PAPER_A4);
if (a4size && pageLayoutModule->portraitRB->isChecked()) {
marginsModule->marginCO->insertItem(qt_("Small margins"));
marginsModule->marginCO->insertItem(qt_("Very small margins"));
marginsModule->marginCO->insertItem(qt_("Very wide margins"));
} else if (olditem > 1) {
olditem = 0;
}
marginsModule->marginCO->setCurrentItem(olditem);
setCustomMargins(olditem);
marginsModule->marginCB->setChecked(custom);
setCustomMargins(custom);
}
@ -300,37 +286,35 @@ void QDocumentDialog::setCustomPapersize(int papersize)
}
void QDocumentDialog::setCustomMargins(int margin)
void QDocumentDialog::setCustomMargins(bool custom)
{
bool const custom = (margin == 1);
marginsModule->topL->setEnabled(!custom);
marginsModule->topLE->setEnabled(!custom);
marginsModule->topUnit->setEnabled(!custom);
marginsModule->topL->setEnabled(custom);
marginsModule->topLE->setEnabled(custom);
marginsModule->topUnit->setEnabled(custom);
marginsModule->bottomL->setEnabled(!custom);
marginsModule->bottomLE->setEnabled(!custom);
marginsModule->bottomUnit->setEnabled(!custom);
marginsModule->bottomL->setEnabled(custom);
marginsModule->bottomLE->setEnabled(custom);
marginsModule->bottomUnit->setEnabled(custom);
marginsModule->innerL->setEnabled(!custom);
marginsModule->innerLE->setEnabled(!custom);
marginsModule->innerUnit->setEnabled(!custom);
marginsModule->innerL->setEnabled(custom);
marginsModule->innerLE->setEnabled(custom);
marginsModule->innerUnit->setEnabled(custom);
marginsModule->outerL->setEnabled(!custom);
marginsModule->outerLE->setEnabled(!custom);
marginsModule->outerUnit->setEnabled(!custom);
marginsModule->outerL->setEnabled(custom);
marginsModule->outerLE->setEnabled(custom);
marginsModule->outerUnit->setEnabled(custom);
marginsModule->headheightL->setEnabled(!custom);
marginsModule->headheightLE->setEnabled(!custom);
marginsModule->headheightUnit->setEnabled(!custom);
marginsModule->headheightL->setEnabled(custom);
marginsModule->headheightLE->setEnabled(custom);
marginsModule->headheightUnit->setEnabled(custom);
marginsModule->headsepL->setEnabled(!custom);
marginsModule->headsepLE->setEnabled(!custom);
marginsModule->headsepUnit->setEnabled(!custom);
marginsModule->headsepL->setEnabled(custom);
marginsModule->headsepLE->setEnabled(custom);
marginsModule->headsepUnit->setEnabled(custom);
marginsModule->footskipL->setEnabled(custom);
marginsModule->footskipLE->setEnabled(custom);
marginsModule->footskipUnit->setEnabled(custom);
marginsModule->footskipL->setEnabled(!custom);
marginsModule->footskipLE->setEnabled(!custom);
marginsModule->footskipUnit->setEnabled(!custom);
}

View File

@ -57,9 +57,9 @@ public slots:
protected slots:
void setLSpacing(int);
void setMargins(int);
void setMargins(bool);
void setCustomPapersize(int);
void setCustomMargins(int);
void setCustomMargins(bool);
void setSkip(int);
void enableSkip(bool);
void portraitChanged();

View File

@ -13,13 +13,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>337</width>
<height>370</height>
<width>329</width>
<height>373</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string></string>
<string>MarginsModuleBase</string>
</property>
<grid>
<property stdset="1">
@ -30,246 +30,22 @@
<name>spacing</name>
<number>6</number>
</property>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>topL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Top:</string>
</property>
<property>
<name>buddy</name>
<cstring>topLE</cstring>
</property>
</widget>
<widget row="2" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>bottomL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Bottom:</string>
</property>
<property>
<name>buddy</name>
<cstring>bottomLE</cstring>
</property>
</widget>
<widget row="3" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>innerL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Inner:</string>
</property>
<property>
<name>buddy</name>
<cstring>innerLE</cstring>
</property>
</widget>
<widget row="4" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>outerL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>O&amp;uter:</string>
</property>
<property>
<name>buddy</name>
<cstring>outerLE</cstring>
</property>
</widget>
<widget row="0" column="0" >
<class>QLabel</class>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>marginL</cstring>
<cstring>marginCB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Margins:</string>
<string>&amp;Default Margins</string>
</property>
<property>
<name>buddy</name>
<cstring>marginCO</cstring>
<name>toolTip</name>
<string>Use the margin settings provided by the document class</string>
</property>
</widget>
<widget row="1" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>topLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="2" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>bottomLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string></string>
</property>
</widget>
<widget row="4" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>outerLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="7" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>footskipL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Foot skip:</string>
</property>
<property>
<name>buddy</name>
<cstring>footskipLE</cstring>
</property>
</widget>
<widget row="5" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>headsepL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>Head &amp;sep:</string>
</property>
<property>
<name>buddy</name>
<cstring>headsepLE</cstring>
</property>
</widget>
<widget row="5" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>headsepLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="6" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>headheightLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="6" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>headheightL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>Head &amp;height:</string>
</property>
<property>
<name>buddy</name>
<cstring>headheightLE</cstring>
</property>
</widget>
<widget row="7" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>footskipLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<spacer row="8" column="1" >
<property>
<name>name</name>
<cstring>Spacer21</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<spacer row="3" column="3" >
<spacer row="1" column="1" >
<property>
<name>name</name>
<cstring>Spacer22</cstring>
@ -290,107 +66,385 @@
</size>
</property>
</spacer>
<widget row="1" column="2" >
<class>LengthCombo</class>
<spacer row="2" column="0" >
<property>
<name>name</name>
<cstring>Spacer21</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget row="1" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>topUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="2" column="2" >
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>bottomUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="3" column="2" >
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>innerUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="3" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>innerLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="4" column="2" >
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>outerUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="5" column="2" >
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>headsepUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="6" column="2" >
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>headheightUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="7" column="2" >
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>footskipUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="0" column="1" rowspan="1" colspan="2" >
<class>QComboBox</class>
<property stdset="1">
<name>name</name>
<cstring>marginCO</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
<cstring>Layout5</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout4</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>topL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Top:</string>
</property>
<property>
<name>buddy</name>
<cstring>topLE</cstring>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>bottomL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Bottom:</string>
</property>
<property>
<name>buddy</name>
<cstring>bottomLE</cstring>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>innerL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Inner:</string>
</property>
<property>
<name>buddy</name>
<cstring>innerLE</cstring>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>outerL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>O&amp;uter:</string>
</property>
<property>
<name>buddy</name>
<cstring>outerLE</cstring>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>headsepL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>Head &amp;sep:</string>
</property>
<property>
<name>buddy</name>
<cstring>headsepLE</cstring>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>headheightL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>Head &amp;height:</string>
</property>
<property>
<name>buddy</name>
<cstring>headheightLE</cstring>
</property>
</widget>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>footskipL</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Foot skip:</string>
</property>
<property>
<name>buddy</name>
<cstring>footskipLE</cstring>
</property>
</widget>
</vbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout3</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>topLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>bottomLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string></string>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>innerLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>outerLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>headsepLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>headheightLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>footskipLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
</vbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout2</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>topUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>bottomUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>innerUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>outerUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>headsepUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>headheightUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>footskipUnit</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
</vbox>
</widget>
</hbox>
</widget>
</grid>
</widget>
@ -418,7 +472,6 @@
</image>
</images>
<tabstops>
<tabstop>marginCO</tabstop>
<tabstop>topLE</tabstop>
<tabstop>bottomLE</tabstop>
<tabstop>innerLE</tabstop>

View File

@ -1,3 +1,9 @@
2005-07-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* FormDocument.C:
* forms/form_document.fd: remove the paperpackage widgets
(bug 1929).
2005-07-18 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* FontInfo.C (query): revert earlier undocumented change.

View File

@ -209,7 +209,6 @@ void FormDocument::build()
paper_.reset(build_document_paper(this));
// disable for read-only documents
bcview().addReadOnly(paper_->choice_paperpackage);
bcview().addReadOnly(paper_->radio_portrait);
bcview().addReadOnly(paper_->radio_landscape);
bcview().addReadOnly(paper_->choice_papersize);
@ -260,11 +259,6 @@ void FormDocument::build()
_(" Default | Custom | US letter | US legal "
"| US executive | A3 | A4 | A5 "
"| B3 | B4 | B5 ").c_str());
fl_addto_choice(paper_->choice_paperpackage,
_(" None "
"| Small Margins "
"| Very small Margins "
"| Very wide Margins ").c_str());
fl_addto_choice(paper_->choice_custom_width_units, units.c_str());
fl_addto_choice(paper_->choice_custom_height_units, units.c_str());
@ -547,10 +541,6 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
params.useClassDefaults();
UpdateLayoutDocument(params);
} else if (ob == paper_->radio_landscape) {
fl_set_choice(paper_->choice_paperpackage,
PACKAGE_NONE + 1);
} else if (ob == paper_->choice_papersize) {
int const paperchoice = fl_get_choice(paper_->choice_papersize);
bool const defsize = paperchoice == 1;
@ -623,25 +613,6 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
fl_set_choice_text(paper_->choice_foot_skip_units,
default_unit.c_str());
} else if (ob == paper_->choice_paperpackage &&
fl_get_choice(paper_->choice_paperpackage) != 1) {
fl_set_button(paper_->check_use_geometry, 0);
setEnabled(paper_->input_top_margin, false);
setEnabled(paper_->input_bottom_margin, false);
setEnabled(paper_->input_inner_margin, false);
setEnabled(paper_->input_outer_margin, false);
setEnabled(paper_->input_head_height, false);
setEnabled(paper_->input_head_sep, false);
setEnabled(paper_->input_foot_skip, false);
setEnabled(paper_->choice_top_margin_units, false);
setEnabled(paper_->choice_bottom_margin_units, false);
setEnabled(paper_->choice_inner_margin_units, false);
setEnabled(paper_->choice_outer_margin_units, false);
setEnabled(paper_->choice_head_height_units, false);
setEnabled(paper_->choice_head_sep_units, false);
setEnabled(paper_->choice_foot_skip_units, false);
} else if (ob == paper_->check_use_geometry) {
// don't allow switching geometry off in custom papersize
// mode nor in A3, B3, and B4
@ -649,9 +620,6 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
if (choice == 2 || choice == 6 || choice == 9 || choice == 10)
fl_set_button(paper_->check_use_geometry, 1);
fl_set_choice(paper_->choice_paperpackage,
PACKAGE_NONE + 1);
bool const use_geom = fl_get_button(paper_->check_use_geometry);
setEnabled(paper_->input_top_margin, use_geom);
setEnabled(paper_->input_bottom_margin, use_geom);
@ -669,20 +637,6 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
setEnabled(paper_->choice_foot_skip_units, use_geom);
}
if (ob == paper_->choice_papersize || ob == paper_->radio_portrait
|| ob == paper_->radio_landscape) {
// either default papersize (preferences) or document
// papersize has to be A4
bool const enable = ( fl_get_choice(paper_->choice_papersize) == 1
&& lyxrc.default_papersize == PAPER_A4)
|| fl_get_choice(paper_->choice_papersize) == 7;
if (!enable)
fl_set_choice(paper_->choice_paperpackage,
PACKAGE_NONE + 1);
setEnabled(paper_->choice_paperpackage,
enable && fl_get_button(paper_->radio_portrait));
}
return ButtonPolicy::SMI_VALID;
}
@ -1243,12 +1197,6 @@ void FormDocument::paper_update(BufferParams const & params)
fl_set_button(paper_->radio_landscape, 1);
else
fl_set_button(paper_->radio_portrait, 1);
setEnabled(paper_->choice_paperpackage,
//either default papersize (preferences)
//or document papersize has to be A4
(paperchoice == 7
|| paperchoice == 1 && lyxrc.default_papersize == PAPER_A4)
&& fl_get_button(paper_->radio_portrait));
// Default unit choice is cm if metric, inches if US paper.
bool const metric = (paperchoice == 1 && lyxrc.default_papersize > PAPER_USEXECUTIVE)

View File

@ -179,7 +179,7 @@ argument: 0
Name: form_document_paper
Width: 395
Height: 320
Number of Objects: 29
Number of Objects: 28
--------------------
class: FL_BOX
@ -433,24 +433,6 @@ name: check_use_geometry
callback: C_FormDialogView_InputCB
argument: 0
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 210 175 160 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Special (A4 portrait only):|#S
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_paperpackage
callback: C_FormDialogView_InputCB
argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
@ -598,7 +580,7 @@ argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 280 210 50 25
box: 280 180 50 25
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -616,7 +598,7 @@ argument: 0
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 330 210 50 25
box: 330 180 50 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -634,7 +616,7 @@ argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 280 240 50 25
box: 280 210 50 25
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -652,7 +634,7 @@ argument: 0
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 330 240 50 25
box: 330 210 50 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
@ -670,7 +652,7 @@ argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 280 270 50 25
box: 280 250 50 25
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -688,7 +670,7 @@ argument: 0
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 330 270 50 25
box: 330 250 50 25
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT