]> git.lyx.org Git - features.git/commitdiff
Cleanup patches for xforms (Angus) and KDE (John)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 24 Oct 2000 13:13:59 +0000 (13:13 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 24 Oct 2000 13:13:59 +0000 (13:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1148 a592a061-630c-0410-9148-cb99ea01b6c8

60 files changed:
ChangeLog
po/POTFILES.in
src/buffer.C
src/frontends/DialogBase.h
src/frontends/kde/copyrightdlgdata.C
src/frontends/kde/copyrightdlgdata.h
src/frontends/kde/indexdlgdata.C
src/frontends/kde/indexdlgdata.h
src/frontends/kde/paraextradlgdata.C
src/frontends/kde/paraextradlgdata.h
src/frontends/kde/parageneraldlgdata.C
src/frontends/kde/parageneraldlgdata.h
src/frontends/kde/printdlgdata.C
src/frontends/kde/printdlgdata.h
src/frontends/xforms/Dialogs.C
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormBase.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormDocument.h
src/frontends/xforms/FormError.C
src/frontends/xforms/FormError.h
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormGraphics.h
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormIndex.h
src/frontends/xforms/FormInset.C
src/frontends/xforms/FormInset.h
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormParagraph.h
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreferences.h
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPrint.h
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormRef.h
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormTabular.h
src/frontends/xforms/FormTabularCreate.C [new file with mode: 0644]
src/frontends/xforms/FormTabularCreate.h [new file with mode: 0644]
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormToc.h
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormUrl.h
src/frontends/xforms/Makefile.am
src/frontends/xforms/form_graphics.C
src/frontends/xforms/form_graphics.h
src/frontends/xforms/form_tabular.C
src/frontends/xforms/form_tabular.h
src/frontends/xforms/form_tabular_create.C [new file with mode: 0644]
src/frontends/xforms/form_tabular_create.h [new file with mode: 0644]
src/frontends/xforms/forms/fdfix.sh
src/frontends/xforms/forms/form_graphics.fd
src/frontends/xforms/forms/form_tabular.fd
src/frontends/xforms/forms/form_tabular_create.fd [new file with mode: 0644]
src/frontends/xforms/forms/makefile
src/insets/insettabular.C
src/insets/insettabular.h
src/support/lstrings.h

index 51c8c2eb917a44fabcceef19c36a0c89a1f1c740..39755945037745675c084e95dce68db3f37a6ea0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,56 @@
+2000-10-24  John Levon  <moz@compsoc.man.ac.uk>
+
+       * src/frontends/kde/*data.[Ch]: _("") is not
+       allowed
+
+2000-10-24  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * src/buffer.C: removed redundant using directive.
+
+       * src/frontends/DialogBase.h: revert to original definition of
+       update(). 
+       
+       * src/frontends/xforms/Dialogs.C (c-tor): splitting the tabular
+       stuff into two classes, one for each dialog, requires a new
+       element in the dialogs vector, FormTabularCreate.
+
+       * src/frontends/xforms/FormXXX.[Ch] (update): revert to original
+       definition.
+
+       * src/frontends/xforms/FormBase.[Ch] (FormBaseBD::updateSlot): new
+       method. Continues Allan's idea, but means that derived classes
+       don't need to worry about "update or hide?".
+
+       * src/frontends/xforms/FormError.C (showInset): add connection
+       again ;-) 
+
+       * src/frontends/xforms/FormTabular.[Ch]: split into two classes,
+       one for each dialog. FormTabular now contains main tabular dialog
+       only.
+
+       * src/frontends/xforms/FormTabularCreate.[Ch]:
+       * src/frontends/xforms/forms/form_tabular_create.fd: the create
+       dialog. 
+
+       * src/frontends/xforms/FormGraphics.[Ch]:
+       * src/frontends/xforms/forms/form_graphics.fd
+       * src/frontends/xforms/FormTabular.[Ch]:
+       * src/frontends/xforms/forms/form_tabular.fd: made daughter
+       classes of FormInset.
+
+       * src/frontends/xforms/forms/fdfix.sh: small fix. Can now create
+       class names properly. Eg, form_my_new_dialog -> FormMyNewDialog.
+
+       * src/frontends/xforms/Makefile.am:
+       * src/frontends/xforms/forms/makefile: added new files.
+
+       * src/insets/insettabular.[Ch]: removed (Dialogs *) member
+       variable. added Signal0 hide signal, in keeping with other GUI-I
+       insets.
+
+       * src/support/lstrings.h: removed redundant std:: qualifier as
+       it's already declared in Lsstream.h.
+
 2000-10-23  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/insets/figinset.C (GhostscriptMsg): use DisplayString() to
 
 2000-10-18  Angus Leeming <a.leeming@ic.ac.uk>
 
-       * src/support/lstrings.C (lowercase, uppercase):
-       use explicit casts to remove compiler warnings.
+       * src/support/lstrings.C (lowercase, uppercase):
+       use explicit casts to remove compiler warnings.
 
-       * src/support/LRegex.C (Impl):
-       * src/support/StrPool.C (add):
-       * src/support/filetools.C (MakeAbsPath, NormalizePath, MakeRelPath)
-       (AddPath, MakeDisplayPath):
-       * src/support/lstrings.C (prefixIs, subst):
-       use correct type to remove compiler warnings.
+       * src/support/LRegex.C (Impl):
+       * src/support/StrPool.C (add):
+       * src/support/filetools.C (MakeAbsPath, NormalizePath, MakeRelPath)
+       (AddPath, MakeDisplayPath):
+       * src/support/lstrings.C (prefixIs, subst):
+       use correct type to remove compiler warnings.
 
-       * src/support/lstrings.[Ch] (countChar): returns string::size_type.
+       * src/support/lstrings.[Ch] (countChar): returns string::size_type.
 
-       * src/support/lyxlib.h:
-       * src/support/mkdir.C (mkdir): change parameter to mode_t for
-       portability and to remove compiler warning with DEC cxx.
+       * src/support/lyxlib.h:
+       * src/support/mkdir.C (mkdir): change parameter to mode_t for
+       portability and to remove compiler warning with DEC cxx.
 
-       * src/support/FileInfo.[Ch] (flagRWX): ditto.
+       * src/support/FileInfo.[Ch] (flagRWX): ditto.
 
 2000-10-18  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
index 3a9041874f4952c5c973c4242109dc784538bbbf..814cab19bf47c432c1294784accaf974ec644f3f 100644 (file)
@@ -70,6 +70,8 @@ src/frontends/xforms/FormRef.C
 src/frontends/xforms/form_ref.C
 src/frontends/xforms/FormTabular.C
 src/frontends/xforms/form_tabular.C
+src/frontends/xforms/FormTabularCreate.C
+src/frontends/xforms/form_tabular_create.C
 src/frontends/xforms/FormToc.C
 src/frontends/xforms/form_toc.C
 src/frontends/xforms/FormUrl.C
index 0cf6c642feceaf88ccb1cad3b8046cadb7d2c4df..c904567a4b2cdcc2ee3ea9b9b1c4bacd83589c1f 100644 (file)
@@ -105,7 +105,6 @@ using std::pair;
 using std::vector;
 using std::max;
 using std::set;
-using std::istringstream;
 
 // all these externs should eventually be removed.
 extern BufferList bufferlist;
index 650df6a3989995a30c4aad84e28e31c011edccce..5ef76e4d1445b4550aecc47bedd5d011a9883ba0 100644 (file)
@@ -50,8 +50,8 @@ public:
        virtual void show() = 0;
        ///
        virtual void hide() = 0;
-       /// Parameter defines if a buffer switch occurred
-       virtual void update(bool = false) = 0;
+       ///
+       virtual void update() = 0;
        //@}
 };
 
index 090421af34cfcf6eb6d9f89ce80500ae5bb186d0..d28a130063edf5d5acb99f24cdd524aa6626a26e 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: copyrightdlgdata.C
-       Last generated: Sat Oct 14 03:43:37 2000
+       Last generated: Tue Oct 24 13:38:02 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
@@ -11,6 +11,7 @@
  *********************************************************************/
 
 #include <gettext.h>
+
 #include <qpixmap.h>
 #include <qlayout.h>
 #include "copyrightdlgdata.h"
index 2f5e97cf18f379d963b79285987cd42a31b40322..c16ca66b9cf111399905e4719bb785538bca48bd 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: copyrightdlgdata.h
-       Last generated: Sat Oct 14 03:43:37 2000
+       Last generated: Tue Oct 24 13:38:02 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
index 1c20c9ac0cfdb4cdc3b4b79b3f4003108fb79829..803f7ee447f1ae4d61eb5daca5828a81932967cd 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: indexdlgdata.C
-       Last generated: Sat Oct 14 03:43:39 2000
+       Last generated: Tue Oct 24 13:38:07 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
@@ -11,6 +11,7 @@
  *********************************************************************/
 
 #include <gettext.h>
+
 #include <qpixmap.h>
 #include <qlayout.h>
 #include "indexdlgdata.h"
@@ -50,7 +51,7 @@ IndexDialogData::IndexDialogData
        index->setBackgroundMode( QWidget::PaletteBase );
        index->setFontPropagation( QWidget::NoChildren );
        index->setPalettePropagation( QWidget::NoChildren );
-       index->setText( _(""));
+       index->setText( "" );
        index->setMaxLength( 32767 );
        index->setFrame( QLineEdit::Normal );
        index->setFrame( TRUE );
index ccb67374317f1802f1c09807748242d5d50354c2..32f04f335d8093702c20a024f6005edde1766e68 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: indexdlgdata.h
-       Last generated: Sat Oct 14 03:43:39 2000
+       Last generated: Tue Oct 24 13:38:07 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
index bb242ddc6baf807aabc8e4b3790258a8b240a1cf..2e8591641c6d52ed6cef9183333bb8efbada34ef 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: paraextradlgdata.C
-       Last generated: Sun Oct 15 05:49:46 2000
+       Last generated: Tue Oct 24 13:38:14 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
@@ -11,6 +11,7 @@
  *********************************************************************/
 
 #include <gettext.h>
+
 #include <qpixmap.h>
 #include <qlayout.h>
 #include "paraextradlgdata.h"
@@ -177,7 +178,7 @@ ParaExtraDialogData::ParaExtraDialogData
        widthvalue->setBackgroundMode( QWidget::PaletteBase );
        widthvalue->setFontPropagation( QWidget::NoChildren );
        widthvalue->setPalettePropagation( QWidget::NoChildren );
-       widthvalue->setText( _("") );
+       widthvalue->setText( "" );
        widthvalue->setMaxLength( 32767 );
        widthvalue->setFrame( QLineEdit::Normal );
        widthvalue->setFrame( TRUE );
index 28562f94413c899b4023f4ca65adf1a897fad46c..226fc366be6ab44b881b53e0df68c93aa77ffc9d 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: paraextradlgdata.h
-       Last generated: Sun Oct 15 05:49:46 2000
+       Last generated: Tue Oct 24 13:38:14 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
index 35b410b057f82271493653e87ec078c4c20f72b0..53f850b0909ec7aa52064d39136843357d16f193 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: parageneraldlgdata.C
-       Last generated: Sun Oct 15 16:00:50 2000
+       Last generated: Tue Oct 24 13:38:19 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
@@ -11,6 +11,7 @@
  *********************************************************************/
 
 #include <gettext.h>
+
 #include <qpixmap.h>
 #include <qlayout.h>
 #include "parageneraldlgdata.h"
@@ -280,7 +281,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        labelwidth->setBackgroundMode( QWidget::PaletteBase );
        labelwidth->setFontPropagation( QWidget::NoChildren );
        labelwidth->setPalettePropagation( QWidget::NoChildren );
-       labelwidth->setText( _("") );
+       labelwidth->setText( "" );
        labelwidth->setMaxLength( 32767 );
        labelwidth->setFrame( QLineEdit::Normal );
        labelwidth->setFrame( TRUE );
@@ -294,7 +295,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        spaceabovevalue->setBackgroundMode( QWidget::PaletteBase );
        spaceabovevalue->setFontPropagation( QWidget::NoChildren );
        spaceabovevalue->setPalettePropagation( QWidget::NoChildren );
-       spaceabovevalue->setText( _("") );
+       spaceabovevalue->setText( "" );
        spaceabovevalue->setMaxLength( 32767 );
        spaceabovevalue->setFrame( QLineEdit::Normal );
        spaceabovevalue->setFrame( TRUE );
@@ -356,7 +357,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        spaceaboveminus->setBackgroundMode( QWidget::PaletteBase );
        spaceaboveminus->setFontPropagation( QWidget::NoChildren );
        spaceaboveminus->setPalettePropagation( QWidget::NoChildren );
-       spaceaboveminus->setText( _("") );
+       spaceaboveminus->setText( "" );
        spaceaboveminus->setMaxLength( 32767 );
        spaceaboveminus->setFrame( QLineEdit::Normal );
        spaceaboveminus->setFrame( TRUE );
@@ -401,7 +402,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        spaceaboveplus->setBackgroundMode( QWidget::PaletteBase );
        spaceaboveplus->setFontPropagation( QWidget::NoChildren );
        spaceaboveplus->setPalettePropagation( QWidget::NoChildren );
-       spaceaboveplus->setText( _("") );
+       spaceaboveplus->setText( "" );
        spaceaboveplus->setMaxLength( 32767 );
        spaceaboveplus->setFrame( QLineEdit::Normal );
        spaceaboveplus->setFrame( TRUE );
@@ -480,7 +481,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        spacebelowminus->setBackgroundMode( QWidget::PaletteBase );
        spacebelowminus->setFontPropagation( QWidget::NoChildren );
        spacebelowminus->setPalettePropagation( QWidget::NoChildren );
-       spacebelowminus->setText( _("") );
+       spacebelowminus->setText( "" );
        spacebelowminus->setMaxLength( 32767 );
        spacebelowminus->setFrame( QLineEdit::Normal );
        spacebelowminus->setFrame( TRUE );
@@ -495,7 +496,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        spacebelowplus->setBackgroundMode( QWidget::PaletteBase );
        spacebelowplus->setFontPropagation( QWidget::NoChildren );
        spacebelowplus->setPalettePropagation( QWidget::NoChildren );
-       spacebelowplus->setText( _("") );
+       spacebelowplus->setText( "" );
        spacebelowplus->setMaxLength( 32767 );
        spacebelowplus->setFrame( QLineEdit::Normal );
        spacebelowplus->setFrame( TRUE );
@@ -510,7 +511,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
        spacebelowvalue->setBackgroundMode( QWidget::PaletteBase );
        spacebelowvalue->setFontPropagation( QWidget::NoChildren );
        spacebelowvalue->setPalettePropagation( QWidget::NoChildren );
-       spacebelowvalue->setText( _("") );
+       spacebelowvalue->setText( "" );
        spacebelowvalue->setMaxLength( 32767 );
        spacebelowvalue->setFrame( QLineEdit::Normal );
        spacebelowvalue->setFrame( TRUE );
index 96715ecd96ef720cff92d86d70d4fcdd11446196..daea0d124fa8b4518410501d29d30c5820558196 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: parageneraldlgdata.h
-       Last generated: Sun Oct 15 16:00:50 2000
+       Last generated: Tue Oct 24 13:38:19 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
index ee62d401963cfe6198818d1cb779a040f6447bcb..9a78e91de3a3983479c2a29f44b96da00b587451 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: printdlgdata.C
-       Last generated: Sat Oct 14 03:43:43 2000
+       Last generated: Tue Oct 24 13:38:22 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
@@ -11,6 +11,7 @@
  *********************************************************************/
 
 #include <gettext.h>
+
 #include <qpixmap.h>
 #include <qlayout.h>
 #include "printdlgdata.h"
@@ -53,7 +54,7 @@ PrintDialogData::PrintDialogData
        pagesRadioGroup->setLineWidth( 1 );
        pagesRadioGroup->setMidLineWidth( 0 );
        pagesRadioGroup->QFrame::setMargin( 0 );
-       pagesRadioGroup->setTitle( _("") );
+       pagesRadioGroup->setTitle( "" );
        pagesRadioGroup->setAlignment( 1 );
        pagesRadioGroup->setExclusive( TRUE );
 
@@ -99,7 +100,7 @@ PrintDialogData::PrintDialogData
        printToRadioGroup->setLineWidth( 1 );
        printToRadioGroup->setMidLineWidth( 0 );
        printToRadioGroup->QFrame::setMargin( 0 );
-       printToRadioGroup->setTitle( _("") );
+       printToRadioGroup->setTitle( "" );
        printToRadioGroup->setAlignment( 1 );
        printToRadioGroup->setExclusive( TRUE );
 
@@ -171,7 +172,7 @@ PrintDialogData::PrintDialogData
        from->setBackgroundMode( QWidget::PaletteBase );
        from->setFontPropagation( QWidget::NoChildren );
        from->setPalettePropagation( QWidget::NoChildren );
-       from->setText( _("") );
+       from->setText( "" );
        from->setMaxLength( 32767 );
        from->setFrame( QLineEdit::Normal );
        from->setFrame( TRUE );
@@ -255,7 +256,7 @@ PrintDialogData::PrintDialogData
        printername->setBackgroundMode( QWidget::PaletteBase );
        printername->setFontPropagation( QWidget::NoChildren );
        printername->setPalettePropagation( QWidget::NoChildren );
-       printername->setText( _("") );
+       printername->setText( "" );
        printername->setMaxLength( 32767 );
        printername->setFrame( QLineEdit::Normal );
        printername->setFrame( TRUE );
@@ -281,7 +282,7 @@ PrintDialogData::PrintDialogData
        filename->setBackgroundMode( QWidget::PaletteBase );
        filename->setFontPropagation( QWidget::NoChildren );
        filename->setPalettePropagation( QWidget::NoChildren );
-       filename->setText( _("") );
+       filename->setText( "" );
        filename->setMaxLength( 32767 );
        filename->setFrame( QLineEdit::Normal );
        filename->setFrame( TRUE );
@@ -325,7 +326,7 @@ PrintDialogData::PrintDialogData
        count->setBackgroundMode( QWidget::PaletteBase );
        count->setFontPropagation( QWidget::NoChildren );
        count->setPalettePropagation( QWidget::NoChildren );
-       count->setText( _("") );
+       count->setText( "" );
        count->setMaxLength( 32767 );
        count->setFrame( QLineEdit::Normal );
        count->setFrame( TRUE );
@@ -354,7 +355,7 @@ PrintDialogData::PrintDialogData
        to->setBackgroundMode( QWidget::PaletteBase );
        to->setFontPropagation( QWidget::NoChildren );
        to->setPalettePropagation( QWidget::NoChildren );
-       to->setText( _("") );
+       to->setText( "" );
        to->setMaxLength( 32767 );
        to->setFrame( QLineEdit::Normal );
        to->setFrame( TRUE );
index 3e9b84ed62c122c358bcfb92680af1e1b591df96..2c46bfe8caf7a1677a8a2eb7aa802fb1429d43c1 100644 (file)
@@ -3,7 +3,7 @@
        --- Qt Architect generated file ---
 
        File: printdlgdata.h
-       Last generated: Sat Oct 14 03:43:43 2000
+       Last generated: Tue Oct 24 13:38:22 2000
 
        DO NOT EDIT!!!  This file will be automatically
        regenerated by qtarch.  All changes will be lost.
index 0aaea3fcf9f342d039ac1cbb82c9396e6e6b8f11..0892d444b5ce74ae53d0ebd16408151bc0c8c382 100644 (file)
@@ -13,6 +13,7 @@
 #include "FormPrint.h"
 #include "FormRef.h"
 #include "FormTabular.h"
+#include "FormTabularCreate.h"
 #include "FormToc.h"
 #include "FormUrl.h"
 
@@ -37,6 +38,7 @@ Dialogs::Dialogs(LyXView * lv)
        dialogs_.push_back(new FormPrint(lv, this));
        dialogs_.push_back(new FormRef(lv, this));
        dialogs_.push_back(new FormTabular(lv, this));
+       dialogs_.push_back(new FormTabularCreate(lv, this));
        dialogs_.push_back(new FormToc(lv, this));
        dialogs_.push_back(new FormUrl(lv, this));
 
index deb7168a0d68ab9685ae32094f321d35796bd88b..1583e7f9600c7181ed7ba6747f4fdbcb9d3ca034 100644 (file)
@@ -167,7 +167,7 @@ FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t,
 void FormBaseBD::connect()
 {
        u_ = d_->updateBufferDependent.
-                connect(slot(this, &FormBaseBD::update));
+                connect(slot(this, &FormBaseBD::updateSlot));
        h_ = d_->hideBufferDependent.
                 connect(slot(this, &FormBaseBD::hide));
        FormBase::connect();
index 26febe08f294a3aeab86b3fe46760c35ee403da0..3eca8ca3ede88863cc09cd8c198ddaccd67770c1 100644 (file)
@@ -59,8 +59,8 @@ protected: // methods
        void show();
        /// Hide the dialog.
        virtual void hide();
-       /// bool indicates if a buffer switch took place
-       virtual void update(bool = false) {}
+       /// Update the dialog.
+       virtual void update() {}
        /// Connect signals. Also perform any necessary initialisation.
        virtual void connect();
        /// Disconnect signals. Also perform any necessary housekeeping.
@@ -146,6 +146,8 @@ protected:
        virtual void connect();
        /// Disconnect signals
        virtual void disconnect();
+       /// bool indicates if a buffer switch took place
+       virtual void updateSlot(bool) { update(); }
 
        /// Update connection.
        Connection u_;
index d30404528815718a587edb8528f2f56ac13358ca..c782adcaaed06d985ed1ec2b4e343e49bbc8cc26 100644 (file)
@@ -10,9 +10,6 @@
  */
 
 #include <config.h>
-
-#include FORMS_H_LOCATION
-
 #include <algorithm>
 
 #ifdef __GNUG__
@@ -86,13 +83,8 @@ void FormCitation::build()
 }
 
 
-void FormCitation::update(bool switched)
+void FormCitation::update()
 {
-       if (switched) {
-               hide();
-               return;
-       }
-
        bibkeys.clear();
        bibkeysInfo.clear();
 
index a8ac4cfb33b1c6ae2fb1110846ff914fb157d68c..175832d4303ba63d179512fddc012a24e30175fe 100644 (file)
@@ -57,7 +57,7 @@ private:
        /// Filter the inputs
        virtual bool input( FL_OBJECT *, long );
        /// Update dialog before showing it
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Apply from dialog (modify or create inset)
        virtual void apply();
        /// Pointer to the actual instantiation of the xform's form
index e3051215e9afdd02aa8d7dccc24bc996f2262243..3452f6ee573e4b54c7532ca05f74a25e72fe95a9 100644 (file)
@@ -303,8 +303,7 @@ void FormDocument::cancel()
 }
 
 
-// we can safely ignore the parameter because we can always update
-void FormDocument::update(bool)
+void FormDocument::update()
 {
     if (!dialog_)
         return;
index 76a413c950c303c236720053e4b5b3a99aac8094..2805d4cf763b0cf0dc78305241c6a6b97ca0e165 100644 (file)
@@ -84,7 +84,7 @@ private:
        /// Filter the inputs
        virtual bool input( FL_OBJECT *, long );
        /// Update the popup.
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Apply from popup
        virtual void apply();
        /// Cancel from popup
index 9bdf9dfb69b3977bcb717bf8831f433ebca3b912..34b0b5077e566409218447dba50c128735101a06 100644 (file)
@@ -60,19 +60,15 @@ void FormError::showInset( InsetError * inset )
        if (inset_)
                ih_.disconnect();
 
-       inset_    = inset;
-       message_  = inset->getContents();
+       inset_ = inset;
+       message_ = inset->getContents();
+       ih_ = inset->hide.connect(slot(this, &FormError::hide));
        show();
 }
 
 
-void FormError::update(bool switched)
+void FormError::update()
 {
-       if (switched) {
-               hide();
-               return;
-       }
-
        fl_set_object_label(dialog_->message, message_.c_str());
 }
 
index 5ce6f6d3ead7a97cefce1cfdae090c484fa0b4f3..4211bc89812e877948eafce0b0e8d7630d7e79ce 100644 (file)
@@ -36,7 +36,7 @@ private:
        /// Slot launching dialog to an existing inset
        void showInset( InsetError * );
        /// Update dialog before showing it
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Build the dialog
        virtual void build();
        /// Pointer to the actual instantiation of the xform's form
index d04ebfddbd198c0447f0392e3b5bdcd353025568..49cb50d87de065fa2f56fb950717b2548739ad51 100644 (file)
 #endif 
 
 #include "lyx_gui_misc.h"
-#include "gettext.h"
-#include FORMS_H_LOCATION
-
-#include "xform_macros.h"
 #include "input_validators.h"
 #include "FormGraphics.h"
 #include "form_graphics.h"
 
 using std::endl;
 
-C_RETURNCB(FormGraphics, WMHideCB)
-C_GENERICCB(FormGraphics, OKCB)
-C_GENERICCB(FormGraphics, ApplyCB)
-C_GENERICCB(FormGraphics, CancelCB)
-C_GENERICCB(FormGraphics, BrowseCB)
-C_GENERICCB(FormGraphics, AdvancedOptionsCB)
-C_GENERICCB(FormGraphics, InputCB)
-
 
 FormGraphics::FormGraphics(LyXView * lv, Dialogs * d)
-               : dialog_(0), lv_(lv), d_(d), inset_(0),
-               // The buttons c-tor values are the number of buttons we use
-               // This is only to reduce memory waste.
-               widthButtons(5), heightButtons(4), displayButtons(4),
-               bc_(new ButtonController
-                       (new NoRepeatedApplyReadOnlyPolicy, _("Cancel"), _("Close") )
-               ),
-               ih_(0), h_(0), u_(0),
-               last_image_path(".")
+       : FormInset( lv, d, _("Graphics"), new NoRepeatedApplyReadOnlyPolicy ),
+         dialog_(0), inset_(0),
+         // The buttons c-tor values are the number of buttons we use
+         // This is only to reduce memory waste.
+         widthButtons(5), heightButtons(4), displayButtons(4),
+         last_image_path(".")
 {
-       Assert(lv_ != 0);
-       Assert(d   != 0);
-       Assert(bc_ != 0);
-       
        // let the dialog be shown
        // This is a permanent connection so we won't bother
        // storing a copy because we won't be disconnecting.
@@ -76,9 +57,6 @@ FormGraphics::FormGraphics(LyXView * lv, Dialogs * d)
 FormGraphics::~FormGraphics()
 {
        free();
-       
-       // Free the button controller.
-       delete bc_;
 }
 
 
@@ -91,6 +69,10 @@ void FormGraphics::build()
                return ;
        }
 
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
+
        // This is the place to add settings of the dialog that did not go
        // to the .fd file.
 
@@ -154,81 +136,39 @@ void FormGraphics::build()
        displayButtons.registerRadioButton(dialog_->radio_no_display,
                                           InsetGraphicsParams::NONE);
 
-       // Connect a signal to hide the window when the window manager orders it.
-       fl_set_form_atclose(dialog_->form,
-                           C_FormGraphicsWMHideCB, 0);
-
-       bc_->setOK(dialog_->button_ok);
-       bc_->setApply(dialog_->button_apply);
-       bc_->setCancel(dialog_->button_cancel);
-       bc_->setUndoAll(0);
-       bc_->refresh();
+        // manage the ok, apply and cancel/close buttons
+       bc_.setOK(dialog_->button_ok);
+       bc_.setApply(dialog_->button_apply);
+       bc_.setCancel(dialog_->button_cancel);
+       bc_.setUndoAll(0);
+       bc_.refresh();
 }
 
-void FormGraphics::show()
-{
-       // If the dialog doesn't exist yet, build it.
-       if (!dialog_) {
-               build();
-       }
 
-       // Update the form with the data from the inset.
-       update();
-
-       // If the form is visible
-       if (dialog_->form->visible) {
-               // Raise it.
-               fl_raise_form(dialog_->form);
-       } else {
-               // Otherwise (invisible), show it.
-               fl_show_form(dialog_->form,
-                            FL_PLACE_MOUSE,
-                            FL_TRANSIENT,
-                            _("Graphics"));
-
-               // And connect the signals 'updateBufferDependent',
-               // 'hideBufferDependent' and 'hideGraphics'.
-               u_ = d_->updateBufferDependent.connect(slot(this,
-                                                      &FormGraphics::update));
-               h_ = d_->hideBufferDependent.connect(slot(this,
-                                                    &FormGraphics::hide));
-       }
+FL_FORM * FormGraphics::form() const
+{
+       if ( dialog_ ) return dialog_->form;
+       return 0;
 }
 
-void FormGraphics::showDialog(InsetGraphics* inset)
+
+void FormGraphics::disconnect()
 {
-       Assert(inset != 0);
+       inset_ = 0;
+       FormInset::disconnect();
+}
 
+
+void FormGraphics::showDialog(InsetGraphics * inset)
+{
        // If we are connected to another inset, disconnect.
        if (inset_)
                ih_.disconnect();
 
        inset_ = inset;
 
-       if (inset_) {
-               ih_ = inset_->hide.connect(slot(this, &FormGraphics::hide));
-               show();
-       }
-}
-
-
-void FormGraphics::hide()
-{
-       // If the dialog exists, and the form is allocated and visible.
-       if (dialog_
-               && dialog_->form
-               && dialog_->form->visible) {
-               // Hide the form
-               fl_hide_form(dialog_->form);
-
-               // And disconnect the signals.
-               u_.disconnect();
-               h_.disconnect();
-               ih_.disconnect();
-
-               // Forget the inset.
-               inset_ = 0;
-       }
+       ih_ = inset_->hide.connect(slot(this, &FormGraphics::hide));
+       show();
 }
 
 
@@ -245,6 +185,7 @@ void FormGraphics::free()
        dialog_ = 0;
 }
 
+
 void FormGraphics::apply()
 {
        Assert(inset_ != 0);
@@ -289,16 +230,8 @@ void FormGraphics::apply()
 }
 
 
-// it doesn't look this is capable of updating on a buffer switch
-// inset_ would be accessible but it's not in the new buffer so
-// ok or apply will call something that won't like it. ARRae.
-void FormGraphics::update(bool switched)
+void FormGraphics::update()
 {
-       if (switched) {
-               hide();
-               return;
-       }
-
        Assert(inset_ != 0);
 
        // Update dialog with details from inset
@@ -336,9 +269,36 @@ void FormGraphics::update(bool switched)
                      igp.inlineFigure);
 
        // Now make sure that the buttons are set correctly.
-       checkInput();
+       input(0, 0);
 }
 
+
+bool FormGraphics::input(FL_OBJECT *, long data )
+{
+       State cb = static_cast<State>( data );
+
+       bool inputOK = true;
+
+       switch( cb ) {
+       case CHECKINPUT:
+               inputOK = checkInput();
+               break;
+       case BROWSE:
+               browse();
+               break;
+       case ADVANCEDINPUT:
+               lyxerr << "Advanced Options button depressed, "
+                      << "show advanced options dialog"
+                      << endl;
+               break;
+       default:
+               break;
+       }
+       
+       return inputOK;
+}
+
+
 bool FormGraphics::checkInput()
 {
        // Put verifications that the dialog shows some sane values,
@@ -392,6 +352,7 @@ extern string system_lyxdir;
 extern string user_lyxdir;
 //extern string system_tempdir;
 
+
 // Need to move this to the form_graphics
 string FormGraphics::browseFile(string const & filename)
 {
@@ -434,6 +395,7 @@ string FormGraphics::browseFile(string const & filename)
        return buf;
 }
 
+
 void FormGraphics::browse()
 {
        // Get the filename from the dialog
@@ -449,67 +411,7 @@ void FormGraphics::browse()
                // The above set input doesn't cause an input event so we do
                // it manually. Otherwise the user needs to cause an input event
                // to get the ok/apply buttons to be activated.
-               checkInput();
+               input(0, 0);
        }
 
 }
-
-int FormGraphics::WMHideCB(FL_FORM * form, void *)
-{
-       // Ensure that the signal h is disconnected even if the
-       // window manager is used to close the dialog.
-       FormGraphics * pre = static_cast < FormGraphics* > (form->u_vdata);
-       pre->hide();
-
-       pre->bc_->hide();
-       
-       return FL_CANCEL;
-}
-
-
-void FormGraphics::OKCB(FL_OBJECT * ob, long)
-{
-       FormGraphics * pre = static_cast < FormGraphics* > (ob->form->u_vdata);
-       pre->apply();
-       pre->hide();
-       
-       pre->bc_->ok();
-}
-
-void FormGraphics::ApplyCB(FL_OBJECT * ob, long)
-{
-       FormGraphics * pre = static_cast < FormGraphics* > (ob->form->u_vdata);
-       pre->apply();
-       
-       pre->bc_->apply();
-}
-
-void FormGraphics::CancelCB(FL_OBJECT * ob, long)
-{
-       FormGraphics * pre = static_cast < FormGraphics* > (ob->form->u_vdata);
-       pre->hide();
-       
-       pre->bc_->cancel();
-}
-
-void FormGraphics::BrowseCB(FL_OBJECT * ob, long)
-{
-       FormGraphics * pre = static_cast < FormGraphics* > (ob->form->u_vdata);
-       pre->browse();
-}
-
-void FormGraphics::AdvancedOptionsCB(FL_OBJECT * /* ob */, long)
-{
-       //  FormGraphics * pre = static_cast<FormGraphics*>(ob->form->u_vdata);
-       //      pre->showAdvancedOptions();
-       lyxerr << "Advanced Options button depressed, "
-       "show advanced options dialog"
-       << endl;
-}
-
-void FormGraphics::InputCB(FL_OBJECT * ob, long)
-{
-       FormGraphics * pre = static_cast < FormGraphics* > (ob->form->u_vdata);
-       pre->bc_->valid(pre->checkInput());
-}
-
index bad8f822322928213189d00864aa15fc3442f831..ce3b853ce79551ff7972ed8e5d81b7cf1cf70864 100644 (file)
 #define FORMGRAPHICS_H
 
 #include "LString.h"
-#include "frontends/DialogBase.h"
 #include "RadioButtonGroup.h"
-#include <boost/utility.hpp>
-#include "ButtonController.h"
 #include "ButtonPolicies.h"
+#include "FormInset.h"
 
 #ifdef __GNUG__
 #pragma interface
 #endif 
 
 // Forward declarations for classes we use only as pointers.
-class Dialogs;
-class LyXView;
 class InsetGraphics;
 
 struct FD_form_graphics;
@@ -38,26 +34,12 @@ struct FD_form_graphics;
  *
  *  @Author Baruch Even <baruch.even@writeme.com>
  */
-class FormGraphics: public DialogBase, public noncopyable {
+class FormGraphics : public FormInset {
 public:
        /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
        FormGraphics(LyXView *, Dialogs *);
        ///
        ~FormGraphics();
-       ///
-       static int WMHideCB(FL_FORM *, void *);
-       ///
-       static void OKCB(FL_OBJECT *, long);
-       ///
-       static void ApplyCB(FL_OBJECT *, long);
-       ///
-       static void CancelCB(FL_OBJECT *, long);
-       ///
-       static void BrowseCB(FL_OBJECT *, long);
-       ///
-       static void AdvancedOptionsCB(FL_OBJECT *, long);
-       ///
-       static void InputCB(FL_OBJECT *, long);
 
 private:
        /// The maximum digits for the image width (cm, inch, percent)
@@ -80,43 +62,46 @@ private:
            ///
            FILENAME_MAXCHARS = 1024
        };
+       ///
+       enum State {
+               ///
+               CHECKINPUT,
+               ///
+               BROWSE,
+               ///
+               ADVANCEDINPUT
+       };
 
-       /// Save the active inset and show the dialog.
-       void showDialog(InsetGraphics * inset);
-       /// Create the dialog if necessary, update it and display it.
-       void show();
-       /// Hide the dialog.
-       void hide();
-       /// Update the dialog
-       void update(bool switched = false);
+       /// Build the dialog
+       virtual void build();
+       /// Filter the inputs
+       virtual bool input( FL_OBJECT *, long );
+       /// Update the popup.
+       virtual void update();
+       /// Apply from popup
+       virtual void apply();
+
+       /// Disconnect signals. Also perform any necessary housekeeping.
+       virtual void disconnect();
 
-       /// Apply the changes to the inset.
-       void apply();
+       /// Save the active inset and show the dialog.
+       void showDialog(InsetGraphics *);
+       /// Explicitly free the dialog.
+       void free();
        /// Verify that the input is correct. If not disable ok/apply buttons.
        bool checkInput();
        /// Open the file browse dialog to select an image file.
        void browse();
-
-       /// Build the dialog
-       void build();
-       ///
-       FD_form_graphics * build_graphics();
-       /// Explicitly free the dialog.
-       void free();
        /// Display a file browser dialog and return the file chosen.
        string browseFile(string const & filename);
 
+       /// Pointer to the actual instantiation of the xform's form
+       virtual FL_FORM * form() const;
+       /// Fdesign generated method
+       FD_form_graphics * build_graphics();
+
        /// Real GUI implementation.
        FD_form_graphics * dialog_;
-       /** Which LyXFunc do we use?
-           We could modify Dialogs to have a visible LyXFunc* instead and
-           save a couple of bytes per dialog.
-       */
-       LyXView * lv_;
-       /** Which Dialogs do we belong to?
-           Used so we can get at the signals we have to connect to.
-       */
-       Dialogs * d_;
        /** Which Inset do we belong to?
           Used to set and update data to/from the inset.
        */
@@ -127,15 +112,6 @@ private:
        RadioButtonGroup heightButtons;
        ///
        RadioButtonGroup displayButtons;
-       /// Controls the actions of the buttons.
-       ButtonController * bc_;
-
-       /// Inset Hide connection, connected to the calling inset hide signal.
-       Connection ih_;
-       /// Hide connection.
-       Connection h_;
-       /// Update connection.
-       Connection u_;
        /// Last used figure path
        string last_image_path;
 };
index cefacea8dba19096a5e2f929c73dde0c58b2bbf9..45bcebe8dc2a4e41d21dc18d66ac2906853f9f77 100644 (file)
@@ -69,13 +69,8 @@ void FormIndex::build()
 }
 
 
-void FormIndex::update(bool switched)
+void FormIndex::update()
 {
-       if (switched) {
-               hide();
-               return;
-       }
-
        fl_set_input(dialog_->key, params.getContents().c_str());
 
        if ( lv_->buffer()->isReadonly() ) {
index 19f93e23911b1ce291d29857fe65d395f0520cbe..6714b1d06ff06ef80fafb1f6e2fcd6ae67b55cb2 100644 (file)
@@ -33,7 +33,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Update dialog before showing it
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Apply from dialog (modify or create inset)
        virtual void apply();
        /// Pointer to the actual instantiation of the xform's form
index 743293f8648db454878e3d86328cc5898bd9543c..d45f507768768e9121bc64de48966f470137641d 100644 (file)
@@ -29,20 +29,19 @@ FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t,
 {}
 
 
-void FormInset::connect()
+void FormInset::disconnect()
 {
-       u_ = d_->updateBufferDependent.
-                connect(slot(this, &FormInset::update));
-       h_ = d_->hideBufferDependent.
-                connect(slot(this, &FormInset::hide));
-       FormBase::connect();
+       ih_.disconnect();
+       FormBaseBD::disconnect();
 }
 
 
-void FormInset::disconnect()
+void FormInset::updateSlot( bool switched )
 {
-       ih_.disconnect();
-       FormBaseBD::disconnect();
+       if (switched)
+               hide();
+       else
+               update();
 }
 
 
index 1ffd4d2359cc30c1c1f94abd425569a70760f90a..f523336ae33ef7cd70a6fcbd26370ede6ae9629e 100644 (file)
@@ -30,11 +30,12 @@ protected:
                   char const * close = N_("Close"),
                   char const * cancel = N_("Cancel"));
 
-       /// Connect signals. Also perform any necessary initialisation.
-       virtual void connect();
        /// Disconnect signals. Also perform any necessary housekeeping.
        virtual void disconnect();
 
+       /// bool indicates if a buffer switch took place
+       virtual void updateSlot(bool);
+
        /// inset::hide connection.
        Connection ih_;
 };
index 0e2f85a95f2195921c8874985ba2d3c0a9d12d12..0f9beea210d1f31ca2268c9f534332dd09787e7b 100644 (file)
@@ -136,8 +136,7 @@ void FormParagraph::apply()
 }
 
 
-// we can safely ignore the parameter because we can always update
-void FormParagraph::update(bool)
+void FormParagraph::update()
 {
     if (!dialog_)
         return;
index 4870989da87c12ae251794d09f8a74d51d534d5c..3e6d1b105d2690dee34a409b498bdde31a4ed112 100644 (file)
@@ -40,7 +40,7 @@ private:
        /// Apply from popup
        virtual void apply();
        /// Update the popup.
-       virtual void update(bool);
+       virtual void update();
        /// Filter the inputs on callback from xforms
        virtual bool input(FL_OBJECT * ob, long);
 
index 5815dd11ad95f42a988357ed6bbfbba7bc3484f0..4ab43da97ba26e45b83f09dbd9cfc26d58bfdcd6 100644 (file)
@@ -372,8 +372,7 @@ void FormPreferences::apply()
 }
 
 
-// we can safely ignore the parameter because we can always update
-void FormPreferences::update(bool)
+void FormPreferences::update()
 {
        if (dialog_) {
                // read lyxrc entries
index 5657707cb98094fb3a517d350aed9de54fd53931..b7a809b6036b2d0b78df2aba8baba2ab4cbfb99f 100644 (file)
@@ -46,7 +46,7 @@ public:
        ~FormPreferences();
 private:
        /// Update the dialog.
-       virtual void update(bool = false);
+       virtual void update();
        ///
        virtual void hide();
        /// OK from dialog
index 4c9dff6571f2ad4c45aea32aa7b14ef937ce3f96..a8aab2b8af069e2808058edf785d266a56e8f2eb 100644 (file)
@@ -158,8 +158,7 @@ void FormPrint::apply()
 }
 
 
-// we can safely ignore the parameter because we can always update
-void FormPrint::update(bool)
+void FormPrint::update()
 {
        if (dialog_
            && lv_->view()->available()) {
index 28acdcc4ca3fc2720dac563a14b001b010debb8c..0f9f69dda1bdcec3c1bfd4928fbf79bb894aa739 100644 (file)
@@ -40,7 +40,7 @@ public:
 
 private:
        /// Update the dialog.
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Apply from dialog
        virtual void apply();
        /// Filter the inputs
index ecbd5db944b6c12686ec31a6ad977b85968b9e7f..8acdaa65028dbfcffffdcace320d2195d9650fc6 100644 (file)
@@ -95,13 +95,8 @@ void FormRef::build()
 }
 
 
-void FormRef::update(bool switched)
+void FormRef::update()
 {
-       if (switched) {
-               hide();
-               return;
-       }
-
        fl_set_input(dialog_->ref,  params.getContents().c_str());
        fl_set_input(dialog_->name, params.getOptions().c_str());
 
index e7ad15d418342a7be1cfcbf7dcbe45fd410ea599..f314d837fd5fd025020faa3f1b6c002e11549402 100644 (file)
@@ -61,7 +61,7 @@ private:
        /// Filter the input
        virtual bool input( FL_OBJECT *, long );
        /// Update dialog before showing it
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Not used but must be instantiated
        virtual void apply();
        /// Pointer to the actual instantiation of the xform's form
index 096a7573ca7fc35c1ceec83d2b066ba5a8b5175a..4c7806d7e1870d80856662855a9fe51c68874876 100644 (file)
+// -*- C++ -*-
+/* This file is part of
+ * ======================================================
+ * 
+ *           LyX, The Document Processor
+ *      
+ *         Copyright 1995 Matthias Ettrich
+ *          Copyright 1995-2000 The LyX Team.
+ *
+ *======================================================*/
 /* FormTabular.C
  * FormTabular Interface Class Implementation
  */
 
 #include <config.h>
-#include "lyx_gui_misc.h"
-#include "gettext.h"
-#include FORMS_H_LOCATION
 
 #include "FormTabular.h"
 #include "form_tabular.h"
-#include "xform_macros.h"
-#include "input_validators.h"
 #include "LyXView.h"
-#include "lyxfunc.h"
 #include "Dialogs.h"
-#include "lyxrc.h"
-#include "debug.h"
 #include "insets/insettabular.h"
 #include "buffer.h"
 
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::slot;
-#endif
-
-C_RETURNCB(FormTabular,  WMHideCB)
-C_GENERICCB(FormTabular, CloseCB)
-C_GENERICCB(FormTabular, InputCB)
-C_GENERICCB(FormTabular, OKCB)
-C_GENERICCB(FormTabular, ApplyCB)
-C_GENERICCB(FormTabular, CancelCB)
-
-
 FormTabular::FormTabular(LyXView * lv, Dialogs * d)
-       : dialog_(0), tabular_options_(0), column_options_(0),
-         cell_options_(0), longtable_options_(0), create_tabular_(0),
-         lv_(lv), d_(d), u_(0), h_(0), inset_(0), actCell_(-1) 
+       : FormInset( lv, d, _("Tabular Layout") ),
+         dialog_(0), tabular_options_(0), column_options_(0),
+         cell_options_(0), longtable_options_(0),
+         inset_(0), actCell_(-1)
 {
-    // let the dialog be shown
-    // This is a permanent connection so we won't bother
-    // storing a copy because we won't be disconnecting.
-    d->showTabular.connect(slot(this, &FormTabular::showInset));
-    d->updateTabular.connect(slot(this, &FormTabular::updateInset));
-    d->hideTabular.connect(slot(this, &FormTabular::hideInset));
-    d->showTabularCreate.connect(slot(this, &FormTabular::show_create));
+       // let the dialog be shown
+       // This is a permanent connection so we won't bother
+       // storing a copy because we won't be disconnecting.
+       d->showTabular.connect(slot(this, &FormTabular::showInset));
+       d->updateTabular.connect(slot(this, &FormTabular::updateInset));
 }
 
 
 FormTabular::~FormTabular()
 {
-    // we don't need to disconnect u and h here because
-    // their destructors do that.
-    delete dialog_;
-    delete tabular_options_;
-    delete column_options_;
-    delete cell_options_;
-    delete longtable_options_;
-    delete create_tabular_;
-}
-
-
-void FormTabular::build()
-{
-    dialog_ = build_tabular();
-    tabular_options_ = build_tabular_options();
-    column_options_ = build_column_options();
-    cell_options_ = build_cell_options();
-    longtable_options_ = build_longtable_options();
-    create_tabular_ = build_create_tabular();
-
-    fl_set_input_return(column_options_->input_column_width,
-                       FL_RETURN_END);
-    fl_set_input_return(column_options_->input_special_alignment,
-                       FL_RETURN_CHANGED);
-    fl_set_input_return(cell_options_->input_mcolumn_width,
-                       FL_RETURN_CHANGED);
-    fl_set_input_return(cell_options_->input_special_multialign,
-                       FL_RETURN_CHANGED);
-
-    fl_addto_tabfolder(dialog_->tabFolder, _("Tabular"),
-                      tabular_options_->form);
-    fl_addto_tabfolder(dialog_->tabFolder, _("Column/Row"),
-                      column_options_->form);
-    fl_addto_tabfolder(dialog_->tabFolder, _("Cell"),
-                      cell_options_->form);
-    fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"),
-                      longtable_options_->form);
-    
-    fl_set_form_atclose(dialog_->form,
-                       C_FormTabularWMHideCB, 0);
-
-    fl_set_slider_bounds(create_tabular_->slider_rows, 1, 50);
-    fl_set_slider_bounds(create_tabular_->slider_columns, 1, 50);
-    fl_set_slider_value(create_tabular_->slider_rows, 5);
-    fl_set_slider_value(create_tabular_->slider_columns, 5);
-    fl_set_slider_precision(create_tabular_->slider_rows, 0);
-    fl_set_slider_precision(create_tabular_->slider_columns, 0);
-    fl_set_form_atclose(create_tabular_->form, 
-                        C_FormTabularWMHideCB, 0);
+       delete dialog_;
+       delete tabular_options_;
+       delete column_options_;
+       delete cell_options_;
+       delete longtable_options_;
 }
 
 
-void FormTabular::show()
+FL_FORM * FormTabular::form() const
 {
-    if (!dialog_) {
-       build();
-    }
-    update();  // make sure its up-to-date
-
-    if (dialog_->form->visible) {
-       fl_raise_form(dialog_->form);
-    } else {
-       fl_show_form(dialog_->form,
-                    FL_PLACE_MOUSE | FL_FREE_SIZE,
-                    FL_TRANSIENT,
-                    _("Tabular Layout"));
-//     u_ = d_->updateBufferDependent.connect(slot(this,
-//                                                 &FormTabular::update));
-       h_ = d_->hideBufferDependent.connect(slot(this,
-                                                 &FormTabular::hide));
-    }
+       if ( dialog_ ) return dialog_->form;
+       return 0;
 }
 
-void FormTabular::showInset(InsetTabular * ti)
-{
-    inset_ = ti;
-    if (ti) {
-       show();
-    }
-}
 
-void FormTabular::hide()
+void FormTabular::disconnect()
 {
-    if (dialog_ && dialog_->form && dialog_->form->visible) {
-       fl_hide_form(dialog_->form);
-       u_.disconnect();
-       h_.disconnect();
        inset_ = 0;
-    }
+       FormInset::disconnect();
 }
 
 
-void FormTabular::hideInset(InsetTabular * ti)
+void FormTabular::showInset( InsetTabular * inset )
 {
-    if (inset_ == ti) {
-       inset_ = 0;
-       hide();
-    }
-}
+       if (inset == 0) return;
 
+       // If connected to another inset, disconnect from it.
+       if (inset_ != inset) {
+               ih_.disconnect();
+               ih_ = inset->hideDialog.connect(slot(this, &FormTabular::hide));
+               inset_ = inset;
+       }
 
-void FormTabular::update(bool)
-{
-    if (dialog_) {
-       local_update(true);
-    }
-}
-
-void FormTabular::updateInset(InsetTabular * ti)
-{
-    inset_ = ti;
-    if (ti && dialog_ && dialog_->form->visible) {
-       update();
-    }
+       show();
 }
 
 
-int FormTabular::WMHideCB(FL_FORM * form, void *)
+void FormTabular::updateInset( InsetTabular * inset )
 {
-    // Ensure that the signals (u and h) are disconnected even if the
-    // window manager is used to close the dialog.
-    FormTabular * pre = static_cast<FormTabular*>(form->u_vdata);
-    pre->hide();
-    return FL_CANCEL;
-}
+       if (inset == 0 || inset_ == 0) return;
 
+       // If connected to another inset, disconnect from it.
+       if (inset_ != inset) {
+               ih_.disconnect();
+               ih_ = inset->hideDialog.connect(slot(this, &FormTabular::hide));
+               inset_ = inset;
+       }
 
-void FormTabular::CloseCB(FL_OBJECT * ob, long)
-{
-    FormTabular * pre = static_cast<FormTabular*>(ob->form->u_vdata);
-    pre->hide();
+       update();
 }
 
 
-void FormTabular::InputCB(FL_OBJECT * ob, long l)
+void FormTabular::build()
 {
-    FormTabular * pre = static_cast<FormTabular*>(ob->form->u_vdata);
-    pre->SetTabularOptions(ob, l);
+       dialog_ = build_tabular();
+       tabular_options_ = build_tabular_options();
+       column_options_ = build_column_options();
+       cell_options_ = build_cell_options();
+       longtable_options_ = build_longtable_options();
+
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
+
+       fl_set_input_return(column_options_->input_column_width,
+                           FL_RETURN_END);
+       fl_set_input_return(column_options_->input_special_alignment,
+                           FL_RETURN_CHANGED);
+       fl_set_input_return(cell_options_->input_mcolumn_width,
+                           FL_RETURN_CHANGED);
+       fl_set_input_return(cell_options_->input_special_multialign,
+                           FL_RETURN_CHANGED);
+
+       fl_addto_tabfolder(dialog_->tabFolder, _("Tabular"),
+                          tabular_options_->form);
+       fl_addto_tabfolder(dialog_->tabFolder, _("Column/Row"),
+                          column_options_->form);
+       fl_addto_tabfolder(dialog_->tabFolder, _("Cell"),
+                          cell_options_->form);
+       fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"),
+                          longtable_options_->form);
 }
 
 
-bool FormTabular::local_update(bool)
+void FormTabular::update()
 {
-    if (!inset_ || !inset_->tabular)
-        return false;
-
-    LyXTabular
-        * tabular = inset_->tabular;
-    int
-        align,
-        cell,
-        column,row;
-    char
-        buf[12];
-    string
-        pwidth, special;
-
-    actCell_ = cell = inset_->GetActCell();
-    column = tabular->column_of_cell(cell)+1;
-    fl_set_object_label(dialog_->text_warning,"");
-    fl_activate_object(column_options_->input_special_alignment);
-    fl_activate_object(cell_options_->input_special_multialign);
-    fl_activate_object(column_options_->input_column_width);
-    sprintf(buf,"%d",column);
-    fl_set_input(dialog_->input_tabular_column, buf);
-    fl_deactivate_object(dialog_->input_tabular_column);
-    row = tabular->row_of_cell(cell)+1;
-    sprintf(buf,"%d",row);
-    fl_set_input(dialog_->input_tabular_row, buf);
-    fl_deactivate_object(dialog_->input_tabular_row);
-    if (tabular->IsMultiColumn(cell)) {
-        fl_set_button(cell_options_->radio_multicolumn, 1);
-        fl_set_button(cell_options_->radio_border_top,
-                     tabular->TopLine(cell)?1:0);
-        fl_activate_object(cell_options_->radio_border_top);
-        fl_set_object_lcol(cell_options_->radio_border_top, FL_BLACK);
-        fl_set_button(cell_options_->radio_border_bottom,
-                     tabular->BottomLine(cell)?1:0);
-        fl_activate_object(cell_options_->radio_border_bottom);
-        fl_set_object_lcol(cell_options_->radio_border_bottom, FL_BLACK);
-        fl_set_button(cell_options_->radio_border_left,
-                     tabular->LeftLine(cell)?1:0);
-        fl_activate_object(cell_options_->radio_border_left);
-        fl_set_object_lcol(cell_options_->radio_border_left, FL_BLACK);
-       fl_set_button(cell_options_->radio_border_right,
-                     tabular->RightLine(cell)?1:0);
-        fl_activate_object(cell_options_->radio_border_right);
-        fl_set_object_lcol(cell_options_->radio_border_right, FL_BLACK);
-       pwidth = tabular->GetMColumnPWidth(cell);
-       align = tabular->GetAlignment(cell);
+       if (!inset_ || !inset_->tabular)
+               return;
+
+       LyXTabular
+               * tabular = inset_->tabular;
+       int
+               align,
+               cell,
+               column,row;
+       char
+               buf[12];
+       string
+               pwidth, special;
+
+       actCell_ = cell = inset_->GetActCell();
+       column = tabular->column_of_cell(cell)+1;
+       fl_set_object_label(dialog_->text_warning,"");
+       fl_activate_object(column_options_->input_special_alignment);
+       fl_activate_object(cell_options_->input_special_multialign);
+       fl_activate_object(column_options_->input_column_width);
+       sprintf(buf,"%d",column);
+       fl_set_input(dialog_->input_tabular_column, buf);
+       fl_deactivate_object(dialog_->input_tabular_column);
+       row = tabular->row_of_cell(cell)+1;
+       sprintf(buf,"%d",row);
+       fl_set_input(dialog_->input_tabular_row, buf);
+       fl_deactivate_object(dialog_->input_tabular_row);
+       if (tabular->IsMultiColumn(cell)) {
+               fl_set_button(cell_options_->radio_multicolumn, 1);
+               fl_set_button(cell_options_->radio_border_top,
+                             tabular->TopLine(cell)?1:0);
+               fl_activate_object(cell_options_->radio_border_top);
+               fl_set_object_lcol(cell_options_->radio_border_top, FL_BLACK);
+               fl_set_button(cell_options_->radio_border_bottom,
+                             tabular->BottomLine(cell)?1:0);
+               fl_activate_object(cell_options_->radio_border_bottom);
+               fl_set_object_lcol(cell_options_->radio_border_bottom, FL_BLACK);
+               fl_set_button(cell_options_->radio_border_left,
+                             tabular->LeftLine(cell)?1:0);
+               fl_activate_object(cell_options_->radio_border_left);
+               fl_set_object_lcol(cell_options_->radio_border_left, FL_BLACK);
+               fl_set_button(cell_options_->radio_border_right,
+                             tabular->RightLine(cell)?1:0);
+               fl_activate_object(cell_options_->radio_border_right);
+               fl_set_object_lcol(cell_options_->radio_border_right, FL_BLACK);
+               pwidth = tabular->GetMColumnPWidth(cell);
+               align = tabular->GetAlignment(cell);
+               if (!pwidth.empty() || (align == LYX_ALIGN_LEFT))
+                       fl_set_button(cell_options_->radio_align_left, 1);
+               else if (align == LYX_ALIGN_RIGHT)
+                       fl_set_button(cell_options_->radio_align_right, 1);
+               else
+                       fl_set_button(cell_options_->radio_align_center, 1);
+               fl_activate_object(cell_options_->radio_align_left);
+               fl_set_object_lcol(cell_options_->radio_align_left, FL_BLACK);
+               fl_activate_object(cell_options_->radio_align_right);
+               fl_set_object_lcol(cell_options_->radio_align_right, FL_BLACK);
+               fl_activate_object(cell_options_->radio_align_center);
+               fl_set_object_lcol(cell_options_->radio_align_center, FL_BLACK);
+               align = tabular->GetVAlignment(cell);
+               fl_set_button(cell_options_->radio_valign_top, 0);
+               fl_set_button(cell_options_->radio_valign_bottom, 0);
+               fl_set_button(cell_options_->radio_valign_center, 0);
+               if (pwidth.empty() || (align == LyXTabular::LYX_VALIGN_CENTER))
+                       fl_set_button(cell_options_->radio_valign_center, 1);
+               else if (align == LyXTabular::LYX_VALIGN_BOTTOM)
+                       fl_set_button(cell_options_->radio_valign_bottom, 1);
+               else
+                       fl_set_button(cell_options_->radio_valign_top, 1);
+               fl_activate_object(cell_options_->radio_valign_top);
+               fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK);
+               fl_activate_object(cell_options_->radio_valign_bottom);
+               fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_BLACK);
+               fl_activate_object(cell_options_->radio_valign_center);
+               fl_set_object_lcol(cell_options_->radio_valign_center, FL_BLACK);
+               special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_MULTI);
+               fl_set_input(cell_options_->input_special_multialign, special.c_str());
+               fl_set_input(cell_options_->input_mcolumn_width,pwidth.c_str());
+               if (!lv_->buffer()->isReadonly()) {
+                       fl_activate_object(cell_options_->input_special_multialign);
+                       fl_set_object_lcol(cell_options_->input_special_multialign,
+                                          FL_BLACK);
+                       fl_activate_object(cell_options_->input_mcolumn_width);
+                       fl_set_object_lcol(cell_options_->input_mcolumn_width, FL_BLACK);
+               }
+               if (!pwidth.empty()) {
+                       fl_deactivate_object(cell_options_->radio_align_left);
+                       fl_deactivate_object(cell_options_->radio_align_right);
+                       fl_deactivate_object(cell_options_->radio_align_center);
+                       fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE);
+                       fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE);
+                       fl_set_object_lcol(cell_options_->radio_align_center, FL_INACTIVE);
+                       fl_activate_object(cell_options_->radio_valign_top);
+                       fl_activate_object(cell_options_->radio_valign_bottom);
+                       fl_activate_object(cell_options_->radio_valign_center);
+                       fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK);
+                       fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_BLACK);
+                       fl_set_object_lcol(cell_options_->radio_valign_center, FL_BLACK);
+               } else {
+                       fl_activate_object(cell_options_->radio_align_left);
+                       fl_activate_object(cell_options_->radio_align_right);
+                       fl_activate_object(cell_options_->radio_align_center);
+                       fl_set_object_lcol(cell_options_->radio_align_left, FL_BLACK);
+                       fl_set_object_lcol(cell_options_->radio_align_right, FL_BLACK);
+                       fl_set_object_lcol(cell_options_->radio_align_center, FL_BLACK);
+                       fl_deactivate_object(cell_options_->radio_valign_top);
+                       fl_deactivate_object(cell_options_->radio_valign_bottom);
+                       fl_deactivate_object(cell_options_->radio_valign_center);
+                       fl_set_object_lcol(cell_options_->radio_valign_top, FL_INACTIVE);
+                       fl_set_object_lcol(cell_options_->radio_valign_bottom,FL_INACTIVE);
+                       fl_set_object_lcol(cell_options_->radio_valign_center,FL_INACTIVE);
+               }
+       } else {
+               fl_set_button(cell_options_->radio_multicolumn, 0);
+               fl_set_button(cell_options_->radio_border_top, 0);
+               fl_deactivate_object(cell_options_->radio_border_top);
+               fl_set_object_lcol(cell_options_->radio_border_top, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_border_bottom, 0);
+               fl_deactivate_object(cell_options_->radio_border_bottom);
+               fl_set_object_lcol(cell_options_->radio_border_bottom, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_border_left, 0);
+               fl_deactivate_object(cell_options_->radio_border_left);
+               fl_set_object_lcol(cell_options_->radio_border_left, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_border_right, 0);
+               fl_deactivate_object(cell_options_->radio_border_right);
+               fl_set_object_lcol(cell_options_->radio_border_right, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_align_left, 0);
+               fl_deactivate_object(cell_options_->radio_align_left);
+               fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_align_right, 0);
+               fl_deactivate_object(cell_options_->radio_align_right);
+               fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_align_center, 0);
+               fl_deactivate_object(cell_options_->radio_align_center);
+               fl_set_object_lcol(cell_options_->radio_align_center, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_valign_top, 0);
+               fl_deactivate_object(cell_options_->radio_valign_top);
+               fl_set_object_lcol(cell_options_->radio_valign_top, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_valign_bottom, 0);
+               fl_deactivate_object(cell_options_->radio_valign_bottom);
+               fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_valign_center, 0);
+               fl_deactivate_object(cell_options_->radio_valign_center);
+               fl_set_object_lcol(cell_options_->radio_valign_center, FL_INACTIVE);
+               fl_set_input(cell_options_->input_special_multialign, "");
+               fl_deactivate_object(cell_options_->input_special_multialign);
+               fl_set_object_lcol(cell_options_->input_special_multialign, FL_INACTIVE);
+               fl_set_input(cell_options_->input_mcolumn_width,"");
+               fl_deactivate_object(cell_options_->input_mcolumn_width);
+               fl_set_object_lcol(cell_options_->input_mcolumn_width, FL_INACTIVE);
+       }
+       if (tabular->GetRotateCell(cell))
+               fl_set_button(cell_options_->radio_rotate_cell, 1);
+       else
+               fl_set_button(cell_options_->radio_rotate_cell, 0);
+       if (tabular->TopLine(cell, true))
+               fl_set_button(column_options_->radio_border_top, 1);
+       else
+               fl_set_button(column_options_->radio_border_top, 0);
+       if (tabular->BottomLine(cell, true))
+               fl_set_button(column_options_->radio_border_bottom, 1);
+       else
+               fl_set_button(column_options_->radio_border_bottom, 0);
+       if (tabular->LeftLine(cell, true))
+               fl_set_button(column_options_->radio_border_left, 1);
+       else
+               fl_set_button(column_options_->radio_border_left, 0);
+       if (tabular->RightLine(cell, true))
+               fl_set_button(column_options_->radio_border_right, 1);
+       else
+               fl_set_button(column_options_->radio_border_right, 0);
+       special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_COLUMN);
+       fl_set_input(column_options_->input_special_alignment, special.c_str());
+       if (lv_->buffer()->isReadonly()) 
+               fl_deactivate_object(column_options_->input_special_alignment);
+       else
+               fl_activate_object(column_options_->input_special_alignment);
+       pwidth = tabular->GetColumnPWidth(cell);
+       fl_set_input(column_options_->input_column_width,pwidth.c_str());
+       if (lv_->buffer()->isReadonly()) {
+               fl_deactivate_object(column_options_->input_column_width);
+       } else {
+               fl_activate_object(column_options_->input_column_width);
+       }
+       if (!pwidth.empty()) {
+               fl_activate_object(cell_options_->radio_useminipage);
+               fl_set_object_lcol(cell_options_->radio_useminipage, FL_BLACK);
+               if (tabular->GetUsebox(cell) == 2)
+                       fl_set_button(cell_options_->radio_useminipage, 1);
+               else
+                       fl_set_button(cell_options_->radio_useminipage, 0);
+       } else {
+               fl_deactivate_object(cell_options_->radio_useminipage);
+               fl_set_object_lcol(cell_options_->radio_useminipage, FL_INACTIVE);
+               fl_set_button(cell_options_->radio_useminipage,0);
+       }
+       align = tabular->GetAlignment(cell, true);
+       fl_set_button(column_options_->radio_align_left, 0);
+       fl_set_button(column_options_->radio_align_right, 0);
+       fl_set_button(column_options_->radio_align_center, 0);
        if (!pwidth.empty() || (align == LYX_ALIGN_LEFT))
-           fl_set_button(cell_options_->radio_align_left, 1);
+               fl_set_button(column_options_->radio_align_left, 1);
        else if (align == LYX_ALIGN_RIGHT)
-           fl_set_button(cell_options_->radio_align_right, 1);
+               fl_set_button(column_options_->radio_align_right, 1);
        else
-           fl_set_button(cell_options_->radio_align_center, 1);
-        fl_activate_object(cell_options_->radio_align_left);
-        fl_set_object_lcol(cell_options_->radio_align_left, FL_BLACK);
-        fl_activate_object(cell_options_->radio_align_right);
-        fl_set_object_lcol(cell_options_->radio_align_right, FL_BLACK);
-        fl_activate_object(cell_options_->radio_align_center);
-        fl_set_object_lcol(cell_options_->radio_align_center, FL_BLACK);
-       align = tabular->GetVAlignment(cell);
-       fl_set_button(cell_options_->radio_valign_top, 0);
-       fl_set_button(cell_options_->radio_valign_bottom, 0);
-       fl_set_button(cell_options_->radio_valign_center, 0);
+               fl_set_button(column_options_->radio_align_center, 1);
+       align = tabular->GetVAlignment(cell, true);
+       fl_set_button(column_options_->radio_valign_top, 0);
+       fl_set_button(column_options_->radio_valign_bottom, 0);
+       fl_set_button(column_options_->radio_valign_center, 0);
        if (pwidth.empty() || (align == LyXTabular::LYX_VALIGN_CENTER))
-           fl_set_button(cell_options_->radio_valign_center, 1);
+               fl_set_button(column_options_->radio_valign_center, 1);
        else if (align == LyXTabular::LYX_VALIGN_BOTTOM)
-           fl_set_button(cell_options_->radio_valign_bottom, 1);
+               fl_set_button(column_options_->radio_valign_bottom, 1);
        else
-           fl_set_button(cell_options_->radio_valign_top, 1);
-        fl_activate_object(cell_options_->radio_valign_top);
-        fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK);
-        fl_activate_object(cell_options_->radio_valign_bottom);
-        fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_BLACK);
-        fl_activate_object(cell_options_->radio_valign_center);
-        fl_set_object_lcol(cell_options_->radio_valign_center, FL_BLACK);
-       special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_MULTI);
-       fl_set_input(cell_options_->input_special_multialign, special.c_str());
-       fl_set_input(cell_options_->input_mcolumn_width,pwidth.c_str());
-       if (!lv_->buffer()->isReadonly()) {
-           fl_activate_object(cell_options_->input_special_multialign);
-           fl_set_object_lcol(cell_options_->input_special_multialign,
-                              FL_BLACK);
-           fl_activate_object(cell_options_->input_mcolumn_width);
-           fl_set_object_lcol(cell_options_->input_mcolumn_width, FL_BLACK);
-       }
+               fl_set_button(column_options_->radio_valign_top, 1);
        if (!pwidth.empty()) {
-           fl_deactivate_object(cell_options_->radio_align_left);
-           fl_deactivate_object(cell_options_->radio_align_right);
-           fl_deactivate_object(cell_options_->radio_align_center);
-           fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE);
-           fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE);
-           fl_set_object_lcol(cell_options_->radio_align_center, FL_INACTIVE);
-           fl_activate_object(cell_options_->radio_valign_top);
-           fl_activate_object(cell_options_->radio_valign_bottom);
-           fl_activate_object(cell_options_->radio_valign_center);
-           fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK);
-           fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_BLACK);
-           fl_set_object_lcol(cell_options_->radio_valign_center, FL_BLACK);
+               fl_deactivate_object(column_options_->radio_align_left);
+               fl_deactivate_object(column_options_->radio_align_right);
+               fl_deactivate_object(column_options_->radio_align_center);
+               fl_set_object_lcol(column_options_->radio_align_left, FL_INACTIVE);
+               fl_set_object_lcol(column_options_->radio_align_right, FL_INACTIVE);
+               fl_set_object_lcol(column_options_->radio_align_center, FL_INACTIVE);
+               fl_activate_object(column_options_->radio_valign_top);
+               fl_activate_object(column_options_->radio_valign_bottom);
+               fl_activate_object(column_options_->radio_valign_center);
+               fl_set_object_lcol(column_options_->radio_valign_top, FL_BLACK);
+               fl_set_object_lcol(column_options_->radio_valign_bottom, FL_BLACK);
+               fl_set_object_lcol(column_options_->radio_valign_center, FL_BLACK);
        } else {
-           fl_activate_object(cell_options_->radio_align_left);
-           fl_activate_object(cell_options_->radio_align_right);
-           fl_activate_object(cell_options_->radio_align_center);
-           fl_set_object_lcol(cell_options_->radio_align_left, FL_BLACK);
-           fl_set_object_lcol(cell_options_->radio_align_right, FL_BLACK);
-           fl_set_object_lcol(cell_options_->radio_align_center, FL_BLACK);
-           fl_deactivate_object(cell_options_->radio_valign_top);
-           fl_deactivate_object(cell_options_->radio_valign_bottom);
-           fl_deactivate_object(cell_options_->radio_valign_center);
-           fl_set_object_lcol(cell_options_->radio_valign_top, FL_INACTIVE);
-           fl_set_object_lcol(cell_options_->radio_valign_bottom,FL_INACTIVE);
-           fl_set_object_lcol(cell_options_->radio_valign_center,FL_INACTIVE);
+               fl_activate_object(column_options_->radio_align_left);
+               fl_activate_object(column_options_->radio_align_right);
+               fl_activate_object(column_options_->radio_align_center);
+               fl_set_object_lcol(column_options_->radio_align_left, FL_BLACK);
+               fl_set_object_lcol(column_options_->radio_align_right, FL_BLACK);
+               fl_set_object_lcol(column_options_->radio_align_center, FL_BLACK);
+               fl_deactivate_object(column_options_->radio_valign_top);
+               fl_deactivate_object(column_options_->radio_valign_bottom);
+               fl_deactivate_object(column_options_->radio_valign_center);
+               fl_set_object_lcol(column_options_->radio_valign_top, FL_INACTIVE);
+               fl_set_object_lcol(column_options_->radio_valign_bottom, FL_INACTIVE);
+               fl_set_object_lcol(column_options_->radio_valign_center, FL_INACTIVE);
        }
-    } else {
-        fl_set_button(cell_options_->radio_multicolumn, 0);
-       fl_set_button(cell_options_->radio_border_top, 0);
-        fl_deactivate_object(cell_options_->radio_border_top);
-        fl_set_object_lcol(cell_options_->radio_border_top, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_border_bottom, 0);
-        fl_deactivate_object(cell_options_->radio_border_bottom);
-        fl_set_object_lcol(cell_options_->radio_border_bottom, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_border_left, 0);
-        fl_deactivate_object(cell_options_->radio_border_left);
-        fl_set_object_lcol(cell_options_->radio_border_left, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_border_right, 0);
-        fl_deactivate_object(cell_options_->radio_border_right);
-        fl_set_object_lcol(cell_options_->radio_border_right, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_align_left, 0);
-        fl_deactivate_object(cell_options_->radio_align_left);
-        fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_align_right, 0);
-        fl_deactivate_object(cell_options_->radio_align_right);
-        fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_align_center, 0);
-        fl_deactivate_object(cell_options_->radio_align_center);
-        fl_set_object_lcol(cell_options_->radio_align_center, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_valign_top, 0);
-        fl_deactivate_object(cell_options_->radio_valign_top);
-        fl_set_object_lcol(cell_options_->radio_valign_top, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_valign_bottom, 0);
-        fl_deactivate_object(cell_options_->radio_valign_bottom);
-        fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_INACTIVE);
-       fl_set_button(cell_options_->radio_valign_center, 0);
-        fl_deactivate_object(cell_options_->radio_valign_center);
-        fl_set_object_lcol(cell_options_->radio_valign_center, FL_INACTIVE);
-       fl_set_input(cell_options_->input_special_multialign, "");
-        fl_deactivate_object(cell_options_->input_special_multialign);
-        fl_set_object_lcol(cell_options_->input_special_multialign, FL_INACTIVE);
-       fl_set_input(cell_options_->input_mcolumn_width,"");
-        fl_deactivate_object(cell_options_->input_mcolumn_width);
-        fl_set_object_lcol(cell_options_->input_mcolumn_width, FL_INACTIVE);
-    }
-    if (tabular->GetRotateCell(cell))
-        fl_set_button(cell_options_->radio_rotate_cell, 1);
-    else
-        fl_set_button(cell_options_->radio_rotate_cell, 0);
-    if (tabular->TopLine(cell, true))
-        fl_set_button(column_options_->radio_border_top, 1);
-    else
-        fl_set_button(column_options_->radio_border_top, 0);
-    if (tabular->BottomLine(cell, true))
-        fl_set_button(column_options_->radio_border_bottom, 1);
-    else
-        fl_set_button(column_options_->radio_border_bottom, 0);
-    if (tabular->LeftLine(cell, true))
-        fl_set_button(column_options_->radio_border_left, 1);
-    else
-        fl_set_button(column_options_->radio_border_left, 0);
-    if (tabular->RightLine(cell, true))
-        fl_set_button(column_options_->radio_border_right, 1);
-    else
-        fl_set_button(column_options_->radio_border_right, 0);
-    special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_COLUMN);
-    fl_set_input(column_options_->input_special_alignment, special.c_str());
-    if (lv_->buffer()->isReadonly()) 
-        fl_deactivate_object(column_options_->input_special_alignment);
-    else
-        fl_activate_object(column_options_->input_special_alignment);
-    pwidth = tabular->GetColumnPWidth(cell);
-    fl_set_input(column_options_->input_column_width,pwidth.c_str());
-    if (lv_->buffer()->isReadonly()) {
-        fl_deactivate_object(column_options_->input_column_width);
-    } else {
-        fl_activate_object(column_options_->input_column_width);
-    }
-    if (!pwidth.empty()) {
-        fl_activate_object(cell_options_->radio_useminipage);
-        fl_set_object_lcol(cell_options_->radio_useminipage, FL_BLACK);
-       if (tabular->GetUsebox(cell) == 2)
-           fl_set_button(cell_options_->radio_useminipage, 1);
-       else
-           fl_set_button(cell_options_->radio_useminipage, 0);
-    } else {
-        fl_deactivate_object(cell_options_->radio_useminipage);
-        fl_set_object_lcol(cell_options_->radio_useminipage, FL_INACTIVE);
-        fl_set_button(cell_options_->radio_useminipage,0);
-    }
-    align = tabular->GetAlignment(cell, true);
-    fl_set_button(column_options_->radio_align_left, 0);
-    fl_set_button(column_options_->radio_align_right, 0);
-    fl_set_button(column_options_->radio_align_center, 0);
-    if (!pwidth.empty() || (align == LYX_ALIGN_LEFT))
-        fl_set_button(column_options_->radio_align_left, 1);
-    else if (align == LYX_ALIGN_RIGHT)
-        fl_set_button(column_options_->radio_align_right, 1);
-    else
-        fl_set_button(column_options_->radio_align_center, 1);
-    align = tabular->GetVAlignment(cell, true);
-    fl_set_button(column_options_->radio_valign_top, 0);
-    fl_set_button(column_options_->radio_valign_bottom, 0);
-    fl_set_button(column_options_->radio_valign_center, 0);
-    if (pwidth.empty() || (align == LyXTabular::LYX_VALIGN_CENTER))
-        fl_set_button(column_options_->radio_valign_center, 1);
-    else if (align == LyXTabular::LYX_VALIGN_BOTTOM)
-        fl_set_button(column_options_->radio_valign_bottom, 1);
-    else
-        fl_set_button(column_options_->radio_valign_top, 1);
-    if (!pwidth.empty()) {
-        fl_deactivate_object(column_options_->radio_align_left);
-        fl_deactivate_object(column_options_->radio_align_right);
-        fl_deactivate_object(column_options_->radio_align_center);
-        fl_set_object_lcol(column_options_->radio_align_left, FL_INACTIVE);
-        fl_set_object_lcol(column_options_->radio_align_right, FL_INACTIVE);
-        fl_set_object_lcol(column_options_->radio_align_center, FL_INACTIVE);
-        fl_activate_object(column_options_->radio_valign_top);
-        fl_activate_object(column_options_->radio_valign_bottom);
-        fl_activate_object(column_options_->radio_valign_center);
-        fl_set_object_lcol(column_options_->radio_valign_top, FL_BLACK);
-        fl_set_object_lcol(column_options_->radio_valign_bottom, FL_BLACK);
-        fl_set_object_lcol(column_options_->radio_valign_center, FL_BLACK);
-    } else {
-        fl_activate_object(column_options_->radio_align_left);
-        fl_activate_object(column_options_->radio_align_right);
-        fl_activate_object(column_options_->radio_align_center);
-        fl_set_object_lcol(column_options_->radio_align_left, FL_BLACK);
-        fl_set_object_lcol(column_options_->radio_align_right, FL_BLACK);
-        fl_set_object_lcol(column_options_->radio_align_center, FL_BLACK);
-        fl_deactivate_object(column_options_->radio_valign_top);
-        fl_deactivate_object(column_options_->radio_valign_bottom);
-        fl_deactivate_object(column_options_->radio_valign_center);
-        fl_set_object_lcol(column_options_->radio_valign_top, FL_INACTIVE);
-        fl_set_object_lcol(column_options_->radio_valign_bottom, FL_INACTIVE);
-        fl_set_object_lcol(column_options_->radio_valign_center, FL_INACTIVE);
-    }
-    fl_set_button(tabular_options_->radio_longtable,
-                 tabular->IsLongTabular());
-    if (tabular->IsLongTabular()) {
-        fl_activate_object(longtable_options_->radio_lt_firsthead);
-        fl_activate_object(longtable_options_->radio_lt_head);
-        fl_activate_object(longtable_options_->radio_lt_foot);
-        fl_activate_object(longtable_options_->radio_lt_lastfoot);
-        fl_activate_object(longtable_options_->radio_lt_newpage);
-        fl_set_object_lcol(longtable_options_->radio_lt_firsthead, FL_BLACK);
-        fl_set_object_lcol(longtable_options_->radio_lt_head, FL_BLACK);
-        fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_BLACK);
-        fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_BLACK);
-        fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_BLACK);
-       int dummy;
-        fl_set_button(longtable_options_->radio_lt_firsthead,
-                      tabular->GetRowOfLTFirstHead(cell, dummy));
-        fl_set_button(longtable_options_->radio_lt_head,
-                     tabular->GetRowOfLTHead(cell, dummy));
-        fl_set_button(longtable_options_->radio_lt_foot,
-                     tabular->GetRowOfLTFoot(cell, dummy));
-        fl_set_button(longtable_options_->radio_lt_lastfoot,
-                      tabular->GetRowOfLTLastFoot(cell, dummy));
-        fl_set_button(longtable_options_->radio_lt_newpage,
-                     tabular->GetLTNewPage(cell));
-    } else {
-        fl_deactivate_object(longtable_options_->radio_lt_firsthead);
-        fl_deactivate_object(longtable_options_->radio_lt_head);
-        fl_deactivate_object(longtable_options_->radio_lt_foot);
-        fl_deactivate_object(longtable_options_->radio_lt_lastfoot);
-        fl_deactivate_object(longtable_options_->radio_lt_newpage);
-        fl_set_button(longtable_options_->radio_lt_firsthead,0);
-        fl_set_button(longtable_options_->radio_lt_head,0);
-        fl_set_button(longtable_options_->radio_lt_foot,0);
-        fl_set_button(longtable_options_->radio_lt_lastfoot,0);
-        fl_set_button(longtable_options_->radio_lt_newpage,0);
-        fl_set_object_lcol(longtable_options_->radio_lt_firsthead,FL_INACTIVE);
-        fl_set_object_lcol(longtable_options_->radio_lt_head, FL_INACTIVE);
-        fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_INACTIVE);
-        fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_INACTIVE);
-        fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_INACTIVE);
-    }
-    fl_set_button(tabular_options_->radio_rotate_tabular,
-                 tabular->GetRotateTabular());
-    return true;
+       fl_set_button(tabular_options_->radio_longtable,
+                     tabular->IsLongTabular());
+       if (tabular->IsLongTabular()) {
+               fl_activate_object(longtable_options_->radio_lt_firsthead);
+               fl_activate_object(longtable_options_->radio_lt_head);
+               fl_activate_object(longtable_options_->radio_lt_foot);
+               fl_activate_object(longtable_options_->radio_lt_lastfoot);
+               fl_activate_object(longtable_options_->radio_lt_newpage);
+               fl_set_object_lcol(longtable_options_->radio_lt_firsthead, FL_BLACK);
+               fl_set_object_lcol(longtable_options_->radio_lt_head, FL_BLACK);
+               fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_BLACK);
+               fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_BLACK);
+               fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_BLACK);
+               int dummy;
+               fl_set_button(longtable_options_->radio_lt_firsthead,
+                             tabular->GetRowOfLTFirstHead(cell, dummy));
+               fl_set_button(longtable_options_->radio_lt_head,
+                             tabular->GetRowOfLTHead(cell, dummy));
+               fl_set_button(longtable_options_->radio_lt_foot,
+                             tabular->GetRowOfLTFoot(cell, dummy));
+               fl_set_button(longtable_options_->radio_lt_lastfoot,
+                             tabular->GetRowOfLTLastFoot(cell, dummy));
+               fl_set_button(longtable_options_->radio_lt_newpage,
+                             tabular->GetLTNewPage(cell));
+       } else {
+               fl_deactivate_object(longtable_options_->radio_lt_firsthead);
+               fl_deactivate_object(longtable_options_->radio_lt_head);
+               fl_deactivate_object(longtable_options_->radio_lt_foot);
+               fl_deactivate_object(longtable_options_->radio_lt_lastfoot);
+               fl_deactivate_object(longtable_options_->radio_lt_newpage);
+               fl_set_button(longtable_options_->radio_lt_firsthead,0);
+               fl_set_button(longtable_options_->radio_lt_head,0);
+               fl_set_button(longtable_options_->radio_lt_foot,0);
+               fl_set_button(longtable_options_->radio_lt_lastfoot,0);
+               fl_set_button(longtable_options_->radio_lt_newpage,0);
+               fl_set_object_lcol(longtable_options_->radio_lt_firsthead,FL_INACTIVE);
+               fl_set_object_lcol(longtable_options_->radio_lt_head, FL_INACTIVE);
+               fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_INACTIVE);
+               fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_INACTIVE);
+               fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_INACTIVE);
+       }
+       fl_set_button(tabular_options_->radio_rotate_tabular,
+                     tabular->GetRotateTabular());
 }
 
-void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
+bool FormTabular::input(FL_OBJECT * ob, long)
 {
     if (!inset_)
-       return;
+        return false;
 
     LyXTabular
         * tabular = inset_->tabular;
@@ -499,17 +430,17 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
 
     cell = inset_->GetActCell();
     if (actCell_ != cell) {
-        local_update(false);
+        update();
         fl_set_object_label(dialog_->text_warning,
                      _("Warning: Wrong Cursor position, updated window"));
         fl_show_object(dialog_->text_warning);
-        return;
+        return false;
     }
     // No point in processing directives that you can't do anything with
     // anyhow, so exit now if the buffer is read-only.
     if (lv_->buffer()->isReadonly()) {
-      local_update(false);
-      return;
+      update();
+      return false;
     }
     if (ob == column_options_->input_column_width) {
         string
@@ -519,11 +450,11 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
             fl_set_object_label(dialog_->text_warning,
                  _("Warning: Invalid Length (valid example: 10mm)"));
             fl_show_object(dialog_->text_warning);
-            return;
+            return false;
         }
         inset_->TabularFeatures(lv_->view(), LyXTabular::SET_PWIDTH,str);
-        local_update(false); // update for alignment
-        return;
+        update(); // update for alignment
+        return true;
     }
     if (ob == cell_options_->input_mcolumn_width) {
         string
@@ -533,11 +464,11 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
             fl_set_object_label(dialog_->text_warning,
                  _("Warning: Invalid Length (valid example: 10mm)"));
             fl_show_object(dialog_->text_warning);
-            return;
+            return false;
         }
         inset_->TabularFeatures(lv_->view(), LyXTabular::SET_MPWIDTH,str);
-        local_update(false); // update for alignment
-        return;
+        update(); // update for alignment
+        return true;
     }
     str = fl_get_input(column_options_->input_column_width);
     if (!str.empty() && !isValidLength(str)) {
@@ -545,7 +476,7 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
            dialog_->text_warning,
            _("Warning: Invalid Length (valid example: 10mm)"));
         fl_show_object(dialog_->text_warning);
-        return;
+        return false;
     }
     if (ob == tabular_options_->button_append_row)
         num = LyXTabular::APPEND_ROW;
@@ -674,74 +605,10 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
     else if (ob == cell_options_->radio_valign_center)
         num = LyXTabular::M_VALIGN_CENTER;
     else
-        return;
+        return false;
     
     inset_->TabularFeatures(lv_->view(), num, special);
-    local_update(false);
-}
-
-// +-----------------------------------------------------------------------+
-// |          Functions/Dialogs for creating tabular insets                |
-// +-----------------------------------------------------------------------+
-
-void FormTabular::show_create()
-{
-    if (!dialog_) {
-       build();
-    }
-    if (create_tabular_->form->visible) {
-        fl_raise_form(create_tabular_->form);
-    } else {
-        fl_show_form(create_tabular_->form,
-                    FL_PLACE_MOUSE | FL_FREE_SIZE,
-                     FL_FULLBORDER, _("Insert Tabular"));
-    }
-}
-
-
-void FormTabular::apply_create()
-{
-    int
-        xsize,ysize;
-
-//    comm->setMinibuffer(_("Inserting tabular inset..."));
-    ysize = int(fl_get_slider_value(create_tabular_->slider_columns) + 0.5);
-    xsize = int(fl_get_slider_value(create_tabular_->slider_rows) + 0.5);
-    InsetTabular * in = new InsetTabular(*lv_->buffer(),xsize,ysize);
-    if (!lv_->view()->open_new_inset(in)) {
-       delete in;
-    }
-//    comm->setMinibuffer(_("Tabular mode"));
-}
-
-
-void FormTabular::hide_create()
-{
-    if (create_tabular_->form &&
-       create_tabular_->form->visible)
-        fl_hide_form(create_tabular_->form);
-}
-
-
-void FormTabular::OKCB(FL_OBJECT * ob, long)
-{
-    FormTabular * pre = (FormTabular*)ob->form->u_vdata;
-    pre->apply_create();
-    pre->hide_create();
-}
-
-
-void FormTabular::ApplyCB(FL_OBJECT * ob, long)
-{
-    FormTabular * pre = (FormTabular*)ob->form->u_vdata;
-    pre->apply_create();
-}
+    update();
 
-
-void FormTabular::CancelCB(FL_OBJECT * ob, long)
-{
-    FormTabular * pre = (FormTabular*)ob->form->u_vdata;
-    pre->hide_create();
+    return true;
 }
-
-
index f21aba995c00e4f22d20663535c9e8cc9e6cfb0b..bebdf513278822e482970af0a69c6afa76478153 100644 (file)
 #ifndef FORMTABULAR_H
 #define FORMTABULAR_H
 
-#include "DialogBase.h"
-#include <boost/utility.hpp>
+#include "FormInset.h"
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Connection;
-#endif
-
-class LyXView;
-class Dialogs;
 class InsetTabular;
 struct FD_form_tabular;
 struct FD_form_tabular_options;
 struct FD_form_column_options;
 struct FD_form_cell_options;
 struct FD_form_longtable_options;
-struct FD_form_create_tabular;
 
 /** This class provides an XForms implementation of the FormTabular Dialog.
     The tabular dialog allows users to set/save their tabular.
  */
-class FormTabular : public DialogBase, public noncopyable {
+class FormTabular : public FormInset {
 public:
-    /// #FormTabular x(LyXFunc ..., Dialogs ...);#
-    FormTabular(LyXView *, Dialogs *);
-    ///
-    ~FormTabular();
-    ///
-    static  int WMHideCB(FL_FORM *, void *);
-    ///
-    static void CloseCB(FL_OBJECT *, long);
-    ///
-    static void OKCB(FL_OBJECT *, long);
-    ///
-    static void CancelCB(FL_OBJECT *, long);
-    ///
-    static void ApplyCB(FL_OBJECT *, long);
-    ///
-    static void InputCB(FL_OBJECT *, long);
+       /// #FormTabular x(LyXFunc ..., Dialogs ...);#
+       FormTabular(LyXView *, Dialogs *);
+       ///
+       ~FormTabular();
 
 private:
-    /// Create the dialog if necessary, update it and display it.
-    void show();
-    ///
-    void show_create();
-    ///
-    void showInset(InsetTabular *);
-    /// Hide the dialog.
-    void hide();
-    ///
-    void hide_create();
-    ///
-    void hideInset(InsetTabular *);
-    /// Update the dialog.
-    void update(bool = false);
-    ///
-    void updateInset(InsetTabular *);
-    ///
-    bool local_update(bool);
-    
-    /// Apply from dialog
-    void apply_create();
-    /// Build the dialog
-    void build();
-    ///
-    void SetTabularOptions(FL_OBJECT *, long);
-    ///
-    FD_form_tabular * build_tabular();
-    ///
-    FD_form_tabular_options * build_tabular_options();
-    ///
-    FD_form_column_options * build_column_options();
-    ///
-    FD_form_cell_options * build_cell_options();
-    ///
-    FD_form_longtable_options * build_longtable_options();
-    ///
-    FD_form_create_tabular * build_create_tabular();
+       /// Disconnect signals. Also perform any necessary housekeeping.
+       virtual void disconnect();
+
+       /// Slot launching dialog to an existing inset
+       void showInset(InsetTabular *);
+       /// Slot launching dialog to an existing inset
+       void updateInset(InsetTabular *);
+       /// Update dialog before showing it
+       virtual void update();
+       /// Build the dialog
+       virtual void build();
+       /// Filter the inputs
+       virtual bool input(FL_OBJECT *, long);
+       /// Pointer to the actual instantiation of the xform's form
+       virtual FL_FORM * form() const;
+
+       /// Fdesign generated methods
+       FD_form_tabular * build_tabular();
+       ///
+       FD_form_tabular_options * build_tabular_options();
+       ///
+       FD_form_column_options * build_column_options();
+       ///
+       FD_form_cell_options * build_cell_options();
+       ///
+       FD_form_longtable_options * build_longtable_options();
 
-    /// Real GUI implementation.
-    FD_form_tabular * dialog_;
-    ///
-    FD_form_tabular_options * tabular_options_;
-    ///
-    FD_form_column_options * column_options_;
-    ///
-    FD_form_cell_options * cell_options_;
-    ///
-    FD_form_longtable_options * longtable_options_;
-    ///
-    FD_form_create_tabular * create_tabular_;
+       /// Real GUI implementation.
+       FD_form_tabular * dialog_;
+       ///
+       FD_form_tabular_options * tabular_options_;
+       ///
+       FD_form_column_options * column_options_;
+       ///
+       FD_form_cell_options * cell_options_;
+       ///
+       FD_form_longtable_options * longtable_options_;
 
-    /// Which LyXView do we belong to?
-    LyXView * lv_;
-    ///
-    Dialogs * d_;
-    /// Update connection.
-    Connection u_;
-    /// Hide connection.
-    Connection h_;
-    ///
-    InsetTabular * inset_;
-    ///
-    int actCell_;
+       /// pointer to the inset passed through showInset
+       InsetTabular * inset_;
+       ///
+       int actCell_;
 };
 
 #endif
diff --git a/src/frontends/xforms/FormTabularCreate.C b/src/frontends/xforms/FormTabularCreate.C
new file mode 100644 (file)
index 0000000..dc37c2b
--- /dev/null
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+/* FormTabularCreate.C
+ * FormTabularCreate Interface Class Implementation
+ */
+
+#include <config.h>
+
+#include "FormTabularCreate.h"
+#include "form_tabular_create.h"
+#include "BufferView.h"
+#include "Dialogs.h"
+#include "LyXView.h"
+#include "insets/insettabular.h"
+
+
+FormTabularCreate::FormTabularCreate(LyXView * lv, Dialogs * d)
+       : FormBaseBD(lv, d, _("Insert Tabular")),
+         dialog_(0)
+{
+       // let the dialog be shown
+       // This is a permanent connection so we won't bother
+       // storing a copy because we won't be disconnecting.
+       d->showTabularCreate.connect(slot(this, &FormTabularCreate::show));
+}
+
+
+FormTabularCreate::~FormTabularCreate()
+{
+       delete dialog_;
+}
+
+
+FL_FORM * FormTabularCreate::form() const
+{
+       if ( dialog_ ) return dialog_->form;
+       return 0;
+}
+
+
+void FormTabularCreate::connect()
+{
+       bc_.valid(true);
+       FormBaseBD::connect();
+}
+
+
+void FormTabularCreate::build()
+{
+       dialog_ = build_tabular_create();
+
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
+
+       fl_set_slider_bounds(dialog_->slider_rows, 1, 50);
+       fl_set_slider_bounds(dialog_->slider_columns, 1, 50);
+       fl_set_slider_value(dialog_->slider_rows, 5);
+       fl_set_slider_value(dialog_->slider_columns, 5);
+       fl_set_slider_precision(dialog_->slider_rows, 0);
+       fl_set_slider_precision(dialog_->slider_columns, 0);
+
+        // manage the ok, apply and cancel/close buttons
+       bc_.setOK(dialog_->button_ok);
+       bc_.setApply(dialog_->button_apply);
+       bc_.setCancel(dialog_->button_cancel);
+       bc_.refresh();
+}
+
+
+void FormTabularCreate::apply()
+{
+       int ysize = int(fl_get_slider_value(dialog_->slider_columns) + 0.5);
+       int xsize = int(fl_get_slider_value(dialog_->slider_rows) + 0.5);
+
+       InsetTabular * in = new InsetTabular( *lv_->buffer(), xsize, ysize );
+       if (!lv_->view()->open_new_inset(in)) {
+               delete in;
+       }
+}
diff --git a/src/frontends/xforms/FormTabularCreate.h b/src/frontends/xforms/FormTabularCreate.h
new file mode 100644 (file)
index 0000000..cfcb4bb
--- /dev/null
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+/* This file is part of
+ * ======================================================
+ * 
+ *           LyX, The Document Processor
+ *      
+ *         Copyright 1995 Matthias Ettrich
+ *          Copyright 1995-2000 The LyX Team.
+ *
+ *======================================================*/
+/* FormTabularCreate.h
+ * FormTabularCreate Interface Class
+ */
+
+#ifndef FORMTABULARCREATE_H
+#define FORMTABULARCREATE_H
+
+#include "FormBase.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class LyXView;
+class Dialogs;
+struct FD_form_tabular_create;
+
+/** This class provides an XForms implementation of the FormTabularCreate
+    Dialog.
+ */
+class FormTabularCreate : public FormBaseBD {
+public:
+       /// #FormTabularCreate x(LyXView ..., Dialogs ...);#
+       FormTabularCreate(LyXView *, Dialogs *);
+       ///
+       ~FormTabularCreate();
+
+private:
+       /// Connect signals etc.
+       virtual void connect();
+
+       /// Apply from dialog
+       virtual void apply();
+       /// Pointer to the actual instantiation of the xform's form
+       virtual FL_FORM * form() const;
+       /// Build the dialog
+       virtual void build();
+
+       ///
+       FD_form_tabular_create * build_tabular_create();
+       
+       /// Real GUI implementation.
+       FD_form_tabular_create * dialog_;
+};
+
+#endif
index 2191473c4f217a54fc993d9b41c01e1c0058a2bc..40ca12b59567fa5dde0ab9848f1c7adbaf55da20 100644 (file)
@@ -78,8 +78,7 @@ void FormToc::build()
 }
 
 
-// we can safely ignore the parameter because we can always update
-void FormToc::update(bool)
+void FormToc::update()
 {
        Buffer::TocType type;
 
index 906ff7ad78c434c7d2ae5a441861c3c0db2ca7ba..c8bf93d8c26922042e7703f7cd06a652d431906f 100644 (file)
@@ -34,8 +34,10 @@ private:
 
        /// Build the dialog
        virtual void build();
+       /// bool indicates if a buffer switch took place
+       virtual void updateSlot(bool) { update(); }
        /// Update dialog before showing it
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Apply from dialog (modify or create inset)
        virtual void apply();
        /// Pointer to the actual instantiation of the xform's form
index b32450b5c10f27c31f5b6f73e20e90c1f0647f1b..fc0ac2b40acb56cb36f5a4baaf7c89d4df6d9700 100644 (file)
@@ -69,13 +69,8 @@ void FormUrl::build()
 }
 
 
-void FormUrl::update(bool switched)
+void FormUrl::update()
 {
-       if (switched) {
-               hide();
-               return;
-       }
-
        fl_set_input(dialog_->url,  params.getContents().c_str());
        fl_set_input(dialog_->name, params.getOptions().c_str());
 
index e6f718ab0ab05ac76c912073229d9bf8831694f4..3aa21d665be0d47e5f3bb9de0ae8d1d573aec1d3 100644 (file)
@@ -33,7 +33,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Update dialog before showing it
-       virtual void update(bool switched = false);
+       virtual void update();
        /// Apply from dialog (modify or create inset)
        virtual void apply();
        /// Pointer to the actual instantiation of the xform's form
index 16f621108a6b13bf9321729cc57b8bd92eb4205e..f696cf53be02203e1e4b961328c6a4a86e4702d6 100644 (file)
@@ -63,6 +63,10 @@ libxforms_la_SOURCES = \
        FormTabular.h \
        form_tabular.C \
        form_tabular.h \
+       FormTabularCreate.C \
+       FormTabularCreate.h \
+       form_tabular_create.C \
+       form_tabular_create.h \
        FormToc.C \
        FormToc.h \
        form_toc.C \
index 14dc5a5e4a84f18da42947be82ecb0d18f47b878..a7e724e98d3e4f2a7277632a90ddfedd1dcd1726 100644 (file)
@@ -26,60 +26,60 @@ FD_form_graphics * FormGraphics::build_graphics()
   fdui->form->u_vdata = this;
   obj = fl_add_box(FL_UP_BOX, 0, 0, 410, 390, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_resize(obj, FL_RESIZE_NONE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 310, 390, 30, "");
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 250, 170, 50, "");
   fdui->input_filename = obj = fl_add_input(FL_NORMAL_INPUT, 90, 20, 210, 30, idex(_("Graphics File|F#F")));
     fl_set_button_shortcut(obj, scex(_("Graphics File|F#F")), 1);
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->button_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 20, 90, 30, idex(_("Browse|B#B")));
     fl_set_button_shortcut(obj, scex(_("Browse|B#B")), 1);
-    fl_set_object_callback(obj, C_FormGraphicsBrowseCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, BROWSE);
   obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 70, 200, 160, _("Width"));
     fl_set_object_lalign(obj, FL_ALIGN_CENTER);
   obj = fl_add_text(FL_NORMAL_TEXT, 130, 60, 50, 20, _("Height"));
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
   fdui->input_width = obj = fl_add_input(FL_NORMAL_INPUT, 20, 190, 90, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->input_height = obj = fl_add_input(FL_NORMAL_INPUT, 120, 190, 80, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 230, 70, 170, 160, _("Display"));
     fl_set_object_lalign(obj, FL_ALIGN_CENTER);
   fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 350, 70, 30, _("Ok"));
-    fl_set_object_callback(obj, C_FormGraphicsOKCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 100, 350, 70, 30, idex(_("Apply|A#A")));
     fl_set_button_shortcut(obj, scex(_("Apply|A#A")), 1);
-    fl_set_object_callback(obj, C_FormGraphicsApplyCB, 0);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
   fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 190, 350, 70, 30, idex(_("Cancel|C#C^[")));
     fl_set_button_shortcut(obj, scex(_("Cancel|C#C^[")), 1);
-    fl_set_object_callback(obj, C_FormGraphicsCancelCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
 
   fdui->radio_button_group_width = fl_bgn_group();
   fdui->radio_width_percent_page = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 140, 80, 30, _("% of Page"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->radio_width_default = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 80, 80, 30, _("Default"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
     fl_set_button(obj, 1);
   fdui->radio_width_cm = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 100, 80, 30, _("cm"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->radio_width_inch = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 120, 80, 30, _("Inch"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->radio_width_percent_column = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 160, 80, 30, _("% of Column"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fl_end_group();
 
 
   fdui->radio_button_group_height = fl_bgn_group();
   fdui->radio_height_percent_page = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 140, 80, 30, _("% of Page"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->radio_height_inch = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 120, 80, 30, _("Inch"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->radio_height_cm = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 100, 80, 30, _("cm"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->radio_height_default = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 80, 80, 30, _("Default"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
     fl_set_button(obj, 1);
   fl_end_group();
 
@@ -94,14 +94,14 @@ FD_form_graphics * FormGraphics::build_graphics()
 
   obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 250, 200, 50, _("Rotate"));
   fdui->input_rotate_angle = obj = fl_add_input(FL_INT_INPUT, 70, 260, 80, 30, _("Angle"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->check_inline = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 260, 170, 30, _("Inline Figure"));
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->input_subcaption = obj = fl_add_input(FL_NORMAL_INPUT, 120, 310, 280, 30, "");
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fdui->check_subcaption = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 310, 110, 30, idex(_("Subcaption|S#S")));
     fl_set_button_shortcut(obj, scex(_("Subcaption|S#S")), 1);
-    fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, CHECKINPUT);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index 492394db215c54eaed0a618e4505675000f9ea24..107be0440c3d2f2f8d7158afc361a985061c2a22 100644 (file)
@@ -5,11 +5,10 @@
 #define FD_form_graphics_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormGraphicsInputCB(FL_OBJECT *, long);
-extern  "C" void C_FormGraphicsBrowseCB(FL_OBJECT *, long);
-extern  "C" void C_FormGraphicsOKCB(FL_OBJECT *, long);
-extern  "C" void C_FormGraphicsApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormGraphicsCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 51d53ae80ce9aac920f45eaeaede6d142452757d..afe2ebe91d311591d9220a6d684cbb1f21cdb276 100644 (file)
@@ -30,7 +30,7 @@ FD_form_tabular * FormTabular::build_tabular()
   fdui->button_close = obj = fl_add_button(FL_NORMAL_BUTTON, 415, 260, 90, 30, idex(_("Close|#C")));
     fl_set_button_shortcut(obj, scex(_("Close|#C")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularCloseCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fdui->input_tabular_column = obj = fl_add_input(FL_NORMAL_INPUT, 65, 260, 60, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
@@ -69,32 +69,32 @@ FD_form_tabular_options * FormTabular::build_tabular_options()
   fdui->button_append_column = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 40, 120, 30, idex(_("Append Column|#A")));
     fl_set_button_shortcut(obj, scex(_("Append Column|#A")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_delete_column = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 40, 120, 30, idex(_("Delete Column|#O")));
     fl_set_button_shortcut(obj, scex(_("Delete Column|#O")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_append_row = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 70, 120, 30, idex(_("Append Row|#p")));
     fl_set_button_shortcut(obj, scex(_("Append Row|#p")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_delete_row = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 70, 120, 30, idex(_("Delete Row|#w")));
     fl_set_button_shortcut(obj, scex(_("Delete Row|#w")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_set_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 10, 120, 30, idex(_("Set Borders|#S")));
     fl_set_button_shortcut(obj, scex(_("Set Borders|#S")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_unset_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 10, 120, 30, idex(_("Unset Borders|#U")));
     fl_set_button_shortcut(obj, scex(_("Unset Borders|#U")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_longtable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 280, 30, 90, 25, _("Longtable"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_rotate_tabular = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 280, 55, 90, 25, idex(_("Rotate 90°|#9")));
     fl_set_button_shortcut(obj, scex(_("Rotate 90°|#9")), 1);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_text(FL_NORMAL_TEXT, 285, 10, 100, 20, _("Spec. Table"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
@@ -133,22 +133,22 @@ FD_form_column_options * FormTabular::build_column_options()
     fl_set_button_shortcut(obj, scex(_("Top|#t")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 85, 75, 25, 25, idex(_("Bottom|#b")));
     fl_set_button_shortcut(obj, scex(_("Bottom|#b")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 65, 60, 25, 25, idex(_("Left|#l")));
     fl_set_button_shortcut(obj, scex(_("Left|#l")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 105, 60, 25, 25, idex(_("Right|#r")));
     fl_set_button_shortcut(obj, scex(_("Right|#r")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 200, 20, 130, 105, "");
     fl_set_object_color(obj, FL_COL1, FL_COL1);
   obj = fl_add_text(FL_NORMAL_TEXT, 205, 10, 115, 20, _("H. Alignment"));
@@ -158,18 +158,18 @@ FD_form_column_options * FormTabular::build_column_options()
   fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 30, 110, 25, idex(_("Left|#e")));
     fl_set_button_shortcut(obj, scex(_("Left|#e")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 80, 115, 25, idex(_("Right|#i")));
     fl_set_button_shortcut(obj, scex(_("Right|#i")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 55, 115, 25, idex(_("Center|#c")));
     fl_set_button_shortcut(obj, scex(_("Center|#c")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_column_width = obj = fl_add_input(FL_NORMAL_INPUT, 375, 150, 95, 30, _("Width of column:"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 340, 20, 130, 105, "");
     fl_set_object_color(obj, FL_COL1, FL_COL1);
   obj = fl_add_text(FL_NORMAL_TEXT, 345, 10, 115, 20, _("V. Alignment"));
@@ -181,7 +181,7 @@ FD_form_column_options * FormTabular::build_column_options()
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT, 30, 150, 200, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_text(FL_NORMAL_TEXT, 25, 130, 170, 20, _("Special Column Alignment"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
@@ -189,15 +189,15 @@ FD_form_column_options * FormTabular::build_column_options()
   fdui->radio_valign_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 30, 125, 25, idex(_("Top|#p")));
     fl_set_button_shortcut(obj, scex(_("Top|#p")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_valign_center = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 55, 125, 25, idex(_("Center|#n")));
     fl_set_button_shortcut(obj, scex(_("Center|#n")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_valign_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 80, 120, 25, idex(_("Bottom|#o")));
     fl_set_button_shortcut(obj, scex(_("Bottom|#o")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
@@ -246,69 +246,69 @@ FD_form_cell_options * FormTabular::build_cell_options()
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
   fdui->radio_multicolumn = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 25, 145, 25, idex(_("Multicolumn|#M")));
     fl_set_button_shortcut(obj, scex(_("Multicolumn|#M")), 1);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_rotate_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 75, 145, 25, _("Rotate 90°"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 165, 15, 325, 90, "");
     fl_set_object_color(obj, FL_COL1, FL_COL1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT, 175, 30, 310, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_text(FL_NORMAL_TEXT, 170, 5, 290, 20, _("Special Multicolumn Alignment"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
   fdui->input_mcolumn_width = obj = fl_add_input(FL_NORMAL_INPUT, 360, 65, 125, 30, _("Width of multi-column:"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 140, 25, 25, idex(_("Top|#t")));
     fl_set_button_shortcut(obj, scex(_("Top|#t")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 170, 25, 25, idex(_("Bottom|#b")));
     fl_set_button_shortcut(obj, scex(_("Bottom|#b")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 55, 155, 25, 25, idex(_("Left|#l")));
     fl_set_button_shortcut(obj, scex(_("Left|#l")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 95, 155, 25, 25, idex(_("Right|#r")));
     fl_set_button_shortcut(obj, scex(_("Right|#r")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 195, 125, 110, 25, idex(_("Left|#e")));
     fl_set_button_shortcut(obj, scex(_("Left|#e")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 195, 175, 115, 25, idex(_("Right|#i")));
     fl_set_button_shortcut(obj, scex(_("Right|#i")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 195, 150, 115, 25, idex(_("Center|#c")));
     fl_set_button_shortcut(obj, scex(_("Center|#c")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_valign_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 125, 140, 25, idex(_("Top|#p")));
     fl_set_button_shortcut(obj, scex(_("Top|#p")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_valign_center = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 150, 140, 25, idex(_("Center|#n")));
     fl_set_button_shortcut(obj, scex(_("Center|#n")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_valign_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 345, 175, 140, 25, idex(_("Bottom|#o")));
     fl_set_button_shortcut(obj, scex(_("Bottom|#o")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_useminipage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 50, 145, 25, idex(_("Use Minipage|#s")));
     fl_set_button_shortcut(obj, scex(_("Use Minipage|#s")), 1);
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
@@ -338,67 +338,25 @@ FD_form_longtable_options * FormTabular::build_longtable_options()
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
   fdui->radio_lt_firsthead = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 30, 90, 25, _("First Head"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_lt_head = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 60, 90, 25, _("Head"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 130, 20, 100, 75, "");
   obj = fl_add_text(FL_NORMAL_TEXT, 135, 10, 85, 20, _("Footer"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
   fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 135, 30, 90, 25, _("Foot"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_lt_lastfoot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 135, 60, 90, 25, _("Last Foot"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 245, 20, 95, 75, "");
   obj = fl_add_text(FL_NORMAL_TEXT, 250, 10, 85, 20, _("Special"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
   fdui->radio_lt_newpage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 250, 30, 90, 25, _("New Page"));
-    fl_set_object_callback(obj, C_FormTabularInputCB, 0);
-  fl_end_form();
-
-  fdui->form->fdui = fdui;
-
-  return fdui;
-}
-/*---------------------------------------*/
-
-FD_form_create_tabular::~FD_form_create_tabular()
-{
-  if( form->visible ) fl_hide_form( form );
-  fl_free_form( form );
-}
-
-
-FD_form_create_tabular * FormTabular::build_create_tabular()
-{
-  FL_OBJECT *obj;
-  FD_form_create_tabular *fdui = new FD_form_create_tabular;
-
-  fdui->form = fl_bgn_form(FL_NO_BOX, 310, 130);
-  fdui->form->u_vdata = this;
-  obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, "");
-  fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK"));
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularOKCB, 0);
-  fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_("Apply|#A")));
-    fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularApplyCB, 0);
-  fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_("Cancel|^[")));
-    fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormTabularCancelCB, 0);
-  fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns"));
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->slider_rows = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 10, 220, 30, _("Rows"));
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index ab59e23360cc62f0c9e8f9f0dc5d86c9ed981364..b888f02f7eda5a38146805707e81daca0754a67c 100644 (file)
@@ -5,19 +5,15 @@
 #define FD_form_tabular_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormTabularCloseCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormTabularInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormTabularInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormTabularInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormTabularInputCB(FL_OBJECT *, long);
-
-extern  "C" void C_FormTabularOKCB(FL_OBJECT *, long);
-extern  "C" void C_FormTabularApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormTabularCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
@@ -91,15 +87,5 @@ struct FD_form_longtable_options {
        FL_OBJECT *radio_lt_lastfoot;
        FL_OBJECT *radio_lt_newpage;
 };
-struct FD_form_create_tabular {
-       ~FD_form_create_tabular();
-
-       FL_FORM *form;
-       FL_OBJECT *button_ok;
-       FL_OBJECT *button_apply;
-       FL_OBJECT *button_cancel;
-       FL_OBJECT *slider_columns;
-       FL_OBJECT *slider_rows;
-};
 
 #endif /* FD_form_tabular_h_ */
diff --git a/src/frontends/xforms/form_tabular_create.C b/src/frontends/xforms/form_tabular_create.C
new file mode 100644 (file)
index 0000000..18b72f8
--- /dev/null
@@ -0,0 +1,54 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+#include <config.h>
+#include "lyx_gui_misc.h"
+#include "gettext.h"
+
+/* Form definition file generated with fdesign. */
+
+#include FORMS_H_LOCATION
+#include <stdlib.h>
+#include "form_tabular_create.h"
+#include "FormTabularCreate.h"
+
+FD_form_tabular_create::~FD_form_tabular_create()
+{
+  if( form->visible ) fl_hide_form( form );
+  fl_free_form( form );
+}
+
+
+FD_form_tabular_create * FormTabularCreate::build_tabular_create()
+{
+  FL_OBJECT *obj;
+  FD_form_tabular_create *fdui = new FD_form_tabular_create;
+
+  fdui->form = fl_bgn_form(FL_NO_BOX, 310, 130);
+  fdui->form->u_vdata = this;
+  obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, "");
+  fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK"));
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
+  fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_("Apply|#A")));
+    fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
+  fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_("Cancel|^[")));
+    fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
+  fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns"));
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+  fdui->slider_rows = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 10, 220, 30, _("Rows"));
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+  fl_end_form();
+
+  fdui->form->fdui = fdui;
+
+  return fdui;
+}
+/*---------------------------------------*/
+
diff --git a/src/frontends/xforms/form_tabular_create.h b/src/frontends/xforms/form_tabular_create.h
new file mode 100644 (file)
index 0000000..677c9ac
--- /dev/null
@@ -0,0 +1,25 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+/** Header file generated with fdesign **/
+
+#ifndef FD_form_tabular_create_h_
+#define FD_form_tabular_create_h_
+
+/** Callbacks, globals and object handlers **/
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+
+
+/**** Forms and Objects ****/
+struct FD_form_tabular_create {
+       ~FD_form_tabular_create();
+
+       FL_FORM *form;
+       FL_OBJECT *button_ok;
+       FL_OBJECT *button_apply;
+       FL_OBJECT *button_cancel;
+       FL_OBJECT *slider_columns;
+       FL_OBJECT *slider_rows;
+};
+
+#endif /* FD_form_tabular_create_h_ */
index 550dc6818a657eedb030a9e523072ece3a91db78..d381dede0aaf8ee8554fe63a4904eed0a88f44d0 100644 (file)
@@ -10,51 +10,70 @@ if [ ! -f $1 ]; then
 fi
 
 FDESIGN=fdesign
-base=`basename $1 .fd`
 
-if [ $1 = $base ]; then
+# names of the files generated by fdesign and by running the sed scripts
+BASE=`basename $1 .fd`
+
+if [ $1 = $BASE ]; then
     echo "Input file is not a .fd file. Cannot continue"
     exit 1
 fi
 
-cin=$base.c
-cout=$base.C
-hin=$base.h
-hout=$base.H
+CIN=$BASE.c
+COUT=$BASE.C
+HIN=$BASE.h
+HOUT=$BASE.H
+
+# Ascertain the class name from the name of the file
+# eg form_my_new_dialog -> FormMyNewDialog
+CLASSNAME=""
+SECTION="start"
+i=1
+while :
+do
+    SECTION=`echo $BASE | cut -d_ -f$i`
+    i=`expr $i + 1 `
 
-classname=`echo $base | cut -c6-`
-firstchar=`echo $classname | cut -c1 | tr a-z A-Z`
-rest=`echo $classname | cut -c2-`
-classname=Form$firstchar$rest
+    if [ $SECTION ]
+    then
+       FIRST=`echo $SECTION | cut -c1 | tr a-z A-Z`
+       SECOND=`echo $SECTION | cut -c2-`
+       CLASSNAME=$CLASSNAME$FIRST$SECOND
+    else
+       break
+    fi
+done
 
 # Create .c and .h files
 $FDESIGN -convert $1
+FDFIXH=fdfixh.sed
+FDFIXC=fdfixc.sed
 
 # Modify .h file for use by LyX
-echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $hout
-sed -f fdfixh.sed < $hin >> $hout
+echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $HOUT
+sed -f $FDFIXH < $HIN >> $HOUT
 
 # Patch the .h file if a patch exists
-if [ -f "$hout.patch" ] ; then
-    echo "Patching $hout with $hout.patch"
-    patch -s $hout < $hout.patch
+if [ -f "$HOUT.patch" ] ; then
+    echo "Patching $HOUT with $HOUT.patch"
+    patch -s $HOUT < $HOUT.patch
 fi
 
 # Modify .c file for use by LyX
-echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $cout
-echo "#include <config.h>" >> $cout
-echo "#include \"lyx_gui_misc.h\"" >> $cout
-echo "#include \"gettext.h\"" >> $cout
-echo >> $cout
+echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $COUT
+echo "#include <config.h>" >> $COUT
+echo "#include \"lyx_gui_misc.h\"" >> $COUT
+echo "#include \"gettext.h\"" >> $COUT
+echo >> $COUT
 
-sed -f fdfixc.sed < $cin | sed -e "s/CLASSNAME/$classname/" >> $cout
+sed -f $FDFIXC < $CIN | sed -e "s/CLASSNAME/$CLASSNAME/" >> $COUT
 
 # Patch the .C file if a patch exists
-if [ -f "$cout.patch" ] ; then
-    echo "Patching $cout with $cout.patch"
-    patch -s $cout < $cout.patch
+if [ -f "$COUT.patch" ] ; then
+    echo "Patching $COUT with $COUT.patch"
+    patch -s $COUT < $COUT.patch
 fi
 
 # Clean up, to leave .C and .h files
-rm -f $cin $hin
-mv $hout $hin
+rm -f $CIN $HIN
+mv $HOUT $HIN
index 0707cc314ab5b8ac32dd71ee5dcf471617a7627e..8c188871805f02974af1f11842b998fe498edab6 100644 (file)
@@ -24,8 +24,8 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: 
 shortcut: 
-resize: FL_RESIZE_NONE
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_ALL
+gravity: FL_NorthWest FL_SouthEast
 name: 
 callback: 
 argument: 
@@ -81,8 +81,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_filename
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_BUTTON
@@ -99,8 +99,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_browse
-callback: C_FormGraphicsBrowseCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: BROWSE
 
 --------------------
 class: FL_LABELFRAME
@@ -153,8 +153,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_width
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_INPUT
@@ -171,8 +171,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_height
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_LABELFRAME
@@ -207,7 +207,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ok
-callback: C_FormGraphicsOKCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -225,7 +225,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_apply
-callback: C_FormGraphicsApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -243,7 +243,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_cancel
-callback: C_FormGraphicsCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -279,8 +279,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_width_percent_page
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -297,8 +297,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_width_default
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
        value: 1
 
 --------------------
@@ -316,8 +316,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_width_cm
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -334,8 +334,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_width_inch
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -352,8 +352,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_width_percent_column
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_END_GROUP
@@ -406,8 +406,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_height_percent_page
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -424,8 +424,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_height_inch
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -442,8 +442,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_height_cm
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -460,8 +460,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_height_default
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
        value: 1
 
 --------------------
@@ -624,8 +624,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_rotate_angle
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -642,8 +642,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_inline
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_INPUT
@@ -660,8 +660,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_subcaption
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 --------------------
 class: FL_CHECKBUTTON
@@ -678,8 +678,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_subcaption
-callback: C_FormGraphicsInputCB
-argument: 0
+callback: C_FormBaseInputCB
+argument: CHECKINPUT
 
 ==============================
 create_the_forms
index 8b2f61982f8b49391aca4f7c0ca1db98a789dfdf..c5a51a3ef55e3a4986153b9315b87e78ae1feb3e 100644 (file)
@@ -3,7 +3,7 @@ Magic: 13000
 Internal Form Definition File
     (do not change)
 
-Number of forms: 6
+Number of forms: 5
 Unit of measure: FL_COORD_PIXEL
 SnapGrid: 5
 
@@ -64,7 +64,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_close
-callback: C_FormTabularCloseCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -178,7 +178,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_append_column
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -196,7 +196,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_delete_column
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -214,7 +214,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_append_row
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -232,7 +232,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_delete_row
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -250,7 +250,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_set_borders
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -268,7 +268,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_unset_borders
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -286,7 +286,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_longtable
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -304,7 +304,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_rotate_tabular
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -400,7 +400,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_top
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -418,7 +418,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_bottom
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -436,7 +436,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_left
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -454,7 +454,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_right
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -508,7 +508,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_align_left
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -526,7 +526,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_align_right
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -544,7 +544,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_align_center
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -562,7 +562,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_column_width
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -634,7 +634,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_special_alignment
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -670,7 +670,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_valign_top
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -688,7 +688,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_valign_center
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -706,7 +706,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_valign_bottom
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 =============== FORM ===============
@@ -892,7 +892,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_multicolumn
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -910,7 +910,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_rotate_cell
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -946,7 +946,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_special_multialign
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -982,7 +982,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_mcolumn_width
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1000,7 +1000,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_top
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1018,7 +1018,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_bottom
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1036,7 +1036,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_left
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1054,7 +1054,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_border_right
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1072,7 +1072,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_align_left
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1090,7 +1090,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_align_right
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1108,7 +1108,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_align_center
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1126,7 +1126,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_valign_top
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1144,7 +1144,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_valign_center
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1162,7 +1162,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_valign_bottom
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1180,7 +1180,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_useminipage
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 =============== FORM ===============
@@ -1258,7 +1258,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_lt_firsthead
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1276,7 +1276,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_lt_head
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1330,7 +1330,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_lt_foot
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1348,7 +1348,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_lt_lastfoot
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1402,122 +1402,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_lt_newpage
-callback: C_FormTabularInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
-=============== FORM ===============
-Name: form_create_tabular
-Width: 310
-Height: 130
-Number of Objects: 6
-
---------------------
-class: FL_BOX
-type: UP_BOX
-box: 0 0 310 130
-boxtype: FL_UP_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_BUTTON
-type: RETURN_BUTTON
-box: 10 90 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_FormTabularOKCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 110 90 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_FormTabularApplyCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 210 90 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_cancel
-callback: C_FormTabularCancelCB
-argument: 0
-
---------------------
-class: FL_VALSLIDER
-type: HOR_SLIDER
-box: 80 50 220 30
-boxtype: FL_DOWN_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Columns
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
-name: slider_columns
-callback: 
-argument: 
-
---------------------
-class: FL_VALSLIDER
-type: HOR_SLIDER
-box: 80 10 220 30
-boxtype: FL_DOWN_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Rows
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NoGravity FL_NoGravity
-name: slider_rows
-callback: 
-argument: 
-
 ==============================
 create_the_forms
diff --git a/src/frontends/xforms/forms/form_tabular_create.fd b/src/frontends/xforms/forms/form_tabular_create.fd
new file mode 100644 (file)
index 0000000..838c000
--- /dev/null
@@ -0,0 +1,125 @@
+Magic: 13000
+
+Internal Form Definition File
+    (do not change)
+
+Number of forms: 1
+Unit of measure: FL_COORD_PIXEL
+SnapGrid: 5
+
+=============== FORM ===============
+Name: form_tabular_create
+Width: 310
+Height: 130
+Number of Objects: 6
+
+--------------------
+class: FL_BOX
+type: UP_BOX
+box: 0 0 310 130
+boxtype: FL_UP_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_BUTTON
+type: RETURN_BUTTON
+box: 10 90 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_FormBaseOKCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 110 90 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_FormBaseApplyCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 210 90 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_cancel
+callback: C_FormBaseCancelCB
+argument: 0
+
+--------------------
+class: FL_VALSLIDER
+type: HOR_SLIDER
+box: 80 50 220 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Columns
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NoGravity FL_NoGravity
+name: slider_columns
+callback: 
+argument: 
+
+--------------------
+class: FL_VALSLIDER
+type: HOR_SLIDER
+box: 80 10 220 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Rows
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NoGravity FL_NoGravity
+name: slider_rows
+callback: 
+argument: 
+
+==============================
+create_the_forms
index 6c24c3f9cb10b0213059d63e550486d521111240..f64419ea6f04f09fd7c57751b1f3a94faf0c5b9c 100644 (file)
@@ -31,6 +31,7 @@ SRCS := form_citation.fd \
        form_print.fd \
        form_ref.fd \
        form_tabular.fd \
+       form_tabular_create.fd \
        form_toc.fd \
        form_url.fd
 
index 6e47e90b13b9472d95c69fc8bf062d9d16889512..bed00cf7c83e591f5c55e394650cb04839bd4041 100644 (file)
@@ -132,7 +132,6 @@ InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns)
     actcell = 0;
     cursor.pos(0);
     sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
-    dialogs_ = 0;
     need_update = INIT;
 }
 
@@ -148,7 +147,6 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
     actcell = 0;
     cursor.pos(0);
     sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
-    dialogs_ = 0;
     need_update = INIT;
 }
 
@@ -156,8 +154,7 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
 InsetTabular::~InsetTabular()
 {
     delete tabular;
-    if (dialogs_)
-       dialogs_->hideTabular(this);
+    hideDialog();
 }
 
 
@@ -534,9 +531,8 @@ bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
        if (inset->LyxCode() == TABULAR_CODE &&
            !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE))
        {
-           dialogs_ = bv->owner()->getDialogs();
-           dialogs_->updateTabular(this);
-           oldcell = actcell;
+               bv->owner()->getDialogs()->updateTabular(this);
+               oldcell = actcell;
        }
        return true;
     }
@@ -639,8 +635,7 @@ void InsetTabular::InsetButtonRelease(BufferView * bv,
                return;
            }
        }
-       dialogs_ = bv->owner()->getDialogs();
-        dialogs_->showTabular(this);
+       bv->owner()->getDialogs()->showTabular(this);
        return;
     }
     if (the_locking_inset) {
@@ -848,8 +843,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
        break;
     case LFUN_LAYOUT_TABULAR:
     {
-       dialogs_ = bv->owner()->getDialogs();
-        dialogs_->showTabular(this);
+       bv->owner()->getDialogs()->showTabular(this);
     }
     break;
     case LFUN_TABULAR_FEATURE:
@@ -1135,9 +1129,9 @@ void InsetTabular::resetPos(BufferView * bv) const
     if ((!the_locking_inset ||
         !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) &&
        (actcell != oldcell)) {
-       dialogs_ = bv->owner()->getDialogs();
-        dialogs_->updateTabular(const_cast<InsetTabular *>(this));
-       oldcell = actcell;
+           InsetTabular * inset = const_cast<InsetTabular *>(this);
+           bv->owner()->getDialogs()->updateTabular(inset);
+           oldcell = actcell;
     }
 }
 
@@ -1673,8 +1667,7 @@ void InsetTabular::OpenLayoutDialog(BufferView * bv) const
            return;
        }
     }
-    dialogs_ = bv->owner()->getDialogs();
-    dialogs_->showTabular(const_cast<InsetTabular *>(this));
+    bv->owner()->getDialogs()->showTabular(const_cast<InsetTabular *>(this));
 }
 
 //
index 9cece3c8903570727e6fa74a485d38d5c2419318..39ee7b6bf6127908fb9d9181f712bd5e75584aae 100644 (file)
 #include "LString.h"
 #include "lyxcursor.h"
 #include "lyxfunc.h"
+#include <sigc++/signal_system.h>
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Signal0;
+#endif
 
 class LyXLex;
 class Painter;
 class BufferView;
 class Buffer;
-class Dialogs;
 
 class InsetTabular : public UpdatableInset {
 public:
@@ -174,6 +178,8 @@ public:
     // Public structures and variables
     ///
     LyXTabular * tabular;
+       ///
+       Signal0<void> hideDialog;
 
 private:
     ///
@@ -268,7 +274,5 @@ private:
     mutable bool locked;
     ///
     mutable UpdateCodes need_update;
-    ///
-    mutable Dialogs * dialogs_;
 };
 #endif
index cc3e88acda57de2c16d7566bec356876e1ece1ad..963a5779fd157d7ca1790126e3078a05512f6f0e 100644 (file)
@@ -70,7 +70,7 @@ template<typename T>
 inline
 string const tostr(T const & t) 
 {
-       std::ostringstream ostr;
+       ostringstream ostr;
        ostr << t;
        return ostr.str().c_str();
        // We need to use the .c_str since we sometimes are using