From 83ceb3c57b371c71c1706ecc371e624162f5ccef Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 14 Dec 2003 13:47:40 +0000 Subject: [PATCH] Minipage is no more (long live the box inset) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8246 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 + src/factory.C | 5 +- src/frontends/controllers/ChangeLog | 5 + src/frontends/controllers/ControlMinipage.C | 45 --- src/frontends/controllers/ControlMinipage.h | 40 -- src/frontends/controllers/Makefile.am | 2 - src/frontends/qt2/ChangeLog | 9 + src/frontends/qt2/Dialogs.C | 8 +- src/frontends/qt2/Makefile.am | 1 - src/frontends/qt2/Makefile.dialogs | 2 - src/frontends/qt2/QMinipage.C | 114 ------ src/frontends/qt2/QMinipage.h | 40 -- src/frontends/qt2/QMinipageDialog.C | 47 --- src/frontends/qt2/QMinipageDialog.h | 32 -- src/frontends/qt2/ui/QMinipageDialogBase.ui | 388 -------------------- src/frontends/xforms/ChangeLog | 8 + src/frontends/xforms/Dialogs.C | 24 +- src/frontends/xforms/FormMinipage.C | 129 ------- src/frontends/xforms/FormMinipage.h | 39 -- src/frontends/xforms/Makefile.am | 2 - src/frontends/xforms/forms/Makefile.am | 1 - src/frontends/xforms/forms/form_minipage.fd | 286 --------------- src/insets/ChangeLog | 4 + src/insets/Makefile.am | 2 - src/insets/insetminipage.C | 336 ----------------- src/insets/insetminipage.h | 124 ------- src/lyxfunc.C | 13 +- 27 files changed, 46 insertions(+), 1666 deletions(-) delete mode 100644 src/frontends/controllers/ControlMinipage.C delete mode 100644 src/frontends/controllers/ControlMinipage.h delete mode 100644 src/frontends/qt2/QMinipage.C delete mode 100644 src/frontends/qt2/QMinipage.h delete mode 100644 src/frontends/qt2/QMinipageDialog.C delete mode 100644 src/frontends/qt2/QMinipageDialog.h delete mode 100644 src/frontends/qt2/ui/QMinipageDialogBase.ui delete mode 100644 src/frontends/xforms/FormMinipage.C delete mode 100644 src/frontends/xforms/FormMinipage.h delete mode 100644 src/frontends/xforms/forms/form_minipage.fd delete mode 100644 src/insets/insetminipage.C delete mode 100644 src/insets/insetminipage.h diff --git a/src/ChangeLog b/src/ChangeLog index 7ccf3e4e40..99346b882d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-12-14 Jürgen Spitzmüller + + * factory.C: + * lyxfunc.C: remove insetminipage. "minipage-insert" + now produces a frameless minipage box inset. + 2003-12-12 Alfredo Braunstein * textcursor.[Ch] (selStart,selEnd): add new methods diff --git a/src/factory.C b/src/factory.C index 20a85fbabd..387a3a5f02 100644 --- a/src/factory.C +++ b/src/factory.C @@ -40,7 +40,6 @@ #include "insets/insetlabel.h" #include "insets/insetline.h" #include "insets/insetmarginal.h" -#include "insets/insetminipage.h" #include "insets/insetnote.h" #include "insets/insetbox.h" #include "insets/insetbranch.h" @@ -86,7 +85,7 @@ InsetOld * createInset(FuncRequest const & cmd) return new InsetPagebreak; case LFUN_INSET_MINIPAGE: - return new InsetMinipage(params); + return new InsetBox(params, "Frameless"); case LFUN_INSERT_CHARSTYLE: { string s = cmd.getArg(0); @@ -444,7 +443,7 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf) } else if (tmptok == "OptArg") { inset.reset(new InsetOptArg(buf.params())); } else if (tmptok == "Minipage") { - inset.reset(new InsetMinipage(buf.params())); + inset.reset(new InsetBox(buf.params(), "Frameless")); } else if (tmptok == "Float") { lex.next(); string tmptok = lex.getString(); diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 86deb176d8..8bbbec0bb8 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2003-12-14 Jürgen Spitzmüller + + * ControlMinipage.[Ch]: remove. + * Makefile.am: remove minipage files. + 2003-12-12 Martin Vermeer * ControlMath.C (dispatchSubscript, dispatchSuperscript): enable diff --git a/src/frontends/controllers/ControlMinipage.C b/src/frontends/controllers/ControlMinipage.C deleted file mode 100644 index ecee9dfd00..0000000000 --- a/src/frontends/controllers/ControlMinipage.C +++ /dev/null @@ -1,45 +0,0 @@ -/** - * \file ControlMinipage.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Jürgen Vigna - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "ControlMinipage.h" -#include "funcrequest.h" - - -using std::string; - - -ControlMinipage::ControlMinipage(Dialog & parent) - : Dialog::Controller(parent) -{} - - -bool ControlMinipage::initialiseParams(string const & data) -{ - InsetMinipage::Params params; - InsetMinipageMailer::string2params(data, params); - params_.reset(new InsetMinipage::Params(params)); - return true; -} - - -void ControlMinipage::clearParams() -{ - params_.reset(); -} - - -void ControlMinipage::dispatchParams() -{ - string const lfun = InsetMinipageMailer::params2string(params()); - kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); -} diff --git a/src/frontends/controllers/ControlMinipage.h b/src/frontends/controllers/ControlMinipage.h deleted file mode 100644 index bdb8fbfb6e..0000000000 --- a/src/frontends/controllers/ControlMinipage.h +++ /dev/null @@ -1,40 +0,0 @@ -// -*- C++ -*- -/** - * \file ControlMinipage.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Jürgen Vigna - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef CONTROLMINIPAGE_H -#define CONTROLMINIPAGE_H - -#include "Dialog.h" -#include "insets/insetminipage.h" - -class ControlMinipage : public Dialog::Controller { -public: - /// - ControlMinipage(Dialog &); - /// - virtual bool initialiseParams(std::string const & data); - /// clean-up on hide. - virtual void clearParams(); - /// clean-up on hide. - virtual void dispatchParams(); - /// - virtual bool isBufferDependent() const { return true; } - /// - InsetMinipage::Params & params() { return *params_.get(); } - /// - InsetMinipage::Params const & params() const { return *params_.get(); } -private: - /// - boost::scoped_ptr params_; -}; - -#endif diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am index 7bbef306b9..2efe63eb97 100644 --- a/src/frontends/controllers/Makefile.am +++ b/src/frontends/controllers/Makefile.am @@ -70,8 +70,6 @@ libcontrollers_la_SOURCES= \ ControlLog.h \ ControlMath.C \ ControlMath.h \ - ControlMinipage.C \ - ControlMinipage.h \ ControlNote.C \ ControlNote.h \ ControlParagraph.C \ diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 66494a90c6..cb636b376c 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2003-12-14 Jürgen Spitzmüller + + * QMinipage.[Ch]: + * QMinipageDialog.[Ch]: + * ui/QMinipageDialogBase.ui: remove from repository. + * Dialogs.C: + * Makefile.am: + * Makefile.dialogs: remove minipage. + 2003-12-12 Angus Leeming * QBranch.C: diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 5b909d0d8e..5ed714492c 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -27,7 +27,6 @@ #include "ControlInclude.h" #include "ControlLog.h" #include "ControlMath.h" -#include "ControlMinipage.h" #include "ControlNote.h" #include "ControlParagraph.h" #include "ControlRef.h" @@ -61,7 +60,6 @@ #include "QIndex.h" #include "QLog.h" #include "QMath.h" -#include "QMinipage.h" #include "QNote.h" #include "QParagraph.h" #include "QRef.h" @@ -90,7 +88,7 @@ char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character", "citation", "error", "errorlist", "ert", "external", "file", "float", "graphics", "include", "index", "label", "log", "mathpanel", "mathdelimiter", "mathmatrix", -"minipage", "note", "paragraph", "ref", "tabular", "tabularcreate", "texinfo", +"note", "paragraph", "ref", "tabular", "tabularcreate", "texinfo", #ifdef HAVE_LIBAIKSAURUS "thesaurus", @@ -217,10 +215,6 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlMath(*dialog)); dialog->setView(new QMathMatrix(*dialog)); dialog->bc().bp(new IgnorantPolicy); - } else if (name == "minipage") { - dialog->setController(new ControlMinipage(*dialog)); - dialog->setView(new QMinipage(*dialog)); - dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "note") { dialog->setController(new ControlNote(*dialog)); dialog->setView(new QNote(*dialog)); diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index 7dcde30f99..44afc20809 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -48,7 +48,6 @@ libqt2_la_SOURCES = \ QLPainter.C QLPainter.h \ QLyXKeySym.C QLyXKeySym.h \ QMath.C QMath.h \ - QMinipage.C QMinipage.h \ QNote.C QNote.h \ QParagraph.C QParagraph.h \ QPrefs.C QPrefs.h \ diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index e1ec999953..57a9f0b4bc 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -35,7 +35,6 @@ UIFILES = \ QLogDialogBase.ui \ QMathDialogBase.ui \ QMathMatrixDialogBase.ui \ - QMinipageDialogBase.ui \ QNoteDialogBase.ui \ QParagraphDialogBase.ui \ QPrefAsciiModule.ui \ @@ -105,7 +104,6 @@ MOCFILES = \ QLPrintDialog.C QLPrintDialog.h \ QMathDialog.C QMathDialog.h \ QMathMatrixDialog.C QMathMatrixDialog.h \ - QMinipageDialog.C QMinipageDialog.h \ QNoteDialog.C QNoteDialog.h \ QParagraphDialog.C QParagraphDialog.h \ QPrefsDialog.C QPrefsDialog.h \ diff --git a/src/frontends/qt2/QMinipage.C b/src/frontends/qt2/QMinipage.C deleted file mode 100644 index 7a062f4c48..0000000000 --- a/src/frontends/qt2/QMinipage.C +++ /dev/null @@ -1,114 +0,0 @@ -/** - * \file QMinipage.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "debug.h" -#include "qt_helpers.h" -#include "support/tostr.h" -#include "support/lstrings.h" -#include "ControlMinipage.h" - -#include "QMinipage.h" -#include "QMinipageDialog.h" -#include "Qt2BC.h" -#include "lengthcombo.h" - -#include -#include - -using lyx::support::strToDbl; - -using std::string; - - -typedef QController > base_class; - -QMinipage::QMinipage(Dialog & parent) - : base_class(parent, _("LyX: Minipage Settings")) -{ -} - - -void QMinipage::build_dialog() -{ - dialog_.reset(new QMinipageDialog(this)); - - bcview().setRestore(dialog_->restorePB); - bcview().setOK(dialog_->okPB); - bcview().setApply(dialog_->applyPB); - bcview().setCancel(dialog_->closePB); - - bcview().addReadOnly(dialog_->widthED); - bcview().addReadOnly(dialog_->unitsLC); - bcview().addReadOnly(dialog_->valignCO); -} - - -void QMinipage::apply() -{ - double const value = strToDbl(fromqstr(dialog_->widthED->text())); - LyXLength::UNIT unit = dialog_->unitsLC->currentLengthItem(); - if (dialog_->widthED->text().isEmpty()) - unit = LyXLength::UNIT_NONE; - - InsetMinipage::Params & params = controller().params(); - - params.width = LyXLength(value, unit); - - switch (dialog_->valignCO->currentItem()) { - case 0: - params.pos = InsetMinipage::top; - break; - case 1: - params.pos = InsetMinipage::center; - break; - case 2: - params.pos = InsetMinipage::bottom; - break; - } -} - - -namespace { - -string const numtostr(double val) -{ - string a(tostr(val)); - if (a == "0") - a.erase(); - return a; -} - -} // namespace anon - - -void QMinipage::update_contents() -{ - InsetMinipage::Params const & params = controller().params(); - - LyXLength len(params.width); - dialog_->widthED->setText(toqstr(numtostr(len.value()))); - dialog_->unitsLC->setCurrentItem(len.unit()); - - int item = 0; - switch (params.pos) { - case InsetMinipage::top: - item = 0; - break; - case InsetMinipage::center: - item = 1; - break; - case InsetMinipage::bottom: - item = 2; - break; - } - dialog_->valignCO->setCurrentItem(item); -} diff --git a/src/frontends/qt2/QMinipage.h b/src/frontends/qt2/QMinipage.h deleted file mode 100644 index b60055c674..0000000000 --- a/src/frontends/qt2/QMinipage.h +++ /dev/null @@ -1,40 +0,0 @@ -// -*- C++ -*- -/** - * \file QMinipage.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef QMINIPAGE_H -#define QMINIPAGE_H - - -#include "QDialogView.h" - - -class ControlMinipage; -class QMinipageDialog; - -/// -class QMinipage - : public QController > -{ -public: - /// - friend class QMinipageDialog; - /// - QMinipage(Dialog &); -private: - /// Apply changes - virtual void apply(); - /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); -}; - -#endif // QMINIPAGE_H diff --git a/src/frontends/qt2/QMinipageDialog.C b/src/frontends/qt2/QMinipageDialog.C deleted file mode 100644 index 884dd00b2b..0000000000 --- a/src/frontends/qt2/QMinipageDialog.C +++ /dev/null @@ -1,47 +0,0 @@ -/** - * \file QMinipageDialog.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#include - - - -#include "QMinipage.h" -#include "QMinipageDialog.h" - -#include - - - -QMinipageDialog::QMinipageDialog(QMinipage * form) - : QMinipageDialogBase(0, 0, false, 0), - form_(form) -{ - connect(restorePB, SIGNAL(clicked()), - form, SLOT(slotRestore())); - connect(okPB, SIGNAL(clicked()), - form, SLOT(slotOK())); - connect(applyPB, SIGNAL(clicked()), - form, SLOT(slotApply())); - connect(closePB, SIGNAL(clicked()), - form, SLOT(slotClose())); -} - - -void QMinipageDialog::closeEvent(QCloseEvent * e) -{ - form_->slotWMHide(); - e->accept(); -} - - -void QMinipageDialog::change_adaptor() -{ - form_->changed(); -} diff --git a/src/frontends/qt2/QMinipageDialog.h b/src/frontends/qt2/QMinipageDialog.h deleted file mode 100644 index 8e7462581f..0000000000 --- a/src/frontends/qt2/QMinipageDialog.h +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -/** - * \file QMinipageDialog.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef QMINIPAGEDIALOG_H -#define QMINIPAGEDIALOG_H - - -#include "ui/QMinipageDialogBase.h" - -class QMinipage; - -class QMinipageDialog : public QMinipageDialogBase { - Q_OBJECT -public: - QMinipageDialog(QMinipage * form); -protected slots: - virtual void change_adaptor(); -protected: - virtual void closeEvent(QCloseEvent * e); -private: - QMinipage * form_; -}; - -#endif // QMINIPAGEDIALOG_H diff --git a/src/frontends/qt2/ui/QMinipageDialogBase.ui b/src/frontends/qt2/ui/QMinipageDialogBase.ui deleted file mode 100644 index 1464da0ef9..0000000000 --- a/src/frontends/qt2/ui/QMinipageDialogBase.ui +++ /dev/null @@ -1,388 +0,0 @@ - -QMinipageDialogBase -config.h -qt_helpers.h -vspace.h - - QDialog - - name - QMinipageDialogBase - - - geometry - - 0 - 0 - 364 - 111 - - - - caption - Minipage settings - - - sizeGripEnabled - true - - - layoutMargin - - - layoutSpacing - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout3 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - widthLA - - - frameShape - MShape - - - frameShadow - MShadow - - - text - &Width: - - - buddy - widthED - - - - QComboBox - - - text - Top - - - - - text - Middle - - - - - text - Bottom - - - - name - valignCO - - - toolTip - Vertical alignment - - - - QLabel - - name - valignLA - - - text - A&lignment: - - - buddy - valignCO - - - - LengthCombo - - name - unitsLC - - - sizePolicy - - 3 - 0 - - - - minimumSize - - 40 - 22 - - - - focusPolicy - StrongFocus - - - toolTip - Units of width value - - - - QLineEdit - - name - widthED - - - sizePolicy - - 1 - 0 - - - - toolTip - Width value - - - - QLabel - - name - unitsLA - - - text - &Units: - - - buddy - unitsLC - - - - - - - name - Spacer1_2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout17 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - restorePB - - - text - &Restore - - - autoDefault - false - - - default - false - - - toolTip - - - - - - name - Spacer1 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - okPB - - - text - &OK - - - default - true - - - toolTip - - - - - QPushButton - - name - applyPB - - - text - &Apply - - - autoDefault - false - - - default - false - - - toolTip - - - - - QPushButton - - name - closePB - - - text - &Close - - - autoDefault - false - - - default - false - - - - - - - - - LengthCombo -
lengthcombo.h
- - -1 - -1 - - 0 - - 5 - 5 - - image0 - selectionChanged(LyXLength::UNIT) -
-
- - - image0 - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - - - - widthED - textChanged(const QString&) - QMinipageDialogBase - change_adaptor() - - - unitsLC - selectionChanged(LyXLength::UNIT) - QMinipageDialogBase - change_adaptor() - - - valignCO - highlighted(const QString&) - QMinipageDialogBase - change_adaptor() - - change_adaptor() - - - widthED - unitsLC - valignCO - restorePB - applyPB - okPB - closePB - -
diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 9cdec68802..78db2944ac 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,11 @@ +2003-12-14 Jürgen Spitzmüller + + * FormMinipage.[Ch]: + * forms/form_minipage.fd: remove from repository. + * Dialogs.C: + * Makefile.am: + * forms/Makefile.am: remove minipage. + 2003-12-10 Angus Leeming * FormExternal.C, forms/form_external.fd: add a 'draft' check box diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index 11444a3c1e..8322fc8c30 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -28,7 +28,6 @@ #include "ControlInclude.h" #include "ControlLog.h" #include "ControlMath.h" -#include "ControlMinipage.h" #include "ControlNote.h" #include "ControlParagraph.h" #include "ControlRef.h" @@ -60,7 +59,6 @@ #include "FormMathsMatrix.h" #include "FormMathsSpace.h" #include "FormMathsStyle.h" -#include "FormMinipage.h" #include "FormNote.h" #include "FormParagraph.h" #include "FormRef.h" @@ -119,7 +117,7 @@ char const * const dialognames[] = { "mathmisc", "mathdots", "mathbigoperators", "mathamsmisc", "mathamsarrows", "mathamsrelations", "mathamsnegatedrelations", "mathamsoperators", "mathdelimiter", "mathmatrix", "mathspace", "mathstyle", -"minipage", "note", "paragraph", "ref", "tabular", "tabularcreate", "texinfo", +"note", "paragraph", "ref", "tabular", "tabularcreate", "texinfo", #ifdef HAVE_LIBAIKSAURUS "thesaurus", @@ -169,6 +167,14 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlBibtex(*dialog)); dialog->setView(new FormBibtex(*dialog)); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); + } else if (name == "box") { + dialog->setController(new ControlBox(*dialog)); + dialog->setView(new FormBox(*dialog)); + dialog->bc().bp(new OkApplyCancelReadOnlyPolicy); + } else if (name == "branch") { + dialog->setController(new ControlBranch(*dialog)); + dialog->setView(new FormBranch(*dialog)); + dialog->bc().bp(new OkApplyCancelReadOnlyPolicy); } else if (name == "character") { dialog->setController(new ControlCharacter(*dialog)); dialog->setView(new FormCharacter(*dialog)); @@ -405,22 +411,10 @@ Dialog * Dialogs::build(string const & name) dialog->setController(new ControlMath(*dialog)); dialog->setView(new FormMathsStyle(*dialog)); dialog->bc().bp(new IgnorantPolicy); - } else if (name == "minipage") { - dialog->setController(new ControlMinipage(*dialog)); - dialog->setView(new FormMinipage(*dialog)); - dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "note") { dialog->setController(new ControlNote(*dialog)); dialog->setView(new FormNote(*dialog)); dialog->bc().bp(new OkApplyCancelReadOnlyPolicy); - } else if (name == "box") { - dialog->setController(new ControlBox(*dialog)); - dialog->setView(new FormBox(*dialog)); - dialog->bc().bp(new OkApplyCancelReadOnlyPolicy); - } else if (name == "branch") { - dialog->setController(new ControlBranch(*dialog)); - dialog->setView(new FormBranch(*dialog)); - dialog->bc().bp(new OkApplyCancelReadOnlyPolicy); } else if (name == "paragraph") { dialog->setController(new ControlParagraph(*dialog)); dialog->setView(new FormParagraph(*dialog)); diff --git a/src/frontends/xforms/FormMinipage.C b/src/frontends/xforms/FormMinipage.C deleted file mode 100644 index 48b65c58d1..0000000000 --- a/src/frontends/xforms/FormMinipage.C +++ /dev/null @@ -1,129 +0,0 @@ -/** - * \file FormMinipage.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Jürgen Vigna - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "FormMinipage.h" -#include "ControlMinipage.h" -#include "forms/form_minipage.h" - -#include "xforms_helpers.h" -#include "xformsBC.h" - -#include "controllers/helper_funcs.h" - -#include "support/lstrings.h" -#include "support/tostr.h" - -#include "lyx_forms.h" - -using lyx::support::getStringFromVector; -using lyx::support::isStrDbl; -using lyx::support::subst; - -using std::string; - - -typedef FormController > base_class; - -FormMinipage::FormMinipage(Dialog & parent) - : base_class(parent, _("Minipage Settings")) -{} - - -void FormMinipage::build() -{ - dialog_.reset(build_minipage(this)); - - // Allow the base class to control messages - setMessageWidget(dialog_->text_warning); - - fl_set_input_return(dialog_->input_width, FL_RETURN_CHANGED); - setPrehandler(dialog_->input_width); - - string const choice = getStringFromVector(getLatexUnits(), "|"); - fl_addto_choice(dialog_->choice_width_units, subst(choice, "%", "%%").c_str()); - - // Manage the ok, apply and cancel/close buttons - bcview().setOK(dialog_->button_ok); - bcview().setApply(dialog_->button_apply); - bcview().setCancel(dialog_->button_close); - bcview().setRestore(dialog_->button_restore); - - bcview().addReadOnly(dialog_->input_width); - bcview().addReadOnly(dialog_->choice_width_units); - bcview().addReadOnly(dialog_->radio_top); - bcview().addReadOnly(dialog_->radio_middle); - bcview().addReadOnly(dialog_->radio_bottom); -} - - -void FormMinipage::apply() -{ - controller().params().width = - LyXLength(getLengthFromWidgets(dialog_->input_width, - dialog_->choice_width_units)); - - if (fl_get_button(dialog_->radio_top)) - controller().params().pos = InsetMinipage::top; - else if (fl_get_button(dialog_->radio_middle)) - controller().params().pos = InsetMinipage::center; - else - controller().params().pos = InsetMinipage::bottom; -} - - -void FormMinipage::update() -{ - LyXLength len(controller().params().width); - fl_set_input(dialog_->input_width, tostr(len.value()).c_str()); - fl_set_choice(dialog_->choice_width_units, len.unit() + 1); - - switch (controller().params().pos) { - case InsetMinipage::top: - fl_set_button(dialog_->radio_top, 1); - break; - case InsetMinipage::center: - fl_set_button(dialog_->radio_middle, 1); - break; - case InsetMinipage::bottom: - fl_set_button(dialog_->radio_bottom, 1); - break; - } -} - - -ButtonPolicy::SMInput FormMinipage::input(FL_OBJECT * ob, long) -{ - clearMessage(); - - ButtonPolicy::SMInput action = ButtonPolicy::SMI_NOOP; - - if (ob == dialog_->radio_top || - ob == dialog_->radio_middle || - ob == dialog_->radio_bottom || - ob == dialog_->choice_width_units) - return ButtonPolicy::SMI_VALID; - - // disallow senseless data - // warnings if input is senseless - if (ob == dialog_->input_width) { - string const input = getString(dialog_->input_width); - bool const invalid = !isValidLength(input) && !isStrDbl(input); - if (invalid) { - postWarning(_("Invalid length!")); - action = ButtonPolicy::SMI_INVALID; - } else { - action = ButtonPolicy::SMI_VALID; - } - } - - return action; -} diff --git a/src/frontends/xforms/FormMinipage.h b/src/frontends/xforms/FormMinipage.h deleted file mode 100644 index c89ec719fa..0000000000 --- a/src/frontends/xforms/FormMinipage.h +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- -/** - * \file FormMinipage.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Jürgen Vigna - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef FORMMINIPAGE_H -#define FORMMINIPAGE_H - -#include "FormDialogView.h" - -class ControlMinipage; -struct FD_minipage; - -/** This class provides an XForms implementation of the Minipage - Dialog. - */ -class FormMinipage - : public FormController > { -public: - /// - FormMinipage(Dialog &); -private: - /// Set the Params variable for the Controller. - virtual void apply(); - /// Build the dialog. - virtual void build(); - /// Update dialog before/whilst showing it. - virtual void update(); - /// Filter the inputs on callback from xforms - virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); -}; - -#endif // FORMMINIPAGE_H diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 375fbd731f..77ad9d6193 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -116,8 +116,6 @@ libxforms_la_SOURCES = \ FormMathsSpace.h \ FormMathsStyle.C \ FormMathsStyle.h \ - FormMinipage.C \ - FormMinipage.h \ FormNote.C \ FormNote.h \ FormParagraph.C \ diff --git a/src/frontends/xforms/forms/Makefile.am b/src/frontends/xforms/forms/Makefile.am index 6c26530aeb..fd98192efd 100644 --- a/src/frontends/xforms/forms/Makefile.am +++ b/src/frontends/xforms/forms/Makefile.am @@ -33,7 +33,6 @@ SRCS = form_aboutlyx.fd \ form_maths_panel.fd \ form_maths_space.fd \ form_maths_style.fd \ - form_minipage.fd \ form_note.fd \ form_paragraph.fd \ form_preamble.fd \ diff --git a/src/frontends/xforms/forms/form_minipage.fd b/src/frontends/xforms/forms/form_minipage.fd deleted file mode 100644 index 05736ff3df..0000000000 --- a/src/frontends/xforms/forms/form_minipage.fd +++ /dev/null @@ -1,286 +0,0 @@ -Magic: 13000 - -Internal Form Definition File - (do not change) - -Number of forms: 1 -Unit of measure: FL_COORD_PIXEL - -=============== FORM =============== -Name: form_minipage -Width: 430 -Height: 170 -Number of Objects: 15 - --------------------- -class: FL_BOX -type: FLAT_BOX -box: 0 0 430 170 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_LABELFRAME -type: ENGRAVED_FRAME -box: 20 20 200 60 -boxtype: FL_NO_BOX -colors: FL_BLACK FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Width -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_LABELFRAME -type: ENGRAVED_FRAME -box: 240 20 180 100 -boxtype: FL_NO_BOX -colors: FL_BLACK FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Alignment -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 30 30 110 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_width -callback: C_FormDialogView_InputCB -argument: 0 - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 150 30 60 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: choice_width_units -callback: C_FormDialogView_InputCB -argument: 0 - --------------------- -class: FL_BEGIN_GROUP -type: 0 -box: 0 0 0 0 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_ROUND3DBUTTON -type: RADIO_BUTTON -box: 249 30 152 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Top|#T -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_top -callback: C_FormDialogView_InputCB -argument: 0 - --------------------- -class: FL_ROUND3DBUTTON -type: RADIO_BUTTON -box: 249 60 152 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Middle|#d -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_middle -callback: C_FormDialogView_InputCB -argument: 0 - --------------------- -class: FL_ROUND3DBUTTON -type: RADIO_BUTTON -box: 249 90 152 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Bottom|#B -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_bottom -callback: C_FormDialogView_InputCB -argument: 0 - --------------------- -class: FL_END_GROUP -type: 0 -box: 0 0 0 0 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 330 130 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Cancel|^[ -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_close -callback: C_FormDialogView_CancelCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 230 130 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Apply|#A -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_apply -callback: C_FormDialogView_ApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 130 130 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: OK -shortcut: ^M -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_ok -callback: C_FormDialogView_OKCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 10 130 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Restore|#R -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_restore -callback: C_FormDialogView_RestoreCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 90 210 30 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: text_warning -callback: -argument: - -============================== -create_the_forms diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b74da17061..c5f2d133c1 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-12-14 Jürgen Spitzmüller + + * insetminipage.[Ch]: remove from repository. + 2003-12-12 Michael Schmitt * insetert.[Ch]: diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index b07c8ee86c..676894d5b6 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -82,8 +82,6 @@ libinsets_la_SOURCES = \ insetline.h \ insetmarginal.h \ insetmarginal.C \ - insetminipage.C \ - insetminipage.h \ insetnewline.C \ insetnewline.h \ insetnote.C \ diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C deleted file mode 100644 index 3a4f2da379..0000000000 --- a/src/insets/insetminipage.C +++ /dev/null @@ -1,336 +0,0 @@ -/** - * \file insetminipage.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Jürgen Vigna - * \author Lars Gullik Bjønnes - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "insetminipage.h" - -#include "BufferView.h" -#include "debug.h" -#include "dispatchresult.h" -#include "funcrequest.h" -#include "gettext.h" -#include "LColor.h" -#include "lyxlex.h" -#include "metricsinfo.h" -#include "paragraph.h" - -#include "support/std_sstream.h" - - -using std::string; -using std::endl; -using std::auto_ptr; -using std::istringstream; -using std::ostream; -using std::ostringstream; - - -// Some information about Minipages in LaTeX: -// A minipage is a complete miniversion of a page and can contain -// its own footnotes, paragraphs, and array, tabular, and multicols -// environments. However it cannot contain floats or \marginpar's, -// but it can appear inside floats. -// -// The minipage environment is defined like this: -// -// \begin{minipage}[pos][height][inner-pos]{width} \end{minipage} -// -// Where: -// pos [opt] = is the vertical placement of the box with respect -// to the text baseline, [c], [t] and [b]. -// height [opt] = the height of the box -// inner-pos [opt] = the position of the text within the box. -// It can be t, c, b or s, if unspecified the value -// of pos is used. -// width = the width of the box -// -// In LyX we should try to support all these parameters, settable in a -// pop-up dialog. -// In this pop-up diallog it should also be possible to set all margin -// values that is usable in the minipage. -// With regard to different formats (like DocBook) I guess a minipage -// can be used there also. Perhaps not in the latex way, but we do not -// have to output "" for minipages. -// (Lgb) - -InsetMinipage::InsetMinipage(BufferParams const & bp) - : InsetCollapsable(bp) -{ - setLabel(_("minipage")); - LyXFont font(LyXFont::ALL_SANE); - font.decSize(); - font.decSize(); - font.setColor(LColor::collapsable); - setLabelFont(font); -#if 0 - setAutoCollapse(false); -#endif - inset.setFrameColor(LColor::blue); - setInsetName("Minipage"); -} - - -InsetMinipage::InsetMinipage(InsetMinipage const & in) - : InsetCollapsable(in), params_(in.params_) -{} - - -auto_ptr InsetMinipage::clone() const -{ - return auto_ptr(new InsetMinipage(*this)); -} - - -InsetMinipage::~InsetMinipage() -{ - InsetMinipageMailer(*this).hideDialog(); -} - - -DispatchResult -InsetMinipage::priv_dispatch(FuncRequest const & cmd, - idx_type & idx, pos_type & pos) -{ - switch (cmd.action) { - case LFUN_INSET_MODIFY: { - InsetMinipage::Params params; - InsetMinipageMailer::string2params(cmd.argument, params); - params_.pos = params.pos; - params_.width = params.width; - cmd.view()->update(); - return DispatchResult(true, true); - } - - case LFUN_INSET_DIALOG_UPDATE: - InsetMinipageMailer(*this).updateDialog(cmd.view()); - return DispatchResult(true, true); - - default: - return InsetCollapsable::priv_dispatch(cmd, idx, pos); - } -} - - -void InsetMinipage::Params::write(ostream & os) const -{ - os << "Minipage" << '\n' - << "position " << pos << '\n' - << "inner_position " << inner_pos << '\n' - << "height \"" << height.asString() << "\"\n" - << "width \"" << width.asString() << "\"\n"; -} - - -void InsetMinipage::Params::read(LyXLex & lex) -{ - if (lex.isOK()) { - lex.next(); - string const token = lex.getString(); - if (token == "position") { - lex.next(); - pos = static_cast(lex.getInteger()); - } else { - lyxerr << "InsetMinipage::Read: Missing 'position'-tag!" - << endl; - // take countermeasures - lex.pushToken(token); - } - } - if (lex.isOK()) { - lex.next(); - string const token = lex.getString(); - if (token == "inner_position") { - lex.next(); - inner_pos = static_cast(lex.getInteger()); - } else { - lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!" - << endl; - // take countermeasures - lex.pushToken(token); - } - } - if (lex.isOK()) { - lex.next(); - string const token = lex.getString(); - if (token == "height") { - lex.next(); - height = LyXLength(lex.getString()); - } else { - lyxerr << "InsetMinipage::Read: Missing 'height'-tag!" - << endl; - // take countermeasures - lex.pushToken(token); - } - } - if (lex.isOK()) { - lex.next(); - string const token = lex.getString(); - if (token == "width") { - lex.next(); - width = LyXLength(lex.getString()); - } else { - lyxerr << "InsetMinipage::Read: Missing 'width'-tag!" - << endl; - // take countermeasures - lex.pushToken(token); - } - } -} - - -void InsetMinipage::write(Buffer const & buf, ostream & os) const -{ - params_.write(os); - InsetCollapsable::write(buf, os); -} - - -void InsetMinipage::read(Buffer const & buf, LyXLex & lex) -{ - params_.read(lex); - InsetCollapsable::read(buf, lex); -} - - -void InsetMinipage::metrics(MetricsInfo & mi, Dimension & dim) const -{ - if (isOpen()) { - Dimension d; - MetricsInfo m = mi; - m.base.textwidth = params_.width.inPixels(mi.base.textwidth); - InsetCollapsable::metrics(m, d); - switch (params_.pos) { - case top: - dim.asc = d.asc; - dim.des = d.des; - break; - case center: - dim.asc = d.ascent() + d.descent() / 2; - dim.des = dim.asc; - break; - case bottom: - dim.asc = d.des; - dim.des = d.asc; - break; - } - dim.wid = d.wid; - } else - dimension_collapsed(dim); - - dim_ = dim; -} - - -string const InsetMinipage::editMessage() const -{ - return _("Opened Minipage Inset"); -} - - -int InsetMinipage::latex(Buffer const & buf, ostream & os, - OutputParams const & runparams) const -{ - string s_pos; - switch (params_.pos) { - case top: - s_pos += 't'; - break; - case center: - s_pos += 'c'; - break; - case bottom: - s_pos += 'b'; - break; - } - os << "\\begin{minipage}[" << s_pos << "]{" - << params_.width.asLatexString() << "}%\n"; - - int i = inset.latex(buf, os, runparams); - - os << "\\end{minipage}%\n"; - return i + 2; -} - - -bool InsetMinipage::insetAllowed(InsetOld::Code code) const -{ - if (code == InsetOld::FLOAT_CODE || code == InsetOld::MARGIN_CODE) - return false; - - return InsetCollapsable::insetAllowed(code); -} - - -bool InsetMinipage::showInsetDialog(BufferView * bv) const -{ - if (!inset.showInsetDialog(bv)) { - InsetMinipage * tmp = const_cast(this); - InsetMinipageMailer(*tmp).showDialog(bv); - } - - return true; -} - - -InsetMinipage::Params::Params() - : pos(center), inner_pos(inner_center), width(100, LyXLength::PCW) -{} - - -string const InsetMinipageMailer:: name_("minipage"); - -InsetMinipageMailer::InsetMinipageMailer(InsetMinipage & inset) - : inset_(inset) -{} - - -string const InsetMinipageMailer::inset2string(Buffer const &) const -{ - return params2string(inset_.params()); -} - - -void InsetMinipageMailer::string2params(string const & in, - InsetMinipage::Params & params) -{ - params = InsetMinipage::Params(); - if (in.empty()) - return; - - istringstream data(in); - LyXLex lex(0, 0); - lex.setStream(data); - - string name; - lex >> name; - if (!lex || name != name_) - return print_mailer_error("InsetMinipageMailer", in, 1, name_); - - // This is part of the inset proper that is usually swallowed - // by LyXText::readInset - string id; - lex >> id; - if (!lex || id != "Minipage") - return print_mailer_error("InsetBoxMailer", in, 2, "Minipage"); - - params.read(lex); -} - - -string const -InsetMinipageMailer::params2string(InsetMinipage::Params const & params) -{ - ostringstream data; - data << name_ << ' '; - params.write(data); - return data.str(); -} diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h deleted file mode 100644 index 536768e2ea..0000000000 --- a/src/insets/insetminipage.h +++ /dev/null @@ -1,124 +0,0 @@ -// -*- C++ -*- -/** - * \file insetminipage.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Jürgen Vigna - * \author Lars Gullik Bjønnes - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef INSETMINIPAGE_H -#define INSETMINIPAGE_H - -#include "insetcollapsable.h" -#include "lyxlength.h" - -/** The minipage inset - -*/ -class InsetMinipage : public InsetCollapsable { -public: - /// - enum Position { - top, - center, - bottom - }; - /// - enum InnerPosition { - inner_center, - inner_top, - inner_bottom, - inner_stretch - }; - - /// - struct Params { - /// - Params(); - /// - Position pos; - /// - InnerPosition inner_pos; - /// - LyXLength height; - /// - LyXLength width; - /// - void write(std::ostream & os) const; - /// - void read(LyXLex & lex); - }; - - /// - InsetMinipage(BufferParams const &); - /// - InsetMinipage(InsetMinipage const &); - /// - ~InsetMinipage(); - /// - void write(Buffer const & buf, std::ostream & os) const; - /// - void read(Buffer const & buf, LyXLex & lex); - /// - virtual std::auto_ptr clone() const; - /// - void metrics(MetricsInfo &, Dimension &) const; - /// - InsetOld::Code lyxCode() const { return InsetOld::MINIPAGE_CODE; } - /// - int latex(Buffer const &, std::ostream &, - OutputParams const &) const; - /// - std::string const editMessage() const; - /// - bool insetAllowed(InsetOld::Code) const; - /** returns true if, when outputing LaTeX, font changes should - be closed before generating this inset. This is needed for - insets that may contain several paragraphs */ - bool noFontChange() const { return true; } - /// - bool showInsetDialog(BufferView *) const; - /// - void params(Params const & p) { params_ = p; } - /// - Params const & params() const { return params_; } -protected: - /// - virtual - DispatchResult - priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &); -private: - /// - Params params_; -}; - - -#include "mailinset.h" - - -class InsetMinipageMailer : public MailInset { -public: - /// - InsetMinipageMailer(InsetMinipage & inset); - /// - virtual InsetBase & inset() const { return inset_; } - /// - virtual std::string const & name() const { return name_; } - /// - virtual std::string const inset2string(Buffer const &) const; - /// - static void string2params(std::string const &, InsetMinipage::Params &); - /// - static std::string const params2string(InsetMinipage::Params const &); -private: - /// - static std::string const name_; - /// - InsetMinipage & inset_; -}; - -#endif diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 015943c890..ab10b7ab70 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -58,7 +58,6 @@ #include "insets/insetexternal.h" #include "insets/insetfloat.h" #include "insets/insetgraphics.h" -#include "insets/insetminipage.h" #include "insets/insetnote.h" #include "insets/insettabular.h" #include "insets/insetvspace.h" @@ -491,9 +490,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const case InsetOld::FLOAT_CODE: disable = ev.argument != "float"; break; - case InsetOld::MINIPAGE_CODE: - disable = ev.argument != "minipage"; - break; case InsetOld::WRAP_CODE: disable = ev.argument != "wrap"; break; @@ -587,8 +583,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const code = InsetOld::INDEX_CODE; else if (ev.argument == "label") code = InsetOld::LABEL_CODE; - else if (ev.argument == "minipage") - code = InsetOld::MINIPAGE_CODE; else if (ev.argument == "note") code = InsetOld::NOTE_CODE; else if (ev.argument == "ref") @@ -616,7 +610,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const code = InsetOld::MARGIN_CODE; break; case LFUN_INSET_MINIPAGE: - code = InsetOld::MINIPAGE_CODE; + code = InsetOld::BOX_CODE; break; case LFUN_INSET_FLOAT: case LFUN_INSET_WIDE_FLOAT: @@ -662,7 +656,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const code = InsetOld::OPTARG_CODE; break; case LFUN_ENVIRONMENT_INSERT: - code = InsetOld::MINIPAGE_CODE; + code = InsetOld::BOX_CODE; break; case LFUN_INDEX_INSERT: code = InsetOld::INDEX_CODE; @@ -1277,9 +1271,6 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose) InsetGraphicsParams p; Buffer const & buffer = *owner->buffer(); data = InsetGraphicsMailer::params2string(p, buffer); - } else if (name == "minipage") { - InsetMinipage::Params p; - data = InsetMinipageMailer::params2string(p); } else if (name == "note") { InsetNoteParams p; data = InsetNoteMailer::params2string(p); -- 2.39.2