From 9a4842fc84493d7587f177aeda4c66f56b34c0dc Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Wed, 17 Jul 2002 15:51:23 +0000 Subject: [PATCH] Add paragraph dialog to qt2 frontend. First commit, I am sure it can be done better but it works. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4683 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 9 + src/frontends/qt2/Makefile.am | 3 +- src/frontends/qt2/Makefile.dialogs | 7 + src/frontends/qt2/QLImage.C | 2 +- src/frontends/qt2/QParagraph.C | 496 +++-- src/frontends/qt2/QParagraph.h | 55 +- src/frontends/qt2/QParagraphDialog.C | 532 +----- src/frontends/qt2/QParagraphDialog.h | 64 +- src/frontends/qt2/guiapi.C | 8 +- src/frontends/qt2/ui/QParagraphDialog.ui | 2169 ++++++---------------- 10 files changed, 958 insertions(+), 2387 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index b7ebfc77d3..23c9106cbc 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2002-07-07 Edwin Leuven + + * QParagraph.[Ch]: Add paragraph dialog + * QParagraphDialog.[Ch]: + * ui/QParagraphDialog.[Ch]: + * Makefile.am: + * Makefile.dialogs: + * guiapi.C: + 2002-07-17 John Levon * QtView.C: basic statusbar show diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index cf9ad768f5..0a33a81781 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -3,8 +3,7 @@ include $(top_srcdir)/config/common.am SUBDIRS = ui moc EXTRA_DIST = Makefile.dialogs QDocument.C QDocument.h \ - QDocumentDialog.C QDocumentDialog.h QParagraph.h QParagraph.C \ - QParagraphDialog.h QParagraphDialog.C + QDocumentDialog.C QDocumentDialog.h noinst_LTLIBRARIES = libqt2.la diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index 2568f64ac6..b96c4719fc 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -16,6 +16,7 @@ DIALOGS = \ QIndex \ QLog \ QMinipage \ + QParagraph \ QPreamble \ QPrint \ QRef \ @@ -58,6 +59,8 @@ DIALOGSOURCES = \ QLog.C QLogDialog.C \ QMinipage.h QMinipageDialog.h \ QMinipage.C QMinipageDialog.C \ + QParagraph.h QParagraphDialog.h \ + QParagraph.C QParagraphDialog.C \ QPreamble.h QPreambleDialog.h \ QPreamble.C QPreambleDialog.C \ QPrint.h QPrintDialog.h \ @@ -98,6 +101,7 @@ MOCDIALOGS = \ QIndexDialog_moc.C \ QLogDialog_moc.C \ QMinipageDialog_moc.C \ + QParagraphDialog_moc.C \ QPreambleDialog_moc.C \ QPrintDialog_moc.C \ QRefDialog_moc.C \ @@ -142,6 +146,8 @@ UIDIALOGS = \ QLogDialogBase.C \ QMinipageDialogBase.h \ QMinipageDialogBase.C \ + QParagraphDialogBase.h \ + QParagraphDialogBase.C \ QPreambleDialogBase.h \ QPreambleDialogBase.C \ QPrintDialogBase.h \ @@ -183,6 +189,7 @@ UIMOCDIALOGS = \ QIndexDialogBase_moc.C \ QLogDialogBase_moc.C \ QMinipageDialogBase_moc.C \ + QParagraphDialogBase_moc.C \ QPreambleDialogBase_moc.C \ QPrintDialogBase_moc.C \ QRefDialogBase_moc.C \ diff --git a/src/frontends/qt2/QLImage.C b/src/frontends/qt2/QLImage.C index f8d9b2d8ee..0050d66af6 100644 --- a/src/frontends/qt2/QLImage.C +++ b/src/frontends/qt2/QLImage.C @@ -60,7 +60,7 @@ Image::FormatList QLImage::loadableFormats() QStrListIterator it(qt_formats); for (; it.current(); ++it) { - lyxerr[Debug::GRAPHICS] << it.current() << endl; + lyxerr[Debug::GRAPHICS] << it.current() << std::endl; string ext = lowercase(it.current()); diff --git a/src/frontends/qt2/QParagraph.C b/src/frontends/qt2/QParagraph.C index 0d47d49937..b408d77dd0 100644 --- a/src/frontends/qt2/QParagraph.C +++ b/src/frontends/qt2/QParagraph.C @@ -1,198 +1,372 @@ /** * \file QParagraph.C - * Copyright 2001 LyX Team - * see the file COPYING + * Copyright 2000-2001 The LyX Team. + * See the file COPYING. * - * \author John Levon, moz@compsoc.man.ac.uk + * \author Edwin Leuven */ #include -#include "QParagraphDialog.h" +#ifdef __GNUG__ +#pragma implementation +#endif +#include "ControlParagraph.h" #include "QParagraph.h" -#include "Liason.h" -#include "gettext.h" -#include "buffer.h" -#include "QtLyXView.h" -#include "lyxtextclasslist.h" -#include "lyxtext.h" -#include "debug.h" -#include "BufferView.h" +#include "QParagraphDialog.h" +#include "Qt2BC.h" #include "ParagraphParameters.h" - -using SigC::slot; -using Liason::setMinibuffer; -using std::endl; - - -QParagraph::QParagraph(LyXView *v, Dialogs *d) - : dialog_(0), lv_(v), d_(d), h_(0) -{ - d->showParagraph.connect(slot(this, &QParagraph::show)); -} - - -QParagraph::~QParagraph() +#include "lyxrc.h" // to set the deafult length values +#include "gettext.h" +#include "layout.h" // LyXAlignment +#include "helper_funcs.h" +#include "lyxgluelength.h" +#include "vspace.h" + +#include "support/lstrings.h" +#include "support/LAssert.h" + +#include + +#include +#include +#include +#include +#include +#include + +using std::vector; +using std::bind2nd; +using std::remove_if; + +typedef Qt2CB > base_class; + +QParagraph::QParagraph(ControlParagraph & c, Dialogs &) + : base_class(c, _("Paragraph Layout")) +{} + +void QParagraph::build_dialog() { - delete dialog_; + // the tabbed folder + dialog_.reset(new QParagraphDialog(this)); + + // Create the contents of the unit choices + // Don't include the "%" terms... + units_ = getLatexUnits(); + vector::iterator del = remove_if(units_.begin(), units_.end(), + bind2nd(contains_functor(), "%")); + units_.erase(del, units_.end()); + + for (vector::const_iterator it = units_.begin(); + it != units_.end(); ++it) { + dialog_->unitAbove->insertItem(it->c_str()); + dialog_->unitBelow->insertItem(it->c_str()); + } + + // Manage the ok, apply, restore and cancel/close buttons + bc().setOK(dialog_->okPB); + bc().setApply(dialog_->applyPB); + bc().setCancel(dialog_->closePB); + bc().setRestore(dialog_->restorePB); + bc().addReadOnly(dialog_->paragraphTab); } +namespace { -void QParagraph::update(bool switched) +VSpace setVSpaceFromWidgets(int spacing, + string value, + string unit, + bool keep) { - if (switched) { - hide(); - return; - } - - if (!lv_->view()->available()) - return; - - Buffer * buf = lv_->view()->buffer(); - - if (readonly!=buf->isReadonly()) { - readonly = buf->isReadonly(); - dialog_->setReadOnly(readonly); - } - - LyXText * text(lv_->view()->getLyXText()); - Paragraph * par = text->cursor.par(); - - int align = par->getAlign(); - - if (align==LYX_ALIGN_LAYOUT) - align = textclasslist.Style(buf->params.textclass, par->getLayout()).align; - - ParagraphParameters * params = &(par->params()); - - if (params->spaceTop().kind() == VSpace::LENGTH) { - LyXGlueLength above = params->spaceTop().length(); - lyxerr[Debug::GUI] << "Reading above space : \"" << params->spaceTop().length().asString() << "\"" << endl; - dialog_->setAboveLength(above.len().value(), above.plus().value(), above.minus().value(), - above.len().unit(), above.plus().unit(), above.minus().unit()); - } else - dialog_->setAboveLength(0.0, 0.0, 0.0, LyXLength::UNIT_NONE, LyXLength::UNIT_NONE, LyXLength::UNIT_NONE); - - if (params->spaceBottom().kind() == VSpace::LENGTH) { - LyXGlueLength below = params->spaceBottom().length(); - lyxerr[Debug::GUI] << "Reading below space : \"" << params->spaceBottom().length().asString() << "\"" << endl; - dialog_->setBelowLength(below.len().value(), below.plus().value(), below.minus().value(), - below.len().unit(), below.plus().unit(), below.minus().unit()); - } else - dialog_->setBelowLength(0.0, 0.0, 0.0, LyXLength::UNIT_NONE, LyXLength::UNIT_NONE, LyXLength::UNIT_NONE); - - dialog_->setLabelWidth(text->cursor.par()->getLabelWidthString().c_str()); - dialog_->setAlign(align); - dialog_->setChecks(params->lineTop(), params->lineBottom(), - params->pagebreakTop(), params->pagebreakBottom(), params->noindent()); - dialog_->setSpace(params->spaceTop().kind(), params->spaceBottom().kind(), - params->spaceTop().keep(), params->spaceBottom().keep()); - - // now the extras page - - LyXLength extrawidth; - float val = 0.0; - LyXLength::UNIT unit = LyXLength::CM; - params = &(par->params()); - if (isValidLength(params->pextraWidth(), &extrawidth)) { - lyxerr[Debug::GUI] << "Reading extra width \"" << extrawidth.asString() << "\"" << endl; - val = extrawidth.value(); - unit = extrawidth.unit(); + VSpace space; + + switch (spacing) { + case 0: + space = VSpace(VSpace::NONE); + break; + case 1: + space = VSpace(VSpace::DEFSKIP); + break; + case 2: + space = VSpace(VSpace::SMALLSKIP); + break; + case 3: + space = VSpace(VSpace::MEDSKIP); + break; + case 4: + space = VSpace(VSpace::BIGSKIP); + break; + case 5: + space = VSpace(VSpace::VFILL); + break; + case 6: + string s; + string const length = strip(frontStrip(value)); + if (isValidGlueLength(length)) { + s = length; + } else if (!length.empty()){ + string u = strip(frontStrip(unit)); + u = subst(u, "%%", "%"); + s = length + u; + } + space = VSpace(LyXGlueLength(s)); + break; } - lyxerr[Debug::GUI] << "Reading widthp \"" << params->pextraWidthp() << "\"" << endl; + space.setKeep(keep); - dialog_->setExtra(val, unit, params->pextraWidthp(), - params->pextraAlignment(), - params->pextraHfill(), - params->pextraStartMinipage(), - static_cast(params->pextraType())); + return space; } +} // namespace anon void QParagraph::apply() { - if (readonly) - return; - - VSpace spaceabove; - VSpace spacebelow; - - if (dialog_->getSpaceAboveKind()==VSpace::LENGTH) - spaceabove = VSpace(dialog_->getAboveLength()); - else - spaceabove = VSpace(dialog_->getSpaceAboveKind()); - - if (dialog_->getSpaceBelowKind()==VSpace::LENGTH) - spacebelow = VSpace(dialog_->getBelowLength()); - else - spacebelow = VSpace(dialog_->getSpaceBelowKind()); - - spaceabove.setKeep(dialog_->getAboveKeep()); - spacebelow.setKeep(dialog_->getBelowKeep()); - - lyxerr[Debug::GUI] << "Setting above space \"" << LyXGlueLength(spaceabove.length().asString()).asString() << "\"" << endl; - lyxerr[Debug::GUI] << "Setting below space \"" << LyXGlueLength(spacebelow.length().asString()).asString() << "\"" << endl; - - LyXText * text(lv_->view()->getLyXText()); - text->setParagraph(lv_->view(), - dialog_->getLineAbove(), dialog_->getLineBelow(), - dialog_->getPagebreakAbove(), dialog_->getPagebreakBelow(), - spaceabove, spacebelow, Spacing(), dialog_->getAlign(), - dialog_->getLabelWidth(), dialog_->getNoIndent()); - - // extra stuff - - string width(""); - string widthp(""); - - LyXLength extrawidth(dialog_->getExtraWidth()); - if (extrawidth.unit()==LyXLength::UNIT_NONE) { - widthp = dialog_->getExtraWidthPercent(); - } else - width = extrawidth.asString(); - - lyxerr[Debug::GUI] << "Setting extrawidth \"" << width << "\"" << endl; - lyxerr[Debug::GUI] << "Setting percent extrawidth \"" << widthp << "\"" << endl; + /* SPACING ABOVE */ + // If a vspace kind is "Length" but there's no text in + // the input field, reset the kind to "None". + if (dialog_->spacingAbove->currentItem()==5 + && dialog_->valueAbove->text().isEmpty()) + dialog_->spacingAbove->setCurrentItem(0); + + VSpace const space_top = + setVSpaceFromWidgets(dialog_->spacingAbove->currentItem(), + string(dialog_->valueAbove->text()), + string(dialog_->unitAbove->currentText()), + dialog_->keepAbove->isChecked()); + + + controller().params().spaceTop(space_top); + + /* SPACING BELOW */ + if (dialog_->spacingBelow->currentItem()==5 + && dialog_->valueBelow->text().isEmpty()) + dialog_->spacingBelow->setCurrentItem(0); + + VSpace const space_bottom = + setVSpaceFromWidgets(dialog_->spacingBelow->currentItem(), + string(dialog_->valueBelow->text()), + string(dialog_->unitBelow->currentText()), + dialog_->keepBelow->isChecked()); + + controller().params().spaceBottom(space_bottom); + + /* alignment */ + LyXAlignment align; + switch (dialog_->align->currentItem()) { + case 0: + align = LYX_ALIGN_BLOCK; + break; + case 1: + align = LYX_ALIGN_LEFT; + break; + case 2: + align = LYX_ALIGN_RIGHT; + break; + case 3: + align = LYX_ALIGN_CENTER; + break; + default: + align = LYX_ALIGN_BLOCK; + } + controller().params().align(align); + + /* get spacing */ + Spacing::Space linespacing = Spacing::Default; + string other; + switch (dialog_->linespacing->currentItem()) { + case 0: + linespacing = Spacing::Default; + break; + case 1: + linespacing = Spacing::Single; + break; + case 2: + linespacing = Spacing::Onehalf; + break; + case 3: + linespacing = Spacing::Double; + break; + case 4: + linespacing = Spacing::Other; + other = dialog_->linespacingValue->text(); + break; + } - lv_->view()->update(text, - BufferView::SELECT | - BufferView::FITCUR | - BufferView::CHANGE); + Spacing const spacing(linespacing, other); + controller().params().spacing(spacing); + + /* lines and pagebreaks */ + controller().params().lineTop(dialog_->lineAbove->isChecked()); + controller().params().lineBottom(dialog_->lineBelow->isChecked()); + controller().params().pagebreakTop(dialog_->pagebreakAbove->isChecked()); + controller().params().pagebreakBottom(dialog_->pagebreakBelow->isChecked()); + /* label width */ + controller().params().labelWidthString(string(dialog_->labelWidth->text())); + /* indendation */ + controller().params().noindent(dialog_->noindent->isChecked()); - lv_->buffer()->markDirty(); - setMinibuffer(lv_, _("Paragraph layout set")); } +namespace { -void QParagraph::show() +void setWidgetsFromVSpace(VSpace const & space, + QComboBox * spacing, + QLineEdit * value, + QComboBox * unit, + QCheckBox * keep, vector units_) { - if (!dialog_) - dialog_ = new QParagraphDialog(this, 0, - _("LyX: Paragraph Settings"), - false); + value->setText(""); + value->setEnabled(false); + unit->setEnabled(false); + + int item; + switch (space.kind()) { + case VSpace::NONE: + item = 0; + break; + case VSpace::DEFSKIP: + item = 1; + break; + case VSpace::SMALLSKIP: + item = 2; + break; + case VSpace::MEDSKIP: + item = 3; + break; + case VSpace::BIGSKIP: + item = 4; + break; + case VSpace::VFILL: + item = 5; + break; + case VSpace::LENGTH: + item = 6; + value->setEnabled(true); + unit->setEnabled(true); + string length = space.length().asString(); + string const default_unit = (lyxrc.default_papersize>3) ? "cm" : "in"; + string supplied_unit = default_unit; + LyXLength len(length); + if ((isValidLength(length) || isStrDbl(length)) && !len.zero()) { + ostringstream buffer; + buffer << len.value(); + length = buffer.str(); + supplied_unit = subst(stringFromUnit(len.unit()),"%","%%"); + } + int unit_item = 0; + int i = 0; + for (vector::const_iterator it = units_.begin(); + it != units_.end(); ++it) { + if (*it==default_unit) { + unit_item = i; + } + if (*it==supplied_unit) { + unit_item = i; + break; + } + i += 1; + } + value->setText(length.c_str()); + unit->setCurrentItem(unit_item); + break; + } + spacing->setCurrentItem(item); + keep->setChecked(space.keep()); +} - if (!dialog_->isVisible()) - h_ = d_->hideBufferDependent - .connect(slot(this, &QParagraph::hide)); +} // namespace anon - dialog_->raise(); - dialog_->setActiveWindow(); - update(); +void QParagraph::update_contents() +{ + /* label width */ + string labelwidth = controller().params().labelWidthString(); + dialog_->labelWidth->setText(labelwidth.c_str()); + dialog_->labelwidthGB->setEnabled( + labelwidth != _("Senseless with this layout!")); + + /* alignment */ + int i; + switch (controller().params().align()) { + case LYX_ALIGN_LEFT: + i = 1; + break; + case LYX_ALIGN_RIGHT: + i = 2; + break; + case LYX_ALIGN_CENTER: + i = 3; + break; + default: + i = 0; + break; + } + dialog_->align->setCurrentItem(i); + + + //LyXAlignment alignpos = controller().alignPossible(); + + // no inset-text-owned paragraph may have pagebreaks + bool ininset = controller().inInset(); + dialog_->pagebreakAbove->setEnabled(!ininset); + dialog_->pagebreakBelow->setEnabled(!ininset); + + /* lines, pagebreaks and indent */ + dialog_->lineAbove->setChecked(controller().params().lineTop()); + dialog_->lineBelow->setChecked(controller().params().lineBottom()); + dialog_->pagebreakAbove->setChecked(controller().params().pagebreakTop()); + dialog_->pagebreakBelow->setChecked(controller().params().pagebreakBottom()); + dialog_->noindent->setChecked(controller().params().noindent()); + + /* linespacing */ + int linespacing; + Spacing const space = controller().params().spacing(); + switch (space.getSpace()) { + case Spacing::Single: + linespacing = 1; + break; + case Spacing::Onehalf: + linespacing = 2; + break; + case Spacing::Double: + linespacing = 3; + break; + case Spacing::Other: + linespacing = 4; + break; + default: + linespacing = 0; + break; + } + dialog_->linespacing->setCurrentItem(linespacing); + if (space.getSpace() == Spacing::Other) { + string const sp = tostr(space.getValue()); + dialog_->linespacingValue->setText(sp.c_str()); + dialog_->linespacingValue->setEnabled(true); + } else { + dialog_->linespacingValue->setText(""); + dialog_->linespacingValue->setEnabled(false); + } - dialog_->show(); + /* vspace top */ + setWidgetsFromVSpace(controller().params().spaceTop(), + dialog_->spacingAbove, + dialog_->valueAbove, + dialog_->unitAbove, + dialog_->keepAbove,units_); + + /* vspace bottom */ + setWidgetsFromVSpace(controller().params().spaceBottom(), + dialog_->spacingBelow, + dialog_->valueBelow, + dialog_->unitBelow, + dialog_->keepBelow,units_); + + /* no indent */ + dialog_->noindent->setChecked(controller().params().noindent()); } -void QParagraph::close() -{ - h_.disconnect(); -} -void QParagraph::hide() -{ - dialog_->hide(); - close(); -} diff --git a/src/frontends/qt2/QParagraph.h b/src/frontends/qt2/QParagraph.h index 90ce3989d8..f51218c7e1 100644 --- a/src/frontends/qt2/QParagraph.h +++ b/src/frontends/qt2/QParagraph.h @@ -4,52 +4,37 @@ * Copyright 2001 LyX Team * see the file COPYING * - * \author John Levon, moz@compsoc.man.ac.uk + * \author Edwin Leuven + * \author John Levon */ #ifndef QPARAGRAPH_H #define QPARAGRAPH_H -#include "DialogBase.h" -#include "LString.h" -#include "boost/utility.hpp" +#include +#include "Qt2Base.h" -class Dialogs; -class LyXView; +class ControlParagraph; class QParagraphDialog; +class Dialogs; -class QParagraph : public DialogBase { -public: - QParagraph(LyXView *, Dialogs *); - ~QParagraph(); +class QParagraph : + public Qt2CB > +{ + friend class QParagraphDialog; - /// Apply changes - void apply(); - /// Update the dialog. - void update(bool switched = false); - /// Close the connections - void close(); +public: + QParagraph(ControlParagraph &, Dialogs &); private: - /// Create the dialog if necessary, update it and display it. - void show(); - /// Hide the dialog. - void hide(); - - /// Real GUI implementation. - QParagraphDialog * dialog_; - - /// the LyXView we belong to - LyXView * lv_; - - /// Used so we can get at the signals we have to connect to. - Dialogs * d_; - - /// Hide connection. - SigC::Connection h_; - - /// readonly file or not - bool readonly; + /// Apply changes + virtual void apply(); + /// update + virtual void update_contents(); + /// build the dialog + virtual void build_dialog(); + + std::vector units_; }; #endif // QPARAGRAPH_H diff --git a/src/frontends/qt2/QParagraphDialog.C b/src/frontends/qt2/QParagraphDialog.C index 2a6d327bf1..7cfaaa7703 100644 --- a/src/frontends/qt2/QParagraphDialog.C +++ b/src/frontends/qt2/QParagraphDialog.C @@ -7,532 +7,66 @@ * \author Edwin Leuven, leuven@fee.uva.nl */ -#include -#include -#include - #include "QParagraphDialog.h" -#include "QParagraph.h" -#include "support/lstrings.h" -#include "debug.h" #include #include -#include #include -#include -#include -#include - -using std::endl; - -QParagraphDialog::QParagraphDialog(QParagraph * form, QWidget * parent, - char const * name, bool modal, WFlags fl) - : QParagraphDialogBase(parent, name, modal, fl), - form_(form) -{ - setCaption(name); -} - - -QParagraphDialog::~QParagraphDialog() -{ -} - - -void QParagraphDialog::setReadOnly(bool readonly) -{ - TabsParagraph->setEnabled(!readonly); - okPB->setEnabled(!readonly); - applyPB->setEnabled(!readonly); - defaultsPB->setEnabled(!readonly); - cancelPB->setText(readonly ? _("&Close") : _("&Cancel")); -} - - -void QParagraphDialog::setLabelWidth(char const * text) -{ - // FIXME: should be cleverer here - if (!strcmp(_("Senseless with this layout!"),text)) { - listOptions->setEnabled(false); - labelWidth->setText(""); - } else { - listOptions->setEnabled(true); - labelWidth->setText(text); - } -} - - -void QParagraphDialog::setAlign(int type) -{ - int item = 0; - switch (type) { - case LYX_ALIGN_BLOCK: item = 0; break; - case LYX_ALIGN_LEFT: item = 1; break; - case LYX_ALIGN_RIGHT: item = 2; break; - case LYX_ALIGN_CENTER: item = 3; break; - default: - item = 0; - break; - } - alignment->setCurrentItem(item); -} - - -void QParagraphDialog::setChecks(bool labove, bool lbelow, bool pabove, - bool pbelow, bool noindent) -{ - lineAbove->setChecked(labove); - lineBelow->setChecked(lbelow); - pagebreakAbove->setChecked(pabove); - pagebreakBelow->setChecked(pbelow); - noIndent->setChecked(noindent); -} - - -void QParagraphDialog::setSpace(VSpace::vspace_kind kindabove, - VSpace::vspace_kind kindbelow, - bool keepabove, bool keepbelow) -{ - int item = 0; - - switch (kindabove) { - case VSpace::NONE: item = 0; break; - case VSpace::DEFSKIP: item = 1; break; - case VSpace::SMALLSKIP: item = 2; break; - case VSpace::MEDSKIP: item = 3; break; - case VSpace::BIGSKIP: item = 4; break; - case VSpace::VFILL: item = 5; break; - case VSpace::LENGTH: item = 6; break; - } - spacingAbove->setCurrentItem(item); - - switch (kindbelow) { - case VSpace::NONE: item = 0; break; - case VSpace::DEFSKIP: item = 1; break; - case VSpace::SMALLSKIP: item = 2; break; - case VSpace::MEDSKIP: item = 3; break; - case VSpace::BIGSKIP: item = 4; break; - case VSpace::VFILL: item = 5; break; - case VSpace::LENGTH: item = 6; break; - } - spacingBelow->setCurrentItem(item); - - spacingAboveValue->setEnabled(kindabove == VSpace::LENGTH); - spacingAbovePlus->setEnabled(kindabove == VSpace::LENGTH); - spacingAboveMinus->setEnabled(kindabove == VSpace::LENGTH); - spacingBelowValue->setEnabled(kindbelow == VSpace::LENGTH); - spacingBelowPlus->setEnabled(kindbelow == VSpace::LENGTH); - spacingBelowMinus->setEnabled(kindbelow == VSpace::LENGTH); - - spacingAboveKeep->setChecked(keepabove); - spacingBelowKeep->setChecked(keepbelow); -} - - -void QParagraphDialog::setAboveLength(float val, float plus, float minus, - LyXLength::UNIT vunit, - LyXLength::UNIT punit, - LyXLength::UNIT munit) -{ - if (vunit == LyXLength::UNIT_NONE) { - spacingAboveValue->setText(""); - spacingAbovePlus->setText(""); - spacingAboveMinus->setText(""); - } else { - spacingAboveValue->setText(tostr(val).c_str()); - spacingAbovePlus->setText(tostr(plus).c_str()); - spacingAboveMinus->setText(tostr(minus).c_str()); - } - - spacingAboveValueUnit->setCurrentItem(getItem(vunit)); - spacingAbovePlusUnit->setCurrentItem(getItem(punit)); - spacingAboveMinusUnit->setCurrentItem(getItem(munit)); - -} - - -void QParagraphDialog::setBelowLength(float val, float plus, float minus, - LyXLength::UNIT vunit, - LyXLength::UNIT punit, - LyXLength::UNIT munit) -{ - if (vunit == LyXLength::UNIT_NONE) { - spacingBelowValue->setText(""); - spacingBelowPlus->setText(""); - spacingBelowMinus->setText(""); - } else { - spacingBelowValue->setText(tostr(val).c_str()); - spacingBelowPlus->setText(tostr(plus).c_str()); - spacingBelowMinus->setText(tostr(minus).c_str()); - } - - spacingBelowValueUnit->setCurrentItem(getItem(vunit)); - spacingBelowPlusUnit->setCurrentItem(getItem(punit)); - spacingBelowMinusUnit->setCurrentItem(getItem(munit)); -} - - -void QParagraphDialog::setExtra(float widthval, LyXLength::UNIT units, - string const & percent, int align, - bool hfill, bool startminipage, - Paragraph::PEXTRA_TYPE type) -{ - if (type != Paragraph::PEXTRA_NONE) { - lyxerr[Debug::GUI] << "percent : $" << percent << "$ widthval " - << widthval << " unit " << long(units) - << endl; - if (percent != "") { - extraWidth->setText(percent.c_str()); - extraUnit->setCurrentItem(11); - } else { - extraWidth->setText(tostr(widthval).c_str()); - extraUnit->setCurrentItem(getItem(units)); - } - } else - extraWidth->setText(""); - - switch (type) { - case Paragraph::PEXTRA_NONE: - extraType->setCurrentItem(0); - break; - case Paragraph::PEXTRA_MINIPAGE: - extraType->setCurrentItem(1); - enable_extraOptions(1); - enable_minipageOptions(1); - break; - case Paragraph::PEXTRA_FLOATFLT: - extraType->setCurrentItem(2); - enable_extraOptions(2); - break; - case Paragraph::PEXTRA_INDENT: - extraType->setCurrentItem(3); - enable_extraOptions(3); - break; - } - - switch (align) { - case Paragraph::MINIPAGE_ALIGN_TOP: - minipageValign->setCurrentItem(0); - break; - case Paragraph::MINIPAGE_ALIGN_MIDDLE: - minipageValign->setCurrentItem(1); - break; - case Paragraph::MINIPAGE_ALIGN_BOTTOM: - minipageValign->setCurrentItem(2); - break; - } - - minipageHfill->setChecked(hfill); - minipageStart->setChecked(startminipage); -} - - -LyXGlueLength QParagraphDialog::getAboveLength() const -{ - LyXGlueLength len( - LyXLength(spacingAboveValue->text().toFloat(), - getLyXLength(spacingAboveValueUnit->currentItem())), - LyXLength(spacingAbovePlus->text().toFloat(), - getLyXLength(spacingAbovePlusUnit->currentItem())), - LyXLength(spacingAboveMinus->text().toFloat(), - getLyXLength(spacingAboveMinusUnit->currentItem())) - ); - return len; -} - - -LyXGlueLength QParagraphDialog::getBelowLength() const -{ - LyXGlueLength len( - LyXLength(spacingBelowValue->text().toFloat(), - getLyXLength(spacingBelowValueUnit->currentItem())), - LyXLength(spacingBelowPlus->text().toFloat(), - getLyXLength(spacingBelowPlusUnit->currentItem())), - LyXLength(spacingBelowMinus->text().toFloat(), - getLyXLength(spacingBelowMinusUnit->currentItem())) - ); - return len; -} - - -LyXLength QParagraphDialog::getExtraWidth() const -{ - if (extraUnit->currentItem() != 11) { - LyXLength len( - (extraWidth->text()).toDouble(), - getLyXLength(extraUnit->currentItem()) - ); - return len; - } else { - LyXLength len(0.0, LyXLength::UNIT_NONE); - return len; - } -} - - -string QParagraphDialog::getExtraWidthPercent() const -{ - double val = (extraWidth->text()).toDouble(); - if (val > 100.0) - val = 100.0; - if (val < 0.0) - val = 0.0; - return tostr(val); -} - - -char const * QParagraphDialog::getLabelWidth() const -{ - return labelWidth->text(); -} - - -LyXAlignment QParagraphDialog::getAlign() const -{ - switch (alignment->currentItem()) { - case 0: return LYX_ALIGN_BLOCK; - case 1: return LYX_ALIGN_LEFT; - case 2: return LYX_ALIGN_RIGHT; - case 3: return LYX_ALIGN_CENTER; - default: return LYX_ALIGN_CENTER; - } -} - - -bool QParagraphDialog::getAboveKeep() const -{ - return spacingAboveKeep->isChecked(); -} - - -bool QParagraphDialog::getBelowKeep() const -{ - return spacingBelowKeep->isChecked(); -} - - -bool QParagraphDialog::getLineAbove() const -{ - return lineAbove->isChecked(); -} +#include +#include "helper_funcs.h" -bool QParagraphDialog::getLineBelow() const -{ - return lineBelow->isChecked(); -} - - -bool QParagraphDialog::getPagebreakAbove() const -{ - return pagebreakAbove->isChecked(); -} - +using std::vector; -bool QParagraphDialog::getPagebreakBelow() const +QParagraphDialog::QParagraphDialog(QParagraph * form) + : QParagraphDialogBase(0, 0, false, 0), + form_(form) { - return pagebreakBelow->isChecked(); -} + connect(okPB, SIGNAL(clicked()), + form_, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form_, SLOT(slotApply())); + connect(closePB, SIGNAL(clicked()), + form_, SLOT(slotClose())); + - -bool QParagraphDialog::getNoIndent() const -{ - return noIndent->isChecked(); + linespacingValue->setValidator(new QDoubleValidator(linespacingValue)); + valueAbove->setValidator(new QDoubleValidator(valueAbove)); + valueBelow->setValidator(new QDoubleValidator(valueBelow)); } - -VSpace::vspace_kind QParagraphDialog::getSpaceAboveKind() const -{ - return getSpaceKind(spacingAbove->currentItem()); -} - - -VSpace::vspace_kind QParagraphDialog::getSpaceBelowKind() const -{ - return getSpaceKind(spacingBelow->currentItem()); -} - - -Paragraph::PEXTRA_TYPE QParagraphDialog::getExtraType() const -{ - switch (extraType->currentItem()) { - case 0: return Paragraph::PEXTRA_NONE; - case 1: return Paragraph::PEXTRA_MINIPAGE; - case 2: return Paragraph::PEXTRA_FLOATFLT; - case 3: return Paragraph::PEXTRA_INDENT; - } - return Paragraph::PEXTRA_NONE; -} - - -Paragraph::MINIPAGE_ALIGNMENT QParagraphDialog::getExtraAlign() const -{ - switch (minipageValign->currentItem()) { - case 0: return Paragraph::MINIPAGE_ALIGN_TOP; - case 1: return Paragraph::MINIPAGE_ALIGN_MIDDLE; - case 2: return Paragraph::MINIPAGE_ALIGN_BOTTOM; - default: return Paragraph::MINIPAGE_ALIGN_BOTTOM; - } -} - - -bool QParagraphDialog::getHfillBetween() const -{ - return minipageHfill->isChecked(); -} - - -bool QParagraphDialog::getStartNewMinipage() const -{ - return minipageStart->isChecked(); -} - - -VSpace::vspace_kind QParagraphDialog::getSpaceKind(int val) const -{ - switch (val) { - case 0: return VSpace::NONE; - case 1: return VSpace::DEFSKIP; - case 2: return VSpace::SMALLSKIP; - case 3: return VSpace::MEDSKIP; - case 4: return VSpace::BIGSKIP; - case 5: return VSpace::VFILL; - case 6: return VSpace::LENGTH; - default: - lyxerr[Debug::GUI] << "Unknown kind combo entry " - << val << std::endl; - } - return VSpace::NONE; -} - - -LyXLength::UNIT QParagraphDialog::getLyXLength(int val) const -{ - switch (val) { - case 0: return LyXLength::CM; - case 1: return LyXLength::IN; - case 2: return LyXLength::PT; - case 3: return LyXLength::MM; - case 4: return LyXLength::PC; - case 5: return LyXLength::EX; - case 6: return LyXLength::EM; - case 7: return LyXLength::SP; - case 8: return LyXLength::BP; - case 9: return LyXLength::DD; - case 10: return LyXLength::CC; - default: - lyxerr[Debug::GUI] << "Unknown kind combo entry " - << val << std::endl; - } - return LyXLength::UNIT_NONE; -} - - -int QParagraphDialog::getItem(LyXLength::UNIT unit) const -{ - int item = 0; - switch (unit) { - case LyXLength::CM: item = 0; break; - case LyXLength::IN: item = 1; break; - case LyXLength::PT: item = 2; break; - case LyXLength::MM: item = 3; break; - case LyXLength::PC: item = 4; break; - case LyXLength::EX: item = 5; break; - case LyXLength::EM: item = 6; break; - case LyXLength::SP: item = 7; break; - case LyXLength::BP: item = 8; break; - case LyXLength::DD: item = 9; break; - case LyXLength::CC: item = 10; break; - case LyXLength::MU: item = 0; break; - case LyXLength::UNIT_NONE: item = 0; break; - default: - lyxerr[Debug::GUI] << "Unknown unit " << long(unit) - << endl; - } - return item; -} - - -void QParagraphDialog::enable_extraOptions(int item) -{ - bool const enable = (item != 0); - extraWidth->setEnabled(enable); - extraWidthL->setEnabled(enable); - extraUnit->setEnabled(enable); - extraUnitL->setEnabled(enable); -} - - -void QParagraphDialog::enable_minipageOptions(int item) +void QParagraphDialog::closeEvent(QCloseEvent * e) { - minipageOptions->setEnabled( item == 1 ); + form_->slotWMHide(); + e->accept(); } -void QParagraphDialog::enable_spacingAbove(int item) +void QParagraphDialog::change_adaptor() { - bool const enable = (item == 6); - spacingAboveValue->setEnabled(enable); - spacingAbovePlus->setEnabled(enable); - spacingAboveMinus->setEnabled(enable); - spacingAboveValueUnit->setEnabled(enable); - spacingAbovePlusUnit->setEnabled(enable); - spacingAboveMinusUnit->setEnabled(enable); - spacingAboveUnitsL->setEnabled(enable); - bool const enablel = ( (item == 6) || (item != 6 && spacingBelow->currentItem() == 6) ); - spacingValueL->setEnabled(enablel); - spacingPlusL->setEnabled(enablel); - spacingMinusL->setEnabled(enablel); + form_->changed(); } - -void QParagraphDialog::enable_spacingBelow(int item) +void QParagraphDialog::enableAbove(int) { - bool const enable = (item == 6); - spacingBelowValue->setEnabled(enable); - spacingBelowPlus->setEnabled(enable); - spacingBelowMinus->setEnabled(enable); - spacingBelowValueUnit->setEnabled(enable); - spacingBelowPlusUnit->setEnabled(enable); - spacingBelowMinusUnit->setEnabled(enable); - spacingBelowUnitsL->setEnabled(enable); - bool const enablel = ( (item == 6) || (item!=6 && spacingAbove->currentItem() == 6) ); - spacingValueL->setEnabled(enablel); - spacingPlusL->setEnabled(enablel); - spacingMinusL->setEnabled(enablel); + bool const enable = spacingAbove->currentItem()==6; + valueAbove->setEnabled(enable); + unitAbove->setEnabled(enable); + } - -void QParagraphDialog::closeEvent(QCloseEvent * e) +void QParagraphDialog::enableBelow(int) { - form_->close(); - e->accept(); + bool const enable = spacingBelow->currentItem()==6; + valueBelow->setEnabled(enable); + unitBelow->setEnabled(enable); } - -void QParagraphDialog::apply_adaptor() +void QParagraphDialog::enableLinespacingValue(int) { - form_->apply(); + bool const enable = linespacing->currentItem()==4; + linespacingValue->setEnabled(enable); } -void QParagraphDialog::cancel_adaptor() -{ - form_->close(); - hide(); -} - -void QParagraphDialog::ok_adaptor() -{ - apply_adaptor(); - form_->close(); - hide(); -} - - -void QParagraphDialog::restore_adaptor() -{ - form_->update(); -} diff --git a/src/frontends/qt2/QParagraphDialog.h b/src/frontends/qt2/QParagraphDialog.h index 9d391d5068..e972b8d269 100644 --- a/src/frontends/qt2/QParagraphDialog.h +++ b/src/frontends/qt2/QParagraphDialog.h @@ -13,71 +13,27 @@ #include +#include "QParagraph.h" #include "ui/QParagraphDialogBase.h" -#include "vspace.h" -#include "paragraph.h" -#include "layout.h" -#include "lyxgluelength.h" - -class QParagraph; +#include class QParagraphDialog : public QParagraphDialogBase -{ Q_OBJECT - +{ + Q_OBJECT public: - QParagraphDialog(QParagraph * form, QWidget * parent = 0, - char const * name = 0, bool modal = FALSE, - WFlags fl = 0); - ~QParagraphDialog(); + QParagraphDialog(QParagraph * form); - void setReadOnly(bool); - void setLabelWidth(char const *); - void setAlign(int); - void setChecks(bool, bool, bool, bool, bool); - void setSpace(VSpace::vspace_kind, VSpace::vspace_kind, bool, bool); - void setAboveLength(float, float, float, - LyXLength::UNIT, LyXLength::UNIT, LyXLength::UNIT); - void setBelowLength(float, float, float, - LyXLength::UNIT, LyXLength::UNIT, LyXLength::UNIT); - void setExtra(float, LyXLength::UNIT, - string const &, int, bool, bool, Paragraph::PEXTRA_TYPE); - LyXGlueLength getAboveLength() const; - LyXGlueLength getBelowLength() const; - LyXLength getExtraWidth() const; - string getExtraWidthPercent() const; - // FIXME: return a std::string ! - char const * getLabelWidth() const; - LyXAlignment getAlign() const; - bool getAboveKeep() const; - bool getBelowKeep() const; - bool getLineAbove() const; - bool getLineBelow() const; - bool getPagebreakAbove() const; - bool getPagebreakBelow() const; - bool getNoIndent() const; - VSpace::vspace_kind getSpaceAboveKind() const; - VSpace::vspace_kind getSpaceBelowKind() const; - Paragraph::PEXTRA_TYPE getExtraType() const; - Paragraph::MINIPAGE_ALIGNMENT getExtraAlign() const; - bool getHfillBetween() const; - bool getStartNewMinipage() const; protected: void closeEvent (QCloseEvent * e); private: QParagraph * form_; - VSpace::vspace_kind getSpaceKind(int val) const; - LyXLength::UNIT getLyXLength(int val) const; - int getItem(LyXLength::UNIT unit) const; + protected slots: - void apply_adaptor(); - void cancel_adaptor(); - void enable_extraOptions(int); - void enable_minipageOptions(int); - void enable_spacingAbove(int); - void enable_spacingBelow(int); - void ok_adaptor(); - void restore_adaptor(); + void change_adaptor(); + void enableAbove(int); + void enableBelow(int); + void enableLinespacingValue(int); }; #endif // QPARAGRAPHDIALOG_H diff --git a/src/frontends/qt2/guiapi.C b/src/frontends/qt2/guiapi.C index f8ec2e7282..26e0fb8972 100644 --- a/src/frontends/qt2/guiapi.C +++ b/src/frontends/qt2/guiapi.C @@ -44,7 +44,8 @@ #include "QLogDialog.h" #include "QMinipage.h" #include "QMinipageDialog.h" -//#include "QParagraph.h" +#include "QParagraph.h" +#include "QParagraphDialog.h" #include "QPreamble.h" #include "QPreambleDialog.h" //#include "QPreferences.h" @@ -150,6 +151,10 @@ GUISingleton > controlMinipageSingleton; +GUISingleton > +controlParagraphSingleton; + //GUISingleton formPreferencesSingleton; GUISingleton cp(lv, d); diff --git a/src/frontends/qt2/ui/QParagraphDialog.ui b/src/frontends/qt2/ui/QParagraphDialog.ui index 1d4f0b3668..0545dea39c 100644 --- a/src/frontends/qt2/ui/QParagraphDialog.ui +++ b/src/frontends/qt2/ui/QParagraphDialog.ui @@ -13,30 +13,13 @@ 0 0 - 567 - 387 + 403 + 292 - - sizePolicy - - 1 - 1 - - caption - Paragraph - - - sizeGripEnabled - true - - - layoutMargin - - - layoutSpacing + Form1 @@ -51,13 +34,11 @@ QTabWidget name - TabsParagraph - - - layoutMargin + paragraphTab - layoutSpacing + toolTip + QWidget @@ -67,9 +48,9 @@ title - &Alignment and Spacing + &General - + margin 11 @@ -78,1176 +59,411 @@ spacing 6 - - QLayoutWidget + + QComboBox + + + text + Justified + + + + + text + Left + + + + + text + Right + + + + + text + Center + + name - Layout6 + align - - - margin - 0 + + + QLineEdit + + name + linespacingValue + + + enabled + false + + + + QComboBox + + + text + Default - - spacing - 6 + + + + text + Single - - QLabel - - name - alignmentL - - - text - Alignment: - - - sizePolicy - - 1 - 1 - - - - - QComboBox - - - text - Justified - - - - - text - Left - - - - - text - Right - - - - - text - Centered - - - - name - alignment - - - insertionPolicy - AtBottom - - - autoCompletion - false - - - - - name - Spacer3 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QCheckBox - - name - noIndent - - - text - No indentation - - - + + + + text + 1.5 + + + + + text + Double + + + + + text + Custom + + + + name + linespacing + - - QGroupBox + + QLabel name - spacingOptions + linespacingL - title - Spacing + text + L&ine spacing: + + + buddy + linespacing + + + + QLabel + + name + alignL - enabled - true + text + Alig&nment: - layoutSpacing + buddy + align - - - margin - 11 + + + QCheckBox + + name + noindent + + + text + No &indent + + + + + + QWidget + + name + tab + + + title + &Spacing + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + aboveL + + + text + Above paragraph + + + alignment + AlignCenter + + + hAlign + + + + QLabel + + name + spacingL + + + text + S&pacing: + + + buddy + spacingAbove + + + + QLabel + + name + keepL + + + text + &Keep space: + + + buddy + keepAbove + + + + QLabel + + name + unitL + + + text + &Unit: + + + buddy + unitAbove + + + + QLabel + + name + valueL + + + text + &Value: + + + buddy + valueAbove + + + + QComboBox + + + text + None - - spacing - 6 + + + + text + DefSkip - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - spacingBelowValueUnit - - - enabled - false - - - sizePolicy - - 3 - 0 - - - - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - spacingBelowPlusUnit - - - enabled - false - - - sizePolicy - - 3 - 0 - - - - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - spacingBelowMinusUnit - - - enabled - false - - - sizePolicy - - 3 - 0 - - - - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - spacingAbovePlusUnit - - - enabled - false - - - sizePolicy - - 3 - 0 - - - - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - spacingAboveValueUnit - - - enabled - false - - - sizePolicy - - 3 - 0 - - - - - QLineEdit - - name - spacingBelowValue - - - enabled - false - - - - QLineEdit - - name - spacingBelowPlus - - - enabled - false - - - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - spacingAboveMinusUnit - - - enabled - false - - - sizePolicy - - 3 - 0 - - - - - QLineEdit - - name - spacingAboveValue - - - enabled - false - - - - QLineEdit - - name - spacingAbovePlus - - - enabled - false - - - - QLineEdit - - name - spacingAboveMinus - - - enabled - false - - - - QLineEdit - - name - spacingBelowMinus - - - enabled - false - - - - QLayoutWidget - - name - Layout2_1 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer2_1_1 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLabel - - name - spacingBelowUnitsL - - - text - Units: - - - sizePolicy - - 1 - 1 - - - - enabled - false - - - toolTip - Unit of Size, Stretch and Slink - - - - - - QLayoutWidget - - name - Layout2_1_2 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer2_1_1_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLabel - - name - spacingAboveUnitsL - - - text - Units: - - - sizePolicy - - 1 - 1 - - - - enabled - false - - - toolTip - Unit of Size, Stretch and Slink - - - - - - QLabel - - name - spacingValueL - - - sizePolicy - - 1 - 1 - - - - text - Value: - - - enabled - false - - - toolTip - Amount of spacing - - - - QLabel - - name - spacingPlusL - - - sizePolicy - - 1 - 1 - - - - text - Stretch: - - - enabled - false - - - toolTip - Margin by which paragraph is allowed to increase - - - - QLabel - - name - spacingMinusL - - - sizePolicy - - 1 - 1 - - - - text - Shrink: - - - enabled - false - - - toolTip - Margin by which paragraph is allowed to decrease - - - - QComboBox - - - text - None - - - - - text - DefSkip - - - - - text - SmallSkip - - - - - text - MedSkip - - - - - text - BigSkip - - - - - text - VFill - - - - - text - Custom - - - - name - spacingAbove - - - sizePolicy - - 3 - 0 - - - - - QLabel - - name - spacingAboveL - - - text - Above: - - - buddy - - - - - QLabel - - name - spacingBelowL - - - text - Below: - - - buddy - - - - - QComboBox - - - text - None - - - - - text - DefSkip - - - - - text - SmallSkip - - - - - text - MedSkip - - - - - text - BigSkip - - - - - text - VFill - - - - - text - Custom - - - - name - spacingBelow - - - sizePolicy - - 3 - 0 - - - - - QCheckBox - - name - spacingAboveKeep - - - text - Keep space at the top of the page - - - enabled - true - - - toolTip - Keep space at top of the page - - - - QCheckBox - - name - spacingBelowKeep - - - text - Keep space at the bottom of the page - - - enabled - true - - - toolTip - Keep space at the bottom of the page - - - + + + + text + SmallSkip + + + + + text + MedSkip + + + + + text + BigSkip + + + + + text + VFill + + + + + text + Custom + + + + name + spacingAbove + - - QGroupBox + + QComboBox + + + text + None + + + + + text + DefSkip + + + + + text + SmallSkip + + + + + text + MedSkip + + + + + text + BigSkip + + + + + text + VFill + + + + + text + Custom + + name - listOptions + spacingBelow + + + QLineEdit - title - List environment + name + valueAbove enabled false - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - labelWidthL - - - text - Label width: - - - enabled - false - - - toolTip - Label width in list environment - - - - QLineEdit - - name - labelWidth - - - enabled - false - - - - - name - Spacer7 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - + + QLineEdit + + name + valueBelow + + + enabled + false + + + + QComboBox + + name + unitAbove + + + enabled + false + + + + QComboBox + + name + unitBelow + + + enabled + false + + + + QCheckBox + + name + keepAbove + + + text + + + + + QCheckBox + + name + keepBelow + + + text + + + + + QLabel + + name + belowL + + + text + Below paragraph + + + alignment + AlignCenter + + + hAlign + + + name - Spacer1_5 + Spacer7 orientation @@ -1265,7 +481,7 @@ - + QWidget @@ -1275,7 +491,7 @@ title - &Lines and Page breaks + &Lines && Pagebreaks @@ -1286,21 +502,21 @@ spacing 6 - - QGroupBox + + QButtonGroup name - pagebreakOptions + labelwidthGB - title - Page break + enabled + false - orientation - Vertical + title + Label width - + margin 11 @@ -1310,84 +526,38 @@ 6 - QCheckBox + QLabel name - pagebreakAbove + TextLabel2 text - above paragraph + Lon&gest label + + + buddy + labelWidth - QCheckBox + QLineEdit name - pagebreakBelow - - - text - below paragraph + labelWidth - + - - - name - Spacer1_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - toolTip - Index entry - - - - - name - Spacer2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - QGroupBox name - lineOptions + linesGB title - Line + L&ines @@ -1406,7 +576,7 @@ text - above paragraph + A&bove @@ -1417,236 +587,20 @@ text - below paragraph + B&elow - - - - QWidget - - name - tab - - - title - &Extra options - - - - margin - 11 - - - spacing - 6 - - - - name - Spacer1_4 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout7 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - extraUnitL - - - text - Unit: - - - enabled - false - - - - QComboBox - - - text - Centimetres - - - - - text - Inches - - - - - text - Points - - - - - text - Millimetres - - - - - text - Picas - - - - - text - ex Units - - - - - text - em Units - - - - - text - Scaled Points - - - - - text - Big/PS Points - - - - - text - Didot Points - - - - - text - Cicero Points - - - - name - extraUnit - - - focusPolicy - TabFocus - - - enabled - false - - - - QLineEdit - - name - extraWidth - - - enabled - false - - - - QComboBox - - - text - None - - - - - text - Minipage - - - - - text - Wrap text around floats - - - - - text - Indent whole paragraph - - - - name - extraType - - - - QLabel - - name - extraWidthL - - - text - Width: - - - enabled - false - - - - - + QGroupBox name - minipageOptions + pagebreakGB title - Minipage options - - - enabled - false + &Page breaks @@ -1661,129 +615,26 @@ QCheckBox name - minipageStart + pagebreakAbove text - Start new minipage - - - enabled - false + Abo&ve QCheckBox name - minipageHfill + pagebreakBelow text - HFill between minipage paragraphs + Belo&w - - enabled - false - - - - QLayoutWidget - - name - Layout15 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - minipageValignL - - - text - Vertical Alignment: - - - - QComboBox - - - text - Top - - - - - text - Middle - - - - - text - Bottom - - - - name - minipageValign - - - - - name - Spacer8 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - name - Spacer6 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - @@ -1806,7 +657,7 @@ QPushButton name - defaultsPB + restorePB text @@ -1838,45 +689,33 @@ QPushButton name - applyPB + okPB text - &Apply + &OK QPushButton name - okPB + applyPB text - &OK - - - flat - false - - - default - false + &Apply QPushButton name - cancelPB + closePB text - &Cancel - - - default - true + &Close @@ -1885,96 +724,158 @@ - defaultsPB - clicked() + align + activated(int) + QParagraphDialogBase + change_adaptor() + + + linespacing + activated(int) + QParagraphDialogBase + change_adaptor() + + + linespacing + activated(int) QParagraphDialogBase - restore_adaptor() + enableLinespacingValue(int) - applyPB - clicked() + linespacingValue + textChanged(const QString&) QParagraphDialogBase - apply_adaptor() + change_adaptor() - cancelPB - clicked() + noindent + toggled(bool) QParagraphDialogBase - cancel_adaptor() + change_adaptor() - okPB - clicked() + spacingAbove + activated(int) QParagraphDialogBase - ok_adaptor() + change_adaptor() spacingAbove activated(int) QParagraphDialogBase - enable_spacingAbove(int) + enableAbove(int) + + + valueAbove + textChanged(const QString&) + QParagraphDialogBase + change_adaptor() + + + unitAbove + activated(int) + QParagraphDialogBase + change_adaptor() + + + keepAbove + toggled(bool) + QParagraphDialogBase + change_adaptor() spacingBelow activated(int) QParagraphDialogBase - enable_spacingBelow(int) + enableBelow(int) - extraType + spacingBelow activated(int) QParagraphDialogBase - enable_minipageOptions(int) + change_adaptor() + + + valueBelow + textChanged(const QString&) + QParagraphDialogBase + change_adaptor() + + + valueBelow + textChanged(const QString&) + QParagraphDialogBase + change_adaptor() - extraType + unitBelow activated(int) QParagraphDialogBase - enable_extraOptions(int) + change_adaptor() + + + keepBelow + toggled(bool) + QParagraphDialogBase + change_adaptor() + + + lineAbove + toggled(bool) + QParagraphDialogBase + change_adaptor() + + + lineBelow + toggled(bool) + QParagraphDialogBase + change_adaptor() + + + pagebreakAbove + toggled(bool) + QParagraphDialogBase + change_adaptor() - apply_adaptor() - cancel_adaptor() - enable_extraOptions(int) - enable_minipageOptions(int) - enable_spacingAbove(int) - enable_spacingBelow(int) - ok_adaptor() - restore_adaptor() + + pagebreakBelow + toggled(bool) + QParagraphDialogBase + change_adaptor() + + + labelWidth + textChanged(const QString&) + QParagraphDialogBase + change_adaptor() + + change_adaptor() + enableLinespacingValue(int) + enableAbove(int) + enableBelow(int) - TabsParagraph - alignment - noIndent + paragraphTab + align + linespacing + linespacingValue + noindent spacingAbove - spacingAboveValue - spacingAbovePlus - spacingAboveMinus - spacingAboveKeep - spacingAboveValueUnit - spacingAbovePlusUnit - spacingAboveMinusUnit + valueAbove + unitAbove + keepAbove spacingBelow - spacingBelowValue - spacingBelowPlus - spacingBelowMinus - spacingBelowKeep - spacingBelowValueUnit - spacingBelowPlusUnit - spacingBelowMinusUnit - labelWidth + valueBelow + unitBelow + keepBelow lineAbove lineBelow pagebreakAbove pagebreakBelow - extraType - extraWidth - extraUnit - minipageStart - minipageHfill - minipageValign - cancelPB + labelWidth + restorePB okPB applyPB - defaultsPB + closePB -- 2.39.2