]> git.lyx.org Git - features.git/commitdiff
Minipage is no more (long live the box inset)
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 14 Dec 2003 13:47:40 +0000 (13:47 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 14 Dec 2003 13:47:40 +0000 (13:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8246 a592a061-630c-0410-9148-cb99ea01b6c8

27 files changed:
src/ChangeLog
src/factory.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlMinipage.C [deleted file]
src/frontends/controllers/ControlMinipage.h [deleted file]
src/frontends/controllers/Makefile.am
src/frontends/qt2/ChangeLog
src/frontends/qt2/Dialogs.C
src/frontends/qt2/Makefile.am
src/frontends/qt2/Makefile.dialogs
src/frontends/qt2/QMinipage.C [deleted file]
src/frontends/qt2/QMinipage.h [deleted file]
src/frontends/qt2/QMinipageDialog.C [deleted file]
src/frontends/qt2/QMinipageDialog.h [deleted file]
src/frontends/qt2/ui/QMinipageDialogBase.ui [deleted file]
src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs.C
src/frontends/xforms/FormMinipage.C [deleted file]
src/frontends/xforms/FormMinipage.h [deleted file]
src/frontends/xforms/Makefile.am
src/frontends/xforms/forms/Makefile.am
src/frontends/xforms/forms/form_minipage.fd [deleted file]
src/insets/ChangeLog
src/insets/Makefile.am
src/insets/insetminipage.C [deleted file]
src/insets/insetminipage.h [deleted file]
src/lyxfunc.C

index 7ccf3e4e4056e8579ca7c4eada88c724ba599796..99346b882de9ee9a4a7023d5589c5f736b925af7 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * factory.C: 
+       * lyxfunc.C: remove insetminipage. "minipage-insert"
+       now produces a frameless minipage box inset.
+
 2003-12-12  Alfredo Braunstein  <abraunst@lyx.org>
 
        * textcursor.[Ch] (selStart,selEnd): add new methods 
index 20a85fbabd4d6c0af9e73726f9690c91054a45ac..387a3a5f02473535bc720c47e7d88246b5572ab9 100644 (file)
@@ -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();
index 86deb176d8fafd78500007310424138fd931f81d..8bbbec0bb8088095c9d9492d6f548899e877e51d 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * ControlMinipage.[Ch]: remove.
+       * Makefile.am: remove minipage files.
+
 2003-12-12  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * ControlMath.C (dispatchSubscript, dispatchSuperscript): enable
diff --git a/src/frontends/controllers/ControlMinipage.C b/src/frontends/controllers/ControlMinipage.C
deleted file mode 100644 (file)
index ecee9df..0000000
+++ /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 <config.h>
-
-#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 (file)
index bdb8fbf..0000000
+++ /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<InsetMinipage::Params> params_;
-};
-
-#endif
index 7bbef306b94e8e0bc86c23292b4b9a0f4e38f458..2efe63eb9747ddca2925a4e51a1c2ded6d3ee305 100644 (file)
@@ -70,8 +70,6 @@ libcontrollers_la_SOURCES= \
        ControlLog.h \
        ControlMath.C \
        ControlMath.h \
-       ControlMinipage.C \
-       ControlMinipage.h \
        ControlNote.C \
        ControlNote.h \
        ControlParagraph.C \
index 66494a90c69bfd458f7aa6635cffb7b597c5db27..cb636b376c321c6e0b68bfc4cefab34b8924f910 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * QMinipage.[Ch]:
+       * QMinipageDialog.[Ch]: 
+       * ui/QMinipageDialogBase.ui: remove from repository.
+       * Dialogs.C:
+       * Makefile.am:
+       * Makefile.dialogs: remove minipage.
+
 2003-12-12  Angus Leeming  <leeming@lyx.org>
 
        * QBranch.C:
index 5b909d0d8e804cac116ecef989b124607f1c99de..5ed714492c193a20f0aa0814c43b381f1cf2703f 100644 (file)
@@ -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));
index 7dcde30f99b5586d0decee2dfe9c48642a3479a5..44afc2080943fd4c30df8abd9b2f38834dd33cd9 100644 (file)
@@ -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 \
index e1ec999953139f3b5b69381d770217d7a892b2b5..57a9f0b4bc6d2f5513f942d5c478ac9ef2caabfd 100644 (file)
@@ -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 (file)
index 7a062f4..0000000
+++ /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 <config.h>
-
-#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 <qpushbutton.h>
-#include <qlineedit.h>
-
-using lyx::support::strToDbl;
-
-using std::string;
-
-
-typedef QController<ControlMinipage, QView<QMinipageDialog> > 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 (file)
index b60055c..0000000
+++ /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<ControlMinipage, QView<QMinipageDialog> >
-{
-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 (file)
index 884dd00..0000000
+++ /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 <config.h>
-
-
-
-#include "QMinipage.h"
-#include "QMinipageDialog.h"
-
-#include <qpushbutton.h>
-
-
-
-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 (file)
index 8e74625..0000000
+++ /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 (file)
index 1464da0..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-<!DOCTYPE UI><UI>
-<class>QMinipageDialogBase</class>
-<include location="global">config.h</include>
-<include location="local">qt_helpers.h</include>
-<include location="local">vspace.h</include>
-<widget>
-    <class>QDialog</class>
-    <property stdset="1">
-        <name>name</name>
-        <cstring>QMinipageDialogBase</cstring>
-    </property>
-    <property stdset="1">
-        <name>geometry</name>
-        <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>364</width>
-            <height>111</height>
-        </rect>
-    </property>
-    <property stdset="1">
-        <name>caption</name>
-        <string>Minipage settings</string>
-    </property>
-    <property stdset="1">
-        <name>sizeGripEnabled</name>
-        <bool>true</bool>
-    </property>
-    <property>
-        <name>layoutMargin</name>
-    </property>
-    <property>
-        <name>layoutSpacing</name>
-    </property>
-    <vbox>
-        <property stdset="1">
-            <name>margin</name>
-            <number>11</number>
-        </property>
-        <property stdset="1">
-            <name>spacing</name>
-            <number>6</number>
-        </property>
-        <widget>
-            <class>QLayoutWidget</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>Layout3</cstring>
-            </property>
-            <grid>
-                <property stdset="1">
-                    <name>margin</name>
-                    <number>0</number>
-                </property>
-                <property stdset="1">
-                    <name>spacing</name>
-                    <number>6</number>
-                </property>
-                <widget row="0"  column="0" >
-                    <class>QLabel</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>widthLA</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>frameShape</name>
-                        <enum>MShape</enum>
-                    </property>
-                    <property stdset="1">
-                        <name>frameShadow</name>
-                        <enum>MShadow</enum>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Width:</string>
-                    </property>
-                    <property>
-                        <name>buddy</name>
-                        <cstring>widthED</cstring>
-                    </property>
-                </widget>
-                <widget row="1"  column="2" >
-                    <class>QComboBox</class>
-                    <item>
-                        <property>
-                            <name>text</name>
-                            <string>Top</string>
-                        </property>
-                    </item>
-                    <item>
-                        <property>
-                            <name>text</name>
-                            <string>Middle</string>
-                        </property>
-                    </item>
-                    <item>
-                        <property>
-                            <name>text</name>
-                            <string>Bottom</string>
-                        </property>
-                    </item>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>valignCO</cstring>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Vertical alignment</string>
-                    </property>
-                </widget>
-                <widget row="0"  column="2" >
-                    <class>QLabel</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>valignLA</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>A&amp;lignment:</string>
-                    </property>
-                    <property>
-                        <name>buddy</name>
-                        <cstring>valignCO</cstring>
-                    </property>
-                </widget>
-                <widget row="1"  column="1" >
-                    <class>LengthCombo</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>unitsLC</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>sizePolicy</name>
-                        <sizepolicy>
-                            <hsizetype>3</hsizetype>
-                            <vsizetype>0</vsizetype>
-                        </sizepolicy>
-                    </property>
-                    <property stdset="1">
-                        <name>minimumSize</name>
-                        <size>
-                            <width>40</width>
-                            <height>22</height>
-                        </size>
-                    </property>
-                    <property stdset="1">
-                        <name>focusPolicy</name>
-                        <enum>StrongFocus</enum>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Units of width value</string>
-                    </property>
-                </widget>
-                <widget row="1"  column="0" >
-                    <class>QLineEdit</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>widthED</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>sizePolicy</name>
-                        <sizepolicy>
-                            <hsizetype>1</hsizetype>
-                            <vsizetype>0</vsizetype>
-                        </sizepolicy>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Width value</string>
-                    </property>
-                </widget>
-                <widget row="0"  column="1" >
-                    <class>QLabel</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>unitsLA</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Units:</string>
-                    </property>
-                    <property>
-                        <name>buddy</name>
-                        <cstring>unitsLC</cstring>
-                    </property>
-                </widget>
-            </grid>
-        </widget>
-        <spacer>
-            <property>
-                <name>name</name>
-                <cstring>Spacer1_2</cstring>
-            </property>
-            <property stdset="1">
-                <name>orientation</name>
-                <enum>Vertical</enum>
-            </property>
-            <property stdset="1">
-                <name>sizeType</name>
-                <enum>Expanding</enum>
-            </property>
-            <property>
-                <name>sizeHint</name>
-                <size>
-                    <width>20</width>
-                    <height>20</height>
-                </size>
-            </property>
-        </spacer>
-        <widget>
-            <class>QLayoutWidget</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>Layout17</cstring>
-            </property>
-            <hbox>
-                <property stdset="1">
-                    <name>margin</name>
-                    <number>0</number>
-                </property>
-                <property stdset="1">
-                    <name>spacing</name>
-                    <number>6</number>
-                </property>
-                <widget>
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>restorePB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Restore</string>
-                    </property>
-                    <property stdset="1">
-                        <name>autoDefault</name>
-                        <bool>false</bool>
-                    </property>
-                    <property stdset="1">
-                        <name>default</name>
-                        <bool>false</bool>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string></string>
-                    </property>
-                </widget>
-                <spacer>
-                    <property>
-                        <name>name</name>
-                        <cstring>Spacer1</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>orientation</name>
-                        <enum>Horizontal</enum>
-                    </property>
-                    <property stdset="1">
-                        <name>sizeType</name>
-                        <enum>Expanding</enum>
-                    </property>
-                    <property>
-                        <name>sizeHint</name>
-                        <size>
-                            <width>20</width>
-                            <height>20</height>
-                        </size>
-                    </property>
-                </spacer>
-                <widget>
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>okPB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;OK</string>
-                    </property>
-                    <property stdset="1">
-                        <name>default</name>
-                        <bool>true</bool>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string></string>
-                    </property>
-                </widget>
-                <widget>
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>applyPB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Apply</string>
-                    </property>
-                    <property stdset="1">
-                        <name>autoDefault</name>
-                        <bool>false</bool>
-                    </property>
-                    <property stdset="1">
-                        <name>default</name>
-                        <bool>false</bool>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string></string>
-                    </property>
-                </widget>
-                <widget>
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>closePB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Close</string>
-                    </property>
-                    <property stdset="1">
-                        <name>autoDefault</name>
-                        <bool>false</bool>
-                    </property>
-                    <property stdset="1">
-                        <name>default</name>
-                        <bool>false</bool>
-                    </property>
-                </widget>
-            </hbox>
-        </widget>
-    </vbox>
-</widget>
-<customwidgets>
-    <customwidget>
-        <class>LengthCombo</class>
-        <header location="local">lengthcombo.h</header>
-        <sizehint>
-            <width>-1</width>
-            <height>-1</height>
-        </sizehint>
-        <container>0</container>
-        <sizepolicy>
-            <hordata>5</hordata>
-            <verdata>5</verdata>
-        </sizepolicy>
-        <pixmap>image0</pixmap>
-        <signal>selectionChanged(LyXLength::UNIT)</signal>
-    </customwidget>
-</customwidgets>
-<images>
-    <image>
-        <name>image0</name>
-        <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
-    </image>
-</images>
-<connections>
-    <connection>
-        <sender>widthED</sender>
-        <signal>textChanged(const QString&amp;)</signal>
-        <receiver>QMinipageDialogBase</receiver>
-        <slot>change_adaptor()</slot>
-    </connection>
-    <connection>
-        <sender>unitsLC</sender>
-        <signal>selectionChanged(LyXLength::UNIT)</signal>
-        <receiver>QMinipageDialogBase</receiver>
-        <slot>change_adaptor()</slot>
-    </connection>
-    <connection>
-        <sender>valignCO</sender>
-        <signal>highlighted(const QString&amp;)</signal>
-        <receiver>QMinipageDialogBase</receiver>
-        <slot>change_adaptor()</slot>
-    </connection>
-    <slot access="public">change_adaptor()</slot>
-</connections>
-<tabstops>
-    <tabstop>widthED</tabstop>
-    <tabstop>unitsLC</tabstop>
-    <tabstop>valignCO</tabstop>
-    <tabstop>restorePB</tabstop>
-    <tabstop>applyPB</tabstop>
-    <tabstop>okPB</tabstop>
-    <tabstop>closePB</tabstop>
-</tabstops>
-</UI>
index 9cdec688022935b9268a5846bed428862532a855..78db2944acf346ea0972507f9b0bd301c69bf40e 100644 (file)
@@ -1,3 +1,11 @@
+2003-12-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * FormMinipage.[Ch]:
+       * forms/form_minipage.fd: remove from repository.
+       * Dialogs.C:
+       * Makefile.am:
+       * forms/Makefile.am: remove minipage.
+
 2003-12-10  Angus Leeming  <leeming@lyx.org>
 
        * FormExternal.C, forms/form_external.fd: add a 'draft' check box
index 11444a3c1e21d0e75ed41d9f3660dc59be2ff2c6..8322fc8c30a676e802805f501dc9d31e0dad18a7 100644 (file)
@@ -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 (file)
index 48b65c5..0000000
+++ /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 <config.h>
-
-#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<ControlMinipage, FormView<FD_minipage> > 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 (file)
index c89ec71..0000000
+++ /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<ControlMinipage, FormView<FD_minipage> > {
-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
index 375fbd731f6db6e10b608a3c63627ed17ac47b76..77ad9d6193face84f9bd6b36b54e9999ddc26b3f 100644 (file)
@@ -116,8 +116,6 @@ libxforms_la_SOURCES = \
        FormMathsSpace.h \
        FormMathsStyle.C \
        FormMathsStyle.h \
-       FormMinipage.C \
-       FormMinipage.h \
        FormNote.C \
        FormNote.h \
        FormParagraph.C \
index 6c26530aebe9abbc970cc575d786dc0544928bb8..fd98192efd5a7fc6a721a793789a329afd985f56 100644 (file)
@@ -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 (file)
index 05736ff..0000000
+++ /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
index b74da170610fa5512f12fbad087daf5e22cb3407..c5f2d133c1141380be13cdf60eac1ac230717282 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * insetminipage.[Ch]: remove from repository.
+       
 2003-12-12  Michael Schmitt  <michael.schmitt@teststep.org>
 
        * insetert.[Ch]:
index b07c8ee86cfaa361f691008a0235987f928aabc9..676894d5b6ccbaaa97fdb9500cbeb5af22dbf8d8 100644 (file)
@@ -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 (file)
index 3a4f2da..0000000
+++ /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 <config.h>
-
-#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} <text> \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<InsetBase> InsetMinipage::clone() const
-{
-       return auto_ptr<InsetBase>(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<Position>(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<InnerPosition>(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<InsetMinipage *>(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 (file)
index 536768e..0000000
+++ /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<InsetBase> 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
index 015943c8906f99ea166af9b1f47ab53824d86377..ab10b7ab707ffc4ec4146c0bda9738b9de088631 100644 (file)
@@ -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);