From 3995f53261f7a91955a64c29bced051d5884181f Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Wed, 9 Oct 2002 08:59:02 +0000 Subject: [PATCH] Brand new qt document dialog. Not finished yet though. TODO is updated and lists what is left to do... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5370 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 6 + src/frontends/controllers/ControlDocument.C | 160 + src/frontends/controllers/ControlDocument.h | 60 + src/frontends/controllers/Makefile.am | 2 + src/frontends/qt2/BulletsModule.C | 73 + src/frontends/qt2/BulletsModule.h | 45 + src/frontends/qt2/ChangeLog | 33 + src/frontends/qt2/Dialogs.C | 1 + src/frontends/qt2/Dialogs2.C | 6 +- src/frontends/qt2/Dialogs_impl.h | 8 +- src/frontends/qt2/Makefile.am | 6 + src/frontends/qt2/Makefile.dialogs | 29 +- src/frontends/qt2/QBrowseBox.C | 281 ++ src/frontends/qt2/QBrowseBox.h | 74 + src/frontends/qt2/QDocument.C | 1455 ++---- src/frontends/qt2/QDocument.h | 149 +- src/frontends/qt2/QDocumentDialog.C | 839 ++-- src/frontends/qt2/QDocumentDialog.h | 129 +- src/frontends/qt2/TODO | 6 +- src/frontends/qt2/moc/Makefile.am | 3 + src/frontends/qt2/qgridview.cpp | 354 ++ src/frontends/qt2/qgridview.h | 134 + src/frontends/qt2/ui/BiblioModuleBase.ui | 125 + src/frontends/qt2/ui/BulletsModuleBase.ui | 244 + src/frontends/qt2/ui/ClassModuleBase.ui | 295 ++ src/frontends/qt2/ui/LanguageModuleBase.ui | 161 + src/frontends/qt2/ui/Makefile.am | 47 + src/frontends/qt2/ui/MarginsModuleBase.ui | 413 ++ src/frontends/qt2/ui/NumberingModuleBase.ui | 141 + src/frontends/qt2/ui/PackagesModuleBase.ui | 204 + src/frontends/qt2/ui/PaperModuleBase.ui | 307 ++ src/frontends/qt2/ui/PreambleModuleBase.ui | 44 + src/frontends/qt2/ui/QDocumentDialog.ui | 4983 +------------------ src/frontends/qt2/ui/QGraphicsDialog.ui | 2231 +++------ src/frontends/qt2/ui/QPrintDialog.ui | 250 +- src/frontends/qt2/ui/QRefDialog.ui | 556 +-- 36 files changed, 5514 insertions(+), 8340 deletions(-) create mode 100644 src/frontends/controllers/ControlDocument.C create mode 100644 src/frontends/controllers/ControlDocument.h create mode 100644 src/frontends/qt2/BulletsModule.C create mode 100644 src/frontends/qt2/BulletsModule.h create mode 100644 src/frontends/qt2/QBrowseBox.C create mode 100644 src/frontends/qt2/QBrowseBox.h create mode 100644 src/frontends/qt2/qgridview.cpp create mode 100644 src/frontends/qt2/qgridview.h create mode 100644 src/frontends/qt2/ui/BiblioModuleBase.ui create mode 100644 src/frontends/qt2/ui/BulletsModuleBase.ui create mode 100644 src/frontends/qt2/ui/ClassModuleBase.ui create mode 100644 src/frontends/qt2/ui/LanguageModuleBase.ui create mode 100644 src/frontends/qt2/ui/MarginsModuleBase.ui create mode 100644 src/frontends/qt2/ui/NumberingModuleBase.ui create mode 100644 src/frontends/qt2/ui/PackagesModuleBase.ui create mode 100644 src/frontends/qt2/ui/PaperModuleBase.ui create mode 100644 src/frontends/qt2/ui/PreambleModuleBase.ui diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index bb8b554d0f..c26df76591 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,9 @@ +2002-10-09 Edwin Leuven + + * ControlDocument.h: + * ControlDocument.C: + * Makefile.am: New document parameters controller + 2002-09-24 Lars Gullik Bjønnes * Makefile.am (INCLUDES): loose SIGC_INCLUDES diff --git a/src/frontends/controllers/ControlDocument.C b/src/frontends/controllers/ControlDocument.C new file mode 100644 index 0000000000..e25f7923e5 --- /dev/null +++ b/src/frontends/controllers/ControlDocument.C @@ -0,0 +1,160 @@ +// -*- C++ -*- +/** + * \file ControlDocument.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Edwin Leuven + * + * Full author contact details are available in file CREDITS + */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "BufferView.h" +#include "ControlDocument.h" +#include "ViewBase.h" + +#include "gettext.h" +#include "lyxfind.h" + +#include "buffer.h" +#include "language.h" +#include "lyx_main.h" +#include "lyxtextclass.h" +#include "lyxtextclasslist.h" +#include "CutAndPaste.h" + +#include "frontends/Liason.h" +#include "frontends/LyXView.h" +#include "frontends/Alert.h" + +#include "support/lstrings.h" +#include "support/filetools.h" + +using Liason::setMinibuffer; + + +ControlDocument::ControlDocument(LyXView & lv, Dialogs & d) + : ControlDialogBD(lv, d), bp_(0) +{ +} + +ControlDocument::~ControlDocument() +{} + + +void ControlDocument::showPreamble() +{ +} + +BufferParams & ControlDocument::params() +{ + lyx::Assert(bp_.get()); + return *bp_; +} + +LyXTextClass ControlDocument::textClass() +{ + return textclasslist[bp_->textclass]; +} + + +void ControlDocument::apply() +{ + if (!bufferIsAvailable()) + return; + + setLanguage(); + bool succes = classApply(); + lv_.view()->redoCurrentBuffer(); + + view().apply(); + buffer()->params = *bp_; + + buffer()->markDirty(); + + Liason::setMinibuffer(&lv_, _("Document Settings Applied")); +} + + +void ControlDocument::setParams() +{ + if (!bp_.get()) + bp_.reset(new BufferParams()); + + /// Set the buffer parameters + *bp_ = buffer()->params; +} + +void ControlDocument::setLanguage() +{ + Language const * oldL = buffer()->params.language; + Language const * newL = bp_->language; + + if (oldL != newL + && oldL->RightToLeft() == newL->RightToLeft() + && !lv_.buffer()->isMultiLingual()) + lv_.buffer()->changeLanguage(oldL, newL); +} + + +bool ControlDocument::classApply() +{ + BufferParams ¶ms = lv_.buffer()->params; + unsigned int const old_class = bp_->textclass; + // exit if nothing changes + if (params.textclass == old_class) + return true; + + // try to load new_class + if (!textclasslist[params.textclass].load()) { + // problem changing class + // -- warn user (to retain old style) + Alert::alert(_("Conversion Errors!"), + _("Errors loading new document class."), + _("Reverting to original document class.")); + return false; + } + + // successfully loaded + Liason::setMinibuffer(&lv_, + _("Converting document to new document class...")); + int ret = CutAndPaste::SwitchLayoutsBetweenClasses( + old_class, params.textclass, + &*(lv_.buffer()->paragraphs.begin()), + lv_.buffer()->params); + if (ret) { + string s; + if (ret == 1) { + s = _("One paragraph couldn't be converted"); + } else { + s += tostr(ret); + s += _(" paragraphs couldn't be converted"); + } + Alert::alert(_("Conversion Errors!"),s, + _("into chosen document class")); + } + //lv_.view()->redoCurrentBuffer(); + return true; +} + +void ControlDocument::saveAsDefault() +{ + lv_.buffer()->params.preamble = bp_->preamble; + + string const fname = AddName(AddPath(user_lyxdir, "templates/"), + "defaults.lyx"); + Buffer defaults(fname); + defaults.params = params(); + + // add an empty paragraph. Is this enough? + defaults.paragraphs.set(new Paragraph); + + defaults.writeFile(defaults.fileName()); + +} diff --git a/src/frontends/controllers/ControlDocument.h b/src/frontends/controllers/ControlDocument.h new file mode 100644 index 0000000000..796a7d644f --- /dev/null +++ b/src/frontends/controllers/ControlDocument.h @@ -0,0 +1,60 @@ +// -*- C++ -*- +/** + * \file ControlDocument.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Edwin Leuven + * + * Full author contact details are available in file CREDITS + */ + +#ifndef CONTROLDOCUMENT_H +#define CONTROLDOCUMENT_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include +#include "ControlDialog_impl.h" +#include "LString.h" +#include "bufferparams.h" + +#include + +class Language; + + +/** A controller for Document dialogs. + */ +class ControlDocument : public ControlDialogBD { +public: + /// + ControlDocument(LyXView &, Dialogs &); + ~ControlDocument(); + /// show latex preamble + void showPreamble(); + /// + void setLanguage(); + /// + LyXTextClass textClass(); + /// + BufferParams & params(); + /// + void saveAsDefault(); + /// + bool classApply(); + +private: + /// apply settings + void apply(); + /// set the params before show or update + void setParams(); + /// + boost::scoped_ptr bp_; +}; + +#endif // CONTROLDOCUMENT_H + + diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am index 9651250f55..656c5c6bbb 100644 --- a/src/frontends/controllers/Makefile.am +++ b/src/frontends/controllers/Makefile.am @@ -42,6 +42,8 @@ libcontrollers_la_SOURCES= \ ControlDialog.h \ ControlDialog_impl.C \ ControlDialog_impl.h \ + ControlDocument.C \ + ControlDocument.h \ ControlError.C \ ControlError.h \ ControlERT.C \ diff --git a/src/frontends/qt2/BulletsModule.C b/src/frontends/qt2/BulletsModule.C new file mode 100644 index 0000000000..55afd12508 --- /dev/null +++ b/src/frontends/qt2/BulletsModule.C @@ -0,0 +1,73 @@ +/** + * \file QBulletsModule.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Edwin Leuven + * + * Full author contact details are available in file CREDITS + */ + +#include +#include "gettext.h" + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include +#include +#include +#include "BulletsModule.h" +#include "ui/BulletsModuleBase.h" +#include "QBrowseBox.h" + +BulletsModule::BulletsModule( QWidget* parent, const char* name, WFlags fl ) + : BulletsModuleBase(parent, name, fl) +{ + standard = new QBrowseBox(6,6); + standard->insertItem(QPixmap("standard.xpm")); + + maths = new QBrowseBox(6,6); + maths->insertItem(QPixmap("amssymb.xpm")); + + QPopupMenu * pm = new QPopupMenu(); + + QPopupMenu * pm1 = new QPopupMenu(pm); + pm1->insertItem(standard); + + QPopupMenu * pm2 = new QPopupMenu(pm); + pm2->insertItem(maths); + + + pm->insertItem("Standard",pm1); + pm->insertItem("Maths",pm2); + pm->insertItem("Ding 1"); + pm->insertItem("Ding 2"); + pm->insertItem("Ding 3"); + pm->insertItem("Ding 4"); + + setbullet1TB->setPopup(pm); + + connect( standard, SIGNAL( selected(int,int) ), + this , SLOT( checkThis(int,int) ) ); + +} + +BulletsModule::~BulletsModule() +{ + delete standard; + delete maths; + +} + +void BulletsModule::setLevel1() +{ + qWarning("no setLevel1() yet"); +} + +void BulletsModule::checkThis(int x, int y) +{ + qWarning("Check, x: %d y: %d ",x,y); +} + diff --git a/src/frontends/qt2/BulletsModule.h b/src/frontends/qt2/BulletsModule.h new file mode 100644 index 0000000000..3938f910f7 --- /dev/null +++ b/src/frontends/qt2/BulletsModule.h @@ -0,0 +1,45 @@ +// -*- C++ -*- +/** + * \file BulletsModule.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Edwin Leuven + * + * Full author contact details are available in file CREDITS + */ + +#ifndef QBULLETSMODULE_H +#define QBULLETSMODULE_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ui/BulletsModuleBase.h" +#include "LString.h" +class QBrowseBox; + +class BulletsModule : public BulletsModuleBase +{ + Q_OBJECT +public: + + BulletsModule( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~BulletsModule(); + +public slots: + + void checkThis(int,int); + void setLevel1(); + +private: + QBrowseBox * standard; + QBrowseBox * maths; + QBrowseBox * ding1; + QBrowseBox * ding2; + QBrowseBox * ding3; + QBrowseBox * ding4; +}; + +#endif // BULLETSMODULE_H diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 0ca4a5e654..5dfe004444 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,36 @@ +2002-10-09 Edwin Leuven + + * QDocument.C: Brand new document dialog + * QDocument.h: + * QDocumentDialog.C: + * QDocumentDialog.h: + * BulletsModule.C: + * BulletsModule.h: + * Dialogs.C: + * Dialogs2.C: + * Dialogs_impl.h: + * Makefile.am: + * Makefile.dialogs: + * QBrowseBox.C: + * QBrowseBox.h: + * qgridview.cpp: + * qgridview.h: + * moc/Makefile.am: + * ui/BiblioModuleBase.ui: + * ui/BulletsModuleBase.ui: + * ui/ClassModuleBase.ui: + * ui/LanguageModuleBase.ui: + * ui/Makefile.am: + * ui/MarginsModuleBase.ui: + * ui/NumberingModuleBase.ui: + * ui/PackagesModuleBase.ui: + * ui/PaperModuleBase.ui: + * ui/PreambleModuleBase.ui: + * ui/QDocumentDialog.ui: + * ui/QGraphicsDialog.ui: + * ui/QPrintDialog.ui: + * ui/QRefDialog.ui: + 2002-09-28 Juergen Spitzmueller * ui/QWrapDialog.ui: diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 467b04938b..ec32c2ac41 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -49,6 +49,7 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) bibtex(lv, d), character(lv, d), citation(lv, d), + document(lv, d), error(lv, d), ert(lv, d), external(lv, d), diff --git a/src/frontends/qt2/Dialogs2.C b/src/frontends/qt2/Dialogs2.C index e0f8cb7f47..e3190c7d0a 100644 --- a/src/frontends/qt2/Dialogs2.C +++ b/src/frontends/qt2/Dialogs2.C @@ -61,7 +61,9 @@ void Dialogs::createCitation(string const & s) void Dialogs::showDocument() -{} +{ + pimpl_->document.controller().show(); +} void Dialogs::showError(InsetError * ie) @@ -169,7 +171,7 @@ void Dialogs::updateParagraph() void Dialogs::showPreamble() { - pimpl_->preamble.controller().show(); + pimpl_->document.controller().showPreamble(); } diff --git a/src/frontends/qt2/Dialogs_impl.h b/src/frontends/qt2/Dialogs_impl.h index ba61490317..1af45e89f1 100644 --- a/src/frontends/qt2/Dialogs_impl.h +++ b/src/frontends/qt2/Dialogs_impl.h @@ -23,6 +23,7 @@ #include "ControlBibtex.h" #include "ControlCharacter.h" #include "ControlCitation.h" +#include "ControlDocument.h" #include "ControlError.h" #include "ControlERT.h" #include "ControlExternal.h" @@ -59,7 +60,8 @@ #include "QCharacterDialog.h" #include "QCitation.h" #include "QCitationDialog.h" -//#include "QDocument.h" +#include "QDocument.h" +#include "QDocumentDialog.h" #include "QError.h" #include "QErrorDialog.h" #include "QERT.h" @@ -139,6 +141,9 @@ CharacterDialog; typedef GUI CitationDialog; +typedef GUI +DocumentDialog; + typedef GUI ErrorDialog; @@ -219,6 +224,7 @@ struct Dialogs::Impl { BibtexDialog bibtex; CharacterDialog character; CitationDialog citation; + DocumentDialog document; ErrorDialog error; ERTDialog ert; ExternalDialog external; diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index f7a82ed462..4e2372d226 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -18,6 +18,12 @@ include $(srcdir)/Makefile.dialogs libqt2_la_SOURCES = \ Alert_pimpl.C \ + qgridview.h \ + qgridview.cpp \ + BulletsModule.C \ + BulletsModule.h \ + QBrowseBox.C \ + QBrowseBox.h \ Dialogs.C \ Dialogs2.C \ Dialogs_impl.h \ diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index 722256ab25..6ffb2a6365 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -7,6 +7,7 @@ DIALOGS = \ QBibtex \ QCharacter \ QCitation \ + QDocument \ QError \ QERT \ QExternal \ @@ -43,6 +44,8 @@ DIALOGSOURCES = \ QCharacter.C QCharacterDialog.C \ QCitation.h QCitationDialog.h \ QCitation.C QCitationDialog.C \ + QDocument.h QDocumentDialog.h \ + QDocument.C QDocumentDialog.C \ QDelimiterDialog.h QDelimiterDialog.C \ QError.h QErrorDialog.h \ QError.C QErrorDialog.C \ @@ -99,6 +102,7 @@ MOCDIALOGS = \ QBibtexDialog_moc.C \ QCharacterDialog_moc.C \ QCitationDialog_moc.C \ + QDocumentDialog_moc.C \ QDelimiterDialog_moc.C \ QErrorDialog_moc.C \ QERTDialog_moc.C \ @@ -138,6 +142,8 @@ UIDIALOGS = \ QCharacterDialogBase.C \ QCitationDialogBase.h \ QCitationDialogBase.C \ + QDocumentDialogBase.h \ + QDocumentDialogBase.C \ QDelimiterDialogBase.h \ QDelimiterDialogBase.C \ QErrorDialogBase.C \ @@ -187,7 +193,16 @@ UIDIALOGS = \ QVCLogDialogBase.h \ QVCLogDialogBase.C \ QWrapDialogBase.h \ - QWrapDialogBase.C + QWrapDialogBase.C \ + ClassModuleBase.h ClassModuleBase.C \ + PackagesModuleBase.h PackagesModuleBase.C \ + PaperModuleBase.h PaperModuleBase.C \ + MarginsModuleBase.h MarginsModuleBase.C \ + LanguageModuleBase.h LanguageModuleBase.C \ + NumberingModuleBase.h NumberingModuleBase.C \ + BiblioModuleBase.h BiblioModuleBase.C \ + PreambleModuleBase.h PreambleModuleBase.C \ + BulletsModuleBase.h BulletsModuleBase.C UIMOCDIALOGS = \ QAboutDialogBase_moc.C \ @@ -196,6 +211,7 @@ UIMOCDIALOGS = \ QBibtexDialogBase_moc.C \ QCharacterDialogBase_moc.C \ QCitationDialogBase_moc.C \ + QDocumentDialogBase_moc.C \ QDelimiterDialogBase_moc.C \ QErrorDialogBase_moc.C \ QERTDialogBase_moc.C \ @@ -220,4 +236,13 @@ UIMOCDIALOGS = \ QTocDialogBase_moc.C \ QURLDialogBase_moc.C \ QVCLogDialogBase_moc.C \ - QWrapDialogBase_moc.C + QWrapDialogBase_moc.C \ + ClassModuleBase_moc.C \ + PackagesModuleBase_moc.C \ + PaperModuleBase_moc.C \ + MarginsModuleBase_moc.C \ + LanguageModuleBase_moc.C \ + NumberingModuleBase_moc.C \ + BiblioModuleBase_moc.C \ + PreambleModuleBase_moc.C \ + BulletsModuleBase_moc.C diff --git a/src/frontends/qt2/QBrowseBox.C b/src/frontends/qt2/QBrowseBox.C new file mode 100644 index 0000000000..b964d252e8 --- /dev/null +++ b/src/frontends/qt2/QBrowseBox.C @@ -0,0 +1,281 @@ +/** + * \file QBrowseBox.C + * + * Original file taken from klyx 0.10 sources: + * $Id: QBrowseBox.C,v 1.1 2002/10/09 08:59:02 leuven Exp $ + * + * \author Kalle Dalheimer ? + * + * Full author contact details are available in file CREDITS + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "QBrowseBox.h" + + +QBrowseBox::QBrowseBox(int rows, int cols, QWidget* parent=0 , const char* name=0 , WFlags fl=0 ) + : QGridView() +{ + setNumRows( rows ); + setNumCols( cols ); + setCellWidth( width()/cols ); + setCellHeight( height()/rows ); + + _texts = new QString[rows*cols]; + _pixmaps = new QPixmap[rows*cols]; + + _activecell.setX( 0 ); + _activecell.setY( 0 ); + updateCell(0,0); + setMouseTracking( true ); + + if( style().inherits( "QWindowsStyle" ) ) + setFrameStyle( QFrame::WinPanel | QFrame::Raised ); + else + setFrameStyle( QFrame::Panel | QFrame::Raised ); + + setFocusPolicy(QWidget::StrongFocus); +} + + + +QBrowseBox::~QBrowseBox() +{ + delete [] _texts; + delete [] _pixmaps; +} + + +int QBrowseBox::coordsToIndex( int row, int col ) +{ + if( col<0 || col>numCols() || row<0 || row>numRows() ) + qDebug( "coordsToIndex: invalid coords (%d, %d)\n", row, col ); + + return row + col*numCols(); +} + + +void QBrowseBox::insertItem( const QString& text, int row, int col ) +{ + _texts[ coordsToIndex( row, col ) ] = text; +} + + +void QBrowseBox::insertItem( QPixmap pixmap, int row, int col ) +{ + _pixmaps[ coordsToIndex( row, col ) ] = pixmap; +} + +void QBrowseBox::insertItem( QPixmap pixmap) +{ + int w = (pixmap.width()/numCols()); + int h = (pixmap.height()/numRows()); + + for( int row = 0; row < numRows(); row++ ) + for( int col = 0; col < numCols(); col++ ) + { + QPixmap small(w,h); + bitBlt(&small,0,0,&pixmap,col*w,row*h,w,h,Qt::CopyROP,false); + insertItem(small, row, col ); + } + + resize(pixmap.width() + (numCols()+1)*frameWidth(), + pixmap.height() +(numRows()+1)*frameWidth()); +} + +void QBrowseBox::removeItem( int row, int col ) +{ + _texts[ coordsToIndex( row, col ) ] = ""; + _pixmaps[ coordsToIndex( row, col ) ].resize( 0, 0 ); +} + + +void QBrowseBox::clear() +{ + for( int row = 0; row < numRows(); row++ ) + for( int col = 0; col < numCols(); col++ ) + removeItem( row, col ); +} + + +QString QBrowseBox::text( int row, int col ) +{ + if( col<0 || col >= numCols() || row<0 || row >= numRows() ) + return ""; + return _texts[ coordsToIndex( row, col ) ]; +} + + +QPixmap QBrowseBox::pixmap( int row, int col ) +{ + static QPixmap empty; + + if( col<0 || col>=numCols() || row<0 || row>=numRows() ) + return empty; + return _pixmaps[ coordsToIndex( row, col ) ]; +} + +void QBrowseBox::keyPressEvent( QKeyEvent* e ) +{ + switch( e->key()){ + case Key_Up: + moveUp(); + break; + case Key_Down: + moveDown(); + break; + case Key_Left: + moveLeft(); + break; + case Key_Right: + moveRight(); + break; + case Key_Return: + emit selected( _activecell.x(), _activecell.y()); + break; + default: + e->ignore(); + } + +} + +void QBrowseBox::mouseReleaseEvent( QMouseEvent* e ) +{ + qWarning("mouse release"); + emit selected( _activecell.x(), _activecell.y()); +} + +//void QBrowseBox::closeEvent( QCloseEvent* e) +//{ +// e->accept(); +// qApp->exit_loop(); +//} + +void QBrowseBox::paintCell( class QPainter * painter, int row, int col ) +{ + painter->setClipRect(cellGeometry(row,col));//, QPainter::CoordPainter); + bool ispixmap = false; + + if( ! _pixmaps[coordsToIndex(row,col)].isNull() ) { + painter->drawPixmap(0,0,_pixmaps[coordsToIndex(row,col)]); + ispixmap = true; + } + + if( (_activecell.x()==row) && (_activecell.y()==col) ) { + if( ispixmap ) + qDrawShadeRect( painter, 0, 0, cellWidth(), + cellHeight(), colorGroup(), false, 1 ); + else + qDrawShadePanel( painter, 0, 0, cellWidth(), + cellHeight(), colorGroup(), false, 1 ); + } else { + qDrawPlainRect( painter, 0, 0, cellWidth(), + cellHeight(), colorGroup().background(), 1 ); + } + + if( ! _texts[ coordsToIndex( row, col ) ].isEmpty() ) { + painter->drawText( 0, 0, cellWidth(), + cellHeight(), AlignLeft, + _texts[ coordsToIndex( row, col ) ] ); + } + painter->setClipping(false); +} + + +void QBrowseBox::resizeEvent( QResizeEvent* e ) +{ + QGridView::resizeEvent(e); + setCellWidth( contentsRect().width()/numCols() ); + setCellHeight( contentsRect().height()/numRows() ); +} + + + +void QBrowseBox::mouseMoveEvent( QMouseEvent* e ) +{ + qWarning("mouseMoveEvent"); + int x = e->pos().x(); + int y = e->pos().y(); + + int cellx; + int celly; + + if( x < 0 || y < 0 || x > width() || y > height() ) { + // outside the box + cellx = -1; + celly = -1; + } else { + celly = (int)floor( ((double)x) / ((double)cellWidth()) ); + cellx = (int)floor( ((double)y) / ((double)cellHeight()) ); + } + + if( (_activecell.x() != cellx) || (_activecell.y() != celly) ) + { + qWarning("update"); + // mouse has been moved to another cell + int oldactivecellx = _activecell.x(); + int oldactivecelly = _activecell.y(); + _activecell.setX( cellx ); + _activecell.setY( celly ); + // remove old highlighting + updateCell( oldactivecellx, oldactivecelly ); + // set new highlighting + updateCell( _activecell.x(), _activecell.y() ); + } +} + +void QBrowseBox::moveLeft( ) +{ + int const y = _activecell.y(); + + if (y>0) + _activecell.setY(y-1); + + updateCell(_activecell.x(), y); + updateCell(_activecell.x(), _activecell.y()); +} + +void QBrowseBox::moveRight( ) +{ + int const y = _activecell.y(); + + if (y0) + _activecell.setX(x-1); + + updateCell(x, _activecell.y()); + updateCell(_activecell.x(),_activecell.y()); +} + +void QBrowseBox::moveDown( ) +{ + int const x = _activecell.x(); + + if (x +#include + + +class QString; +class QPainter; +class QPixmap; + + +class QBrowseBox : public QGridView +{ + Q_OBJECT +public: + QBrowseBox( int rows , int cols, QWidget* parent = 0 , const char* name=0 , WFlags f =0 ); + ~QBrowseBox(); + + void insertItem( const QString& text, int x, int y ); + void insertItem( const char* text, int x, int y ) { insertItem( QString( text ), x, y ); } + void insertItem( QPixmap pixmap, int x, int y ); + void insertItem( QPixmap pixmap); + void removeItem( int x, int y ); + void clear(); + + QString text( int x, int y ); + QPixmap pixmap( int x, int y); + +// int exec( const QPoint& pos ); +// int exec( int x, int y ); +// int exec( const QWidget* trigger ); + + signals: + void selected(int, int); + +protected: + virtual void keyPressEvent( QKeyEvent* e ); + virtual void resizeEvent( QResizeEvent* e ); + virtual void mouseReleaseEvent( QMouseEvent* e ); +// virtual void closeEvent( QCloseEvent* e ); + virtual void mouseMoveEvent( QMouseEvent* e ); + virtual void paintCell( QPainter *, int, int ); + +private: + void moveLeft(); + void moveRight(); + void moveUp(); + void moveDown(); + + int coordsToIndex( int x, int y ); + + QString* _texts; + QPixmap* _pixmaps; + QPoint _activecell; + +}; + + +#endif diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index 9e762d83ff..94732b5fef 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -2,8 +2,8 @@ * \file QDocument.C * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. - * - * \author Kalle Dalheimer + * + * \author Edwin Leuven * * Full author contact details are available in file CREDITS */ @@ -14,1014 +14,587 @@ #pragma implementation #endif +#include "gettext.h" + + +#include "ControlDocument.h" #include "QDocument.h" #include "QDocumentDialog.h" +#include "Qt2BC.h" -#include "lyx_gui_misc.h" - -#include "layout.h" -#include "tex-strings.h" -#include "bufferparams.h" -#include "insets/insetquotes.h" -#include "vspace.h" -#include "support/filetools.h" #include "language.h" -#include "BufferView.h" -#include "buffer.h" -#include "Liason.h" -#include "CutAndPaste.h" -#include "bufferview_funcs.h" +#include "helper_funcs.h" // getSecond() +#include "insets/insetquotes.h" +#include "frnt_lang.h" +#include "tex-strings.h" // tex_graphics +#include "support/lstrings.h" // tostr() +#include "support/filetools.h" // LibFileSearch() +#include "lyxtextclasslist.h" +#include "vspace.h" +#include "bufferparams.h" -#include -#include +#include +#include #include +#include +#include #include +#include +#include +#include "lengthcombo.h" -using Liason::setMinibuffer; -using SigC::slot; +#include typedef Qt2CB > base_class; -#if 0 -QDocument::QDocument(ControlDocument & c) - : base_class(c, _("Document Settings")) +QDocument::QDocument() + : base_class(_("Document Settings")) { + vector const langs = frnt::getLanguageData(false); + lang_ = getSecond(langs); } -#else -QDocument::QDocument(LyXView *, Dialogs *) -{ -} -#endif - - void QDocument::build_dialog() { - // the tabbed folder - //dialog_.reset(new QDocumentDialog()); + dialog_.reset(new QDocumentDialog(this)); -#if 0 + /* biblio */ + dialog_->biblioModule->citeStyleCO->insertItem(_("Author-year")); + dialog_->biblioModule->citeStyleCO->insertItem(_("Numerical")); + dialog_->biblioModule->citeStyleCO->setCurrentItem(0); + + /* language & quotes */ + vector const langs = frnt::getLanguageData(false); + vector::const_iterator lit = langs.begin(); + vector::const_iterator lend = langs.end(); + for (; lit != lend; ++lit) { + dialog_->langModule->languageCO->insertItem( + lit->first.c_str()); + } + + dialog_->langModule->quoteStyleCO->insertItem(_("``text''")); + dialog_->langModule->quoteStyleCO->insertItem(_("''text''")); + dialog_->langModule->quoteStyleCO->insertItem(_(",,text``")); + dialog_->langModule->quoteStyleCO->insertItem(_(",,text''")); + dialog_->langModule->quoteStyleCO->insertItem(_("«text»")); + dialog_->langModule->quoteStyleCO->insertItem(_("»text«")); + + /* packages */ + char const * items[] = {"default","auto","latin1","latin2", + "latin3","latin4","latin5","latin9", + "koi8-r","koi8-u","cp866","cp1251", + "iso88595","pt154",0}; + dialog_->packagesModule->encodingCO->insertStrList(items); + + dialog_->packagesModule->lspacingCO->insertItem( + _("Single"),Spacing::Single); + dialog_->packagesModule->lspacingCO->insertItem( + _("OneHalf"),Spacing::Onehalf); + dialog_->packagesModule->lspacingCO->insertItem( + _("Double"),Spacing::Double); + dialog_->packagesModule->lspacingCO->insertItem( + _("Custom"),Spacing::Other); + + int n; + for (n=0; tex_graphics[n][0]; ++n) { + QString enc = tex_graphics[n]; + dialog_->packagesModule->psdriverCO->insertItem(enc); + } + + /* paper */ + QStringList papersize_; + papersize_ << _("Default") << _("Custom") << _("US letter") << _("US legal") + << _("US executive") << _("A3") << _("A4") << _("A5") + << _("B3") << _("B4") << _("B5"); + dialog_->paperModule->papersizeCO->insertStringList(papersize_); + + /* layout */ + for (LyXTextClassList::const_iterator cit = textclasslist.begin(); + cit != textclasslist.end(); ++cit) { + dialog_->layoutModule->classCO->insertItem(cit->description().c_str()); + } + + for (n=0; tex_fonts[n][0]; ++n) { + QString font = tex_fonts[n]; + dialog_->layoutModule->fontsCO->insertItem(font); + } + + dialog_->layoutModule->fontsizeCO->insertItem(_("default")); + dialog_->layoutModule->fontsizeCO->insertItem(_("10")); + dialog_->layoutModule->fontsizeCO->insertItem(_("11")); + dialog_->layoutModule->fontsizeCO->insertItem(_("12")); + + dialog_->layoutModule->skipCO->insertItem(_("Smallskip")); + dialog_->layoutModule->skipCO->insertItem(_("Medskip")); + dialog_->layoutModule->skipCO->insertItem(_("Bigskip")); + dialog_->layoutModule->skipCO->insertItem(_("Length")); + + dialog_->layoutModule->pagestyleCO->insertItem(_("default")); + dialog_->layoutModule->pagestyleCO->insertItem(_("empty")); + dialog_->layoutModule->pagestyleCO->insertItem(_("plain")); + dialog_->layoutModule->pagestyleCO->insertItem(_("headings")); + dialog_->layoutModule->pagestyleCO->insertItem(_("fancy")); + + /* margins */ + dialog_->setMargins(0); + + string const bmtablefile = LibFileSearch("images", "standard", "xpm"); + QString s = bmtablefile.c_str(); + qWarning("%d",s); + // Manage the restore, ok, apply, restore and cancel/close buttons bc().setOK(dialog_->okPB); bc().setApply(dialog_->applyPB); bc().setCancel(dialog_->cancelPB); bc().setRestore(dialog_->restorePB); - bc().refresh(); - - // the document paper page - QDocumentDialog * dialog = dialog_.get(); - dialog->papersize2CO->insertItem( _( "Default" ) ); - dialog->papersize2CO->insertItem( _( "Custom" ) ); - dialog->papersize2CO->insertItem( _( "USletter" ) ); - dialog->papersize2CO->insertItem( _( "USlegal" ) ); - dialog->papersize2CO->insertItem( _( "USexecutive" ) ); - dialog->papersize2CO->insertItem( _( "A3" ) ); - dialog->papersize2CO->insertItem( _( "A4" ) ); - dialog->papersize2CO->insertItem( _( "A5" ) ); - dialog->papersize2CO->insertItem( _( "B3" ) ); - dialog->papersize2CO->insertItem( _( "B4" ) ); - dialog->papersize2CO->insertItem( _( "B5" ) ); - - dialog->paperPackageCO->insertItem( _( "None" ) ); - dialog->paperPackageCO->insertItem( _( "A4 small Margins (only portrait)" ) ); - dialog->paperPackageCO->insertItem( _( "A4 very small Margins (only portrait)" ) ); - dialog->paperPackageCO->insertItem( _( "A4 very wide margins (only portrait)" ) ); - - bc().addReadOnly (dialog->paperPackageCO); - bc().addReadOnly (dialog->orientationBG); - bc().addReadOnly (dialog->portraitRB); - bc().addReadOnly (dialog->landscapeRB); - bc().addReadOnly (dialog->papersize2CO); - bc().addReadOnly (dialog->useGeometryCB); - bc().addReadOnly (dialog->customWidthED); - bc().addReadOnly (dialog->customHeightED); - bc().addReadOnly (dialog->topMarginED); - bc().addReadOnly (dialog->bottomMarginED); - bc().addReadOnly (dialog->leftMarginED); - bc().addReadOnly (dialog->rightMarginED); - bc().addReadOnly (dialog->headHeightED); - bc().addReadOnly (dialog->headSepED); - bc().addReadOnly (dialog->footSkipED); - - // the document page - for (LyXTextClassList::const_iterator cit = textclasslist.begin(); - cit != textclasslist.end(); ++cit) { - docClassCO->insertItem( (*cit).description().c_str() ); - } - - dialog->docSpacingCO->insertItem( _( "Single" ) ); - dialog->docSpacingCO->insertItem( _( "OneHalf" ) ); - dialog->docSpacingCO->insertItem( _( "Double" ) ); - dialog->docSpacingCO->insertItem( _( "Other" ) ); - - dialog->docFontSizeCO->insertItem( _( "default" ) ); - dialog->docFontSizeCO->insertItem( _( "10" ) ); - dialog->docFontSizeCO->insertItem( _( "11" ) ); - dialog->docFontSizeCO->insertItem( _( "12" ) ); - for (int n=0; tex_fonts[n][0]; ++n) { - dialog->docFontsCO->insertItem( tex_fonts[n] ); - } - - dialog->docPagestyleCO->insertItem( _( "default" ) ); - dialog->docPagestyleCO->insertItem( _( "empty" ) ); - dialog->docPagestyleCO->insertItem( _( "plain" ) ); - dialog->docPagestyleCO->insertItem( _( "headings" ) ); - dialog->docPagestyleCO->insertItem( _( "fancy" ) ); - - dialog->docSkipCO->insertItem( _( "Smallskip" ) ); - dialog->docSkipCO->insertItem( _( "Medskip" ) ); - dialog->docSkipCO->insertItem( _( "Bigskip" ) ); - dialog->docSkipCO->insertItem( _( "Length" ) ); - - bc().addReadOnly (dialog->docIndentRB); - bc().addReadOnly (dialog->docSkipRB); - - bc().addReadOnly (dialog->docPagestyleCO); - bc().addReadOnly (dialog->docFontsCO); - bc().addReadOnly (dialog->docFontsizeCO); - bc().addReadOnly (dialog->docSidesOneRB); - bc().addReadOnly (dialog->docSidesTwoRB); - bc().addReadOnly (dialog->docColumnsOneRB); - bc().addReadOnly (dialog->docColumnsTwoRB); - bc().addReadOnly (dialog->docExtraED); - bc().addReadOnly (dialog->docSkipED); - bc().addReadOnly (dialog->docSkipCO); - bc().addReadOnly (dialog->docSpacingCO); - bc().addReadOnly (dialog->docSpacingED); - - // the document language page - dialog->inputEncCO->insertItem( _( "default" ) ); - dialog->inputEncCO->insertItem( _( "auto" ) ); - dialog->inputEncCO->insertItem( _( "latin1" ) ); - dialog->inputEncCO->insertItem( _( "latin2" ) ); - dialog->inputEncCO->insertItem( _( "latin3" ) ); - dialog->inputEncCO->insertItem( _( "latin4" ) ); - dialog->inputEncCO->insertItem( _( "latin5" ) ); - dialog->inputEncCO->insertItem( _( "latin9" ) ); - dialog->inputEncCO->insertItem( _( "koi8-r" ) ); - dialog->inputEncCO->insertItem( _( "koi8-u" ) ); - dialog->inputEncCO->insertItem( _( "cp866" ) ); - dialog->inputEncCO->insertItem( _( "cp1251" ) ); - dialog->inputEncCO->insertItem( _( "iso88595" ) ); - - for (Languages::const_iterator cit = languages.begin(); - cit != languages.end(); ++cit) { - dialog->languageCO->insertItem( (*cit).second.lang() ); - } - - dialog->quotesLanguageCO->insertItem( _( "``text''" ) ); - dialog->quotesLanguageCO->insertItem( _( "''text''" ) ); - dialog->quotesLanguageCO->insertItem( _( ",,text``" ) ); - dialog->quotesLanguageCO->insertItem( _( ",,text''" ) ); - dialog->quotesLanguageCO->insertItem( _( "«text»" ) ); - dialog->quotesLanguageCO->insertItem( _( "»text«" ) ); - - bc().addReadOnly (dialog->inputEncCO); - - // the document options page - dialog->secNumDepthSB->setRange( -2, 5 ); - dialog->tocDepthSB->setRange( -1, 5 ); - dialog->secNumDepthSB->setSteps( 1, 1 ); - dialog->tocDepthSB->setRange( 1, 1 ); - for (int n=0; tex_graphics[n][0]; ++n) { - dialog->postscriptDriverCO->insertItem( tex_graphics[n] ); - } - - bc().addReadOnly (dialog->secNumDepthSB); - bc().addReadOnly (dialog->tocDepthSB); - bc().addReadOnly (dialog->useAmsMathCB); - bc().addReadOnly (dialog->floatPlacementED); - bc().addReadOnly (dialog->postscriptDriverCO); - - // the document bullets page - dialog->bulletSizeCO->insertItem( _( "default" ) ); - dialog->bulletSizeCO->insertItem( _( "tiny" ) ); - dialog->bulletSizeCO->insertItem( _( "script" ) ); - dialog->bulletSizeCO->insertItem( _( "footnote" ) ); - dialog->bulletSizeCO->insertItem( _( "small" ) ); - dialog->bulletSizeCO->insertItem( _( "normal" ) ); - dialog->bulletSizeCO->insertItem( _( "large" ) ); - dialog->bulletSizeCO->insertItem( _( "Large" ) ); - dialog->bulletSizeCO->insertItem( _( "LARGE" ) ); - dialog->bulletSizeCO->insertItem( _( "huge" ) ); - dialog->bulletSizeCO->insertItem( _( "Huge" ) ); - - dialog->bulletSizeCO->setCurrentItem( 0 ); - dialog->bulletLatexED->setMaxLength( 80 ); - - bc().addReadOnly (dialog->bulletPanelBG); - bc().addReadOnly (dialog->bulletSizeCO); - bc().addReadOnly (dialog->bulletLatexED); -#endif } void QDocument::apply() { - //if (!lv_->view()->available() || !dialog_.get()) - // return; + /* preamble */ + controller().params().preamble = + dialog_->preambleModule->preambleMLE->text().latin1(); + + /* biblio */ + controller().params().use_natbib = + dialog_->biblioModule->natbibCB->isChecked(); + controller().params().use_numerical_citations = + dialog_->biblioModule->citeStyleCO->currentItem(); -#if 0 - bool redo = class_apply(); - paper_apply(); - redo = language_apply() || redo; - redo = options_apply() || redo; - bullets_apply(); + /* language & quotes */ + if (dialog_->langModule->singleQuoteRB->isChecked()) + controller().params().quotes_times = InsetQuotes::SingleQ; + else + controller().params().quotes_times = InsetQuotes::DoubleQ; - if (redo) { - lv_->view()->redoCurrentBuffer(); + + InsetQuotes::quote_language lga = InsetQuotes::EnglishQ; + switch (dialog_->langModule->quoteStyleCO->currentItem()) { + case 0: + lga = InsetQuotes::EnglishQ; + break; + case 1: + lga = InsetQuotes::SwedishQ; + break; + case 2: + lga = InsetQuotes::GermanQ; + break; + case 3: + lga = InsetQuotes::PolishQ; + break; + case 4: + lga = InsetQuotes::FrenchQ; + break; + case 5: + lga = InsetQuotes::DanishQ; + break; } - lv_->buffer()->markDirty(); - setMinibuffer(lv_, _("Document layout set")); -#endif + controller().params().quotes_language = lga; + + int const pos = dialog_->langModule->languageCO->currentItem(); + controller().params().language = languages.getLanguage(lang_[pos]); + + /* numbering */ + controller().params().secnumdepth = + dialog_->numberingModule->tocDepthSB->value(); + controller().params().tocdepth = + dialog_->numberingModule->sectionnrDepthSB->value(); + + /* packages */ + switch (dialog_->packagesModule->lspacingCO->currentItem()) { + case 0: + controller().params().spacing.set(Spacing::Single); + break; + case 1: + controller().params().spacing.set(Spacing::Onehalf); + break; + case 2: + controller().params().spacing.set(Spacing::Double); + break; + case 3: + controller().params().spacing.set(Spacing::Other, + dialog_->packagesModule-> + lspacingLE->text().toFloat() + ); + break; + } + + controller().params().graphicsDriver = + dialog_->packagesModule->psdriverCO->currentText().latin1(); + + controller().params().use_amsmath = + dialog_->packagesModule->amsCB->isChecked(); + + controller().params().inputenc = + dialog_->packagesModule->encodingCO->currentText().latin1(); + + /* layout */ + controller().params().textclass = + dialog_->layoutModule->classCO->currentItem(); + + //bool succes = controller().classApply(); + + controller().params().fonts = + dialog_->layoutModule->fontsCO->currentText().latin1(); + + controller().params().fontsize = + dialog_->layoutModule->fontsizeCO->currentText().latin1(); + + controller().params().pagestyle = + dialog_->layoutModule->pagestyleCO->currentText().latin1(); + + if (dialog_->layoutModule->indentRB->isChecked()) + controller().params().paragraph_separation = BufferParams::PARSEP_INDENT; + else + controller().params().paragraph_separation = BufferParams::PARSEP_SKIP; + + switch (dialog_->layoutModule->skipCO->currentItem()) { + case 0: + controller().params().setDefSkip(VSpace(VSpace::SMALLSKIP)); + break; + case 1: + controller().params().setDefSkip(VSpace(VSpace::MEDSKIP)); + break; + case 2: + controller().params().setDefSkip(VSpace(VSpace::BIGSKIP)); + break; + case 3: + { + LyXLength::UNIT unit = + dialog_->layoutModule->skipLengthCO-> + currentLengthItem(); + double length = + dialog_->layoutModule->skipLE->text().toDouble(); + VSpace vs = VSpace(LyXGlueLength(LyXLength(length,unit))); + controller().params().setDefSkip(vs); + break; + } + default: + // DocumentDefskipCB assures that this never happens + controller().params().setDefSkip(VSpace(VSpace::MEDSKIP)); + break; + } + + controller().params().options = + dialog_->layoutModule->optionsLE->text().latin1(); + + controller().params().float_placement = + dialog_->layoutModule->floatPlacementLE->text().latin1(); + + /* paper */ + controller().params().papersize2 = + dialog_->paperModule->papersizeCO->currentItem(); + + controller().params().paperwidth = + LyXLength(dialog_->paperModule->paperwidthLE->text().toDouble(), + dialog_->paperModule->paperwidthUnitCO->currentLengthItem() + ).asString(); + + controller().params().paperheight = + LyXLength(dialog_->paperModule->paperheightLE->text().toDouble(), + dialog_->paperModule->paperheightUnitCO->currentLengthItem() + ).asString(); + + if (dialog_->paperModule->twoColumnCB->isChecked()) + controller().params().columns = 2; + else + controller().params().columns = 1; + + if (dialog_->paperModule->facingPagesCB->isChecked()) + controller().params().sides = LyXTextClass::TwoSides; + else + controller().params().sides = LyXTextClass::OneSide; + + if (dialog_->paperModule->landscapeRB->isChecked()) + controller().params().orientation = BufferParams::ORIENTATION_LANDSCAPE; + else + controller().params().orientation = BufferParams::ORIENTATION_PORTRAIT; + + /* margins */ + controller().params().use_geometry = + dialog_->marginsModule->marginCO->currentItem()==1; + + int margin = dialog_->marginsModule->marginCO->currentItem(); + if (margin>0) { + margin = margin - 1; + } + controller().params().paperpackage = char(margin); + + controller().params().leftmargin = + LyXLength(dialog_->marginsModule->innerLE->text().toDouble(), + dialog_->marginsModule->innerUnit->currentLengthItem() + ).asString(); + + controller().params().topmargin = + LyXLength(dialog_->marginsModule->topLE->text().toDouble(), + dialog_->marginsModule->topUnit->currentLengthItem() + ).asString(); + + + controller().params().rightmargin = + LyXLength(dialog_->marginsModule->outerLE->text().toDouble(), + dialog_->marginsModule->outerUnit->currentLengthItem() + ).asString(); + + + controller().params().bottommargin = + LyXLength(dialog_->marginsModule->bottomLE->text().toDouble(), + dialog_->marginsModule->bottomUnit->currentLengthItem() + ).asString(); + + + controller().params().headheight = + LyXLength(dialog_->marginsModule->headheightLE->text().toDouble(), + dialog_->marginsModule->headheightUnit->currentLengthItem() + ).asString(); + + + controller().params().headsep = + LyXLength(dialog_->marginsModule->headsepLE->text().toDouble(), + dialog_->marginsModule->headsepUnit->currentLengthItem() + ).asString(); + + + controller().params().footskip = + LyXLength(dialog_->marginsModule->footskipLE->text().toDouble(), + dialog_->marginsModule->footskipUnit->currentLengthItem() + ).asString(); + } +namespace { -void QDocument::cancel() +/** Return the position of val in the vector if found. + If not found, return 0. + */ +template +typename std::vector::size_type +findPos(std::vector const & vec, A const & val) { -#if 0 - // this avoids confusion when reopening - BufferParams & param = lv_->buffer()->params; - param.temp_bullets[0] = param.user_defined_bullets[0]; - param.temp_bullets[1] = param.user_defined_bullets[1]; - param.temp_bullets[2] = param.user_defined_bullets[2]; - param.temp_bullets[3] = param.user_defined_bullets[3]; - hide(); -#endif + typename std::vector::const_iterator it = + std::find(vec.begin(), vec.end(), val); + if (it == vec.end()) + return 0; + return std::distance(vec.begin(), it); } +} // namespace anom void QDocument::update_contents() { if (!dialog_.get()) return; -#if 0 - checkReadOnly(); + /* preamble */ + QString preamble = controller().params().preamble.c_str(); + dialog_->preambleModule->preambleMLE->setText(preamble); - BufferParams const & params = lv_->buffer()->params; + /* biblio */ + dialog_->biblioModule->natbibCB->setChecked( + controller().params().use_natbib); + dialog_->biblioModule->citeStyleCO->setCurrentItem( + controller().params().use_numerical_citations ? 1 : 0); + + /* language & quotes */ + dialog_->langModule->singleQuoteRB->setChecked( + controller().params().quotes_times == InsetQuotes::SingleQ); + dialog_->langModule->doubleQuoteRB->setChecked( + controller().params().quotes_times == InsetQuotes::DoubleQ); + + int const pos = int(findPos(lang_, + controller().params().language->lang())); + dialog_->langModule->languageCO->setCurrentItem(pos); - class_update(params); - paper_update(params); - language_update(params); - options_update(params); - bullets_update(params); -#endif -} + dialog_->langModule->quoteStyleCO->setCurrentItem( + controller().params().quotes_language); + /* numbering */ + dialog_->numberingModule->tocDepthSB->setValue( + controller().params().secnumdepth); + dialog_->numberingModule->sectionnrDepthSB->setValue( + controller().params().tocdepth); -#if 0 -bool QDocument::input( FL_OBJECT * ob, long data ) -{ - State cb = static_cast( data ); - - switch (cb) { - case CHECKCHOICECLASS: - CheckChoiceClass(ob, 0); - break; - case CHOICEBULLETSIZE: - ChoiceBulletSize(ob, 0); - break; - case INPUTBULLETLATEX: - InputBulletLaTeX(ob, 0); - break; - case BULLETDEPTH1: - case BULLETDEPTH2: - case BULLETDEPTH3: - case BULLETDEPTH4: - BulletDepth(ob, cb); - break; - case BULLETPANEL1: - case BULLETPANEL2: - case BULLETPANEL3: - case BULLETPANEL4: - case BULLETPANEL5: - case BULLETPANEL6: - BulletPanel(ob, cb); - break; - case BULLETBMTABLE: - BulletBMTable(ob, 0); - break; - default: - break; + /* packages */ + QStringList enc; + enc << "default" << "auto" << "latin1" << "latin2" << "latin3" << + "latin4" << "latin5" << "latin9" << "koi8-r" << "koi8-u" << + "cp866" << "cp1251" << "iso88595" << "pt154"; + int pos2 = 0; + for (QStringList::Iterator it = enc.begin(); + it!=enc.end(); ++it) { + if (*it==controller().params().inputenc.c_str()) { + dialog_->packagesModule->encodingCO->setCurrentItem(pos2); + } + ++pos2; } - - switch (data) { - case INPUT: - case CHECKCHOICECLASS: - case CHOICEBULLETSIZE: - case INPUTBULLETLATEX: - case BULLETBMTABLE: - return CheckDocumentInput(ob, 0); - default: - break; - } - - return true; -} - - -void QDocument::ComboInputCB(int, void * v, Combox * combox) -{ - QDocument * pre = static_cast(v); - if (combox == pre->combo_doc_class.get()) - pre->CheckChoiceClass(0, 0); - pre->bc().valid(pre->CheckDocumentInput(0,0)); -} - -bool QDocument::class_apply() -{ - bool redo = false; - BufferParams ¶ms = lv_->buffer()->params; - - // If default skip is a "Length" but there's no text in the - // input field, reset the kind to "Medskip", which is the default. - if( ( dialog_->docSkipCO->currentItem() == 3 ) && - dialog_->docSkipED->text().isEmpty() ) - dialog_->docSkipCO->setCurrentItem( 1 ); - - params.fonts = dialog_->docFontsCO->currentText(); - params.fontsize = dialog_->docFontSizeCO->currentText(); - params.pagestyle = dialog->docPagestyleCO->currentText(); - - unsigned int const new_class = dialog_->docClassCO->currentItem(); - - if (params.textclass != new_class) { - // try to load new_class - if (textclasslist.Load(new_class)) { - // successfully loaded - redo = true; - setMinibuffer(lv_, _("Converting document to new document class...")); - CutAndPaste cap; - int ret = cap.SwitchLayoutsBetweenClasses(params.textclass, new_class, - lv_->buffer()->paragraph, - lv_->buffer()->params); - if (ret) { - string s; - if (ret==1) { - s = _("One paragraph couldn't be converted"); - } else { - s += tostr(ret); - s += _(" paragraphs couldn't be converted"); - } - Alert::alert(_("Conversion Errors!"),s, - _("into chosen document class")); - } - - params.textclass = new_class; - } else { - // problem changing class -- warn user and retain old style - Alert::alert(_("Conversion Errors!"), - _("Errors loading new document class."), - _("Reverting to original document class.")); - dialog_->docClassCO->setCurrentItem( params.textclass ); + + + QString text = controller().params().graphicsDriver.c_str(); + int nitem = dialog_->packagesModule->psdriverCO->count(); + for (int n=0; npackagesModule->psdriverCO->setCurrentItem(n); } } - BufferParams::PARSEP tmpsep = params.paragraph_separation; - if( dialog_->_docIndentRB->isChecked() ) - params.paragraph_separation = BufferParams::PARSEP_INDENT; - else - params.paragraph_separation = BufferParams::PARSEP_SKIP; - if (tmpsep != params.paragraph_separation) - redo = true; + + + dialog_->packagesModule->amsCB->setChecked( + controller().params().use_amsmath); - VSpace tmpdefskip = params.getDefSkip(); - switch( dialog_->docSkipCO->currentItem() ) { - case 0: - params.setDefSkip(VSpace(VSpace::SMALLSKIP)); + dialog_->packagesModule->lspacingCO-> + setCurrentItem(controller().params().spacing.getSpace()); + if (controller().params().spacing.getSpace()== + Spacing::Other) { + dialog_->packagesModule->lspacingLE->setText( + tostr(controller().params().spacing.getValue()).c_str()); + dialog_->setLSpacing(3); + } + + /* layout */ + for (int n = 0; nlayoutModule->classCO->count(); ++n) { + if (dialog_->layoutModule->classCO->text(n)== + controller().textClass().description().c_str()) { + dialog_->layoutModule->classCO->setCurrentItem(n); break; - case 1: - params.setDefSkip(VSpace(VSpace::MEDSKIP)); + } + } + + dialog_->updateFontsize(controller().textClass().opt_fontsize(), + controller().params().fontsize); + + dialog_->updatePagestyle(controller().textClass().opt_pagestyle(), + controller().params().pagestyle); + + + for (int n=0; tex_fonts[n][0]; ++n) { + if (tex_fonts[n]==controller().params().fonts) { + dialog_->layoutModule->fontsCO->setCurrentItem(n); break; - case 2: - params.setDefSkip(VSpace(VSpace::BIGSKIP)); - break; - case 3: - params.setDefSkip - (VSpace(LyXGlueLength(dialog_->docSkipED->text()))); - break; - // DocumentDefskipCB assures that this never happens - // ... so why is there code for it ? - default: - params.setDefSkip(VSpace(VSpace::MEDSKIP)); + } + } + + if (controller().params().paragraph_separation + == BufferParams::PARSEP_INDENT) { + dialog_->layoutModule->indentRB->setChecked(true); + } else { + dialog_->layoutModule->skipRB->setChecked(true); + } + + int skip = 0; + switch (controller().params().getDefSkip().kind()) { + case VSpace::SMALLSKIP: + skip = 0; + break; + case VSpace::MEDSKIP: + skip = 1; + break; + case VSpace::BIGSKIP: + skip = 2; + break; + case VSpace::LENGTH: + { + skip = 3; + string const length = controller().params().getDefSkip().asLyXCommand(); + dialog_->layoutModule->skipLengthCO->setCurrentItem(LyXLength(length).unit()); + dialog_->layoutModule->skipLE->setText(tostr(LyXLength(length).value()).c_str()); break; } - if (!(tmpdefskip == params.getDefSkip())) - redo = true; - - if( dialog_->docColumnsTwo->isChecked() ) - params.columns = 2; - else - params.columns = 1; - if( dialog_->docSidesTwo->isChecked() ) - params.sides = LyXTextClass::TwoSides; - else - params.sides = LyXTextClass::OneSide; - - Spacing tmpSpacing = params.spacing; - switch( dialog_->docSpacingCO->currentItem() ) { - case 0: - lyxerr[Debug::INFO] << "Spacing: SINGLE\n"; - params.spacing.set(Spacing::Single); - break; - case 1: - lyxerr[Debug::INFO] << "Spacing: ONEHALF\n"; - params.spacing.set(Spacing::Onehalf); - break; - case 2: - lyxerr[Debug::INFO] << "Spacing: DOUBLE\n"; - params.spacing.set(Spacing::Double); - break; - case 3: - lyxerr[Debug::INFO] << "Spacing: OTHER\n"; - params.spacing.set(Spacing::Other, - dialog_->docSpacingED->text() ); - break; - } - if (tmpSpacing != params.spacing) - redo = true; - - params.options = docExtraED->text(); - - return redo; -} - - -void QDocument::paper_apply() -{ - BufferParams & params = lv_->buffer()->params; - - params.papersize2 = - static_cast(dialog_->papersize2CO->currentItem()); - params.paperpackage = - static_cast(dialog_->paperPackageCO->currentItem() ); - params.use_geometry = dialog_->useGeometryCB->isChecked(); - if (dialog_->landscapeRB->isChecked() ) - params.orientation = BufferParams::ORIENTATION_LANDSCAPE; - else - params.orientation = BufferParams::ORIENTATION_PORTRAIT; - params.paperwidth = dialog_->customWidthED->text(); - params.paperheight = dialog_->customHeightED->text(); - params.leftmargin = dialog_->leftMarginED->text(); - params.topmargin = dialog_->topMarginED->text(); - params.rightmargin = dialog_->rightMarginED->text(); - params.bottommargin = dialog_->bottomMarginED->text(); - params.headheight = dialog_->headHeightED->text(); - params.headsep = dialog_->headSepED->text(); - params.footskip = dialog_->footSkipED->text(); - lv_->buffer()->setPaperStuff(); -} - - -bool QDocument::language_apply() -{ - BufferParams & params = lv_->buffer()->params; - InsetQuotes::quote_language lga = InsetQuotes::EnglishQ; - bool redo = false; - - switch (dialog_->quotesLanguageCO->currentItem() ) { - case 0: - lga = InsetQuotes::EnglishQ; - break; - case 1: - lga = InsetQuotes::SwedishQ; - break; - case 2: - lga = InsetQuotes::GermanQ; - break; - case 3: - lga = InsetQuotes::PolishQ; - break; - case 4: - lga = InsetQuotes::FrenchQ; - break; - case 5: - lga = InsetQuotes::DanishQ; - break; - } - params.quotes_language = lga; - if (dialog_->singleRB->isChecked() ) - params.quotes_times = InsetQuotes::SingleQ; - else - params.quotes_times = InsetQuotes::DoubleQ; - - Language const * old_language = params.language; - Language const * new_language = - languages.getLanguage(dialog_->languageCO->currentItem() ); - if (!new_language) - new_language = default_language; - - if (old_language != new_language - && old_language->RightToLeft() == new_language->RightToLeft() - && !lv_->buffer()->isMultiLingual()) - lv_->buffer()->ChangeLanguage(old_language, new_language); - - if (old_language != new_language) - redo = true; - - params.language = new_language; - params.inputenc = dialog_->inputEncCO->currentText(); - - return redo; -} - - -bool QDocument::options_apply() -{ - BufferParams & params = lv_->buffer()->params; - bool redo = false; - - params.graphicsDriver = - dialog_->postscriptDriverCO->currentText(); - params.use_amsmath = dialog_->useAmsMathCB->isChecked(); - - int tmpchar = int(dialog_->secNumDepth->value() ); - if (params.secnumdepth != tmpchar) - redo = true; - params.secnumdepth = tmpchar; - - params.tocdepth = int(dialog_->tocDepth->value() ); - - params.float_placement = - dialog_->floatPlacementED->text(); - - return redo; -} - - -void QDocument::bullets_apply() -{ - /* update the bullet settings */ - BufferParams & param = lv_->buffer()->params; - - // a little bit of loop unrolling - param.user_defined_bullets[0] = param.temp_bullets[0]; - param.user_defined_bullets[1] = param.temp_bullets[1]; - param.user_defined_bullets[2] = param.temp_bullets[2]; - param.user_defined_bullets[3] = param.temp_bullets[3]; -} - - -void QDocument::class_update(BufferParams const & params) -{ - if (!class_.get()) - return; - - LyXTextClass const & tclass = textclasslist[params.textclass]; - - combo_doc_class->select_text( - textclasslist.DescOfClass(params.textclass)); - Qt2Helper::setCurrentComboItem( dialog_->docFonts, params.fonts.c_str() ); - dialog_->docFontSizeCO->clear(); - dialog_->docFontSizeCO->insertItem( _( "default" ) ); - dialog_->docFontSizeCO->insertItem( tclass.opt_fontsize().c_str()); - dialog_->docFontSizeCO->setCurrentItem( tokenPos(tclass.opt_fontsize(), '|', params.fontsize)+1); - dialog_->docPagestyleCO->clear(); - dialog_->docPagestyleCO->insertItem( _( "default" ) ); - dialog_->docPagestyleCO->insertItem( tclass.opt_pagestyle().c_str()); - dialog_->docPagestyleCO->setCurrentItem( tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle)+1); - dialog_->docIndentRB->setChecked( false ); - dialog_->docSkipRB->setChecked( false ); - if (params.paragraph_separation == BufferParams::PARSEP_INDENT) - dialog_->docIndentRB->setChecked( true ); - else - dialog_->docSkipRB->setChecked( true ); - switch (params.getDefSkip().kind()) { - case VSpace::SMALLSKIP: - dialog_->docSkipCO->setCurrentItem( 0 ); - break; - case VSpace::MEDSKIP: - dialog_->docSkipCO->setCurrentItem( 1 ); - break; - case VSpace::BIGSKIP: - dialog_->docSkipCO->setCurrentItem( 2 ); - break; - case VSpace::LENGTH: - dialog_->docSkipCO->setCurrentItem( 3 ); - dialog_->docSkipED->setText( params.getDefSkip().asLyXCommand().c_str()); - break; - default: - dialog_->docSkipCO->setCurrentItem( 1 ); - break; - } - dialog_->docSidesOneRB->setChecked( false ); - dialog_->docSidesTwoRB->setChecked( false ); - if (params.sides == LyXTextClass::TwoSides) - dialog_->docSidesTwo->setChecked( true ); - else - dialog_->docSidesOne->setChecked( true ); - dialog_->docColumnsOneRB->setChecked( false ); - dialog_->docColumnsTwoRB->setChecked( false ); - if (params.columns == 2) - dialog_->docColumnsTwoRB->setChecked( true ); - else - dialog_->docColumnsOneRB->setChecked( true ); - dialog_->docSpacingED->setText( "" ); - switch (params.spacing.getSpace()) { - case Spacing::Default: // nothing bad should happen with this - case Spacing::Single: - // \singlespacing - dialog_->docSpacingCO->setCurrentItem( 0 ); - break; - case Spacing::Onehalf: - // \onehalfspacing - dialog_->docSpacingCO->setCurrentItem( 1 ); - break; - case Spacing::Double: - // \doublespacing - dialog_->docSpacingCO->setCurrentItem( 2 ); + default: + skip = 0; break; - case Spacing::Other: - { - dialog_->docSpacingCO->setCurrentItem( 3 ); - QString sval; - sval.sprintf("%g",params.spacing.getValue()); - dialog_->docSpacingED->setText( sval ); - break; - } } - if (!params.options.empty()) - dialog_->docExtraED->setText(, params.options.c_str()); - else - dialog_->docExtraED->setText( "" ); -} + dialog_->layoutModule->skipCO->setCurrentItem(skip); + dialog_->setSkip(skip); - -void QDocument::language_update(BufferParams const & params) -{ - if (!language_.get()) - return; - - Qt2Helper::setCurrentItemText( dialog_->languageCO, params.language->lang() ); - Qt2Helper::setCurrentItemText( dialog_->inputEncCO, params.inputenc.c_str() ); - dialog_->quotesLanguageCO->setCurrentItem( params.quotes_language ); - dialog_->singleRB->setChecked( false ); - dialog_->doubleRB->setChecked( false ); - if (params.quotes_times == InsetQuotes::SingleQ) - dialog_->singleRB->setChecked( true ); - else - dialog_->doubleRB->setChecked( true ); -} - - -void QDocument::options_update(BufferParams const & params) -{ - if (!options_.get()) - return; - - Qt2Helper::setCurrentItemText( dialog_->postscriptDriverCO, - params.graphicsDriver.c_str()); - dialog_->useAmsMathCB->setChecked( params.use_amsmath ); - dialog_->secNumDepthSB->setValue( params.secnumdepth ); - dialog_->setTocDepthSB->setValue( params.tocdepth ); - if (!params.float_placement.empty()) - dialog_->floatPlacementED->setText( params.float_placement.c_str()); - else - dialog_->floatPlacementED->setText( "" ); -} - - -void QDocument::paper_update(BufferParams const & params) -{ - if (!paper_.get()) - return; - - dialog_->papersize2CO->setCurrentItem( params.papersize2 ); - dialog_->paperPackageCO->setCurrentItem( params.paperpackage ); - dialog_->useGeometryCB->setChecked( params.use_geometry ); - dialog_->portraitRB->setChecked( false ); - dialog_->landscapeRB->setChecked( false ); - if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE) - dialog_->landscapeRB->setChecked( true ); - else - dialog_->portraitRB->setChecked( true ); - dialog_->customWidthED->setText( params.paperwidth.c_str()); - dialog_->customHeightED->setText( params.paperheight.c_str()); - dialog_->leftMarginED->setText( params.leftmargin.c_str()); - dialog_->topMarginED->setText( params.topmargin.c_str()); - dialog_->rightMarginED->setText( params.rightmargin.c_str()); - dialog_->bottomMarginED->setText( params.bottommargin.c_str()); - dialog_->headHeightED->setText( params.headheight.c_str()); - dialog_->headSepED->setText( params.headsep.c_str()); - dialog_->footSkipED->setText( params.footskip.c_str()); - dialog_->papersize2CO->setFocus(); -} - - -void QDocument::bullets_update(BufferParams const & params) -{ - bool const isLinuxDoc = lv_->buffer()->isLinuxDoc(); - setEnabled(fbullet, !isLinuxDoc); - - if (isLinuxDoc) return; - - dialog_->bulletDepth1RB->setChecked( true ); - dialog_->bulletLatexED->setText( params.user_defined_bullets[0].getText().c_str()); - dialog_->bulletSizeCO->setCurrentItem( params.user_defined_bullets[0].getSize() + 1); -} - - -void QDocument::checkReadOnly() -{ - if (bc().readOnly(lv_->buffer()->isReadonly())) { - dialog_->docClassCO->setEnabled( false ); - dialog_->languageCO->setEnabled( false ); - dialog_->warningLA->setText( _("Document is read-only." - " No changes to layout permitted.")); - dialog_->warningLA->show(); + if (!controller().params().options.empty()) { + dialog_->layoutModule->optionsLE->setText( + controller().params().options.c_str()); } else { - dialog_->docClassCO->setEnabled( true ); - dialog_->languageCO->setEnabled( true ); - dialog_->warningLA->hide(); + dialog_->layoutModule->optionsLE->setText(""); } -} + + /* paper */ + int const psize = controller().params().papersize2; + dialog_->paperModule->papersizeCO->setCurrentItem(psize); + dialog_->setMargins(psize); + dialog_->setCustomPapersize(psize); + bool const landscape = + controller().params().orientation == BufferParams::ORIENTATION_LANDSCAPE; + dialog_->paperModule->landscapeRB->setChecked(landscape); + dialog_->paperModule->portraitRB->setChecked(!landscape); -void QDocument::checkMarginValues() -{ - bool const not_empty = - !dialog_->topMarginED->text().isEmpty() || - !dialog_->bottomMarginED->text().isEmpty() || - !dialog_->leftMarginED->text().isEmpty() || - !dialog_->rightMarginED->text().isEmpty() || - !dialog_->headHeightED->text().isEmpty() || - !dialog_->headSepED->text().isEmpty() || - !dialog_->footSkipED->text().isEmpty() || - !dialog_->customWidthED->text().isEmpty() || - !dialog_->customHeightED->text().isEmpty(); - if (not_empty) - dialog_->useGeometryCB->setChecked( true ); -} + dialog_->paperModule->facingPagesCB->setChecked( + controller().params().sides == LyXTextClass::TwoSides); + + dialog_->paperModule->twoColumnCB->setChecked( + controller().params().columns == 2); + + dialog_->paperModule->paperwidthUnitCO->setCurrentItem( + LyXLength(controller().params().paperwidth).unit()); + + dialog_->paperModule->paperwidthLE->setText( + tostr(LyXLength(controller().params().paperwidth).value()).c_str()); + + dialog_->paperModule->paperheightUnitCO->setCurrentItem( + LyXLength(controller().params().paperheight).unit()); -#ifdef I_SUPPOSE_THIS_NEEDS_TO_FIXED -bool QDocument::CheckDocumentInput(FL_OBJECT * ob, long) -{ - string str; - int val; - bool ok = true; - char const * input; - - checkMarginValues(); - if (ob == paper_->choice_papersize2) { - val = fl_get_choice(paper_->choice_papersize2)-1; - if (val == BufferParams::VM_PAPER_DEFAULT) { - fl_set_button(paper_->push_use_geometry, 0); - checkMarginValues(); - } else { - if ((val != BufferParams::VM_PAPER_USLETTER) && - (val != BufferParams::VM_PAPER_USLEGAL) && - (val != BufferParams::VM_PAPER_USEXECUTIVE) && - (val != BufferParams::VM_PAPER_A4) && - (val != BufferParams::VM_PAPER_A5) && - (val != BufferParams::VM_PAPER_B5)) { - fl_set_button(paper_->push_use_geometry, 1); - } - fl_set_choice(paper_->choice_paperpackage, - BufferParams::PACKAGE_NONE + 1); - } - } else if (ob == paper_->choice_paperpackage) { - val = fl_get_choice(paper_->choice_paperpackage)-1; - if (val != BufferParams::PACKAGE_NONE) { - fl_set_choice(paper_->choice_papersize2, - BufferParams::VM_PAPER_DEFAULT + 1); - fl_set_button(paper_->push_use_geometry, 0); - } - } else if (ob == class_->input_doc_spacing) { - input = fl_get_input(class_->input_doc_spacing); - if (!*input) { - fl_set_choice (class_->choice_doc_spacing, 1); - } else { - fl_set_choice(class_->choice_doc_spacing, 4); - } + dialog_->paperModule->paperheightLE->setText( + tostr(LyXLength(controller().params().paperheight).value()).c_str()); + + /* margins */ + int item = controller().params().paperpackage; + if (controller().params().use_geometry) { + item = 1; + } else if (item>0) { + item = item + 1; } - // this has to be all out of if/elseif because it has to deactivate - // the document buttons and so the whole stuff has to be tested again. - str = fl_get_input(paper_->input_custom_width); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_custom_height); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_left_margin); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_right_margin); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_top_margin); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_bottom_margin); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_head_height); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_head_sep); - ok = ok && (str.empty() || isValidLength(str)); - str = fl_get_input(paper_->input_foot_skip); - ok = ok && (str.empty() || isValidLength(str)); - // "Synchronize" the choice and the input field, so that it - // is impossible to commit senseless data. - input = fl_get_input (class_->input_doc_skip); - if (ob == class_->input_doc_skip) { - if (!*input) { - fl_set_choice (class_->choice_doc_skip, 2); - } else if (isValidGlueLength (input)) { - fl_set_choice (class_->choice_doc_skip, 4); - } else { - fl_set_choice(class_->choice_doc_skip, 4); - ok = false; - } - } else { - if (*input && !isValidGlueLength(input)) - ok = false; - } - if ((fl_get_choice(class_->choice_doc_skip) == 4) && !*input) - ok = false; - else if (fl_get_choice(class_->choice_doc_skip) != 4) - fl_set_input (class_->input_doc_skip, ""); + dialog_->marginsModule->marginCO->setCurrentItem(item); + dialog_->setCustomMargins(item); - input = fl_get_input(class_->input_doc_spacing); - if ((fl_get_choice(class_->choice_doc_spacing) == 4) && !*input) - ok = false; - else if (fl_get_choice(class_->choice_doc_spacing) != 4) - fl_set_input (class_->input_doc_spacing, ""); - return ok; + dialog_->marginsModule->topUnit->setCurrentItem( + LyXLength(controller().params().topmargin).unit()); + dialog_->marginsModule->topLE->setText( + tostr(LyXLength(controller().params().topmargin).value()).c_str()); + + dialog_->marginsModule->bottomUnit->setCurrentItem( + LyXLength(controller().params().bottommargin).unit()); + dialog_->marginsModule->bottomLE->setText( + tostr(LyXLength(controller().params().bottommargin).value()).c_str()); + + dialog_->marginsModule->innerUnit->setCurrentItem( + LyXLength(controller().params().leftmargin).unit()); + dialog_->marginsModule->innerLE->setText( + tostr(LyXLength(controller().params().leftmargin).value()).c_str()); + + dialog_->marginsModule->outerUnit->setCurrentItem( + LyXLength(controller().params().rightmargin).unit()); + dialog_->marginsModule->outerLE->setText( + tostr(LyXLength(controller().params().rightmargin).value()).c_str()); + + dialog_->marginsModule->headheightUnit->setCurrentItem( + LyXLength(controller().params().headheight).unit()); + dialog_->marginsModule->headheightLE->setText( + tostr(LyXLength(controller().params().headheight).value()).c_str()); + + dialog_->marginsModule->headsepUnit->setCurrentItem( + LyXLength(controller().params().headsep).unit()); + dialog_->marginsModule->headsepLE->setText( + tostr(LyXLength(controller().params().headsep).value()).c_str()); + + dialog_->marginsModule->footskipUnit->setCurrentItem( + LyXLength(controller().params().footskip).unit()); + dialog_->marginsModule->footskipLE->setText( + tostr(LyXLength(controller().params().footskip).value()).c_str()); + + } -void QDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ ) -{ - BufferParams & param = lv_->buffer()->params; - - // convert from 1-6 range to -1-4 - param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2); - fl_set_input(bullets_->input_bullet_latex, - param.temp_bullets[current_bullet_depth].getText().c_str()); -} -void QDocument::InputBulletLaTeX(FL_OBJECT *, long) -{ - BufferParams & param = lv_->buffer()->params; - - param.temp_bullets[current_bullet_depth]. - setText(fl_get_input(bullets_->input_bullet_latex)); -} -void QDocument::BulletDepth(FL_OBJECT * ob, State cb) -{ - /* Should I do the following: - * 1. change to the panel that the current bullet belongs in - * 2. show that bullet as selected - * 3. change the size setting to the size of the bullet in Q. - * 4. display the latex equivalent in the latex box - * - * I'm inclined to just go with 3 and 4 at the moment and - * maybe try to support the others later - */ - BufferParams & param = lv_->buffer()->params; - int data = 0; - if (cb == BULLETDEPTH1 ) - data = 0; - else if (cb == BULLETDEPTH2 ) - data = 1; - else if (cb == BULLETDEPTH3 ) - data = 2; - else if (cb == BULLETDEPTH4 ) - data = 3; - - switch (fl_get_button_numb(ob)) { - case 3: - // right mouse button resets to default - param.temp_bullets[data] = ITEMIZE_DEFAULTS[data]; - default: - current_bullet_depth = data; - fl_set_input(bullets_->input_bullet_latex, - param.temp_bullets[data].getText().c_str()); - fl_set_choice(bullets_->choice_bullet_size, - param.temp_bullets[data].getSize() + 2); - } -} - - -void QDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb) -{ - /* Here we have to change the background pixmap to that selected */ - /* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */ - - int data = 0; - if (cb == BULLETPANEL1 ) - data = 0; - else if (cb == BULLETPANEL2 ) - data = 1; - else if (cb == BULLETPANEL3 ) - data = 2; - else if (cb == BULLETPANEL4 ) - data = 3; - else if (cb == BULLETPANEL5 ) - data = 4; - else if (cb == BULLETPANEL6 ) - data = 5; - - if (data != current_bullet_panel) { - fl_freeze_form(bullets_->form); - current_bullet_panel = data; - - /* free the current pixmap */ - fl_free_bmtable_pixmap(bullets_->bmtable_bullet_panel); - string new_panel; - switch (cb) { - /* display the new one */ - case BULLETPANEL1 : - new_panel = "standard"; - break; - case BULLETPANEL2 : - new_panel = "amssymb"; - break; - case BULLETPANEL3 : - new_panel = "psnfss1"; - break; - case BULLETPANEL4 : - new_panel = "psnfss2"; - break; - case BULLETPANEL5 : - new_panel = "psnfss3"; - break; - case BULLETPANEL6 : - new_panel = "psnfss4"; - break; - default : - /* something very wrong happened */ - // play it safe for now but should be an exception - current_bullet_panel = 0; // standard panel - new_panel = "standard"; - break; - } - new_panel += ".xpm"; - fl_set_bmtable_pixmap_file(bullets_->bmtable_bullet_panel, 6, 6, - LibFileSearch("images", new_panel).c_str()); - fl_redraw_object(bullets_->bmtable_bullet_panel); - fl_unfreeze_form(bullets_->form); - } -} - - -void QDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ ) -{ - /* handle the user input by setting the current bullet depth's pixmap */ - /* to that extracted from the current chosen position of the BMTable */ - /* Don't forget to free the button's old pixmap first. */ - - BufferParams & param = lv_->buffer()->params; - int bmtable_button = fl_get_bmtable(ob); - - /* try to keep the button held down till another is pushed */ - /* fl_set_bmtable(ob, 1, bmtable_button); */ - param.temp_bullets[current_bullet_depth].setFont(current_bullet_panel); - param.temp_bullets[current_bullet_depth].setCharacter(bmtable_button); - fl_set_input(bullets_->input_bullet_latex, - param.temp_bullets[current_bullet_depth].getText().c_str()); -} - - -void QDocument::CheckChoiceClass(FL_OBJECT * ob, long) -{ - if (!ob) - ob = class_->choice_doc_class; - - ProhibitInput(lv_->view()); - - unsigned int tc = combo_doc_class->get() - 1; - if (textclasslist.Load(tc)) { - // we use a copy of the bufferparams because we do not - // want to modify them yet. - BufferParams params = lv_->buffer()->params; - - if (params.textclass != tc - && Alert::askQuestion(_("Should I set some parameters to"), - _("the defaults of this document class?"))) { - params.textclass = tc; - params.useClassDefaults(); - UpdateLayoutDocument(params); - } - } else { - // unable to load new style - Alert::alert(_("Conversion Errors!"), - _("Unable to switch to new document class."), - _("Reverting to original document class.")); - combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1); - } - AllowInput(lv_->view()); -} -#endif - -void QDocument::UpdateLayoutDocument(BufferParams const & params) -{ - if (!dialog_.get()) - return; - - checkReadOnly(); - class_update(params); - paper_update(params); - language_update(params); - options_update(params); - bullets_update(params); -} -#endif // 0 diff --git a/src/frontends/qt2/QDocument.h b/src/frontends/qt2/QDocument.h index e72d113ba1..3fec721fb3 100644 --- a/src/frontends/qt2/QDocument.h +++ b/src/frontends/qt2/QDocument.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Kalle Dalheimer + * \author Edwin Leuven * * Full author contact details are available in file CREDITS */ @@ -25,148 +25,25 @@ class ControlDocument; class QDocumentDialog; -class BufferParams; -class LyXView; -class Dialogs; class QDocument - //FIXME !!!!! : public Qt2CB > + : public Qt2CB > { public: - // FIXME!!!!!!! - QDocument(LyXView *, Dialogs *); + /// + QDocument(); + /// + friend class QDocumentDialog; private: + /// Apply changes + void apply(); + /// update + void update_contents(); + /// build the dialog + void build_dialog(); /// - enum State { - /// - INPUT, - /// - CHECKCHOICECLASS, - /// - CHOICEBULLETSIZE, - /// - INPUTBULLETLATEX, - /// - BULLETDEPTH1, - /// - BULLETDEPTH2, - /// - BULLETDEPTH3, - /// - BULLETDEPTH4, - /// - BULLETPANEL1, - /// - BULLETPANEL2, - /// - BULLETPANEL3, - /// - BULLETPANEL4, - /// - BULLETPANEL5, - /// - BULLETPANEL6, - /// - BULLETBMTABLE - }; - /// Pointer to the actual instantiation of the ButtonController. - virtual Qt2BC & bc(); - /// Build the dialog - virtual void build_dialog(); -// /// Filter the inputs -// virtual bool input( FL_OBJECT *, long ); - /// Update the dialog. - virtual void update_contents(); - /// Apply from dialog - virtual void apply(); - /// Cancel from dialog - virtual void cancel(); - -// /// -// virtual QDialog* form() const; - -#if 0 - /// - bool CheckDocumentInput(QWidget* ob, long); - /// - void ChoiceBulletSize(QWidget* ob, long); - /// - void InputBulletLaTeX(QWidget* ob, long); - /// - void BulletDepth(QWidget* ob, State); - /// - void BulletPanel(QWidget* ob, State); - /// - void BulletBMTable(QWidget* ob, long); - /// - void checkMarginValues(); - /// - void checkReadOnly(); - /// - void CheckChoiceClass(QWidget* ob, long); - /// - void UpdateLayoutDocument(BufferParams const & params); - - /// - void paper_update(BufferParams const &); - /// - void class_update(BufferParams const &); - /// - void language_update(BufferParams const &); - /// - void options_update(BufferParams const &); - /// - void bullets_update(BufferParams const &); - - /// - void paper_apply(); - /// - bool class_apply(); - /// - bool language_apply(); - /// - bool options_apply(); - /// - void bullets_apply(); - - /// Fdesign generated methods - QDialog* build_tabbed_document(); - /// - QDialog* build_doc_paper(); - /// - QDialog* build_doc_class(); - /// - QDialog* build_doc_language(); - /// - QDialog* build_doc_options(); - /// - QDialog* build_doc_bullet(); -#endif - /// Real GUI implementation. - boost::scoped_ptr dialog_; - /// - int ActCell; - /// - int Confirmed; - /// - int current_bullet_panel; - /// - int current_bullet_depth; -// /// -// FL_OBJECT * fbullet; -// /// -// boost::scoped_ptr combo_language; -// /// -// boost::scoped_ptr combo_doc_class; - /// The ButtonController - ButtonController bc_; + std::vector lang_; }; -inline -Qt2BC & QDocument::bc() -{ - return bc_; -} - #endif // QDOCUMENT_H diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index 364ca166cc..7dd89a7a24 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -3,458 +3,467 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Kalle Dalheimer + * \author Edwin Leuven * * Full author contact details are available in file CREDITS */ #include +#include "gettext.h" + +#include "ControlDocument.h" +#include "QDocument.h" #ifdef __GNUG__ #pragma implementation #endif #include "QDocumentDialog.h" -#include "Dialogs.h" -#include "QDocument.h" +#include "ui/ClassModuleBase.h" +#include "ui/PackagesModuleBase.h" +#include "ui/PaperModuleBase.h" +#include "ui/LanguageModuleBase.h" +#include "ui/BulletsModuleBase.h" +#include "BulletsModule.h" +#include "ui/BiblioModuleBase.h" +#include "ui/NumberingModuleBase.h" +#include "ui/MarginsModuleBase.h" +#include "ui/PreambleModuleBase.h" + +#include "QBrowseBox.h" +#include "Spacing.h" +#include "support/filetools.h" +#include "support/lstrings.h" +#include "Alert.h" +#include "lyxrc.h" +#include "buffer.h" +#include "lyx_main.h" // for user_lyxdir + +#include +#include +#include +#include #include -#include -#include -#include +#include #include +#include +#include #include - -QDocumentDialog::QDocumentDialog(QDocument * form, QWidget * parent, const char * name, bool modal, WFlags fl) - : QDocumentDialogBase(parent, name, modal, fl), - form_(form) +#include "lengthcombo.h" +/* + * Constructs a DocumentDialog which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +QDocumentDialog::QDocumentDialog( QDocument * form) + : QDocumentDialogBase( 0, 0, false, 0 ), form_(form) { -#if 0 - // Copy the pointers to the bullet buttons into an array so that - // they can all be manipulated together. - bulletbuttons[0] = bullet00PB; - bulletbuttons[1] = bullet01PB; - bulletbuttons[2] = bullet02PB; - bulletbuttons[3] = bullet03PB; - bulletbuttons[4] = bullet04PB; - bulletbuttons[5] = bullet05PB; - bulletbuttons[6] = bullet10PB; - bulletbuttons[7] = bullet11PB; - bulletbuttons[8] = bullet12PB; - bulletbuttons[9] = bullet13PB; - bulletbuttons[10] = bullet14PB; - bulletbuttons[11] = bullet15PB; - bulletbuttons[12] = bullet20PB; - bulletbuttons[13] = bullet21PB; - bulletbuttons[14] = bullet22PB; - bulletbuttons[15] = bullet23PB; - bulletbuttons[16] = bullet24PB; - bulletbuttons[17] = bullet25PB; - bulletbuttons[18] = bullet30PB; - bulletbuttons[19] = bullet31PB; - bulletbuttons[20] = bullet32PB; - bulletbuttons[21] = bullet33PB; - bulletbuttons[22] = bullet34PB; - bulletbuttons[23] = bullet35PB; - bulletbuttons[24] = bullet40PB; - bulletbuttons[25] = bullet41PB; - bulletbuttons[26] = bullet42PB; - bulletbuttons[27] = bullet43PB; - bulletbuttons[28] = bullet44PB; - bulletbuttons[29] = bullet45PB; - bulletbuttons[30] = bullet50PB; - bulletbuttons[31] = bullet51PB; - bulletbuttons[32] = bullet52PB; - bulletbuttons[33] = bullet53PB; - bulletbuttons[34] = bullet54PB; - bulletbuttons[35] = bullet55PB; -#endif + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form, SLOT(slotApply())); + connect(cancelPB, SIGNAL(clicked()), + form, SLOT(slotClose())); + connect(restorePB, SIGNAL(clicked()), + form, SLOT(slotRestore())); + + moduleLB->clear(); + moduleLB->insertItem( _("Layout"), LAYOUT ); + moduleLB->insertItem( _("Packages"), PACKAGES ); + moduleLB->insertItem( _("Paper"), PAPER ); + moduleLB->insertItem( _("Margins"), MARGINS ); + moduleLB->insertItem( _("Language"), LANGUAGE ); + moduleLB->insertItem( _("Bullets"), BULLETS ); + moduleLB->insertItem( _("Numbering"), NUMBERING ); + moduleLB->insertItem( _("Bibliography"), BIBLIOGRAPHY ); + moduleLB->insertItem( _("Preamble"), PREAMBLE ); + moduleLB->setCurrentItem(LAYOUT); + + layoutModule = new ClassModuleBase(this); + paperModule = new PaperModuleBase(this); + marginsModule = new MarginsModuleBase(this); + packagesModule = new PackagesModuleBase(this); + langModule = new LanguageModuleBase(this); + bulletsModule = new BulletsModule(this); + numberingModule = new NumberingModuleBase(this); + biblioModule = new BiblioModuleBase(this); + preambleModule = new PreambleModuleBase(this); + + moduleStack->addWidget(layoutModule,LAYOUT); + moduleStack->addWidget(paperModule,PAPER); + moduleStack->addWidget(marginsModule,MARGINS); + moduleStack->addWidget(packagesModule,PACKAGES); + moduleStack->addWidget(langModule,LANGUAGE); + moduleStack->addWidget(bulletsModule,BULLETS); + moduleStack->addWidget(numberingModule,NUMBERING); + moduleStack->addWidget(biblioModule,BIBLIOGRAPHY); + moduleStack->addWidget(preambleModule,PREAMBLE); + + moduleStack->raiseWidget(LAYOUT); + + //QPixmap image("standard.xpm"); + //bulletsModule->bulletsBB->insertItem(image); + //bulletsModule->bulletsBB->resize(image.width(),image.height()); + // take care of title + QFont f = titleL->font(); + f.setWeight( QFont::Bold ); + titleL->setFont( f ); + setTitle(LAYOUT); + + /* preamble */ + connect( preambleModule->preambleMLE, SIGNAL( textChanged() ), + this , SLOT( change_adaptor() ) ); + /* biblio */ + connect( biblioModule->natbibCB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( biblioModule->citeStyleCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + /* language & quote */ + connect( langModule->singleQuoteRB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( langModule->doubleQuoteRB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( langModule->languageCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( langModule->quoteStyleCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + /* numbering */ + connect( numberingModule->sectionnrDepthSB, + SIGNAL( valueChanged(int) ), + this , SLOT( change_adaptor() ) ); + connect( numberingModule->tocDepthSB, + SIGNAL( valueChanged(int) ), + this , SLOT( change_adaptor() ) ); + /* packages */ + connect( packagesModule->lspacingCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( packagesModule->lspacingCO, SIGNAL( activated(int) ), + this , SLOT( setLSpacing(int) ) ); + connect( packagesModule->lspacingLE, + SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( packagesModule->encodingCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( packagesModule->amsCB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( packagesModule->psdriverCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + /* layout */ + connect( layoutModule->classCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->optionsLE, + SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->pagestyleCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->fontsCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->fontsizeCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->floatPlacementLE, + SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->skipRB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->indentRB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->skipCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->skipLE, + SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( layoutModule->skipLengthCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + + connect( layoutModule->classCO, SIGNAL( activated(int) ), + this , SLOT( classChanged() ) ); + connect( layoutModule->skipCO, SIGNAL( activated(int) ), + this , SLOT( setSkip(int) ) ); + connect( layoutModule->skipRB, SIGNAL( toggled(bool) ), + this , SLOT( enableSkip(bool) ) ); + + /* margins */ + connect( marginsModule->marginCO, SIGNAL( activated(int) ), + this , SLOT( setCustomMargins(int) ) ); + + connect( marginsModule->marginCO, SIGNAL( activated(int) ), + 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() ) ); + connect( marginsModule->bottomUnit, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->innerLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->innerUnit, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->outerLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->outerUnit, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->headheightLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->headheightUnit, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->headsepLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->headsepUnit, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->footskipLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( marginsModule->footskipUnit, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + + /* paper */ + connect( paperModule->papersizeCO, SIGNAL( activated(int) ), + this , SLOT( setMargins(int) ) ); + connect( paperModule->papersizeCO, SIGNAL( activated(int) ), + this , SLOT( setCustomPapersize(int) ) ); + connect( paperModule->papersizeCO, SIGNAL( activated(int) ), + this , SLOT( setCustomPapersize(int) ) ); + + connect( paperModule->papersizeCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->paperheightLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->paperwidthLE, SIGNAL( textChanged(const QString&) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->paperwidthUnitCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->paperheightUnitCO, SIGNAL( activated(int) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->portraitRB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->landscapeRB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->twoColumnCB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + connect( paperModule->facingPagesCB, SIGNAL( toggled(bool) ), + this , SLOT( change_adaptor() ) ); + } +void QDocumentDialog::showPreamble() +{ + moduleStack->raiseWidget(PREAMBLE); + setTitle(PREAMBLE); + QDocumentDialogBase::show(); +} +/* + * Destroys the object and frees any allocated resources + */ QDocumentDialog::~QDocumentDialog() { + // no need to delete child widgets, Qt does it all for us } +/* + * public slot + */ -#if 0 -void QDocumentDialog::slotApply() +void QDocumentDialog::setTitle(int item) { - form->apply(); - // PENDING(kalle) Check whether we need this - // form->bc_->apply(); + switch(item) { + case LAYOUT: + titleL->setText(_("Document Style")); + break; + case PACKAGES: + titleL->setText(_("LaTeX Packages")); + break; + case PAPER: + titleL->setText(_("Papersize and Orientation")); + break; + case MARGINS: + titleL->setText(_("Margins")); + break; + case LANGUAGE: + titleL->setText(_("Language Settings and Quote Style")); + break; + case BULLETS: + titleL->setText(_("Bullet Types")); + break; + case NUMBERING: + titleL->setText(_("Numbering")); + break; + case BIBLIOGRAPHY: + titleL->setText(_("Bibliography Settings")); + break; + case PREAMBLE: + titleL->setText(_("LaTeX Preamble")); + break; + } } +/* + * public slot + */ +void QDocumentDialog::saveDocDefault() +{} -void QDocumentDialog::slotAMSMath(bool) +/* + * public slot + */ +void QDocumentDialog::restore() { - form->checkDocumentInput( amsMathCB ); + qWarning( "DocumentDialog::restore() not yet implemented!" ); } - -void QDocumentDialog::slotBulletDepth1() +/* + * public slot + */ +void QDocumentDialog::useClassDefaults() { - form->bulletDepth( 0 ); + qWarning( "DocumentDialog::useClassDefaults() not yet implemented!" ); } - -void QDocumentDialog::slotBulletDepth2() +void QDocumentDialog::change_adaptor() { - form->bulletDepth( 1 ); + form_->changed(); } - -void QDocumentDialog::slotBulletDepth3() +void QDocumentDialog::closeEvent(QCloseEvent * e) { - form->bulletDepth( 2 ); -} - - -void QDocumentDialog::slotBulletDepth4() -{ - form->bulletDepth( 3 ); -} - - -void QDocumentDialog::slotBulletDing1() -{ - qDebug( "QDocumentDialog::slotBulletDing1()" ); - form->checkDocumentInput( bulletDing1PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} - - -void QDocumentDialog::slotBulletDing2() -{ - form->checkDocumentInput( bulletDing2PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing1PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} - - -void QDocumentDialog::slotBulletDing3() -{ - form->checkDocumentInput( bulletDing3PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing1PB->setOn( false ); - bulletDing4PB->setOn( false ); -} - - -void QDocumentDialog::slotBulletDing4() -{ - form->checkDocumentInput( bulletDing4PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing1PB->setOn( false ); -} - - -void QDocumentDialog::slotBulletMaths() -{ - form->checkDocumentInput( bulletMathsPB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletDing1PB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} - - -void QDocumentDialog::slotBulletSize(int) -{ - form->choiceBulletSize(); - form->checkDocumentInput( bulletSizeCO ); -} - - -void QDocumentDialog::slotBulletStandard() -{ - form->checkDocumentInput( bulletStandardPB ); - form->setBulletPics(); - bulletDing1PB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} - - -void QDocumentDialog::slotBulletSymbol(int n) -{ - qDebug( "QDocumentDialog::slotBulletSymbol( %d )", n ); - for( int i = 0; i < 36; i++ ) - bulletbuttons[i]->setOn( false ); - bulletbuttons[n]->setOn( true ); - form->bulletBMTable( n ); - form->checkDocumentInput( bulletTypeBG ); -} - - -void QDocumentDialog::slotClass(int) -{ - form->checkChoiceClass( 0 ); - form->checkDocumentInput( classesCO ); -} - - -void QDocumentDialog::slotClose() -{ - form->cancel(); - form->hide(); - // PENDING(kalle) do something with this - // form->bc_->cancel(); -} - - -void QDocumentDialog::slotColumns(int) -{ - form->checkDocumentInput( columnsBG ); -} - - -void QDocumentDialog::slotDefaultSkip(const QString&) -{ - form->checkDocumentInput( defaultSkipED ); -} - - -void QDocumentDialog::slotDefaultSkip(int) -{ - form->checkChoiceClass( defaultSkipCO ); - form->checkDocumentInput( defaultSkipCO ); -} - - -void QDocumentDialog::slotEncoding(int) -{ - form->checkChoiceClass( encodingCO ); - form->checkDocumentInput( encodingCO ); -} - - -void QDocumentDialog::slotExtraOptions(const QString&) -{ - form->checkDocumentInput( extraOptionsED ); -} - - -void QDocumentDialog::slotFloatPlacement(const QString&) -{ - form->checkDocumentInput( floatPlacementED ); -} - - -void QDocumentDialog::slotFont(int) -{ - form->checkChoiceClass( fontsCO ); - form->checkDocumentInput( fontsCO ); -} - - -void QDocumentDialog::slotFontSize(int) -{ - form->checkChoiceClass( fontSizeCO ); - form->checkDocumentInput( fontSizeCO ); -} - - -void QDocumentDialog::slotFootskip(const QString&) -{ - form->checkDocumentInput( footskipED ); -} - - -void QDocumentDialog::slotHeadheight(const QString&) -{ - form->checkDocumentInput( headheightED ); -} - - -void QDocumentDialog::slotHeadsep(const QString&) -{ - form->checkDocumentInput( headsepED ); -} - - -void QDocumentDialog::slotHeight(const QString&) -{ - form->checkDocumentInput( customHeightED ); -} - - -void QDocumentDialog::slotLanguage(int) -{ - form->checkChoiceClass( languageCO ); - form->checkDocumentInput( languageCO ); -} - - -void QDocumentDialog::slotBulletLaTeX(const QString&) -{ - form->inputBulletLaTeX(); - form->checkDocumentInput( latexED ); -} - - -void QDocumentDialog::slotMarginBottom(const QString&) -{ - form->checkDocumentInput( marginBottomED ); -} - - -void QDocumentDialog::slotMarginLeft(const QString&) -{ - form->checkDocumentInput( marginLeftED ); -} - - -void QDocumentDialog::slotMarginRight(const QString&) -{ - form->checkDocumentInput( marginRightED ); -} - - -void QDocumentDialog::slotMarginTop(const QString&) -{ - form->checkDocumentInput( marginTopED ); -} - - -void QDocumentDialog::slotOK() -{ - form->apply(); - form->hide(); - // PENDING(kalle) Do something about this. - // form->bc_->ok(); -} - - -void QDocumentDialog::slotOrientation(int) -{ - form->checkDocumentInput( orientationBG ); -} - - -void QDocumentDialog::slotPSDriver(int) -{ - form->checkChoiceClass( psDriverCO ); - form->checkDocumentInput( psDriverCO ); -} - - -void QDocumentDialog::slotPageStyle(int) -{ - form->checkChoiceClass( pagestyleCO ); - form->checkDocumentInput( pagestyleCO ); -} - - -void QDocumentDialog::slotPapersize(int) -{ - form->checkChoiceClass( pagestyleCO ); - form->checkDocumentInput( papersizeCO ); -} - - -void QDocumentDialog::slotQuoteStyle(int) -{ - form->checkChoiceClass( quoteStyleTypeCO ); - form->checkDocumentInput( quoteStyleTypeCO ); -} - - -void QDocumentDialog::slotQuoteType(int) -{ - // Intentionally left blank -} - - -void QDocumentDialog::slotRestore() -{ - form->update(); - // PENDING(kalle) Do something about this. - // form->bc_->updateAll(); -} - - -void QDocumentDialog::slotSectionNumberDepth(int) -{ - form->checkDocumentInput( sectionNumberDepthSB ); -} - - -void QDocumentDialog::slotSeparation(int) -{ - form->checkDocumentInput( separationBG ); -} - - -void QDocumentDialog::slotSides(int) -{ - form->checkDocumentInput( sidesBG ); -} - - -void QDocumentDialog::slotSpacing(const QString&) -{ - form->checkDocumentInput( spacingED ); -} - - -void QDocumentDialog::slotSpacing(int) -{ - form->checkDocumentInput( spacingCO ); - form->checkDocumentInput( spacingCO ); -} - - -void QDocumentDialog::slotSpecialPaperPackage(int) -{ - form->checkChoiceClass( specialCO ); - form->checkDocumentInput( specialCO ); -} - - -void QDocumentDialog::slotTOCDepth(int) -{ - form->checkDocumentInput( tocDepthSB ); -} - - -void QDocumentDialog::slotUseGeometryPackage(bool) -{ - form->checkDocumentInput( CheckBox1 ); -} - - -void QDocumentDialog::slotWidth(const QString&) -{ - form->checkDocumentInput( customWidthED ); -} -#endif - - -void QDocumentDialog::closeEvent( QCloseEvent* e ) -{ - //form_->hide(); - //PENDING(kalle) Do something about this. - // form->bc_->hide(); + form_->slotWMHide(); e->accept(); } + +void QDocumentDialog::setLSpacing(int item) +{ + packagesModule->lspacingLE->setEnabled(item==3); +} + +void QDocumentDialog::setSkip(int item) +{ + bool enable = (item==3); + layoutModule->skipLE->setEnabled(enable); + layoutModule->skipLengthCO->setEnabled(enable); +} + +void QDocumentDialog::enableSkip(bool skip) +{ + layoutModule->skipCO->setEnabled(skip); + layoutModule->skipLE->setEnabled(skip); + layoutModule->skipLengthCO->setEnabled(skip); + if (skip) + setSkip(layoutModule->skipCO->currentItem()); +} + +void QDocumentDialog::setMargins(int papersize) +{ + QStringList a4only; + QStringList normal; + a4only << _("Small Margins") << _( "Very small Margins") + << _("Very wide Margins "); + normal << _("Default") << _("Custom"); + + int olditem = marginsModule->marginCO->currentItem(); + marginsModule->marginCO->clear(); + marginsModule->marginCO->insertStringList(normal); + if (papersize==6) { + marginsModule->marginCO->insertStringList(a4only); + } + marginsModule->marginCO->setCurrentItem(olditem); + setCustomMargins(olditem); +} + + +void QDocumentDialog::setCustomPapersize(int papersize) +{ + bool const custom = (papersize==1); + + paperModule->paperwidthL->setEnabled(custom); + paperModule->paperwidthLE->setEnabled(custom); + paperModule->paperwidthUnitCO->setEnabled(custom); + paperModule->paperheightL->setEnabled(custom); + paperModule->paperheightLE->setEnabled(custom); + paperModule->paperheightLE->setFocus(); + paperModule->paperheightUnitCO->setEnabled(custom); +} + + +void QDocumentDialog::setCustomMargins(int margin) +{ + bool const custom = (margin==1); + + 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->innerL->setEnabled(custom); + marginsModule->innerLE->setEnabled(custom); + marginsModule->innerUnit->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->headsepL->setEnabled(custom); + marginsModule->headsepLE->setEnabled(custom); + marginsModule->headsepUnit->setEnabled(custom); + + marginsModule->footskipL->setEnabled(custom); + marginsModule->footskipLE->setEnabled(custom); + marginsModule->footskipUnit->setEnabled(custom); + +} + +void QDocumentDialog::updateFontsize(string const & items, string const & sel) +{ + layoutModule->fontsizeCO->clear(); + layoutModule->fontsizeCO->insertItem("default"); + + for (int n=0; !token(items,'|',n).empty(); ++n) + layoutModule->fontsizeCO-> + insertItem(token(items,'|',n).c_str()); + + for (int n = 0; nfontsizeCO->count(); ++n) { + if (layoutModule->fontsizeCO->text(n).latin1()==sel) { + layoutModule->fontsizeCO->setCurrentItem(n); + break; + } + } +} + +void QDocumentDialog::updatePagestyle(string const & items, string const & sel) +{ + layoutModule->pagestyleCO->clear(); + layoutModule->pagestyleCO->insertItem("default"); + + for (int n=0; !token(items,'|',n).empty(); ++n) + layoutModule->pagestyleCO-> + insertItem(token(items,'|',n).c_str()); + + for (int n = 0; npagestyleCO->count(); ++n) { + if (layoutModule->pagestyleCO->text(n).latin1()==sel) { + layoutModule->pagestyleCO->setCurrentItem(n); + break; + } + } +} + +void QDocumentDialog::classChanged() +{ + updateFontsize(form_->controller().textClass().opt_fontsize(), + form_->controller().params().fontsize); + + updatePagestyle(form_->controller().textClass().opt_pagestyle(), + form_->controller().params().pagestyle); + +} + + diff --git a/src/frontends/qt2/QDocumentDialog.h b/src/frontends/qt2/QDocumentDialog.h index 0c0176803d..630a4d0277 100644 --- a/src/frontends/qt2/QDocumentDialog.h +++ b/src/frontends/qt2/QDocumentDialog.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Kalle Dalheimer + * \author Edwin Leuven * * Full author contact details are available in file CREDITS */ @@ -17,77 +17,86 @@ #endif #include "ui/QDocumentDialogBase.h" +#include "LString.h" + +#include "ui/BulletsModuleBase.h" +#include "BulletsModule.h" + +#include "ui/ClassModuleBase.h" +#include "ui/PackagesModuleBase.h" +#include "ui/PaperModuleBase.h" +#include "ui/LanguageModuleBase.h" +#include "ui/BiblioModuleBase.h" +#include "ui/NumberingModuleBase.h" +#include "ui/MarginsModuleBase.h" +#include "ui/PreambleModuleBase.h" class QDocument; class QDocumentDialog : public QDocumentDialogBase -{ Q_OBJECT +{ + Q_OBJECT public: - QDocumentDialog(QDocument * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + + QDocumentDialog( QDocument * ); + ~QDocumentDialog(); -public slots: -#if 0 - void slotApply(); - void slotBulletLaTeX(const QString&); - void slotAMSMath(bool); - void slotBulletDepth1(); - void slotBulletDepth2(); - void slotBulletDepth3(); - void slotBulletDepth4(); - void slotBulletDing1(); - void slotBulletDing2(); - void slotBulletDing3(); - void slotBulletDing4(); - void slotBulletMaths(); - void slotBulletSize(int); - void slotBulletStandard(); - void slotBulletSymbol(int); - void slotClass(int); - void slotClose(); - void slotColumns(int); - void slotDefaultSkip(const QString&); - void slotDefaultSkip(int); - void slotEncoding(int); - void slotExtraOptions(const QString&); - void slotFloatPlacement(const QString&); - void slotFont(int); - void slotFontSize(int); - void slotFootskip(const QString&); - void slotHeadheight(const QString&); - void slotHeadsep(const QString&); - void slotHeight(const QString&); - void slotLanguage(int); - void slotMarginBottom(const QString&); - void slotMarginLeft(const QString&); - void slotMarginRight(const QString&); - void slotMarginTop(const QString&); - void slotOK(); - void slotOrientation(int); - void slotPSDriver(int); - void slotPageStyle(int); - void slotPapersize(int); - void slotQuoteStyle(int); - void slotQuoteType(int); - void slotRestore(); - void slotSectionNumberDepth(int); - void slotSeparation(int); - void slotSides(int); - void slotSpacing(const QString&); - void slotSpacing(int); - void slotSpecialPaperPackage(int); - void slotTOCDepth(int); - void slotUseGeometryPackage(bool); - void slotWidth(const QString&); -#endif + void showPreamble(); + + friend class QDocument; + void updateFontsize(string const & , string const & ); + + void updatePagestyle(string const & , string const & ); + +public slots: + + void setTitle(int); + void change_adaptor(); + void saveDocDefault(); + void restore(); + void useClassDefaults(); + +protected slots: + + void setLSpacing(int); + void setMargins(int); + void setCustomPapersize(int); + void setCustomMargins(int); + void setSkip(int); + void enableSkip(bool); + void classChanged(); + protected: - void closeEvent(QCloseEvent *); + + void closeEvent(QCloseEvent * e); private: + enum Module { + LAYOUT, + PACKAGES, + PAPER, + MARGINS, + LANGUAGE, + BULLETS, + NUMBERING, + BIBLIOGRAPHY, + PREAMBLE + }; + + ClassModuleBase * layoutModule; + PackagesModuleBase * packagesModule; + PaperModuleBase * paperModule; + MarginsModuleBase * marginsModule; + LanguageModuleBase * langModule; + BulletsModule * bulletsModule; + NumberingModuleBase * numberingModule; + BiblioModuleBase * biblioModule; + PreambleModuleBase * preambleModule; + QDocument * form_; - QToolButton* bulletbuttons[36]; }; -#endif // QDOCUMENTDIALOG_H +#endif // DOCUMENTDIALOG_H diff --git a/src/frontends/qt2/TODO b/src/frontends/qt2/TODO index 74dfb46704..0d630b89a2 100644 --- a/src/frontends/qt2/TODO +++ b/src/frontends/qt2/TODO @@ -11,7 +11,11 @@ lyx_gui (qt) QDocument - - implement me. Need MVC (Edwin is on this) + - finalize bullets + - buffer should update after apply + - set default unit if metric + - set new pagestuff on class change + - check qfont_loader diff --git a/src/frontends/qt2/moc/Makefile.am b/src/frontends/qt2/moc/Makefile.am index da7fe042c2..9b41e0458e 100644 --- a/src/frontends/qt2/moc/Makefile.am +++ b/src/frontends/qt2/moc/Makefile.am @@ -21,6 +21,9 @@ nodist_libqt2moc_la_SOURCES = \ iconpalette_moc.C \ lengthcombo_moc.C \ qttableview_moc.C \ + qgridview_moc.C \ + QBrowseBox_moc.C \ + BulletsModule_moc.C \ Toolbar_pimpl_moc.C \ QCommandBuffer_moc.C \ QCommandEdit_moc.C \ diff --git a/src/frontends/qt2/qgridview.cpp b/src/frontends/qt2/qgridview.cpp new file mode 100644 index 0000000000..76ef3faca8 --- /dev/null +++ b/src/frontends/qt2/qgridview.cpp @@ -0,0 +1,354 @@ +/**************************************************************************** +** $Id: qgridview.cpp,v 1.1 2002/10/09 08:59:02 leuven Exp $ +** +** Implementation of QGridView class +** +** Created: 010523 +** +** Copyright (C) 1992-2001 Trolltech AS. All rights reserved. +** +** This file is part of the widgets module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + + +#include "qgridview.h" + +#ifndef QT_NO_GRIDVIEW + +#include + +/*! + \class QGridView qgridview.h + \brief The QGridView class provides an abstract base for fixed-size + grids. + + \ingroup abstractwidgets + + A grid view consists of a number of abstract cells organized in rows + and columns. The cells have a fixed size and are identified with a + row index and a column index. The top-left cell is in row 0, column + 0. The bottom-right cell is in row numRows()-1, column numCols()-1. + + You can define \l numRows, \l numCols, \l cellWidth and + \l cellHeight. Reimplement the pure virtual function paintCell() to + draw the content of a cell. + + With ensureCellVisible(), you can ensure a certain cell is + visible. With rowAt() and columnAt() you can find a cell based on + the given x- and y-coordinates. + + If you need to monitor changes to the grid's dimensions (i.e. when + numRows or numCols is changed), reimplement the dimensionChange() + change handler. + + Note: the row, column indices are always given in the order, row + (vertical offset) then column (horizontal offset). This order is the + opposite of all pixel operations, which are given in the order x + (horizontal offset), y (vertical offset). + + QGridView is a very simple abstract class based on QScrollView. It + is designed to simplify the task of drawing many cells of the same + size in a potentially scrollable canvas. If you need rows and + columns in different sizes, use a QTable instead. If you need a + simple list of items, use a QListBox. If you need to present + hierachical data use a QListView, and if you need random objects at + random positions, consider using either a QIconView or a QCanvas. + +*/ + + +/*! + Constructs a grid view. + + The \a parent, \a name and widget flag, \a f, arguments are passed to the + QScrollView constructor. +*/ +QGridView::QGridView( QWidget *parent, const char *name, WFlags f ) + :QScrollView( parent, name ,f ),nrows(5),ncols(5),cellw(12),cellh(12) +{ + viewport()->setBackgroundMode( PaletteBase ); + setBackgroundMode( PaletteBackground ); + viewport()->setFocusProxy( this ); +} + +/*! + Destroys the grid view. +*/ +QGridView::~QGridView() +{ +} + +void QGridView::updateGrid() +{ + resizeContents( ncols * cellw, nrows * cellh ); +} + +/*! \property QGridView::numRows + \brief The number of rows in the grid + + \sa numCols +*/ +void QGridView::setNumRows( int numRows ) +{ + int oldnrows = nrows; + nrows = numRows; + dimensionChange( oldnrows, ncols ); + updateGrid(); +} + +/*! \property QGridView::numCols + \brief The number of columns in the grid + + \sa numRows +*/ +void QGridView::setNumCols( int numCols ) +{ + int oldncols = ncols; + ncols = numCols; + dimensionChange( nrows, oldncols ); + updateGrid(); +} + +/*! \property QGridView::cellWidth + \brief The width of a grid column + + All columns in a grid view have the same width. + + \sa cellHeight +*/ +void QGridView::setCellWidth( int cellWidth ) +{ + cellw = cellWidth; + updateGrid(); + updateContents( contentsX(), contentsY(), visibleWidth(), visibleHeight() ); + +} + +/*! \property QGridView::cellHeight + \brief The height of a grid row + + All rows in a grid view have the same height. + + \sa cellWidth +*/ +void QGridView::setCellHeight( int cellHeight ) +{ + cellh = cellHeight; + updateGrid(); + updateContents( contentsX(), contentsY(), visibleWidth(), visibleHeight() ); + +} + +/*! + Returns the geometry of cell (\a row, \a column) in the content + coordinate system. + + \sa cellRect() + */ +QRect QGridView::cellGeometry( int row, int column ) +{ + QRect r; + if ( row >= 0 && row < nrows && column >= 0 && column < ncols ) + r.setRect( cellw * column, cellh * row, cellw, cellh ); + return r; +} + +/*! Repaints cell (\a row, \a column). + + If \a erase is TRUE, Qt erases the area of the cell before the + paintCell() call; otherwise no erasing takes place. + + \sa QWidget::repaint() + */ +void QGridView::repaintCell( int row, int column, bool erase ) +{ + repaintContents( cellGeometry( row, column ), erase ); +} + +/*! Updates cell (\a row, \a column). + + \sa QWidget::update() + */ +void QGridView::updateCell( int row, int column ) +{ + updateContents( cellGeometry( row, column ) ); +} + +/*! + Ensure cell (\a row, \a column) is visible, scrolling the grid view + if necessary. + */ +void QGridView::ensureCellVisible( int row, int column ) +{ + QRect r = cellGeometry( row, column ); + ensureVisible( r.x(), r.y(), r.width(), r.height() ); +} + +/*! This function fills the \a cw pixels wide and \a ch pixels high + rectangle starting at position (\a cx, \a cy) with the + background color using the painter \a p. + + paintEmptyArea() is invoked by drawContents() to erase + or fill unused areas. +*/ + +void QGridView::paintEmptyArea( QPainter *p, int cx ,int cy, int cw, int ch) +{ + if ( gridSize().width() >= contentsWidth() && gridSize().height() >= contentsHeight() ) + return; + // Region of the rect we should draw + contentsToViewport( cx, cy, cx, cy ); + QRegion reg( QRect( cx, cy, cw, ch ) ); + // Subtract the table from it + reg = reg.subtract( QRect( contentsToViewport( QPoint( 0, 0 ) ), gridSize() ) ); + + // And draw the rectangles (transformed as needed) + QArray r = reg.rects(); + const QBrush &brush = colorGroup().brush(QColorGroup::Background); + for ( int i = 0; i < (int)r.count(); ++i) + p->fillRect( r[ i ], brush ); +} + +/*!\reimp + */ +void QGridView::drawContents( QPainter *p, int cx, int cy, int cw, int ch ) +{ + int colfirst = columnAt( cx ); + int collast = columnAt( cx + cw ); + int rowfirst = rowAt( cy ); + int rowlast = rowAt( cy + ch ); + + if ( rowfirst == -1 || colfirst == -1 ) { + paintEmptyArea( p, cx, cy, cw, ch ); + return; + } + + if ( collast < 0 || collast >= ncols ) + collast = ncols-1; + if ( rowlast < 0 || rowlast >= nrows ) + rowlast = nrows-1; + + // Go through the rows + for ( int r = rowfirst; r <= rowlast; ++r ) { + // get row position and height + int rowp = r * cellh; + + // Go through the columns in the row r + // if we know from where to where, go through [colfirst, collast], + // else go through all of them + for ( int c = colfirst; c <= collast; ++c ) { + // get position and width of column c + int colp = c * cellw; + // Translate painter and draw the cell + p->translate( colp, rowp ); + paintCell( p, r, c ); + p->translate( -colp, -rowp ); + } + } + + // Paint empty rects + paintEmptyArea( p, cx, cy, cw, ch ); +} + +/*! + \reimp + + (Implemented to get rid of a compiler warning.) +*/ +void QGridView::drawContents( QPainter * ) +{ +} + +/*! \fn void QGridView::dimensionChange( int oldNumRows, int oldNumCols ) + + This change handler is called whenever any of the grid's dimensions + changes. \a oldNumRows and \a oldNumCols contain the old dimensions, + numRows() and numCols() contain the new dimensions. + */ +void QGridView::dimensionChange( int, int ) {} + + + +/*! \fn int QGridView::rowAt( int y ) const + + Returns the number of the row at position \a y. \a y must be given in + content coordinates. + + \sa columnAt() + */ + +/*! \fn int QGridView::columnAt( int x ) const + + Returns the number of the column at position \a x. \a x must be + given in content coordinates. + + \sa rowAt() + */ + +/*! + \fn void QGridView::paintCell( QPainter *p, int row, int col ) + + This pure virtual function is called to paint the single cell at + (\a row, \a col) using painter \a p. The painter must be open when + paintCell() is called and must remain open. + + The coordinate system is \link QPainter::translate() translated \endlink + so that the origin is at the top-left corner of the cell to be + painted, i.e. \e cell coordinates. Do not scale or shear the coordinate + system (or if you do, restore the transformation matrix before you + return). + + The painter is not clipped by default in order to get maximum + efficiency. If you want clipping, use + + \code + p->setClipRect( cellRect(), QPainter::CoordPainter ); + //... your drawing code + p->setClipping( FALSE ); + + \endcode + +*/ + +/*! \fn QRect QGridView::cellRect() const + + Returns the geometry of a cell in a cell's coordinate system. This + is a convenience function useful in paintCell(). It is equivalent to + QRect( 0, 0, cellWidth(), cellHeight() ). + + \sa cellGeometry() + + */ + +/*!\fn QSize QGridView::gridSize() const + + Returns the size of the grid in pixels. + + */ + +#endif // QT_NO_GRIDVIEW diff --git a/src/frontends/qt2/qgridview.h b/src/frontends/qt2/qgridview.h new file mode 100644 index 0000000000..f48b870cf4 --- /dev/null +++ b/src/frontends/qt2/qgridview.h @@ -0,0 +1,134 @@ +/********************************************************************** +** $Id: qgridview.h,v 1.1 2002/10/09 08:59:02 leuven Exp $ +** +** Definition of QGridView class +** +** Created: 2001.05.23 +** +** Copyright (C) 1992-2001 Trolltech AS. All rights reserved. +** +** This file is part of the widgets module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QGRIDVIEW_H +#define QGRIDVIEW_H + +#include + +#ifndef QT_NO_GRIDVIEW + +class QGridViewPrivate; + +class Q_EXPORT QGridView : public QScrollView +{ + Q_OBJECT + Q_PROPERTY( int numRows READ numRows WRITE setNumRows ) + Q_PROPERTY( int numCols READ numCols WRITE setNumCols ) + Q_PROPERTY( int cellWidth READ cellWidth WRITE setCellWidth ) + Q_PROPERTY( int cellHeight READ cellHeight WRITE setCellHeight ) +public: + + QGridView( QWidget *parent=0, const char *name=0, WFlags f=0 ); + ~QGridView(); + + int numRows() const; + virtual void setNumRows( int ); + int numCols() const; + virtual void setNumCols( int ); + + int cellWidth() const; + virtual void setCellWidth( int ); + int cellHeight() const; + virtual void setCellHeight( int ); + + QRect cellRect() const; + QRect cellGeometry( int row, int column ); + QSize gridSize() const; + + int rowAt( int y ) const; + int columnAt( int x ) const; + + void repaintCell( int row, int column, bool erase=TRUE ); + void updateCell( int row, int column ); + void ensureCellVisible( int row, int column ); + +protected: + virtual void paintCell( QPainter *, int row, int col ) = 0; + virtual void paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch ); + + void drawContents( QPainter *p, int cx, int cy, int cw, int ch ); + + virtual void dimensionChange( int, int ); + +private: + void drawContents( QPainter* ); + void updateGrid(); + + int nrows; + int ncols; + int cellw; + int cellh; + QGridViewPrivate* d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + QGridView( const QGridView & ); + QGridView &operator=( const QGridView & ); +#endif +}; + +inline int QGridView::cellWidth() const +{ return cellw; } + +inline int QGridView::cellHeight() const +{ return cellh; } + +inline int QGridView::rowAt( int y ) const +{ return y / cellh; } + +inline int QGridView::columnAt( int x ) const +{ return x / cellw; } + +inline int QGridView::numRows() const +{ return nrows; } + +inline int QGridView::numCols() const +{return ncols; } + +inline QRect QGridView::cellRect() const +{ return QRect( 0, 0, cellw, cellh ); } + +inline QSize QGridView::gridSize() const +{ return QSize( ncols * cellw, nrows * cellh ); } + + + +#endif // QT_NO_GRIDVIEW + + +#endif // QTABLEVIEW_H diff --git a/src/frontends/qt2/ui/BiblioModuleBase.ui b/src/frontends/qt2/ui/BiblioModuleBase.ui new file mode 100644 index 0000000000..fe581b6cb1 --- /dev/null +++ b/src/frontends/qt2/ui/BiblioModuleBase.ui @@ -0,0 +1,125 @@ + +BiblioModuleBase +config.h +gettext.h + + QWidget + + name + BiblioModuleBase + + + geometry + + 0 + 0 + 180 + 130 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + QGroupBox + + name + GroupBox3 + + + sizePolicy + + 7 + 5 + + + + title + Style + + + + margin + 11 + + + spacing + 6 + + + QCheckBox + + name + natbibCB + + + text + Use &NatBib + + + + QLabel + + name + citationStyleL + + + enabled + false + + + text + Cite &Style: + + + buddy + citeStyleCO + + + + QComboBox + + name + citeStyleCO + + + enabled + false + + + sizePolicy + + 7 + 0 + + + + + + + + + + natbibCB + toggled(bool) + citationStyleL + setEnabled(bool) + + + natbibCB + toggled(bool) + citeStyleCO + setEnabled(bool) + + + diff --git a/src/frontends/qt2/ui/BulletsModuleBase.ui b/src/frontends/qt2/ui/BulletsModuleBase.ui new file mode 100644 index 0000000000..cf4f110f8d --- /dev/null +++ b/src/frontends/qt2/ui/BulletsModuleBase.ui @@ -0,0 +1,244 @@ + +BulletsModuleBase +config.h +gettext.h + + QWidget + + name + BulletsModuleBase + + + geometry + + 0 + 0 + 311 + 210 + + + + caption + Form3 + + + mouseTracking + true + + + + margin + 11 + + + spacing + 6 + + + QComboBox + + name + bulletsize1CO + + + + QLineEdit + + name + bullet1LE + + + sizePolicy + + 3 + 0 + + + + + QLabel + + name + sizeL + + + text + Size: + + + + QLabel + + name + latexL + + + text + LaTeX: + + + + + name + Spacer25 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QComboBox + + name + bulletsize3CO + + + + QLineEdit + + name + bullet3LE + + + + QComboBox + + name + bulletsize4CO + + + + QLineEdit + + name + bullet4LE + + + + QComboBox + + name + bulletsize5CO + + + + QLineEdit + + name + bullet5LE + + + + QComboBox + + name + bulletsize2CO + + + + QLineEdit + + name + bullet2LE + + + + QToolButton + + name + setbullet2TB + + + text + Set Level 2: + + + popupDelay + 0 + + + + QToolButton + + name + setbullet3TB + + + text + Set Level 3: + + + popupDelay + 0 + + + + QToolButton + + name + setbullet4TB + + + text + Set Level 4: + + + popupDelay + 1 + + + + QToolButton + + name + setbullet5TB + + + text + Set Level 5: + + + + QToolButton + + name + setbullet1TB + + + text + Set Level 1: + + + popupDelay + 0 + + + + + + + setbullet1TB + pressed() + BulletsModuleBase + setLevel1() + + setLevel1() + setLevel2() + setLevel3() + setLevel4() + setLevel5() + updateBulletSet(int) + + diff --git a/src/frontends/qt2/ui/ClassModuleBase.ui b/src/frontends/qt2/ui/ClassModuleBase.ui new file mode 100644 index 0000000000..c260667fc8 --- /dev/null +++ b/src/frontends/qt2/ui/ClassModuleBase.ui @@ -0,0 +1,295 @@ + +ClassModuleBase +config.h +gettext.h + + QWidget + + name + ClassModuleBase + + + geometry + + 0 + 0 + 321 + 287 + + + + caption + Form2 + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + classL + + + text + Document &Type: + + + buddy + classCO + + + + QComboBox + + name + classCO + + + sizePolicy + + 3 + 0 + + + + + QLineEdit + + name + optionsLE + + + + QLabel + + name + optionsL + + + text + Op&tions: + + + buddy + optionsLE + + + + QComboBox + + name + pagestyleCO + + + sizePolicy + + 3 + 0 + + + + + QLabel + + name + pagestyleL + + + text + Page &Style: + + + buddy + pagestyleCO + + + + QComboBox + + name + fontsCO + + + sizePolicy + + 3 + 0 + + + + + QComboBox + + name + fontsizeCO + + + + QLabel + + name + fontsL + + + text + &Font && Size: + + + buddy + fontsCO + + + + QLabel + + name + floatPlacementL + + + enabled + true + + + text + Float &placement: + + + buddy + floatPlacementLE + + + + QLineEdit + + name + floatPlacementLE + + + + QButtonGroup + + name + separationG + + + title + Separation + + + + margin + 11 + + + spacing + 6 + + + QComboBox + + name + skipCO + + + enabled + false + + + + QLineEdit + + name + skipLE + + + enabled + false + + + sizePolicy + + 1 + 0 + + + + + QRadioButton + + name + indentRB + + + text + &Indent + + + + QRadioButton + + name + skipRB + + + text + S&kip + + + + LengthCombo + + name + skipLengthCO + + + enabled + false + + + + + + + + + LengthCombo +
lengthcombo.h
+ + -1 + -1 + + 0 + + 5 + 5 + + image0 + selectionChanged(LyXLength::UNIT) +
+
+ + + image0 + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + + + classCO + optionsLE + pagestyleCO + fontsCO + fontsizeCO + floatPlacementLE + indentRB + skipRB + skipCO + skipLE + +
diff --git a/src/frontends/qt2/ui/LanguageModuleBase.ui b/src/frontends/qt2/ui/LanguageModuleBase.ui new file mode 100644 index 0000000000..19c33f3d58 --- /dev/null +++ b/src/frontends/qt2/ui/LanguageModuleBase.ui @@ -0,0 +1,161 @@ + +LanguageModuleBase +config.h +gettext.h + + QWidget + + name + LanguageModuleBase + + + geometry + + 0 + 0 + 286 + 170 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + languageL + + + text + &Language: + + + buddy + languageCO + + + + QComboBox + + name + languageCO + + + sizePolicy + + 7 + 0 + + + + + QButtonGroup + + name + quoteBG + + + title + Quote style + + + exclusive + true + + + + margin + 11 + + + spacing + 6 + + + QRadioButton + + name + singleQuoteRB + + + text + &Single + + + + QRadioButton + + name + doubleQuoteRB + + + text + &Double + + + + QComboBox + + name + quoteStyleCO + + + sizePolicy + + 7 + 0 + + + + + QLabel + + name + typeL + + + text + &Type: + + + buddy + quoteStyleCO + + + + + name + Spacer7 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + + diff --git a/src/frontends/qt2/ui/Makefile.am b/src/frontends/qt2/ui/Makefile.am index ec28e96d95..f77021e532 100644 --- a/src/frontends/qt2/ui/Makefile.am +++ b/src/frontends/qt2/ui/Makefile.am @@ -31,6 +31,53 @@ QAskForTextDialog.h: QAskForTextDialog.ui QAskForTextDialog.C: QAskForTextDialog.h QAskForTextDialog.ui $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ +ClassModuleBase.h: ClassModuleBase.ui + $(UIC) $< -o $@ +ClassModuleBase.C: ClassModuleBase.h ClassModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +BulletsModuleBase.h: BulletsModuleBase.ui + $(UIC) $< -o $@ +BulletsModuleBase.C: BulletsModuleBase.h BulletsModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +PackagesModuleBase.h: PackagesModuleBase.ui + $(UIC) $< -o $@ +PackagesModuleBase.C: PackagesModuleBase.h PackagesModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +PaperModuleBase.h: PaperModuleBase.ui + $(UIC) $< -o $@ +PaperModuleBase.C: PaperModuleBase.h PaperModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +MarginsModuleBase.h: MarginsModuleBase.ui + $(UIC) $< -o $@ +MarginsModuleBase.C: MarginsModuleBase.h MarginsModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +LanguageModuleBase.h: LanguageModuleBase.ui + $(UIC) $< -o $@ +LanguageModuleBase.C: LanguageModuleBase.h LanguageModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +NumberingModuleBase.h: NumberingModuleBase.ui + $(UIC) $< -o $@ +NumberingModuleBase.C: NumberingModuleBase.h NumberingModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +BiblioModuleBase.h: BiblioModuleBase.ui + $(UIC) $< -o $@ +BiblioModuleBase.C: BiblioModuleBase.h BiblioModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + +PreambleModuleBase.h: PreambleModuleBase.ui + $(UIC) $< -o $@ +PreambleModuleBase.C: PreambleModuleBase.h PreambleModuleBase.ui + $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@ + + + %Base.h: %.ui $(UIC) $< -o $@ %Base.C: %Base.h %.ui diff --git a/src/frontends/qt2/ui/MarginsModuleBase.ui b/src/frontends/qt2/ui/MarginsModuleBase.ui new file mode 100644 index 0000000000..fe5a18f63c --- /dev/null +++ b/src/frontends/qt2/ui/MarginsModuleBase.ui @@ -0,0 +1,413 @@ + +MarginsModuleBase +config.h +gettext.h + + QWidget + + name + MarginsModuleBase + + + geometry + + 0 + 0 + 183 + 260 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + topL + + + enabled + false + + + text + &Top: + + + buddy + topLE + + + + QLabel + + name + bottomL + + + enabled + false + + + text + &Bottom: + + + buddy + bottomLE + + + + QLabel + + name + innerL + + + enabled + false + + + text + &Inner: + + + buddy + innerLE + + + + QLabel + + name + outerL + + + enabled + false + + + text + O&uter: + + + buddy + outerLE + + + + QLabel + + name + marginL + + + text + &Margins: + + + buddy + marginCO + + + + QLineEdit + + name + topLE + + + enabled + false + + + + QLineEdit + + name + bottomLE + + + enabled + false + + + text + + + + + QLineEdit + + name + outerLE + + + enabled + false + + + + QLabel + + name + footskipL + + + enabled + false + + + text + &Foot skip: + + + buddy + footskipLE + + + + QLabel + + name + headsepL + + + enabled + false + + + text + Head &sep: + + + buddy + headsepLE + + + + QLineEdit + + name + headsepLE + + + enabled + false + + + + QLineEdit + + name + headheightLE + + + enabled + false + + + + QLabel + + name + headheightL + + + enabled + false + + + text + Head &height: + + + buddy + headheightLE + + + + QLineEdit + + name + footskipLE + + + enabled + false + + + + + name + Spacer21 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + name + Spacer22 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + LengthCombo + + name + topUnit + + + enabled + false + + + + LengthCombo + + name + bottomUnit + + + enabled + false + + + + LengthCombo + + name + innerUnit + + + enabled + false + + + + QLineEdit + + name + innerLE + + + enabled + false + + + + LengthCombo + + name + outerUnit + + + enabled + false + + + + LengthCombo + + name + headsepUnit + + + enabled + false + + + + LengthCombo + + name + headheightUnit + + + enabled + false + + + + LengthCombo + + name + footskipUnit + + + enabled + false + + + + QComboBox + + name + marginCO + + + + + + + LengthCombo +
lengthcombo.h
+ + -1 + -1 + + 0 + + 5 + 5 + + image0 + selectionChanged(LyXLength::UNIT) +
+
+ + + image0 + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + +
diff --git a/src/frontends/qt2/ui/NumberingModuleBase.ui b/src/frontends/qt2/ui/NumberingModuleBase.ui new file mode 100644 index 0000000000..bfee45261e --- /dev/null +++ b/src/frontends/qt2/ui/NumberingModuleBase.ui @@ -0,0 +1,141 @@ + +NumberingModuleBase +config.h +gettext.h + + QWidget + + name + NumberingModuleBase + + + geometry + + 0 + 0 + 214 + 105 + + + + caption + Form2 + + + + margin + 11 + + + spacing + 6 + + + QGroupBox + + name + GroupBox1 + + + frameShape + Box + + + title + Numbering depth + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + sectionnrDepthL + + + text + &Section: + + + buddy + sectionnrDepthSB + + + + QLabel + + name + tocDepthL + + + text + &Table of Contents: + + + buddy + tocDepthSB + + + + QSpinBox + + name + tocDepthSB + + + maxValue + 5 + + + minValue + -1 + + + + QSpinBox + + name + sectionnrDepthSB + + + maxValue + 5 + + + minValue + -2 + + + + + name + Spacer3 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + + diff --git a/src/frontends/qt2/ui/PackagesModuleBase.ui b/src/frontends/qt2/ui/PackagesModuleBase.ui new file mode 100644 index 0000000000..ac1fb1eeda --- /dev/null +++ b/src/frontends/qt2/ui/PackagesModuleBase.ui @@ -0,0 +1,204 @@ + +PackagesModuleBase +config.h +gettext.h + + QWidget + + name + PackagesModuleBase + + + geometry + + 0 + 0 + 342 + 201 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + QGroupBox + + name + packagesG + + + title + Packages + + + + margin + 11 + + + spacing + 6 + + + QLineEdit + + name + lspacingLE + + + enabled + false + + + sizePolicy + + 1 + 0 + + + + + QCheckBox + + name + amsCB + + + text + AMS &Math + + + + QComboBox + + name + encodingCO + + + sizePolicy + + 7 + 0 + + + + duplicatesEnabled + false + + + + QComboBox + + name + lspacingCO + + + sizePolicy + + 3 + 0 + + + + duplicatesEnabled + false + + + + QLabel + + name + lspacingL + + + text + Line Spacing: + + + + QLabel + + name + encodingL + + + text + Encoding: + + + + + + QGroupBox + + name + packagesoptionsG + + + title + Options + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + psdriverL + + + text + Postscript &Driver: + + + buddy + psdriverCO + + + + QComboBox + + name + psdriverCO + + + sizePolicy + + 3 + 0 + + + + duplicatesEnabled + false + + + + + + + + lspacingCO + lspacingLE + encodingCO + amsCB + psdriverCO + + diff --git a/src/frontends/qt2/ui/PaperModuleBase.ui b/src/frontends/qt2/ui/PaperModuleBase.ui new file mode 100644 index 0000000000..1bc3e1dafb --- /dev/null +++ b/src/frontends/qt2/ui/PaperModuleBase.ui @@ -0,0 +1,307 @@ + +PaperModuleBase +config.h +gettext.h + + QWidget + + name + PaperModuleBase + + + geometry + + 0 + 0 + 204 + 258 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + + name + Spacer24 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QCheckBox + + name + twoColumnCB + + + text + &Two Columns + + + + QCheckBox + + name + facingPagesCB + + + text + &Facing Pages + + + + QGroupBox + + name + psizeGB + + + title + Paper size + + + orientation + Vertical + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + paperheightL + + + enabled + false + + + text + &Height: + + + buddy + paperheightLE + + + + QLabel + + name + paperwidthL + + + enabled + false + + + text + &Width: + + + buddy + paperwidthLE + + + + QLabel + + name + psizeL + + + text + Paper &Size: + + + buddy + papersizeCO + + + + QComboBox + + name + papersizeCO + + + sizePolicy + + 1 + 0 + + + + + QLineEdit + + name + paperheightLE + + + enabled + false + + + sizePolicy + + 5 + 0 + + + + + QLineEdit + + name + paperwidthLE + + + enabled + false + + + sizePolicy + + 5 + 0 + + + + + LengthCombo + + name + paperheightUnitCO + + + enabled + false + + + + LengthCombo + + name + paperwidthUnitCO + + + enabled + false + + + + + + QButtonGroup + + name + orientationBG + + + title + Orientation + + + + margin + 11 + + + spacing + 6 + + + QRadioButton + + name + portraitRB + + + text + &Portrait + + + checked + true + + + + QRadioButton + + name + landscapeRB + + + text + &Landscape + + + + + + + + + LengthCombo +
lengthcombo.h
+ + -1 + -1 + + 0 + + 5 + 5 + + image0 + selectionChanged(LyXLength::UNIT) +
+
+ + + image0 + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + + + papersizeCO + paperheightLE + paperwidthLE + portraitRB + landscapeRB + twoColumnCB + facingPagesCB + +
diff --git a/src/frontends/qt2/ui/PreambleModuleBase.ui b/src/frontends/qt2/ui/PreambleModuleBase.ui new file mode 100644 index 0000000000..02074ba3b5 --- /dev/null +++ b/src/frontends/qt2/ui/PreambleModuleBase.ui @@ -0,0 +1,44 @@ + +PreambleModuleBase +config.h +gettext.h + + QWidget + + name + PreambleModuleBase + + + geometry + + 0 + 0 + 381 + 278 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + QMultiLineEdit + + name + preambleMLE + + + + + + + diff --git a/src/frontends/qt2/ui/QDocumentDialog.ui b/src/frontends/qt2/ui/QDocumentDialog.ui index 3493b1d6e9..aab51952df 100644 --- a/src/frontends/qt2/ui/QDocumentDialog.ui +++ b/src/frontends/qt2/ui/QDocumentDialog.ui @@ -13,19 +13,15 @@ 0 0 - 538 - 437 + 468 + 363 caption - Document Layout + Form1 - - sizeGripEnabled - true - - + margin 11 @@ -34,4381 +30,15 @@ spacing 6 - - QTabWidget - - name - TabWidget2 - - - layoutMargin - - - QWidget - - name - Widget2 - - - title - Document - - - - margin - -1 - - - spacing - -1 - - - QLayoutWidget - - name - Layout33 - - - - margin - 0 - - - spacing - 6 - - - QLayoutWidget - - name - Layout32 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - docExtraED - - - - QLabel - - name - fontsLA - - - text - &Fonts: - - - buddy - fontsCO - - - - QLabel - - name - pagestyleLA - - - text - &Pagestyle: - - - buddy - pagestyleCO - - - - QLabel - - name - defaultSkipLA - - - text - Defa&ult Skip: - - - buddy - defaultSkipCO - - - - QLabel - - name - fontSizeLA - - - text - F&ont Size: - - - buddy - fontSizeCO - - - - QComboBox - - - text - default - - - - - text - empty - - - - - text - plain - - - - - text - headings - - - - - text - fancy - - - - name - docPagestyleCO - - - - QLabel - - name - spacingLA - - - text - Spacin&g: - - - buddy - spacingCO - - - - QLabel - - name - extraOptionsLA - - - text - E&xtra Options: - - - buddy - extraOptionsED - - - - QLabel - - name - classesLA - - - text - &Class: - - - buddy - classesCO - - - - QLayoutWidget - - name - Layout13 - - - - margin - 0 - - - spacing - 6 - - - QComboBox - - - text - smallskip - - - - - text - medskip - - - - - text - bigskip - - - - - text - length - - - - name - docSkipCO - - - - QLineEdit - - name - docSkipED - - - - - - QLayoutWidget - - name - Layout31 - - - - margin - 0 - - - spacing - 6 - - - QComboBox - - - text - Single - - - - - text - OneHalf - - - - - text - Double - - - - - text - Other - - - - name - docSpacingCO - - - - QLineEdit - - name - docSpacingED - - - - - - QComboBox - - name - docFontsCO - - - - QComboBox - - name - docClassCO - - - - QComboBox - - - text - default - - - - - text - 10 - - - - - text - 11 - - - - - text - 12 - - - - name - docFontSizeCO - - - - - - - name - Spacer2_2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QLayoutWidget - - name - Layout52 - - - - margin - 0 - - - spacing - 6 - - - QButtonGroup - - name - sidesBG - - - title - Sides - - - - margin - 11 - - - spacing - 6 - - - QRadioButton - - name - docSidesOneRB - - - text - O&ne - - - - QRadioButton - - name - docSidesTwoRB - - - text - &Two - - - - - - QButtonGroup - - name - columnsBG - - - title - Columns - - - - margin - 11 - - - spacing - 6 - - - QRadioButton - - name - docColumnsOneRB - - - text - On&e - - - - QRadioButton - - name - docColumnsTwoRB - - - text - T&wo - - - - - - QButtonGroup - - name - separationBG - - - title - Separation - - - - margin - 11 - - - spacing - 6 - - - QRadioButton - - name - docIndentRB - - - text - &Indent - - - - QRadioButton - - name - docSkipRB - - - text - S&kip - - - - - - - name - Spacer33 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - - QWidget - - name - Widget3 - - - title - Paper - - - - margin - 11 - - - spacing - 6 - - - - name - Spacer34 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout19 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - papersizeLA - - - text - &Papersize: - - - buddy - papersizeCO - - - - QComboBox - - - text - Default - - - - - text - Custom - - - - - text - USletter - - - - - text - USlegal - - - - - text - USexecutive - - - - - text - A3 - - - - - text - A5 - - - - - text - B3 - - - - - text - B4 - - - - - text - B5 - - - - name - papersize2CO - - - - - name - Spacer5 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLabel - - name - specialLA - - - text - &Special: - - - buddy - specialCO - - - - QComboBox - - - text - None - - - - - text - A4 small Margins (only portrait) - - - - - text - A4 very small Margins (only portrait) - - - - - text - A4 very wide margins (only portrait) - - - - name - paperPackageCO - - - - - - - name - Spacer35 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout23 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer6 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QCheckBox - - name - useGeometryCB - - - text - &Use Geometry Package - - - - - name - Spacer7 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer36 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout22 - - - - margin - 0 - - - spacing - 6 - - - QLayoutWidget - - name - Layout20 - - - - margin - 0 - - - spacing - 6 - - - QButtonGroup - - name - orientationBG - - - title - Orientation - - - - margin - 11 - - - spacing - 6 - - - QRadioButton - - name - portraitRB - - - text - P&ortrait - - - - QRadioButton - - name - landscapeRB - - - text - &Landscape - - - - - - QGroupBox - - name - marginsGB - - - title - Margins - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - marginRightLA - - - text - &Right: - - - buddy - marginRightED - - - - QLineEdit - - name - leftMarginED - - - - QLineEdit - - name - bottomMarginED - - - - QLineEdit - - name - rightMarginED - - - - QLabel - - name - marginBottomLA - - - text - &Bottom: - - - buddy - marginBottomED - - - - QLineEdit - - name - topMarginED - - - - QLabel - - name - marginLeftL - - - text - L&eft: - - - buddy - marginLeftED - - - - QLabel - - name - marginTopLA - - - text - &Top: - - - buddy - marginTopED - - - - - - - - QLayoutWidget - - name - Layout21 - - - - margin - 0 - - - spacing - 6 - - - QGroupBox - - name - customPapersizeGB - - - title - Custom Papersize - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - customWidthLA - - - text - &Width: - - - buddy - customWidthED - - - - QLineEdit - - name - customWidthED - - - - QLineEdit - - name - customHeightED - - - - QLabel - - name - customHeightLA - - - text - &Height: - - - buddy - customHeightED - - - - - - QGroupBox - - name - headsepBG - - - title - Foot/Head Margins - - - - margin - 11 - - - spacing - 6 - - - QLineEdit - - name - headHeightED - - - - QLineEdit - - name - headSepED - - - - QLineEdit - - name - footSkipED - - - - QLabel - - name - footskipLA - - - text - &Footskip: - - - buddy - footskipED - - - - QLabel - - name - headsepLA - - - text - Hea&dsep: - - - buddy - headsepED - - - - QLabel - - name - headheightLA - - - text - Headhe&ight: - - - buddy - headheightED - - - - - - - - - - - name - Spacer37 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QWidget - - name - Widget4 - - - title - Language - - - - margin - 11 - - - spacing - 6 - - - - name - Spacer10 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout53 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer12 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout26 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - languageLA - - - text - &Language: - - - buddy - languageCO - - - - QComboBox - - name - languageCO - - - - - - - name - Spacer38 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout27 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - encodingLA - - - text - Enco&ding: - - - buddy - encodingCO - - - - QComboBox - - - text - default - - - - - text - auto - - - - - text - latin1 - - - - - text - latin2 - - - - - text - latin3 - - - - - text - latin4 - - - - - text - latin5 - - - - - text - latin9 - - - - - text - koi8-r - - - - - text - koi8-u - - - - - text - cp866 - - - - - text - cp1251 - - - - - text - iso88595 - - - - name - inputEncCO - - - - - - - name - Spacer9 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QButtonGroup - - name - quoteStyleBG - - - title - Quote Style - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout28 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - quoteStyleTypeLA - - - text - &Type: - - - buddy - quoteStyleTypeCO - - - - QComboBox - - - text - ``text'' - - - - - text - ''text'' - - - - - text - ,,text`` - - - - - text - ,,text'' - - - - - text - «text» - - - - - text - »text« - - - - name - quotesLanguageCO - - - - - - QLayoutWidget - - name - Layout29 - - - - margin - 0 - - - spacing - 6 - - - QRadioButton - - name - singleRB - - - text - &Single - - - - QRadioButton - - name - doubleRB - - - text - &Double - - - - - - - - - name - Spacer13 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer11 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QWidget - - name - Widget5 - - - title - Extra - - - - margin - 11 - - - spacing - 6 - - - - name - Spacer24 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout39 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer18 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout33 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - TextLabel28 - - - text - F&loat Placement: - - - buddy - floatPlacementED - - - - QLineEdit - - name - floatPlacementED - - - - - - - name - Spacer14 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout34 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - sectionNumberDepthLA - - - text - S&ection number depth: - - - buddy - sectionNumberDepthSB - - - - QSpinBox - - name - secNumDepthSB - - - maxValue - 5 - - - minValue - -2 - - - - - - - name - Spacer15 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout35 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - tocDepthLA - - - text - &Table of contents depth: - - - buddy - tocDepthSB - - - - QSpinBox - - name - tocDepthSB - - - maxValue - 5 - - - minValue - -1 - - - - - - - name - Spacer16 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout36 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - psDriverLA - - - text - P&S Driver: - - - buddy - psDriverCO - - - - QComboBox - - name - postscriptDriverCO - - - - - - - name - Spacer17 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout38 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer23 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QCheckBox - - name - useAmsMathCB - - - text - Use A&MS Math - - - - - name - Spacer22 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer19 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer25 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QWidget - - name - Widget6 - - - title - Bullets - - - - margin - 6 - - - spacing - -1 - - - QLayoutWidget - - name - Layout51 - - - - margin - 0 - - - spacing - 6 - - - QLayoutWidget - - name - Layout48 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer31 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLabel - - name - bulletSizeLA - - - text - Si&ze - - - buddy - bulletSizeCO - - - - QComboBox - - - text - default - - - - - text - tiny - - - - - text - script - - - - - text - footnote - - - - - text - small - - - - - text - normal - - - - - text - large - - - - - text - Large - - - - - text - LARGE - - - - - text - huge - - - - - text - Huge - - - - name - bulletSizeCO - - - - - - QLayoutWidget - - name - Layout50 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer32 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QButtonGroup - - name - bulletDepthBG - - - title - Bullet Depth - - - exclusive - true - - - - margin - 11 - - - spacing - 6 - - - QToolButton - - name - bulletDepth1PB - - - text - &1 - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletDepth2PB - - - text - &2 - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletDepth3PB - - - text - &3 - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletDepth4PB - - - text - &4 - - - toggleButton - true - - - toggleButton - true - - - - - - - - - - - name - Spacer1 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout47 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer27 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QButtonGroup - - name - bulletTypeBG - - - frameShape - NoFrame - - - title - - - - radioButtonExclusive - false - - - layoutSpacing - - - - name - Spacer26 - - - orientation - Horizontal - - - sizeType - Fixed - - - sizeHint - - 20 - 20 - - - - - QToolButton - - name - bullet10PB - - - geometry - - 98 - 33 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet11PB - - - geometry - - 121 - 33 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet12PB - - - geometry - - 144 - 33 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet13PB - - - geometry - - 167 - 33 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet14PB - - - geometry - - 190 - 33 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet15PB - - - geometry - - 213 - 33 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet21PB - - - geometry - - 121 - 55 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet20PB - - - geometry - - 98 - 55 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet22PB - - - geometry - - 144 - 55 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet23PB - - - geometry - - 167 - 55 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet24PB - - - geometry - - 190 - 55 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet25PB - - - geometry - - 213 - 55 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet30PB - - - geometry - - 98 - 77 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet31PB - - - geometry - - 121 - 77 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet32PB - - - geometry - - 144 - 77 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet34PB - - - geometry - - 190 - 77 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet35PB - - - geometry - - 213 - 77 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet42PB - - - geometry - - 144 - 99 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet43PB - - - geometry - - 167 - 99 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet44PB - - - geometry - - 190 - 99 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet45PB - - - geometry - - 213 - 99 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet50PB - - - geometry - - 98 - 121 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet51PB - - - geometry - - 121 - 121 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet52PB - - - geometry - - 144 - 121 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet53PB - - - geometry - - 167 - 121 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet54PB - - - geometry - - 190 - 121 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet55PB - - - geometry - - 213 - 121 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet40PB - - - geometry - - 98 - 99 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet41PB - - - geometry - - 121 - 99 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletPanelStandardPB - - - geometry - - 11 - 11 - 66 - 22 - - - - text - &Standard - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletPanelMathsPB - - - geometry - - 11 - 33 - 66 - 22 - - - - text - &Maths - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletPanelDing1PB - - - geometry - - 11 - 55 - 66 - 22 - - - - text - &Ding 1 - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletPanelDing2PB - - - geometry - - 11 - 77 - 66 - 22 - - - - text - D&ing 2 - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletPanelDing3PB - - - geometry - - 11 - 99 - 66 - 22 - - - - text - Di&ng 3 - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bulletDing4PB - - - geometry - - 11 - 121 - 66 - 22 - - - - text - Din&g 4 - - - - QToolButton - - name - bullet33PB - - - geometry - - 167 - 77 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet00PB - - - geometry - - 98 - 11 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet01PB - - - geometry - - 121 - 11 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet02PB - - - geometry - - 144 - 11 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet03PB - - - geometry - - 167 - 11 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet04PB - - - geometry - - 190 - 11 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - QToolButton - - name - bullet05PB - - - geometry - - 213 - 11 - 23 - 22 - - - - sizePolicy - - 0 - 0 - - - - text - - - - toggleButton - true - - - toggleButton - true - - - - - - name - Spacer28 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout45 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer29 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout42 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - latexLA - - - text - &LaTeX - - - buddy - latexED - - - - QLineEdit - - name - latexED - - - maxLength - 80 - - - - - - - name - Spacer30 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - - - QLabel - - name - warningLA - - - palette - - - - 0 - 0 - 0 - - - 220 - 220 - 220 - - - 255 - 255 - 255 - - - 237 - 237 - 237 - - - 110 - 110 - 110 - - - 146 - 146 - 146 - - - 255 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 0 - 128 - 128 - - - 255 - 255 - 255 - - - - - 128 - 128 - 128 - - - 220 - 220 - 220 - - - 255 - 255 - 255 - - - 253 - 253 - 253 - - - 110 - 110 - 110 - - - 146 - 146 - 146 - - - 255 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 0 - 128 - 128 - - - 255 - 255 - 255 - - - - - 0 - 0 - 0 - - - 220 - 220 - 220 - - - 255 - 255 - 255 - - - 253 - 253 - 253 - - - 110 - 110 - 110 - - - 146 - 146 - 146 - - - 255 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 0 - 128 - 128 - - - 255 - 255 - 255 - - - - - - font - - 1 - - - - text - - - - alignment - AlignCenter - - - hAlign - - - + QLayoutWidget name - Layout54 + Layout2 + + + caption + @@ -4419,10 +49,74 @@ spacing 6 + + QPushButton + + name + defaultPB + + + sizePolicy + + 3 + 0 + + + + text + Use Class Defaults + + + + QPushButton + + name + savePB + + + sizePolicy + + 3 + 0 + + + + text + Save as Document Defaults + + + + + + QLayoutWidget + + name + Layout3 + + + + margin + 0 + + + spacing + 6 + + + QPushButton + + name + restorePB + + + text + &Restore + + name - Spacer39 + Spacer1 orientation @@ -4440,17 +134,6 @@ - - QPushButton - - name - restorePB - - - text - &Restore - - QPushButton @@ -4459,11 +142,7 @@ text - OK - - - default - true + &OK @@ -4485,418 +164,124 @@ text - Cancel + &Cancel - + + QListBox + + name + moduleLB + + + sizePolicy + + 1 + 7 + + + + + QLayoutWidget + + name + Layout3 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + titleL + + + sizePolicy + + 7 + 1 + + + + text + title here + + + + Line + + name + Line1 + + + sizePolicy + + 1 + 0 + + + + orientation + Horizontal + + + + QWidgetStack + + name + moduleStack + + + + + + + + QWidgetStack +
qwidgetstack.h
+ + 0 + -1 + + 0 + + 7 + 7 + + image0 + raiseWidget(int) +
+
+ + + image0 + 789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753 + + - okPB - clicked() - QDocumentDialogBase - slotOK() + moduleLB + highlighted(int) + moduleStack + raiseWidget(int) - restorePB - clicked() + moduleLB + highlighted(int) QDocumentDialogBase - slotRestore() + setTitle(int) - - paperPackageCO - activated(int) - QDocumentDialogBase - slotSpecialPaperPackage(int) - - - orientationBG - clicked(int) - QDocumentDialogBase - slotOrientation(int) - - - papersize2CO - activated(int) - QDocumentDialogBase - slotPapersize(int) - - - useGeometryCB - toggled(bool) - QDocumentDialogBase - slotUseGeometryPackage(bool) - - - customWidthED - textChanged(const QString&) - QDocumentDialogBase - slotWidth(const QString&) - - - customHeightED - textChanged(const QString&) - QDocumentDialogBase - slotHeight(const QString&) - - - topMarginED - textChanged(const QString&) - QDocumentDialogBase - slotMarginTop(const QString&) - - - bottomMarginED - textChanged(const QString&) - QDocumentDialogBase - slotMarginBottom(const QString&) - - - leftMarginED - textChanged(const QString&) - QDocumentDialogBase - slotMarginLeft(const QString&) - - - rightMarginED - textChanged(const QString&) - QDocumentDialogBase - slotMarginRight(const QString&) - - - headHeightED - textChanged(const QString&) - QDocumentDialogBase - slotHeadheight(const QString&) - - - headSepED - textChanged(const QString&) - QDocumentDialogBase - slotHeadsep(const QString&) - - - footSkipED - textChanged(const QString&) - QDocumentDialogBase - slotFootskip(const QString&) - - - docClassCO - activated(int) - QDocumentDialogBase - slotClass(int) - - - docPagestyleCO - activated(int) - QDocumentDialogBase - slotPageStyle(int) - - - docFontsCO - activated(int) - QDocumentDialogBase - slotFont(int) - - - docFontSizeCO - activated(int) - QDocumentDialogBase - slotFontSize(int) - - - docExtraED - textChanged(const QString&) - QDocumentDialogBase - slotExtraOptions(const QString&) - - - docSkipCO - activated(int) - QDocumentDialogBase - slotDefaultSkip(int) - - - docSkipED - textChanged(const QString&) - QDocumentDialogBase - slotDefaultSkip(const QString&) - - - docSpacingCO - activated(int) - QDocumentDialogBase - slotSpacing(int) - - - docSpacingED - textChanged(const QString&) - QDocumentDialogBase - slotSpacing(const QString&) - - - sidesBG - clicked(int) - QDocumentDialogBase - slotSides(int) - - - columnsBG - clicked(int) - QDocumentDialogBase - slotColumns(int) - - - separationBG - clicked(int) - QDocumentDialogBase - slotSeparation(int) - - - languageCO - activated(int) - QDocumentDialogBase - slotLanguage(int) - - - inputEncCO - activated(int) - QDocumentDialogBase - slotEncoding(int) - - - quotesLanguageCO - activated(int) - QDocumentDialogBase - slotQuoteStyle(int) - - - quoteStyleBG - clicked(int) - QDocumentDialogBase - slotQuoteStyle(int) - - - floatPlacementED - textChanged(const QString&) - QDocumentDialogBase - slotFloatPlacement(const QString&) - - - secNumDepthSB - valueChanged(int) - QDocumentDialogBase - slotSectionNumberDepth(int) - - - tocDepthSB - valueChanged(int) - QDocumentDialogBase - slotTOCDepth(int) - - - postscriptDriverCO - activated(int) - QDocumentDialogBase - slotPSDriver(int) - - - useAmsMathCB - toggled(bool) - QDocumentDialogBase - slotAMSMath(bool) - - - applyPB - clicked() - QDocumentDialogBase - slotApply() - - - cancelPB - clicked() - QDocumentDialogBase - slotClose() - - - latexED - textChanged(const QString&) - QDocumentDialogBase - slotBulletLaTeX(const QString&) - - - bulletPanelStandardPB - clicked() - QDocumentDialogBase - slotBulletStandard() - - - bulletPanelMathsPB - clicked() - QDocumentDialogBase - slotBulletMaths() - - - bulletPanelDing1PB - clicked() - QDocumentDialogBase - slotBulletDing1() - - - bulletPanelDing2PB - clicked() - QDocumentDialogBase - slotBulletDing2() - - - bulletPanelDing3PB - clicked() - QDocumentDialogBase - slotBulletDing3() - - - bulletDing4PB - clicked() - QDocumentDialogBase - slotBulletDing4() - - - bulletTypeBG - clicked(int) - QDocumentDialogBase - slotBulletSymbol(int) - - - bulletSizeCO - activated(int) - QDocumentDialogBase - slotBulletSize(int) - - - bulletDepth1PB - clicked() - QDocumentDialogBase - slotBulletDepth1() - - - bulletDepth2PB - clicked() - QDocumentDialogBase - slotBulletDepth2() - - - bulletDepth3PB - clicked() - QDocumentDialogBase - slotBulletDing3() - - - bulletDepth4PB - clicked() - QDocumentDialogBase - slotBulletDepth4() - - slotAMSMath(bool) - slotApply() - slotBulletDepth1() - slotBulletDepth2() - slotBulletDepth3() - slotBulletDepth4() - slotBulletDing1() - slotBulletDing2() - slotBulletDing3() - slotBulletDing4() - slotBulletLaTeX(const QString&) - slotBulletMaths() - slotBulletSize(int) - slotBulletStandard() - slotBulletSymbol(int) - slotClass(int) - slotClose() - slotColumns(int) - slotDefaultSkip(const QString&) - slotDefaultSkip(int) - slotEncoding(int) - slotExtraOptions(const QString&) - slotFloatPlacement(const QString&) - slotFont(int) - slotFontSize(int) - slotFootskip(const QString&) - slotHeadheight(const QString&) - slotHeadsep(const QString&) - slotHeight(const QString&) - slotLanguage(int) - slotMarginBottom(const QString&) - slotMarginLeft(const QString&) - slotMarginRight(const QString&) - slotMarginTop(const QString&) - slotOK() - slotOrientation(int) - slotPSDriver(int) - slotPageStyle(int) - slotPapersize(int) - slotQuoteStyle(int) - slotQuoteType(int) - slotRestore() - slotSectionNumberDepth(int) - slotSeparation(int) - slotSides(int) - slotSpacing(const QString&) - slotSpacing(int) - slotSpecialPaperPackage(int) - slotTOCDepth(int) - slotUseGeometryPackage(bool) - slotWidth(const QString&) + change_adaptor() + setTitle(int) - - docClassCO - docPagestyleCO - docFontsCO - docFontSizeCO - docExtraED - docSkipCO - docSkipED - docSpacingCO - docSpacingED - docSidesOneRB - docSidesTwoRB - docColumnsOneRB - docColumnsTwoRB - docIndentRB - docSkipRB - papersize2CO - paperPackageCO - useGeometryCB - portraitRB - landscapeRB - topMarginED - bottomMarginED - leftMarginED - rightMarginED - customWidthED - customHeightED - headHeightED - headSepED - footSkipED - languageCO - inputEncCO - quotesLanguageCO - singleRB - doubleRB - floatPlacementED - secNumDepthSB - tocDepthSB - postscriptDriverCO - useAmsMathCB - bulletSizeCO - latexED - restorePB - okPB - applyPB - cancelPB - TabWidget2 - diff --git a/src/frontends/qt2/ui/QGraphicsDialog.ui b/src/frontends/qt2/ui/QGraphicsDialog.ui index 985cc33776..a60bf19140 100644 --- a/src/frontends/qt2/ui/QGraphicsDialog.ui +++ b/src/frontends/qt2/ui/QGraphicsDialog.ui @@ -13,8 +13,8 @@ 0 0 - 332 - 470 + 430 + 484 @@ -54,7 +54,7 @@ title &Graphics - + margin 11 @@ -63,7 +63,7 @@ spacing 6 - + QLayoutWidget name @@ -125,17 +125,17 @@ - + QGroupBox name - GroupBox5 + rotateGB title - LyX display + Rotation - + margin 11 @@ -145,289 +145,147 @@ 6 - QCheckBox + QLabel name - displayCB + angleL_2 text - &Show in LyX + A&ngle: + + + buddy + angle toolTip - Display image in LyX + Angle to rotate image by - QLayoutWidget + QLineEdit name - Layout22 + angle + + + sizePolicy + + 3 + 0 + + + + toolTip + Angle to rotate image by - - - margin - 0 - - - spacing - 6 - - - - name - Spacer42 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout19 - - - - margin - 0 - - - spacing - 6 - - - QComboBox - - - text - Default - - - - - text - Monochrome - - - - - text - Grayscale - - - - - text - Color - - - - name - showCB - - - toolTip - Screen display - - - - - name - Spacer18 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QLabel - - name - TextLabel1 - - - text - Display : - - - buddy - showCB - - - toolTip - Screen display - - - - QLayoutWidget - - name - Layout20 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - displayscale - - - enabled - true - - - sizePolicy - - 1 - 0 - - - - toolTip - Percentage to scale by in LyX - - - - QLabel - - name - TextLabel4_2_2 - - - enabled - false - - - text - % - - - - - name - Spacer17_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer41 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLabel - - name - scaleLA - - - text - Scale : - - - buddy - displayscale - - - toolTip - Percentage to scale by in LyX - - - - - + + QLabel + name - Spacer75_2 + originL_2 - orientation - Vertical - - - sizeType - Expanding + text + &Origin: - sizeHint - - 20 - 20 - + buddy + origin - - + + toolTip + The origin of the rotation + + + + QComboBox + + + text + default + + + + + text + Top left + + + + + text + Bottom left + + + + + text + Left baseline + + + + + text + Center + + + + + text + Top center + + + + + text + Bottom center + + + + + text + Center baseline + + + + + text + Top right + + + + + text + Bottom right + + + + + text + Right baseline + + + + + text + Reference point + + + + name + origin + + + toolTip + The origin of the rotation + + + - + QGroupBox name @@ -437,7 +295,7 @@ title Output - + margin 11 @@ -446,11 +304,30 @@ spacing 6 - + + QLabel + + name + sizeheightL_2 + + + enabled + true + + + text + &Height + + + buddy + height + + + QLayoutWidget name - Layout23 + Layout19_2 @@ -462,234 +339,126 @@ 6 - QLayoutWidget + QLineEdit name - Layout32_2 + height + + + enabled + true + + + toolTip + Height of image in output - - - margin - 0 - - - spacing - 6 - - - QLayoutWidget - - name - Layout26_2 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - sizewidthL_2 - - - enabled - true - - - text - &Width - - - buddy - width - - - - QLayoutWidget - - name - Layout18_2 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - width - - - enabled - true - - - toolTip - Width of image in output - - - - LengthCombo - - name - widthUnit - - - enabled - true - - - minimumSize - - 50 - 0 - - - - focusPolicy - StrongFocus - - - toolTip - Width unit - - - - - - - - QLayoutWidget - - name - Layout31_2 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - sizeheightL_2 - - - enabled - true - - - text - &Height - - - buddy - height - - - - QLayoutWidget - - name - Layout19_2 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - height - - - enabled - true - - - toolTip - Height of image in output - - - - LengthCombo - - name - heightUnit - - - enabled - true - - - minimumSize - - 50 - 0 - - - - focusPolicy - StrongFocus - - - toolTip - Height unit - - - - - - - - - + + LengthCombo + name - Spacer46 + heightUnit - orientation - Horizontal + enabled + true - sizeType - Expanding - - - sizeHint + minimumSize - 20 - 20 + 50 + 0 - + + focusPolicy + StrongFocus + + + toolTip + Height unit + + - + + QLabel + + name + sizewidthL_2 + + + enabled + true + + + text + &Width + + + buddy + width + + + + QLayoutWidget + + name + Layout18_2 + + + + margin + 0 + + + spacing + 6 + + + QLineEdit + + name + width + + + enabled + true + + + toolTip + Width of image in output + + + + LengthCombo + + name + widthUnit + + + enabled + true + + + minimumSize + + 50 + 0 + + + + focusPolicy + StrongFocus + + + toolTip + Width unit + + + + + QCheckBox name @@ -708,40 +477,19 @@ Maintain aspect ratio with largest dimension - - - name - Spacer47 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - + - + QGroupBox name - rotateGB + GroupBox5 title - Rotation + LyX display - + margin 11 @@ -750,179 +498,134 @@ spacing 6 - - QLayoutWidget + + QCheckBox name - Layout22 + displayCB + + + text + &Show in LyX + + + toolTip + Display image in LyX - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - angleL_2 - - - text - A&ngle: - - - buddy - angle - - - toolTip - Angle to rotate image by - - - - QLineEdit - - name - angle - - - toolTip - Angle to rotate image by - - - - QLabel - - name - originL_2 - - - text - &Origin: - - - buddy - origin - - - toolTip - The origin of the rotation - - - - QComboBox - - - text - default - - - - - text - Top left - - - - - text - Bottom left - - - - - text - Left baseline - - - - - text - Center - - - - - text - Top center - - - - - text - Bottom center - - - - - text - Center baseline - - - - - text - Top right - - - - - text - Bottom right - - - - - text - Right baseline - - - - - text - Reference point - - - - name - origin - - - toolTip - The origin of the rotation - - - - - name - Spacer21 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - + + QLabel + + name + TextLabel1 + + + text + Display : + + + buddy + showCB + + + toolTip + Screen display + + + + QComboBox + + + text + Default + + + + + text + Monochrome + + + + + text + Grayscale + + + + + text + Color + + + + name + showCB + + + toolTip + Screen display + + + + QLabel + + name + scaleLA + + + text + Scale : + + + buddy + displayscale + + + toolTip + Percentage to scale by in LyX + + + + QLabel + + name + TextLabel4_2_2 + + + enabled + false + + + text + % + + + + QLineEdit + + name + displayscale + + + enabled + true + + + sizePolicy + + 5 + 0 + + + + toolTip + Percentage to scale by in LyX + + + - + QWidget @@ -934,7 +637,7 @@ title &Clipping - + margin 11 @@ -943,12 +646,16 @@ spacing 6 - + QFrame name Frame3 + + enabled + true + sizePolicy @@ -973,609 +680,230 @@ spacing 6 - - - name - Spacer26 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget + + QLabel name - Layout29 + rtL + + + text + Right &top: + + + buddy + rtX - - - margin - 0 - - - spacing - 6 - - - - name - Spacer49 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout27 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - lbL - - - text - &Left bottom: - - - buddy - lbX - - - - QLayoutWidget - - name - Layout25 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - xL - - - text - x - - - - QLayoutWidget - - name - Layout25 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - lbX - - - toolTip - - - - - QComboBox - - - text - pt - - - - - text - cm - - - - - text - in - - - - name - lbXunit - - - - - - - - QLayoutWidget - - name - Layout24 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - yL - - - text - y - - - - QLayoutWidget - - name - Layout25_3 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - lbY - - - - QComboBox - - - text - pt - - - - - text - cm - - - - - text - in - - - - name - lbYunit - - - - - - - - - - - - name - Spacer25 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget + + QLabel name - Layout30 + yL_2 - - - margin - 0 + + text + y + + + + QLineEdit + + name + rtY + + + + QComboBox + + + text + pt - - spacing - 6 + + + + text + cm - - QLayoutWidget - - name - Layout30 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - rtL - - - text - Right &top: - - - buddy - rtX - - - - QLayoutWidget - - name - Layout29 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - xL_2 - - - text - x - - - - QLayoutWidget - - name - Layout25_2 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - rtX - - - - QComboBox - - - text - pt - - - - - text - cm - - - - - text - in - - - - name - rtXunit - - - - - - - - QLayoutWidget - - name - Layout28 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - yL_2 - - - text - y - - - - QLayoutWidget - - name - Layout25_2_2 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - rtY - - - - QComboBox - - - text - pt - - - - - text - cm - - - - - text - in - - - - name - rtYunit - - - - - - - - - - - name - Spacer25_2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - + + + + text + in + + + + name + rtYunit + + + + QLabel + + name + xL_2 + + + text + x + + + + QLineEdit + + name + rtX + + + + QComboBox + + + text + pt + + + + + text + cm + + + + + text + in + + + + name + rtXunit + + + + QComboBox + + + text + pt + + + + + text + cm + + + + + text + in + + + + name + lbXunit + + + + QLabel + + name + yL + + + text + y + + + + QComboBox + + + text + pt + + + + + text + cm + + + + + text + in + + + + name + lbYunit + + + + QLabel + + name + xL + + + text + x + + + + QLineEdit + + name + lbY + + + + QLineEdit + + name + lbX + + + toolTip + + + + + QLabel + + name + lbL + + + text + &Left bottom: + + + buddy + lbX + - - QLayoutWidget + + QPushButton name - Layout24 + getPB - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - getPB - - - text - &Get from file - - - toolTip - Get bounding box from the EPS file - - - - - name - Spacer48 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QLayoutWidget - name - Layout17 + text + &Get from file + + + toolTip + Get bounding box from the EPS file - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - clip - - - text - Clip to &bounding box - - - toolTip - Clip to bounding box (FIXME: what ??) - - - - - name - Spacer7 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - + name Spacer48_2 @@ -1596,35 +924,14 @@ - - - - QWidget - - name - tab - - - title - E&xtra options - - - - margin - 11 - - - spacing - 6 - - + name - Spacer72 + Spacer48 orientation - Vertical + Horizontal sizeType @@ -1638,7 +945,43 @@ - + + QCheckBox + + name + clip + + + text + Clip to &bounding box + + + toolTip + Clip to bounding box (FIXME: what ??) + + + + + + QWidget + + name + tab + + + title + E&xtra options + + + + margin + 11 + + + spacing + 6 + + QCheckBox name @@ -1653,65 +996,74 @@ Is this just one part of a figure float ? - - QLayoutWidget + + QCheckBox name - Layout22 + unzipCB + + + text + Don't un&zip on export + + + toolTip + Don't uncompress image before exporting to LaTeX - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - CaptionLA - - - text - Ca&ption : - - - buddy - subcaption - - - toolTip - The caption for the sub-figure - - - - QLineEdit - - name - subcaption - - - enabled - false - - - toolTip - The caption for the sub-figure - - - - + + QLabel + + name + latexoptionsLA + + + text + LaTeX &options: + + + buddy + latexoptions + + + toolTip + Additional LaTeX options + + + + QLineEdit + + name + latexoptions + + + toolTip + Additional LaTeX options + + + + QCheckBox + + name + draftCB + + + text + &Draft mode + + + toolTip + Draft mode + + + name - Spacer73 + Spacer37 orientation - Vertical + Horizontal sizeType @@ -1725,61 +1077,14 @@ - - QLayoutWidget - - name - Layout26 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - latexoptionsLA - - - text - LaTeX &options: - - - buddy - latexoptions - - - toolTip - Additional LaTeX options - - - - QLineEdit - - name - latexoptions - - - toolTip - Additional LaTeX options - - - - - + name - Spacer74 + Spacer38 orientation - Vertical + Horizontal sizeType @@ -1793,67 +1098,14 @@ - - QLayoutWidget - - name - Layout18 - - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - draftCB - - - text - &Draft mode - - - toolTip - Draft mode - - - - - name - Spacer8_3 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - + name - Spacer75 + Spacer36 orientation - Vertical + Horizontal sizeType @@ -1867,60 +1119,41 @@ - - QLayoutWidget + + QLabel name - Layout18_3 + CaptionLA + + + text + Ca&ption : + + + buddy + subcaption + + + toolTip + The caption for the sub-figure - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - unzipCB - - - text - Don't un&zip on export - - - toolTip - Don't uncompress image before exporting to LaTeX - - - - - name - Spacer8_2_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - + + QLineEdit + + name + subcaption + + + enabled + false + + + toolTip + The caption for the sub-figure + + + name Spacer76 @@ -1941,7 +1174,7 @@ - + diff --git a/src/frontends/qt2/ui/QPrintDialog.ui b/src/frontends/qt2/ui/QPrintDialog.ui index dd8da3d532..e93ba08090 100644 --- a/src/frontends/qt2/ui/QPrintDialog.ui +++ b/src/frontends/qt2/ui/QPrintDialog.ui @@ -13,8 +13,8 @@ 0 0 - 225 - 395 + 407 + 454 @@ -25,7 +25,7 @@ sizeGripEnabled true - + margin 11 @@ -34,144 +34,7 @@ spacing 6 - - QButtonGroup - - name - ButtonGroup1 - - - title - Print Destination - - - layoutSpacing - - - - margin - 11 - - - spacing - 6 - - - QLineEdit - - name - fileED - - - enabled - true - - - toolTip - Send output to a file - - - - QLayoutWidget - - name - Layout5 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - browsePB - - - enabled - true - - - text - &Browse ... - - - - - name - Spacer15 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QRadioButton - - name - printerRB - - - text - P&rinter - - - checked - true - - - toolTip - Send output to the printer - - - - QLineEdit - - name - printerED - - - toolTip - Send output to the given printer - - - - QRadioButton - - name - fileRB - - - text - &File - - - toolTip - Send output to a file - - - - - + QButtonGroup name @@ -357,7 +220,7 @@ - + QGroupBox name @@ -437,7 +300,7 @@ - + QLayoutWidget name @@ -501,7 +364,106 @@ - + + QButtonGroup + + name + ButtonGroup1 + + + title + Print Destination + + + layoutSpacing + + + + margin + 11 + + + spacing + 6 + + + QRadioButton + + name + printerRB + + + text + P&rinter + + + checked + true + + + toolTip + Send output to the printer + + + + QLineEdit + + name + printerED + + + toolTip + Send output to the given printer + + + + QRadioButton + + name + fileRB + + + text + &File + + + toolTip + Send output to a file + + + + QLineEdit + + name + fileED + + + enabled + true + + + toolTip + Send output to a file + + + + QPushButton + + name + browsePB + + + enabled + true + + + text + &Browse ... + + + + + diff --git a/src/frontends/qt2/ui/QRefDialog.ui b/src/frontends/qt2/ui/QRefDialog.ui index 814b1e8d8b..ac388b5159 100644 --- a/src/frontends/qt2/ui/QRefDialog.ui +++ b/src/frontends/qt2/ui/QRefDialog.ui @@ -13,8 +13,8 @@ 0 0 - 363 - 425 + 348 + 439 @@ -25,7 +25,7 @@ sizeGripEnabled true - + margin 11 @@ -34,11 +34,11 @@ spacing 6 - + QLayoutWidget name - Layout5 + Layout7 @@ -49,144 +49,19 @@ spacing 6 - - QLabel - - name - bufferL - - - text - &Document: - - - buddy - bufferCO - - - - QComboBox - - name - bufferCO - - - sizePolicy - - 7 - 0 - - - - - - - - name - Spacer4 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout4 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - refsL - - - text - Available references in selected document: - - - - QListBox - - name - refsLB - - - enabled - true - - - sizePolicy - - 7 - 3 - - - - toolTip - Available references - - - - - - QLayoutWidget - - name - Layout3 - - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - sortCB - - - text - Sort - - - toolTip - Sort references in alphabetical order - - QPushButton name updatePB + + sizePolicy + + 3 + 0 + + text &Update @@ -218,221 +93,160 @@ Move the document cursor to reference - - - name - Spacer2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget + + QCheckBox name - Layout2 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - referenceED - - - - QComboBox - - - text - <reference> - - - - - text - <page> - - - - - text - on page <page> - - - - - text - <reference> on page <page> - - - - - text - Formatted reference - - - - name - typeCO - - - sizePolicy - - 1 - 0 - - - - toolTip - Reference as it appears in output - - - - QLabel - - name - referenceL - - - text - &Reference: - - - alignment - AlignVCenter|AlignLeft - - - buddy - referenceED - - - hAlign - - - - QLabel - - name - typeLA - - - text - &Format: - - - alignment - AlignVCenter|AlignLeft - - - buddy - typeLA - - - hAlign - - - - - - - name - Spacer3 + sortCB - orientation - Horizontal - - - sizeType - MinimumExpanding + text + Sort - sizeHint - - 20 - 20 - + toolTip + Sort references in alphabetical order - - - QLayoutWidget + + + QLineEdit name - Layout6 + referenceED - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - nameL - - - enabled - false - - - text - &Name: - - - alignment - AlignVCenter|AlignLeft - - - buddy - nameED - - - hAlign - - - - QLineEdit - - name - nameED - - - enabled - false - - - - + + QComboBox + + + text + <reference> + + + + + text + <page> + + + + + text + on page <page> + + + + + text + <reference> on page <page> + + + + + text + Formatted reference + + + + name + typeCO + + + sizePolicy + + 1 + 0 + + + + toolTip + Reference as it appears in output + + + + QLabel + + name + referenceL + + + text + &Reference: + + + alignment + AlignVCenter|AlignLeft + + + buddy + referenceED + + + hAlign + + + + QLabel + + name + typeLA + + + text + &Format: + + + alignment + AlignVCenter|AlignLeft + + + buddy + typeLA + + + hAlign + + + + QLabel + + name + nameL + + + enabled + false + + + text + &Name: + + + alignment + AlignVCenter|AlignLeft + + + buddy + nameED + + + hAlign + + + + QLineEdit + + name + nameED + + + enabled + false + + + QLayoutWidget name @@ -496,7 +310,69 @@ - + + QLabel + + name + refsL + + + text + Available references in selected document: + + + + QListBox + + name + refsLB + + + enabled + true + + + sizePolicy + + 7 + 3 + + + + toolTip + Available references + + + + QLabel + + name + bufferL + + + text + &Document: + + + buddy + bufferCO + + + + QComboBox + + name + bufferCO + + + sizePolicy + + 7 + 0 + + + +