Cleanup patches for xforms (Angus) and KDE (John)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1148 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-10-24 13:13:59 +00:00
parent 8e155565a5
commit c9dbe4fd82
60 changed files with 1240 additions and 1305 deletions

View File

@ -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> 2000-10-23 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/insets/figinset.C (GhostscriptMsg): use DisplayString() to * src/insets/figinset.C (GhostscriptMsg): use DisplayString() to
@ -90,23 +143,23 @@
2000-10-18 Angus Leeming <a.leeming@ic.ac.uk> 2000-10-18 Angus Leeming <a.leeming@ic.ac.uk>
* src/support/lstrings.C (lowercase, uppercase): * src/support/lstrings.C (lowercase, uppercase):
use explicit casts to remove compiler warnings. use explicit casts to remove compiler warnings.
* src/support/LRegex.C (Impl): * src/support/LRegex.C (Impl):
* src/support/StrPool.C (add): * src/support/StrPool.C (add):
* src/support/filetools.C (MakeAbsPath, NormalizePath, MakeRelPath) * src/support/filetools.C (MakeAbsPath, NormalizePath, MakeRelPath)
(AddPath, MakeDisplayPath): (AddPath, MakeDisplayPath):
* src/support/lstrings.C (prefixIs, subst): * src/support/lstrings.C (prefixIs, subst):
use correct type to remove compiler warnings. 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/lyxlib.h:
* src/support/mkdir.C (mkdir): change parameter to mode_t for * src/support/mkdir.C (mkdir): change parameter to mode_t for
portability and to remove compiler warning with DEC cxx. 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> 2000-10-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>

View File

@ -70,6 +70,8 @@ src/frontends/xforms/FormRef.C
src/frontends/xforms/form_ref.C src/frontends/xforms/form_ref.C
src/frontends/xforms/FormTabular.C src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular.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/FormToc.C
src/frontends/xforms/form_toc.C src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C src/frontends/xforms/FormUrl.C

View File

@ -105,7 +105,6 @@ using std::pair;
using std::vector; using std::vector;
using std::max; using std::max;
using std::set; using std::set;
using std::istringstream;
// all these externs should eventually be removed. // all these externs should eventually be removed.
extern BufferList bufferlist; extern BufferList bufferlist;

View File

@ -50,8 +50,8 @@ public:
virtual void show() = 0; virtual void show() = 0;
/// ///
virtual void hide() = 0; virtual void hide() = 0;
/// Parameter defines if a buffer switch occurred ///
virtual void update(bool = false) = 0; virtual void update() = 0;
//@} //@}
}; };

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: copyrightdlgdata.C 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.
@ -11,6 +11,7 @@
*********************************************************************/ *********************************************************************/
#include <gettext.h> #include <gettext.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qlayout.h> #include <qlayout.h>
#include "copyrightdlgdata.h" #include "copyrightdlgdata.h"

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: copyrightdlgdata.h 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: indexdlgdata.C 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.
@ -11,6 +11,7 @@
*********************************************************************/ *********************************************************************/
#include <gettext.h> #include <gettext.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qlayout.h> #include <qlayout.h>
#include "indexdlgdata.h" #include "indexdlgdata.h"
@ -50,7 +51,7 @@ IndexDialogData::IndexDialogData
index->setBackgroundMode( QWidget::PaletteBase ); index->setBackgroundMode( QWidget::PaletteBase );
index->setFontPropagation( QWidget::NoChildren ); index->setFontPropagation( QWidget::NoChildren );
index->setPalettePropagation( QWidget::NoChildren ); index->setPalettePropagation( QWidget::NoChildren );
index->setText( _("")); index->setText( "" );
index->setMaxLength( 32767 ); index->setMaxLength( 32767 );
index->setFrame( QLineEdit::Normal ); index->setFrame( QLineEdit::Normal );
index->setFrame( TRUE ); index->setFrame( TRUE );

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: indexdlgdata.h 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: paraextradlgdata.C 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.
@ -11,6 +11,7 @@
*********************************************************************/ *********************************************************************/
#include <gettext.h> #include <gettext.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qlayout.h> #include <qlayout.h>
#include "paraextradlgdata.h" #include "paraextradlgdata.h"
@ -177,7 +178,7 @@ ParaExtraDialogData::ParaExtraDialogData
widthvalue->setBackgroundMode( QWidget::PaletteBase ); widthvalue->setBackgroundMode( QWidget::PaletteBase );
widthvalue->setFontPropagation( QWidget::NoChildren ); widthvalue->setFontPropagation( QWidget::NoChildren );
widthvalue->setPalettePropagation( QWidget::NoChildren ); widthvalue->setPalettePropagation( QWidget::NoChildren );
widthvalue->setText( _("") ); widthvalue->setText( "" );
widthvalue->setMaxLength( 32767 ); widthvalue->setMaxLength( 32767 );
widthvalue->setFrame( QLineEdit::Normal ); widthvalue->setFrame( QLineEdit::Normal );
widthvalue->setFrame( TRUE ); widthvalue->setFrame( TRUE );

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: paraextradlgdata.h 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: parageneraldlgdata.C 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.
@ -11,6 +11,7 @@
*********************************************************************/ *********************************************************************/
#include <gettext.h> #include <gettext.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qlayout.h> #include <qlayout.h>
#include "parageneraldlgdata.h" #include "parageneraldlgdata.h"
@ -280,7 +281,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
labelwidth->setBackgroundMode( QWidget::PaletteBase ); labelwidth->setBackgroundMode( QWidget::PaletteBase );
labelwidth->setFontPropagation( QWidget::NoChildren ); labelwidth->setFontPropagation( QWidget::NoChildren );
labelwidth->setPalettePropagation( QWidget::NoChildren ); labelwidth->setPalettePropagation( QWidget::NoChildren );
labelwidth->setText( _("") ); labelwidth->setText( "" );
labelwidth->setMaxLength( 32767 ); labelwidth->setMaxLength( 32767 );
labelwidth->setFrame( QLineEdit::Normal ); labelwidth->setFrame( QLineEdit::Normal );
labelwidth->setFrame( TRUE ); labelwidth->setFrame( TRUE );
@ -294,7 +295,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
spaceabovevalue->setBackgroundMode( QWidget::PaletteBase ); spaceabovevalue->setBackgroundMode( QWidget::PaletteBase );
spaceabovevalue->setFontPropagation( QWidget::NoChildren ); spaceabovevalue->setFontPropagation( QWidget::NoChildren );
spaceabovevalue->setPalettePropagation( QWidget::NoChildren ); spaceabovevalue->setPalettePropagation( QWidget::NoChildren );
spaceabovevalue->setText( _("") ); spaceabovevalue->setText( "" );
spaceabovevalue->setMaxLength( 32767 ); spaceabovevalue->setMaxLength( 32767 );
spaceabovevalue->setFrame( QLineEdit::Normal ); spaceabovevalue->setFrame( QLineEdit::Normal );
spaceabovevalue->setFrame( TRUE ); spaceabovevalue->setFrame( TRUE );
@ -356,7 +357,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
spaceaboveminus->setBackgroundMode( QWidget::PaletteBase ); spaceaboveminus->setBackgroundMode( QWidget::PaletteBase );
spaceaboveminus->setFontPropagation( QWidget::NoChildren ); spaceaboveminus->setFontPropagation( QWidget::NoChildren );
spaceaboveminus->setPalettePropagation( QWidget::NoChildren ); spaceaboveminus->setPalettePropagation( QWidget::NoChildren );
spaceaboveminus->setText( _("") ); spaceaboveminus->setText( "" );
spaceaboveminus->setMaxLength( 32767 ); spaceaboveminus->setMaxLength( 32767 );
spaceaboveminus->setFrame( QLineEdit::Normal ); spaceaboveminus->setFrame( QLineEdit::Normal );
spaceaboveminus->setFrame( TRUE ); spaceaboveminus->setFrame( TRUE );
@ -401,7 +402,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
spaceaboveplus->setBackgroundMode( QWidget::PaletteBase ); spaceaboveplus->setBackgroundMode( QWidget::PaletteBase );
spaceaboveplus->setFontPropagation( QWidget::NoChildren ); spaceaboveplus->setFontPropagation( QWidget::NoChildren );
spaceaboveplus->setPalettePropagation( QWidget::NoChildren ); spaceaboveplus->setPalettePropagation( QWidget::NoChildren );
spaceaboveplus->setText( _("") ); spaceaboveplus->setText( "" );
spaceaboveplus->setMaxLength( 32767 ); spaceaboveplus->setMaxLength( 32767 );
spaceaboveplus->setFrame( QLineEdit::Normal ); spaceaboveplus->setFrame( QLineEdit::Normal );
spaceaboveplus->setFrame( TRUE ); spaceaboveplus->setFrame( TRUE );
@ -480,7 +481,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
spacebelowminus->setBackgroundMode( QWidget::PaletteBase ); spacebelowminus->setBackgroundMode( QWidget::PaletteBase );
spacebelowminus->setFontPropagation( QWidget::NoChildren ); spacebelowminus->setFontPropagation( QWidget::NoChildren );
spacebelowminus->setPalettePropagation( QWidget::NoChildren ); spacebelowminus->setPalettePropagation( QWidget::NoChildren );
spacebelowminus->setText( _("") ); spacebelowminus->setText( "" );
spacebelowminus->setMaxLength( 32767 ); spacebelowminus->setMaxLength( 32767 );
spacebelowminus->setFrame( QLineEdit::Normal ); spacebelowminus->setFrame( QLineEdit::Normal );
spacebelowminus->setFrame( TRUE ); spacebelowminus->setFrame( TRUE );
@ -495,7 +496,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
spacebelowplus->setBackgroundMode( QWidget::PaletteBase ); spacebelowplus->setBackgroundMode( QWidget::PaletteBase );
spacebelowplus->setFontPropagation( QWidget::NoChildren ); spacebelowplus->setFontPropagation( QWidget::NoChildren );
spacebelowplus->setPalettePropagation( QWidget::NoChildren ); spacebelowplus->setPalettePropagation( QWidget::NoChildren );
spacebelowplus->setText( _("") ); spacebelowplus->setText( "" );
spacebelowplus->setMaxLength( 32767 ); spacebelowplus->setMaxLength( 32767 );
spacebelowplus->setFrame( QLineEdit::Normal ); spacebelowplus->setFrame( QLineEdit::Normal );
spacebelowplus->setFrame( TRUE ); spacebelowplus->setFrame( TRUE );
@ -510,7 +511,7 @@ ParaGeneralDialogData::ParaGeneralDialogData
spacebelowvalue->setBackgroundMode( QWidget::PaletteBase ); spacebelowvalue->setBackgroundMode( QWidget::PaletteBase );
spacebelowvalue->setFontPropagation( QWidget::NoChildren ); spacebelowvalue->setFontPropagation( QWidget::NoChildren );
spacebelowvalue->setPalettePropagation( QWidget::NoChildren ); spacebelowvalue->setPalettePropagation( QWidget::NoChildren );
spacebelowvalue->setText( _("") ); spacebelowvalue->setText( "" );
spacebelowvalue->setMaxLength( 32767 ); spacebelowvalue->setMaxLength( 32767 );
spacebelowvalue->setFrame( QLineEdit::Normal ); spacebelowvalue->setFrame( QLineEdit::Normal );
spacebelowvalue->setFrame( TRUE ); spacebelowvalue->setFrame( TRUE );

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: parageneraldlgdata.h 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: printdlgdata.C 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.
@ -11,6 +11,7 @@
*********************************************************************/ *********************************************************************/
#include <gettext.h> #include <gettext.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qlayout.h> #include <qlayout.h>
#include "printdlgdata.h" #include "printdlgdata.h"
@ -53,7 +54,7 @@ PrintDialogData::PrintDialogData
pagesRadioGroup->setLineWidth( 1 ); pagesRadioGroup->setLineWidth( 1 );
pagesRadioGroup->setMidLineWidth( 0 ); pagesRadioGroup->setMidLineWidth( 0 );
pagesRadioGroup->QFrame::setMargin( 0 ); pagesRadioGroup->QFrame::setMargin( 0 );
pagesRadioGroup->setTitle( _("") ); pagesRadioGroup->setTitle( "" );
pagesRadioGroup->setAlignment( 1 ); pagesRadioGroup->setAlignment( 1 );
pagesRadioGroup->setExclusive( TRUE ); pagesRadioGroup->setExclusive( TRUE );
@ -99,7 +100,7 @@ PrintDialogData::PrintDialogData
printToRadioGroup->setLineWidth( 1 ); printToRadioGroup->setLineWidth( 1 );
printToRadioGroup->setMidLineWidth( 0 ); printToRadioGroup->setMidLineWidth( 0 );
printToRadioGroup->QFrame::setMargin( 0 ); printToRadioGroup->QFrame::setMargin( 0 );
printToRadioGroup->setTitle( _("") ); printToRadioGroup->setTitle( "" );
printToRadioGroup->setAlignment( 1 ); printToRadioGroup->setAlignment( 1 );
printToRadioGroup->setExclusive( TRUE ); printToRadioGroup->setExclusive( TRUE );
@ -171,7 +172,7 @@ PrintDialogData::PrintDialogData
from->setBackgroundMode( QWidget::PaletteBase ); from->setBackgroundMode( QWidget::PaletteBase );
from->setFontPropagation( QWidget::NoChildren ); from->setFontPropagation( QWidget::NoChildren );
from->setPalettePropagation( QWidget::NoChildren ); from->setPalettePropagation( QWidget::NoChildren );
from->setText( _("") ); from->setText( "" );
from->setMaxLength( 32767 ); from->setMaxLength( 32767 );
from->setFrame( QLineEdit::Normal ); from->setFrame( QLineEdit::Normal );
from->setFrame( TRUE ); from->setFrame( TRUE );
@ -255,7 +256,7 @@ PrintDialogData::PrintDialogData
printername->setBackgroundMode( QWidget::PaletteBase ); printername->setBackgroundMode( QWidget::PaletteBase );
printername->setFontPropagation( QWidget::NoChildren ); printername->setFontPropagation( QWidget::NoChildren );
printername->setPalettePropagation( QWidget::NoChildren ); printername->setPalettePropagation( QWidget::NoChildren );
printername->setText( _("") ); printername->setText( "" );
printername->setMaxLength( 32767 ); printername->setMaxLength( 32767 );
printername->setFrame( QLineEdit::Normal ); printername->setFrame( QLineEdit::Normal );
printername->setFrame( TRUE ); printername->setFrame( TRUE );
@ -281,7 +282,7 @@ PrintDialogData::PrintDialogData
filename->setBackgroundMode( QWidget::PaletteBase ); filename->setBackgroundMode( QWidget::PaletteBase );
filename->setFontPropagation( QWidget::NoChildren ); filename->setFontPropagation( QWidget::NoChildren );
filename->setPalettePropagation( QWidget::NoChildren ); filename->setPalettePropagation( QWidget::NoChildren );
filename->setText( _("") ); filename->setText( "" );
filename->setMaxLength( 32767 ); filename->setMaxLength( 32767 );
filename->setFrame( QLineEdit::Normal ); filename->setFrame( QLineEdit::Normal );
filename->setFrame( TRUE ); filename->setFrame( TRUE );
@ -325,7 +326,7 @@ PrintDialogData::PrintDialogData
count->setBackgroundMode( QWidget::PaletteBase ); count->setBackgroundMode( QWidget::PaletteBase );
count->setFontPropagation( QWidget::NoChildren ); count->setFontPropagation( QWidget::NoChildren );
count->setPalettePropagation( QWidget::NoChildren ); count->setPalettePropagation( QWidget::NoChildren );
count->setText( _("") ); count->setText( "" );
count->setMaxLength( 32767 ); count->setMaxLength( 32767 );
count->setFrame( QLineEdit::Normal ); count->setFrame( QLineEdit::Normal );
count->setFrame( TRUE ); count->setFrame( TRUE );
@ -354,7 +355,7 @@ PrintDialogData::PrintDialogData
to->setBackgroundMode( QWidget::PaletteBase ); to->setBackgroundMode( QWidget::PaletteBase );
to->setFontPropagation( QWidget::NoChildren ); to->setFontPropagation( QWidget::NoChildren );
to->setPalettePropagation( QWidget::NoChildren ); to->setPalettePropagation( QWidget::NoChildren );
to->setText( _("") ); to->setText( "" );
to->setMaxLength( 32767 ); to->setMaxLength( 32767 );
to->setFrame( QLineEdit::Normal ); to->setFrame( QLineEdit::Normal );
to->setFrame( TRUE ); to->setFrame( TRUE );

View File

@ -3,7 +3,7 @@
--- Qt Architect generated file --- --- Qt Architect generated file ---
File: printdlgdata.h 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 DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost. regenerated by qtarch. All changes will be lost.

View File

@ -13,6 +13,7 @@
#include "FormPrint.h" #include "FormPrint.h"
#include "FormRef.h" #include "FormRef.h"
#include "FormTabular.h" #include "FormTabular.h"
#include "FormTabularCreate.h"
#include "FormToc.h" #include "FormToc.h"
#include "FormUrl.h" #include "FormUrl.h"
@ -37,6 +38,7 @@ Dialogs::Dialogs(LyXView * lv)
dialogs_.push_back(new FormPrint(lv, this)); dialogs_.push_back(new FormPrint(lv, this));
dialogs_.push_back(new FormRef(lv, this)); dialogs_.push_back(new FormRef(lv, this));
dialogs_.push_back(new FormTabular(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 FormToc(lv, this));
dialogs_.push_back(new FormUrl(lv, this)); dialogs_.push_back(new FormUrl(lv, this));

View File

@ -167,7 +167,7 @@ FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t,
void FormBaseBD::connect() void FormBaseBD::connect()
{ {
u_ = d_->updateBufferDependent. u_ = d_->updateBufferDependent.
connect(slot(this, &FormBaseBD::update)); connect(slot(this, &FormBaseBD::updateSlot));
h_ = d_->hideBufferDependent. h_ = d_->hideBufferDependent.
connect(slot(this, &FormBaseBD::hide)); connect(slot(this, &FormBaseBD::hide));
FormBase::connect(); FormBase::connect();

View File

@ -59,8 +59,8 @@ protected: // methods
void show(); void show();
/// Hide the dialog. /// Hide the dialog.
virtual void hide(); virtual void hide();
/// bool indicates if a buffer switch took place /// Update the dialog.
virtual void update(bool = false) {} virtual void update() {}
/// Connect signals. Also perform any necessary initialisation. /// Connect signals. Also perform any necessary initialisation.
virtual void connect(); virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping. /// Disconnect signals. Also perform any necessary housekeeping.
@ -146,6 +146,8 @@ protected:
virtual void connect(); virtual void connect();
/// Disconnect signals /// Disconnect signals
virtual void disconnect(); virtual void disconnect();
/// bool indicates if a buffer switch took place
virtual void updateSlot(bool) { update(); }
/// Update connection. /// Update connection.
Connection u_; Connection u_;

View File

@ -10,9 +10,6 @@
*/ */
#include <config.h> #include <config.h>
#include FORMS_H_LOCATION
#include <algorithm> #include <algorithm>
#ifdef __GNUG__ #ifdef __GNUG__
@ -86,13 +83,8 @@ void FormCitation::build()
} }
void FormCitation::update(bool switched) void FormCitation::update()
{ {
if (switched) {
hide();
return;
}
bibkeys.clear(); bibkeys.clear();
bibkeysInfo.clear(); bibkeysInfo.clear();

View File

@ -57,7 +57,7 @@ private:
/// Filter the inputs /// Filter the inputs
virtual bool input( FL_OBJECT *, long ); virtual bool input( FL_OBJECT *, long );
/// Update dialog before showing it /// Update dialog before showing it
virtual void update(bool switched = false); virtual void update();
/// Apply from dialog (modify or create inset) /// Apply from dialog (modify or create inset)
virtual void apply(); virtual void apply();
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View File

@ -303,8 +303,7 @@ void FormDocument::cancel()
} }
// we can safely ignore the parameter because we can always update void FormDocument::update()
void FormDocument::update(bool)
{ {
if (!dialog_) if (!dialog_)
return; return;

View File

@ -84,7 +84,7 @@ private:
/// Filter the inputs /// Filter the inputs
virtual bool input( FL_OBJECT *, long ); virtual bool input( FL_OBJECT *, long );
/// Update the popup. /// Update the popup.
virtual void update(bool switched = false); virtual void update();
/// Apply from popup /// Apply from popup
virtual void apply(); virtual void apply();
/// Cancel from popup /// Cancel from popup

View File

@ -60,19 +60,15 @@ void FormError::showInset( InsetError * inset )
if (inset_) if (inset_)
ih_.disconnect(); ih_.disconnect();
inset_ = inset; inset_ = inset;
message_ = inset->getContents(); message_ = inset->getContents();
ih_ = inset->hide.connect(slot(this, &FormError::hide));
show(); show();
} }
void FormError::update(bool switched) void FormError::update()
{ {
if (switched) {
hide();
return;
}
fl_set_object_label(dialog_->message, message_.c_str()); fl_set_object_label(dialog_->message, message_.c_str());
} }

View File

@ -36,7 +36,7 @@ private:
/// Slot launching dialog to an existing inset /// Slot launching dialog to an existing inset
void showInset( InsetError * ); void showInset( InsetError * );
/// Update dialog before showing it /// Update dialog before showing it
virtual void update(bool switched = false); virtual void update();
/// Build the dialog /// Build the dialog
virtual void build(); virtual void build();
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View File

@ -16,10 +16,6 @@
#endif #endif
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h"
#include FORMS_H_LOCATION
#include "xform_macros.h"
#include "input_validators.h" #include "input_validators.h"
#include "FormGraphics.h" #include "FormGraphics.h"
#include "form_graphics.h" #include "form_graphics.h"
@ -42,30 +38,15 @@
using std::endl; 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) FormGraphics::FormGraphics(LyXView * lv, Dialogs * d)
: dialog_(0), lv_(lv), d_(d), inset_(0), : FormInset( lv, d, _("Graphics"), new NoRepeatedApplyReadOnlyPolicy ),
// The buttons c-tor values are the number of buttons we use dialog_(0), inset_(0),
// This is only to reduce memory waste. // The buttons c-tor values are the number of buttons we use
widthButtons(5), heightButtons(4), displayButtons(4), // This is only to reduce memory waste.
bc_(new ButtonController widthButtons(5), heightButtons(4), displayButtons(4),
(new NoRepeatedApplyReadOnlyPolicy, _("Cancel"), _("Close") ) last_image_path(".")
),
ih_(0), h_(0), u_(0),
last_image_path(".")
{ {
Assert(lv_ != 0);
Assert(d != 0);
Assert(bc_ != 0);
// let the dialog be shown // let the dialog be shown
// This is a permanent connection so we won't bother // This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting. // storing a copy because we won't be disconnecting.
@ -76,9 +57,6 @@ FormGraphics::FormGraphics(LyXView * lv, Dialogs * d)
FormGraphics::~FormGraphics() FormGraphics::~FormGraphics()
{ {
free(); free();
// Free the button controller.
delete bc_;
} }
@ -91,6 +69,10 @@ void FormGraphics::build()
return ; 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 // This is the place to add settings of the dialog that did not go
// to the .fd file. // to the .fd file.
@ -154,81 +136,39 @@ void FormGraphics::build()
displayButtons.registerRadioButton(dialog_->radio_no_display, displayButtons.registerRadioButton(dialog_->radio_no_display,
InsetGraphicsParams::NONE); InsetGraphicsParams::NONE);
// Connect a signal to hide the window when the window manager orders it. // manage the ok, apply and cancel/close buttons
fl_set_form_atclose(dialog_->form, bc_.setOK(dialog_->button_ok);
C_FormGraphicsWMHideCB, 0); bc_.setApply(dialog_->button_apply);
bc_.setCancel(dialog_->button_cancel);
bc_->setOK(dialog_->button_ok); bc_.setUndoAll(0);
bc_->setApply(dialog_->button_apply); bc_.refresh();
bc_->setCancel(dialog_->button_cancel);
bc_->setUndoAll(0);
bc_->refresh();
} }
void FormGraphics::show()
FL_FORM * FormGraphics::form() const
{ {
// If the dialog doesn't exist yet, build it. if ( dialog_ ) return dialog_->form;
if (!dialog_) { return 0;
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));
}
} }
void FormGraphics::showDialog(InsetGraphics* inset)
{
Assert(inset != 0);
void FormGraphics::disconnect()
{
inset_ = 0;
FormInset::disconnect();
}
void FormGraphics::showDialog(InsetGraphics * inset)
{
// If we are connected to another inset, disconnect. // If we are connected to another inset, disconnect.
if (inset_) if (inset_)
ih_.disconnect(); ih_.disconnect();
inset_ = inset; inset_ = inset;
if (inset_) { ih_ = inset_->hide.connect(slot(this, &FormGraphics::hide));
ih_ = inset_->hide.connect(slot(this, &FormGraphics::hide)); show();
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;
}
} }
@ -245,6 +185,7 @@ void FormGraphics::free()
dialog_ = 0; dialog_ = 0;
} }
void FormGraphics::apply() void FormGraphics::apply()
{ {
Assert(inset_ != 0); Assert(inset_ != 0);
@ -289,16 +230,8 @@ void FormGraphics::apply()
} }
// it doesn't look this is capable of updating on a buffer switch void FormGraphics::update()
// 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)
{ {
if (switched) {
hide();
return;
}
Assert(inset_ != 0); Assert(inset_ != 0);
// Update dialog with details from inset // Update dialog with details from inset
@ -336,9 +269,36 @@ void FormGraphics::update(bool switched)
igp.inlineFigure); igp.inlineFigure);
// Now make sure that the buttons are set correctly. // 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() bool FormGraphics::checkInput()
{ {
// Put verifications that the dialog shows some sane values, // Put verifications that the dialog shows some sane values,
@ -392,6 +352,7 @@ extern string system_lyxdir;
extern string user_lyxdir; extern string user_lyxdir;
//extern string system_tempdir; //extern string system_tempdir;
// Need to move this to the form_graphics // Need to move this to the form_graphics
string FormGraphics::browseFile(string const & filename) string FormGraphics::browseFile(string const & filename)
{ {
@ -434,6 +395,7 @@ string FormGraphics::browseFile(string const & filename)
return buf; return buf;
} }
void FormGraphics::browse() void FormGraphics::browse()
{ {
// Get the filename from the dialog // 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 // The above set input doesn't cause an input event so we do
// it manually. Otherwise the user needs to cause an input event // it manually. Otherwise the user needs to cause an input event
// to get the ok/apply buttons to be activated. // 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());
}

View File

@ -17,19 +17,15 @@
#define FORMGRAPHICS_H #define FORMGRAPHICS_H
#include "LString.h" #include "LString.h"
#include "frontends/DialogBase.h"
#include "RadioButtonGroup.h" #include "RadioButtonGroup.h"
#include <boost/utility.hpp>
#include "ButtonController.h"
#include "ButtonPolicies.h" #include "ButtonPolicies.h"
#include "FormInset.h"
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface #pragma interface
#endif #endif
// Forward declarations for classes we use only as pointers. // Forward declarations for classes we use only as pointers.
class Dialogs;
class LyXView;
class InsetGraphics; class InsetGraphics;
struct FD_form_graphics; struct FD_form_graphics;
@ -38,26 +34,12 @@ struct FD_form_graphics;
* *
* @Author Baruch Even <baruch.even@writeme.com> * @Author Baruch Even <baruch.even@writeme.com>
*/ */
class FormGraphics: public DialogBase, public noncopyable { class FormGraphics : public FormInset {
public: public:
/// #FormGraphics x(LyXFunc ..., Dialogs ...);# /// #FormGraphics x(LyXFunc ..., Dialogs ...);#
FormGraphics(LyXView *, Dialogs *); FormGraphics(LyXView *, Dialogs *);
/// ///
~FormGraphics(); ~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: private:
/// The maximum digits for the image width (cm, inch, percent) /// The maximum digits for the image width (cm, inch, percent)
@ -80,43 +62,46 @@ private:
/// ///
FILENAME_MAXCHARS = 1024 FILENAME_MAXCHARS = 1024
}; };
///
enum State {
///
CHECKINPUT,
///
BROWSE,
///
ADVANCEDINPUT
};
/// 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();
/// Save the active inset and show the dialog. /// Save the active inset and show the dialog.
void showDialog(InsetGraphics * inset); void showDialog(InsetGraphics *);
/// Create the dialog if necessary, update it and display it. /// Explicitly free the dialog.
void show(); void free();
/// Hide the dialog.
void hide();
/// Update the dialog
void update(bool switched = false);
/// Apply the changes to the inset.
void apply();
/// Verify that the input is correct. If not disable ok/apply buttons. /// Verify that the input is correct. If not disable ok/apply buttons.
bool checkInput(); bool checkInput();
/// Open the file browse dialog to select an image file. /// Open the file browse dialog to select an image file.
void browse(); 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. /// Display a file browser dialog and return the file chosen.
string browseFile(string const & filename); 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. /// Real GUI implementation.
FD_form_graphics * dialog_; 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? /** Which Inset do we belong to?
Used to set and update data to/from the inset. Used to set and update data to/from the inset.
*/ */
@ -127,15 +112,6 @@ private:
RadioButtonGroup heightButtons; RadioButtonGroup heightButtons;
/// ///
RadioButtonGroup displayButtons; 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 /// Last used figure path
string last_image_path; string last_image_path;
}; };

View 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()); fl_set_input(dialog_->key, params.getContents().c_str());
if ( lv_->buffer()->isReadonly() ) { if ( lv_->buffer()->isReadonly() ) {

View File

@ -33,7 +33,7 @@ private:
/// Build the dialog /// Build the dialog
virtual void build(); virtual void build();
/// Update dialog before showing it /// Update dialog before showing it
virtual void update(bool switched = false); virtual void update();
/// Apply from dialog (modify or create inset) /// Apply from dialog (modify or create inset)
virtual void apply(); virtual void apply();
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View File

@ -29,16 +29,6 @@ FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t,
{} {}
void FormInset::connect()
{
u_ = d_->updateBufferDependent.
connect(slot(this, &FormInset::update));
h_ = d_->hideBufferDependent.
connect(slot(this, &FormInset::hide));
FormBase::connect();
}
void FormInset::disconnect() void FormInset::disconnect()
{ {
ih_.disconnect(); ih_.disconnect();
@ -46,6 +36,15 @@ void FormInset::disconnect()
} }
void FormInset::updateSlot( bool switched )
{
if (switched)
hide();
else
update();
}
FormCommand::FormCommand( LyXView * lv, Dialogs * d, string const & t, FormCommand::FormCommand( LyXView * lv, Dialogs * d, string const & t,
ButtonPolicy * bp, ButtonPolicy * bp,
char const * close, char const * cancel) char const * close, char const * cancel)

View File

@ -30,11 +30,12 @@ protected:
char const * close = N_("Close"), char const * close = N_("Close"),
char const * cancel = N_("Cancel")); char const * cancel = N_("Cancel"));
/// Connect signals. Also perform any necessary initialisation.
virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping. /// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect(); virtual void disconnect();
/// bool indicates if a buffer switch took place
virtual void updateSlot(bool);
/// inset::hide connection. /// inset::hide connection.
Connection ih_; Connection ih_;
}; };

View File

@ -136,8 +136,7 @@ void FormParagraph::apply()
} }
// we can safely ignore the parameter because we can always update void FormParagraph::update()
void FormParagraph::update(bool)
{ {
if (!dialog_) if (!dialog_)
return; return;

View File

@ -40,7 +40,7 @@ private:
/// Apply from popup /// Apply from popup
virtual void apply(); virtual void apply();
/// Update the popup. /// Update the popup.
virtual void update(bool); virtual void update();
/// Filter the inputs on callback from xforms /// Filter the inputs on callback from xforms
virtual bool input(FL_OBJECT * ob, long); virtual bool input(FL_OBJECT * ob, long);

View File

@ -372,8 +372,7 @@ void FormPreferences::apply()
} }
// we can safely ignore the parameter because we can always update void FormPreferences::update()
void FormPreferences::update(bool)
{ {
if (dialog_) { if (dialog_) {
// read lyxrc entries // read lyxrc entries

View File

@ -46,7 +46,7 @@ public:
~FormPreferences(); ~FormPreferences();
private: private:
/// Update the dialog. /// Update the dialog.
virtual void update(bool = false); virtual void update();
/// ///
virtual void hide(); virtual void hide();
/// OK from dialog /// OK from dialog

View File

@ -158,8 +158,7 @@ void FormPrint::apply()
} }
// we can safely ignore the parameter because we can always update void FormPrint::update()
void FormPrint::update(bool)
{ {
if (dialog_ if (dialog_
&& lv_->view()->available()) { && lv_->view()->available()) {

View File

@ -40,7 +40,7 @@ public:
private: private:
/// Update the dialog. /// Update the dialog.
virtual void update(bool switched = false); virtual void update();
/// Apply from dialog /// Apply from dialog
virtual void apply(); virtual void apply();
/// Filter the inputs /// Filter the inputs

View 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_->ref, params.getContents().c_str());
fl_set_input(dialog_->name, params.getOptions().c_str()); fl_set_input(dialog_->name, params.getOptions().c_str());

View File

@ -61,7 +61,7 @@ private:
/// Filter the input /// Filter the input
virtual bool input( FL_OBJECT *, long ); virtual bool input( FL_OBJECT *, long );
/// Update dialog before showing it /// Update dialog before showing it
virtual void update(bool switched = false); virtual void update();
/// Not used but must be instantiated /// Not used but must be instantiated
virtual void apply(); virtual void apply();
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View File

@ -1,490 +1,421 @@
// -*- C++ -*-
/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2000 The LyX Team.
*
*======================================================*/
/* FormTabular.C /* FormTabular.C
* FormTabular Interface Class Implementation * FormTabular Interface Class Implementation
*/ */
#include <config.h> #include <config.h>
#include "lyx_gui_misc.h"
#include "gettext.h"
#include FORMS_H_LOCATION
#include "FormTabular.h" #include "FormTabular.h"
#include "form_tabular.h" #include "form_tabular.h"
#include "xform_macros.h"
#include "input_validators.h"
#include "LyXView.h" #include "LyXView.h"
#include "lyxfunc.h"
#include "Dialogs.h" #include "Dialogs.h"
#include "lyxrc.h"
#include "debug.h"
#include "insets/insettabular.h" #include "insets/insettabular.h"
#include "buffer.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) FormTabular::FormTabular(LyXView * lv, Dialogs * d)
: dialog_(0), tabular_options_(0), column_options_(0), : FormInset( lv, d, _("Tabular Layout") ),
cell_options_(0), longtable_options_(0), create_tabular_(0), dialog_(0), tabular_options_(0), column_options_(0),
lv_(lv), d_(d), u_(0), h_(0), inset_(0), actCell_(-1) cell_options_(0), longtable_options_(0),
inset_(0), actCell_(-1)
{ {
// let the dialog be shown // let the dialog be shown
// This is a permanent connection so we won't bother // This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting. // storing a copy because we won't be disconnecting.
d->showTabular.connect(slot(this, &FormTabular::showInset)); d->showTabular.connect(slot(this, &FormTabular::showInset));
d->updateTabular.connect(slot(this, &FormTabular::updateInset)); d->updateTabular.connect(slot(this, &FormTabular::updateInset));
d->hideTabular.connect(slot(this, &FormTabular::hideInset));
d->showTabularCreate.connect(slot(this, &FormTabular::show_create));
} }
FormTabular::~FormTabular() FormTabular::~FormTabular()
{ {
// we don't need to disconnect u and h here because delete dialog_;
// their destructors do that. delete tabular_options_;
delete dialog_; delete column_options_;
delete tabular_options_; delete cell_options_;
delete column_options_; delete longtable_options_;
delete cell_options_; }
delete longtable_options_;
delete create_tabular_;
FL_FORM * FormTabular::form() const
{
if ( dialog_ ) return dialog_->form;
return 0;
}
void FormTabular::disconnect()
{
inset_ = 0;
FormInset::disconnect();
}
void FormTabular::showInset( InsetTabular * inset )
{
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;
}
show();
}
void FormTabular::updateInset( InsetTabular * inset )
{
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;
}
update();
} }
void FormTabular::build() void FormTabular::build()
{ {
dialog_ = build_tabular(); dialog_ = build_tabular();
tabular_options_ = build_tabular_options(); tabular_options_ = build_tabular_options();
column_options_ = build_column_options(); column_options_ = build_column_options();
cell_options_ = build_cell_options(); cell_options_ = build_cell_options();
longtable_options_ = build_longtable_options(); longtable_options_ = build_longtable_options();
create_tabular_ = build_create_tabular();
fl_set_input_return(column_options_->input_column_width, // Workaround dumb xforms sizing bug
FL_RETURN_END); minw_ = form()->w;
fl_set_input_return(column_options_->input_special_alignment, minh_ = form()->h;
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"), fl_set_input_return(column_options_->input_column_width,
tabular_options_->form); FL_RETURN_END);
fl_addto_tabfolder(dialog_->tabFolder, _("Column/Row"), fl_set_input_return(column_options_->input_special_alignment,
column_options_->form); FL_RETURN_CHANGED);
fl_addto_tabfolder(dialog_->tabFolder, _("Cell"), fl_set_input_return(cell_options_->input_mcolumn_width,
cell_options_->form); FL_RETURN_CHANGED);
fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"), fl_set_input_return(cell_options_->input_special_multialign,
longtable_options_->form); FL_RETURN_CHANGED);
fl_set_form_atclose(dialog_->form,
C_FormTabularWMHideCB, 0);
fl_set_slider_bounds(create_tabular_->slider_rows, 1, 50); fl_addto_tabfolder(dialog_->tabFolder, _("Tabular"),
fl_set_slider_bounds(create_tabular_->slider_columns, 1, 50); tabular_options_->form);
fl_set_slider_value(create_tabular_->slider_rows, 5); fl_addto_tabfolder(dialog_->tabFolder, _("Column/Row"),
fl_set_slider_value(create_tabular_->slider_columns, 5); column_options_->form);
fl_set_slider_precision(create_tabular_->slider_rows, 0); fl_addto_tabfolder(dialog_->tabFolder, _("Cell"),
fl_set_slider_precision(create_tabular_->slider_columns, 0); cell_options_->form);
fl_set_form_atclose(create_tabular_->form, fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"),
C_FormTabularWMHideCB, 0); longtable_options_->form);
} }
void FormTabular::show() void FormTabular::update()
{ {
if (!dialog_) { if (!inset_ || !inset_->tabular)
build(); return;
}
update(); // make sure its up-to-date
if (dialog_->form->visible) { LyXTabular
fl_raise_form(dialog_->form); * tabular = inset_->tabular;
} else { int
fl_show_form(dialog_->form, align,
FL_PLACE_MOUSE | FL_FREE_SIZE, cell,
FL_TRANSIENT, column,row;
_("Tabular Layout")); char
// u_ = d_->updateBufferDependent.connect(slot(this, buf[12];
// &FormTabular::update)); string
h_ = d_->hideBufferDependent.connect(slot(this, pwidth, special;
&FormTabular::hide));
}
}
void FormTabular::showInset(InsetTabular * ti) actCell_ = cell = inset_->GetActCell();
{ column = tabular->column_of_cell(cell)+1;
inset_ = ti; fl_set_object_label(dialog_->text_warning,"");
if (ti) { fl_activate_object(column_options_->input_special_alignment);
show(); 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);
void FormTabular::hide() fl_deactivate_object(dialog_->input_tabular_column);
{ row = tabular->row_of_cell(cell)+1;
if (dialog_ && dialog_->form && dialog_->form->visible) { sprintf(buf,"%d",row);
fl_hide_form(dialog_->form); fl_set_input(dialog_->input_tabular_row, buf);
u_.disconnect(); fl_deactivate_object(dialog_->input_tabular_row);
h_.disconnect(); if (tabular->IsMultiColumn(cell)) {
inset_ = 0; 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);
void FormTabular::hideInset(InsetTabular * ti) fl_set_button(cell_options_->radio_border_bottom,
{ tabular->BottomLine(cell)?1:0);
if (inset_ == ti) { fl_activate_object(cell_options_->radio_border_bottom);
inset_ = 0; fl_set_object_lcol(cell_options_->radio_border_bottom, FL_BLACK);
hide(); 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,
void FormTabular::update(bool) tabular->RightLine(cell)?1:0);
{ fl_activate_object(cell_options_->radio_border_right);
if (dialog_) { fl_set_object_lcol(cell_options_->radio_border_right, FL_BLACK);
local_update(true); pwidth = tabular->GetMColumnPWidth(cell);
} align = tabular->GetAlignment(cell);
} if (!pwidth.empty() || (align == LYX_ALIGN_LEFT))
fl_set_button(cell_options_->radio_align_left, 1);
void FormTabular::updateInset(InsetTabular * ti) else if (align == LYX_ALIGN_RIGHT)
{ fl_set_button(cell_options_->radio_align_right, 1);
inset_ = ti; else
if (ti && dialog_ && dialog_->form->visible) { fl_set_button(cell_options_->radio_align_center, 1);
update(); 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);
int FormTabular::WMHideCB(FL_FORM * form, void *) fl_set_object_lcol(cell_options_->radio_align_center, FL_BLACK);
{ align = tabular->GetVAlignment(cell);
// Ensure that the signals (u and h) are disconnected even if the fl_set_button(cell_options_->radio_valign_top, 0);
// window manager is used to close the dialog. fl_set_button(cell_options_->radio_valign_bottom, 0);
FormTabular * pre = static_cast<FormTabular*>(form->u_vdata); fl_set_button(cell_options_->radio_valign_center, 0);
pre->hide(); if (pwidth.empty() || (align == LyXTabular::LYX_VALIGN_CENTER))
return FL_CANCEL; 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
void FormTabular::CloseCB(FL_OBJECT * ob, long) fl_set_button(cell_options_->radio_valign_top, 1);
{ fl_activate_object(cell_options_->radio_valign_top);
FormTabular * pre = static_cast<FormTabular*>(ob->form->u_vdata); fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK);
pre->hide(); 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);
void FormTabular::InputCB(FL_OBJECT * ob, long l) special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_MULTI);
{ fl_set_input(cell_options_->input_special_multialign, special.c_str());
FormTabular * pre = static_cast<FormTabular*>(ob->form->u_vdata); fl_set_input(cell_options_->input_mcolumn_width,pwidth.c_str());
pre->SetTabularOptions(ob, l); if (!lv_->buffer()->isReadonly()) {
} fl_activate_object(cell_options_->input_special_multialign);
fl_set_object_lcol(cell_options_->input_special_multialign,
FL_BLACK);
bool FormTabular::local_update(bool) fl_activate_object(cell_options_->input_mcolumn_width);
{ fl_set_object_lcol(cell_options_->input_mcolumn_width, FL_BLACK);
if (!inset_ || !inset_->tabular) }
return false; if (!pwidth.empty()) {
fl_deactivate_object(cell_options_->radio_align_left);
LyXTabular fl_deactivate_object(cell_options_->radio_align_right);
* tabular = inset_->tabular; fl_deactivate_object(cell_options_->radio_align_center);
int fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE);
align, fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE);
cell, fl_set_object_lcol(cell_options_->radio_align_center, FL_INACTIVE);
column,row; fl_activate_object(cell_options_->radio_valign_top);
char fl_activate_object(cell_options_->radio_valign_bottom);
buf[12]; fl_activate_object(cell_options_->radio_valign_center);
string fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK);
pwidth, special; fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_BLACK);
fl_set_object_lcol(cell_options_->radio_valign_center, FL_BLACK);
actCell_ = cell = inset_->GetActCell(); } else {
column = tabular->column_of_cell(cell)+1; fl_activate_object(cell_options_->radio_align_left);
fl_set_object_label(dialog_->text_warning,""); fl_activate_object(cell_options_->radio_align_right);
fl_activate_object(column_options_->input_special_alignment); fl_activate_object(cell_options_->radio_align_center);
fl_activate_object(cell_options_->input_special_multialign); fl_set_object_lcol(cell_options_->radio_align_left, FL_BLACK);
fl_activate_object(column_options_->input_column_width); fl_set_object_lcol(cell_options_->radio_align_right, FL_BLACK);
sprintf(buf,"%d",column); fl_set_object_lcol(cell_options_->radio_align_center, FL_BLACK);
fl_set_input(dialog_->input_tabular_column, buf); fl_deactivate_object(cell_options_->radio_valign_top);
fl_deactivate_object(dialog_->input_tabular_column); fl_deactivate_object(cell_options_->radio_valign_bottom);
row = tabular->row_of_cell(cell)+1; fl_deactivate_object(cell_options_->radio_valign_center);
sprintf(buf,"%d",row); fl_set_object_lcol(cell_options_->radio_valign_top, FL_INACTIVE);
fl_set_input(dialog_->input_tabular_row, buf); fl_set_object_lcol(cell_options_->radio_valign_bottom,FL_INACTIVE);
fl_deactivate_object(dialog_->input_tabular_row); fl_set_object_lcol(cell_options_->radio_valign_center,FL_INACTIVE);
if (tabular->IsMultiColumn(cell)) { }
fl_set_button(cell_options_->radio_multicolumn, 1); } else {
fl_set_button(cell_options_->radio_border_top, fl_set_button(cell_options_->radio_multicolumn, 0);
tabular->TopLine(cell)?1:0); fl_set_button(cell_options_->radio_border_top, 0);
fl_activate_object(cell_options_->radio_border_top); fl_deactivate_object(cell_options_->radio_border_top);
fl_set_object_lcol(cell_options_->radio_border_top, FL_BLACK); fl_set_object_lcol(cell_options_->radio_border_top, FL_INACTIVE);
fl_set_button(cell_options_->radio_border_bottom, fl_set_button(cell_options_->radio_border_bottom, 0);
tabular->BottomLine(cell)?1:0); fl_deactivate_object(cell_options_->radio_border_bottom);
fl_activate_object(cell_options_->radio_border_bottom); fl_set_object_lcol(cell_options_->radio_border_bottom, FL_INACTIVE);
fl_set_object_lcol(cell_options_->radio_border_bottom, FL_BLACK); fl_set_button(cell_options_->radio_border_left, 0);
fl_set_button(cell_options_->radio_border_left, fl_deactivate_object(cell_options_->radio_border_left);
tabular->LeftLine(cell)?1:0); fl_set_object_lcol(cell_options_->radio_border_left, FL_INACTIVE);
fl_activate_object(cell_options_->radio_border_left); fl_set_button(cell_options_->radio_border_right, 0);
fl_set_object_lcol(cell_options_->radio_border_left, FL_BLACK); fl_deactivate_object(cell_options_->radio_border_right);
fl_set_button(cell_options_->radio_border_right, fl_set_object_lcol(cell_options_->radio_border_right, FL_INACTIVE);
tabular->RightLine(cell)?1:0); fl_set_button(cell_options_->radio_align_left, 0);
fl_activate_object(cell_options_->radio_border_right); fl_deactivate_object(cell_options_->radio_align_left);
fl_set_object_lcol(cell_options_->radio_border_right, FL_BLACK); fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE);
pwidth = tabular->GetMColumnPWidth(cell); fl_set_button(cell_options_->radio_align_right, 0);
align = tabular->GetAlignment(cell); fl_deactivate_object(cell_options_->radio_align_right);
if (!pwidth.empty() || (align == LYX_ALIGN_LEFT)) fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE);
fl_set_button(cell_options_->radio_align_left, 1); fl_set_button(cell_options_->radio_align_center, 0);
else if (align == LYX_ALIGN_RIGHT) fl_deactivate_object(cell_options_->radio_align_center);
fl_set_button(cell_options_->radio_align_right, 1); 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 else
fl_set_button(cell_options_->radio_align_center, 1); fl_set_button(cell_options_->radio_rotate_cell, 0);
fl_activate_object(cell_options_->radio_align_left); if (tabular->TopLine(cell, true))
fl_set_object_lcol(cell_options_->radio_align_left, FL_BLACK); fl_set_button(column_options_->radio_border_top, 1);
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 else
fl_set_button(cell_options_->radio_valign_top, 1); fl_set_button(column_options_->radio_border_top, 0);
fl_activate_object(cell_options_->radio_valign_top); if (tabular->BottomLine(cell, true))
fl_set_object_lcol(cell_options_->radio_valign_top, FL_BLACK); fl_set_button(column_options_->radio_border_bottom, 1);
fl_activate_object(cell_options_->radio_valign_bottom); else
fl_set_object_lcol(cell_options_->radio_valign_bottom, FL_BLACK); fl_set_button(column_options_->radio_border_bottom, 0);
fl_activate_object(cell_options_->radio_valign_center); if (tabular->LeftLine(cell, true))
fl_set_object_lcol(cell_options_->radio_valign_center, FL_BLACK); fl_set_button(column_options_->radio_border_left, 1);
special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_MULTI); else
fl_set_input(cell_options_->input_special_multialign, special.c_str()); fl_set_button(column_options_->radio_border_left, 0);
fl_set_input(cell_options_->input_mcolumn_width,pwidth.c_str()); if (tabular->RightLine(cell, true))
if (!lv_->buffer()->isReadonly()) { fl_set_button(column_options_->radio_border_right, 1);
fl_activate_object(cell_options_->input_special_multialign); else
fl_set_object_lcol(cell_options_->input_special_multialign, fl_set_button(column_options_->radio_border_right, 0);
FL_BLACK); special = tabular->GetAlignSpecial(cell,LyXTabular::SET_SPECIAL_COLUMN);
fl_activate_object(cell_options_->input_mcolumn_width); fl_set_input(column_options_->input_special_alignment, special.c_str());
fl_set_object_lcol(cell_options_->input_mcolumn_width, FL_BLACK); 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()) { if (!pwidth.empty()) {
fl_deactivate_object(cell_options_->radio_align_left); fl_activate_object(cell_options_->radio_useminipage);
fl_deactivate_object(cell_options_->radio_align_right); fl_set_object_lcol(cell_options_->radio_useminipage, FL_BLACK);
fl_deactivate_object(cell_options_->radio_align_center); if (tabular->GetUsebox(cell) == 2)
fl_set_object_lcol(cell_options_->radio_align_left, FL_INACTIVE); fl_set_button(cell_options_->radio_useminipage, 1);
fl_set_object_lcol(cell_options_->radio_align_right, FL_INACTIVE); else
fl_set_object_lcol(cell_options_->radio_align_center, FL_INACTIVE); fl_set_button(cell_options_->radio_useminipage, 0);
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 { } else {
fl_activate_object(cell_options_->radio_align_left); fl_deactivate_object(cell_options_->radio_useminipage);
fl_activate_object(cell_options_->radio_align_right); fl_set_object_lcol(cell_options_->radio_useminipage, FL_INACTIVE);
fl_activate_object(cell_options_->radio_align_center); fl_set_button(cell_options_->radio_useminipage,0);
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 { align = tabular->GetAlignment(cell, true);
fl_set_button(cell_options_->radio_multicolumn, 0); fl_set_button(column_options_->radio_align_left, 0);
fl_set_button(cell_options_->radio_border_top, 0); fl_set_button(column_options_->radio_align_right, 0);
fl_deactivate_object(cell_options_->radio_border_top); fl_set_button(column_options_->radio_align_center, 0);
fl_set_object_lcol(cell_options_->radio_border_top, FL_INACTIVE); if (!pwidth.empty() || (align == LYX_ALIGN_LEFT))
fl_set_button(cell_options_->radio_border_bottom, 0); fl_set_button(column_options_->radio_align_left, 1);
fl_deactivate_object(cell_options_->radio_border_bottom); else if (align == LYX_ALIGN_RIGHT)
fl_set_object_lcol(cell_options_->radio_border_bottom, FL_INACTIVE); fl_set_button(column_options_->radio_align_right, 1);
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 else
fl_set_button(cell_options_->radio_useminipage, 0); fl_set_button(column_options_->radio_align_center, 1);
} else { align = tabular->GetVAlignment(cell, true);
fl_deactivate_object(cell_options_->radio_useminipage); fl_set_button(column_options_->radio_valign_top, 0);
fl_set_object_lcol(cell_options_->radio_useminipage, FL_INACTIVE); fl_set_button(column_options_->radio_valign_bottom, 0);
fl_set_button(cell_options_->radio_useminipage,0); fl_set_button(column_options_->radio_valign_center, 0);
} if (pwidth.empty() || (align == LyXTabular::LYX_VALIGN_CENTER))
align = tabular->GetAlignment(cell, true); fl_set_button(column_options_->radio_valign_center, 1);
fl_set_button(column_options_->radio_align_left, 0); else if (align == LyXTabular::LYX_VALIGN_BOTTOM)
fl_set_button(column_options_->radio_align_right, 0); fl_set_button(column_options_->radio_valign_bottom, 1);
fl_set_button(column_options_->radio_align_center, 0); else
if (!pwidth.empty() || (align == LYX_ALIGN_LEFT)) fl_set_button(column_options_->radio_valign_top, 1);
fl_set_button(column_options_->radio_align_left, 1); if (!pwidth.empty()) {
else if (align == LYX_ALIGN_RIGHT) fl_deactivate_object(column_options_->radio_align_left);
fl_set_button(column_options_->radio_align_right, 1); fl_deactivate_object(column_options_->radio_align_right);
else fl_deactivate_object(column_options_->radio_align_center);
fl_set_button(column_options_->radio_align_center, 1); fl_set_object_lcol(column_options_->radio_align_left, FL_INACTIVE);
align = tabular->GetVAlignment(cell, true); fl_set_object_lcol(column_options_->radio_align_right, FL_INACTIVE);
fl_set_button(column_options_->radio_valign_top, 0); fl_set_object_lcol(column_options_->radio_align_center, FL_INACTIVE);
fl_set_button(column_options_->radio_valign_bottom, 0); fl_activate_object(column_options_->radio_valign_top);
fl_set_button(column_options_->radio_valign_center, 0); fl_activate_object(column_options_->radio_valign_bottom);
if (pwidth.empty() || (align == LyXTabular::LYX_VALIGN_CENTER)) fl_activate_object(column_options_->radio_valign_center);
fl_set_button(column_options_->radio_valign_center, 1); fl_set_object_lcol(column_options_->radio_valign_top, FL_BLACK);
else if (align == LyXTabular::LYX_VALIGN_BOTTOM) fl_set_object_lcol(column_options_->radio_valign_bottom, FL_BLACK);
fl_set_button(column_options_->radio_valign_bottom, 1); fl_set_object_lcol(column_options_->radio_valign_center, FL_BLACK);
else } else {
fl_set_button(column_options_->radio_valign_top, 1); fl_activate_object(column_options_->radio_align_left);
if (!pwidth.empty()) { fl_activate_object(column_options_->radio_align_right);
fl_deactivate_object(column_options_->radio_align_left); fl_activate_object(column_options_->radio_align_center);
fl_deactivate_object(column_options_->radio_align_right); fl_set_object_lcol(column_options_->radio_align_left, FL_BLACK);
fl_deactivate_object(column_options_->radio_align_center); fl_set_object_lcol(column_options_->radio_align_right, FL_BLACK);
fl_set_object_lcol(column_options_->radio_align_left, FL_INACTIVE); fl_set_object_lcol(column_options_->radio_align_center, FL_BLACK);
fl_set_object_lcol(column_options_->radio_align_right, FL_INACTIVE); fl_deactivate_object(column_options_->radio_valign_top);
fl_set_object_lcol(column_options_->radio_align_center, FL_INACTIVE); fl_deactivate_object(column_options_->radio_valign_bottom);
fl_activate_object(column_options_->radio_valign_top); fl_deactivate_object(column_options_->radio_valign_center);
fl_activate_object(column_options_->radio_valign_bottom); fl_set_object_lcol(column_options_->radio_valign_top, FL_INACTIVE);
fl_activate_object(column_options_->radio_valign_center); fl_set_object_lcol(column_options_->radio_valign_bottom, FL_INACTIVE);
fl_set_object_lcol(column_options_->radio_valign_top, FL_BLACK); fl_set_object_lcol(column_options_->radio_valign_center, FL_INACTIVE);
fl_set_object_lcol(column_options_->radio_valign_bottom, FL_BLACK); }
fl_set_object_lcol(column_options_->radio_valign_center, FL_BLACK); fl_set_button(tabular_options_->radio_longtable,
} else { tabular->IsLongTabular());
fl_activate_object(column_options_->radio_align_left); if (tabular->IsLongTabular()) {
fl_activate_object(column_options_->radio_align_right); fl_activate_object(longtable_options_->radio_lt_firsthead);
fl_activate_object(column_options_->radio_align_center); fl_activate_object(longtable_options_->radio_lt_head);
fl_set_object_lcol(column_options_->radio_align_left, FL_BLACK); fl_activate_object(longtable_options_->radio_lt_foot);
fl_set_object_lcol(column_options_->radio_align_right, FL_BLACK); fl_activate_object(longtable_options_->radio_lt_lastfoot);
fl_set_object_lcol(column_options_->radio_align_center, FL_BLACK); fl_activate_object(longtable_options_->radio_lt_newpage);
fl_deactivate_object(column_options_->radio_valign_top); fl_set_object_lcol(longtable_options_->radio_lt_firsthead, FL_BLACK);
fl_deactivate_object(column_options_->radio_valign_bottom); fl_set_object_lcol(longtable_options_->radio_lt_head, FL_BLACK);
fl_deactivate_object(column_options_->radio_valign_center); fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_BLACK);
fl_set_object_lcol(column_options_->radio_valign_top, FL_INACTIVE); fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_BLACK);
fl_set_object_lcol(column_options_->radio_valign_bottom, FL_INACTIVE); fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_BLACK);
fl_set_object_lcol(column_options_->radio_valign_center, FL_INACTIVE); int dummy;
} fl_set_button(longtable_options_->radio_lt_firsthead,
fl_set_button(tabular_options_->radio_longtable, tabular->GetRowOfLTFirstHead(cell, dummy));
tabular->IsLongTabular()); fl_set_button(longtable_options_->radio_lt_head,
if (tabular->IsLongTabular()) { tabular->GetRowOfLTHead(cell, dummy));
fl_activate_object(longtable_options_->radio_lt_firsthead); fl_set_button(longtable_options_->radio_lt_foot,
fl_activate_object(longtable_options_->radio_lt_head); tabular->GetRowOfLTFoot(cell, dummy));
fl_activate_object(longtable_options_->radio_lt_foot); fl_set_button(longtable_options_->radio_lt_lastfoot,
fl_activate_object(longtable_options_->radio_lt_lastfoot); tabular->GetRowOfLTLastFoot(cell, dummy));
fl_activate_object(longtable_options_->radio_lt_newpage); fl_set_button(longtable_options_->radio_lt_newpage,
fl_set_object_lcol(longtable_options_->radio_lt_firsthead, FL_BLACK); tabular->GetLTNewPage(cell));
fl_set_object_lcol(longtable_options_->radio_lt_head, FL_BLACK); } else {
fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_BLACK); fl_deactivate_object(longtable_options_->radio_lt_firsthead);
fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_BLACK); fl_deactivate_object(longtable_options_->radio_lt_head);
fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_BLACK); fl_deactivate_object(longtable_options_->radio_lt_foot);
int dummy; fl_deactivate_object(longtable_options_->radio_lt_lastfoot);
fl_set_button(longtable_options_->radio_lt_firsthead, fl_deactivate_object(longtable_options_->radio_lt_newpage);
tabular->GetRowOfLTFirstHead(cell, dummy)); fl_set_button(longtable_options_->radio_lt_firsthead,0);
fl_set_button(longtable_options_->radio_lt_head, fl_set_button(longtable_options_->radio_lt_head,0);
tabular->GetRowOfLTHead(cell, dummy)); fl_set_button(longtable_options_->radio_lt_foot,0);
fl_set_button(longtable_options_->radio_lt_foot, fl_set_button(longtable_options_->radio_lt_lastfoot,0);
tabular->GetRowOfLTFoot(cell, dummy)); fl_set_button(longtable_options_->radio_lt_newpage,0);
fl_set_button(longtable_options_->radio_lt_lastfoot, fl_set_object_lcol(longtable_options_->radio_lt_firsthead,FL_INACTIVE);
tabular->GetRowOfLTLastFoot(cell, dummy)); fl_set_object_lcol(longtable_options_->radio_lt_head, FL_INACTIVE);
fl_set_button(longtable_options_->radio_lt_newpage, fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_INACTIVE);
tabular->GetLTNewPage(cell)); fl_set_object_lcol(longtable_options_->radio_lt_lastfoot, FL_INACTIVE);
} else { fl_set_object_lcol(longtable_options_->radio_lt_newpage, FL_INACTIVE);
fl_deactivate_object(longtable_options_->radio_lt_firsthead); }
fl_deactivate_object(longtable_options_->radio_lt_head); fl_set_button(tabular_options_->radio_rotate_tabular,
fl_deactivate_object(longtable_options_->radio_lt_foot); tabular->GetRotateTabular());
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;
} }
void FormTabular::SetTabularOptions(FL_OBJECT * ob, long) bool FormTabular::input(FL_OBJECT * ob, long)
{ {
if (!inset_) if (!inset_)
return; return false;
LyXTabular LyXTabular
* tabular = inset_->tabular; * tabular = inset_->tabular;
@ -499,17 +430,17 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
cell = inset_->GetActCell(); cell = inset_->GetActCell();
if (actCell_ != cell) { if (actCell_ != cell) {
local_update(false); update();
fl_set_object_label(dialog_->text_warning, fl_set_object_label(dialog_->text_warning,
_("Warning: Wrong Cursor position, updated window")); _("Warning: Wrong Cursor position, updated window"));
fl_show_object(dialog_->text_warning); fl_show_object(dialog_->text_warning);
return; return false;
} }
// No point in processing directives that you can't do anything with // No point in processing directives that you can't do anything with
// anyhow, so exit now if the buffer is read-only. // anyhow, so exit now if the buffer is read-only.
if (lv_->buffer()->isReadonly()) { if (lv_->buffer()->isReadonly()) {
local_update(false); update();
return; return false;
} }
if (ob == column_options_->input_column_width) { if (ob == column_options_->input_column_width) {
string string
@ -519,11 +450,11 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
fl_set_object_label(dialog_->text_warning, fl_set_object_label(dialog_->text_warning,
_("Warning: Invalid Length (valid example: 10mm)")); _("Warning: Invalid Length (valid example: 10mm)"));
fl_show_object(dialog_->text_warning); fl_show_object(dialog_->text_warning);
return; return false;
} }
inset_->TabularFeatures(lv_->view(), LyXTabular::SET_PWIDTH,str); inset_->TabularFeatures(lv_->view(), LyXTabular::SET_PWIDTH,str);
local_update(false); // update for alignment update(); // update for alignment
return; return true;
} }
if (ob == cell_options_->input_mcolumn_width) { if (ob == cell_options_->input_mcolumn_width) {
string string
@ -533,11 +464,11 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
fl_set_object_label(dialog_->text_warning, fl_set_object_label(dialog_->text_warning,
_("Warning: Invalid Length (valid example: 10mm)")); _("Warning: Invalid Length (valid example: 10mm)"));
fl_show_object(dialog_->text_warning); fl_show_object(dialog_->text_warning);
return; return false;
} }
inset_->TabularFeatures(lv_->view(), LyXTabular::SET_MPWIDTH,str); inset_->TabularFeatures(lv_->view(), LyXTabular::SET_MPWIDTH,str);
local_update(false); // update for alignment update(); // update for alignment
return; return true;
} }
str = fl_get_input(column_options_->input_column_width); str = fl_get_input(column_options_->input_column_width);
if (!str.empty() && !isValidLength(str)) { if (!str.empty() && !isValidLength(str)) {
@ -545,7 +476,7 @@ void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
dialog_->text_warning, dialog_->text_warning,
_("Warning: Invalid Length (valid example: 10mm)")); _("Warning: Invalid Length (valid example: 10mm)"));
fl_show_object(dialog_->text_warning); fl_show_object(dialog_->text_warning);
return; return false;
} }
if (ob == tabular_options_->button_append_row) if (ob == tabular_options_->button_append_row)
num = LyXTabular::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) else if (ob == cell_options_->radio_valign_center)
num = LyXTabular::M_VALIGN_CENTER; num = LyXTabular::M_VALIGN_CENTER;
else else
return; return false;
inset_->TabularFeatures(lv_->view(), num, special); inset_->TabularFeatures(lv_->view(), num, special);
local_update(false); update();
return true;
} }
// +-----------------------------------------------------------------------+
// | 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();
}
void FormTabular::CancelCB(FL_OBJECT * ob, long)
{
FormTabular * pre = (FormTabular*)ob->form->u_vdata;
pre->hide_create();
}

View File

@ -15,109 +15,68 @@
#ifndef FORMTABULAR_H #ifndef FORMTABULAR_H
#define FORMTABULAR_H #define FORMTABULAR_H
#include "DialogBase.h" #include "FormInset.h"
#include <boost/utility.hpp>
#ifdef SIGC_CXX_NAMESPACES
using SigC::Connection;
#endif
class LyXView;
class Dialogs;
class InsetTabular; class InsetTabular;
struct FD_form_tabular; struct FD_form_tabular;
struct FD_form_tabular_options; struct FD_form_tabular_options;
struct FD_form_column_options; struct FD_form_column_options;
struct FD_form_cell_options; struct FD_form_cell_options;
struct FD_form_longtable_options; struct FD_form_longtable_options;
struct FD_form_create_tabular;
/** This class provides an XForms implementation of the FormTabular Dialog. /** This class provides an XForms implementation of the FormTabular Dialog.
The tabular dialog allows users to set/save their tabular. The tabular dialog allows users to set/save their tabular.
*/ */
class FormTabular : public DialogBase, public noncopyable { class FormTabular : public FormInset {
public: public:
/// #FormTabular x(LyXFunc ..., Dialogs ...);# /// #FormTabular x(LyXFunc ..., Dialogs ...);#
FormTabular(LyXView *, Dialogs *); FormTabular(LyXView *, Dialogs *);
/// ///
~FormTabular(); ~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);
private: private:
/// Create the dialog if necessary, update it and display it. /// Disconnect signals. Also perform any necessary housekeeping.
void show(); virtual void disconnect();
///
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();
/// Real GUI implementation. /// Slot launching dialog to an existing inset
FD_form_tabular * dialog_; void showInset(InsetTabular *);
/// /// Slot launching dialog to an existing inset
FD_form_tabular_options * tabular_options_; void updateInset(InsetTabular *);
/// /// Update dialog before showing it
FD_form_column_options * column_options_; virtual void update();
/// /// Build the dialog
FD_form_cell_options * cell_options_; virtual void build();
/// /// Filter the inputs
FD_form_longtable_options * longtable_options_; virtual bool input(FL_OBJECT *, long);
/// /// Pointer to the actual instantiation of the xform's form
FD_form_create_tabular * create_tabular_; virtual FL_FORM * form() const;
/// Which LyXView do we belong to? /// Fdesign generated methods
LyXView * lv_; FD_form_tabular * build_tabular();
/// ///
Dialogs * d_; FD_form_tabular_options * build_tabular_options();
/// Update connection. ///
Connection u_; FD_form_column_options * build_column_options();
/// Hide connection. ///
Connection h_; FD_form_cell_options * build_cell_options();
/// ///
InsetTabular * inset_; FD_form_longtable_options * build_longtable_options();
///
int actCell_; /// 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_;
/// pointer to the inset passed through showInset
InsetTabular * inset_;
///
int actCell_;
}; };
#endif #endif

View File

@ -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;
}
}

View File

@ -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

View File

@ -78,8 +78,7 @@ void FormToc::build()
} }
// we can safely ignore the parameter because we can always update void FormToc::update()
void FormToc::update(bool)
{ {
Buffer::TocType type; Buffer::TocType type;

View File

@ -34,8 +34,10 @@ private:
/// Build the dialog /// Build the dialog
virtual void build(); virtual void build();
/// bool indicates if a buffer switch took place
virtual void updateSlot(bool) { update(); }
/// Update dialog before showing it /// Update dialog before showing it
virtual void update(bool switched = false); virtual void update();
/// Apply from dialog (modify or create inset) /// Apply from dialog (modify or create inset)
virtual void apply(); virtual void apply();
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View 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_->url, params.getContents().c_str());
fl_set_input(dialog_->name, params.getOptions().c_str()); fl_set_input(dialog_->name, params.getOptions().c_str());

View File

@ -33,7 +33,7 @@ private:
/// Build the dialog /// Build the dialog
virtual void build(); virtual void build();
/// Update dialog before showing it /// Update dialog before showing it
virtual void update(bool switched = false); virtual void update();
/// Apply from dialog (modify or create inset) /// Apply from dialog (modify or create inset)
virtual void apply(); virtual void apply();
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View File

@ -63,6 +63,10 @@ libxforms_la_SOURCES = \
FormTabular.h \ FormTabular.h \
form_tabular.C \ form_tabular.C \
form_tabular.h \ form_tabular.h \
FormTabularCreate.C \
FormTabularCreate.h \
form_tabular_create.C \
form_tabular_create.h \
FormToc.C \ FormToc.C \
FormToc.h \ FormToc.h \
form_toc.C \ form_toc.C \

View File

@ -26,60 +26,60 @@ FD_form_graphics * FormGraphics::build_graphics()
fdui->form->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 410, 390, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 410, 390, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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, 10, 310, 390, 30, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 250, 170, 50, ""); 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"))); 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_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"))); 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_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")); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 70, 200, 160, _("Width"));
fl_set_object_lalign(obj, FL_ALIGN_CENTER); fl_set_object_lalign(obj, FL_ALIGN_CENTER);
obj = fl_add_text(FL_NORMAL_TEXT, 130, 60, 50, 20, _("Height")); obj = fl_add_text(FL_NORMAL_TEXT, 130, 60, 50, 20, _("Height"));
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); 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, ""); 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_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, ""); 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_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")); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 230, 70, 170, 160, _("Display"));
fl_set_object_lalign(obj, FL_ALIGN_CENTER); fl_set_object_lalign(obj, FL_ALIGN_CENTER);
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 350, 70, 30, _("Ok")); 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"))); 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_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^["))); 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_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_button_group_width = fl_bgn_group();
fdui->radio_width_percent_page = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 140, 80, 30, _("% of Page")); 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")); 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); fl_set_button(obj, 1);
fdui->radio_width_cm = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 100, 80, 30, _("cm")); 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")); 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")); 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(); fl_end_group();
fdui->radio_button_group_height = fl_bgn_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")); 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")); 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")); 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")); 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_set_button(obj, 1);
fl_end_group(); 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")); 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")); 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")); 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, ""); 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"))); 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_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(); fl_end_form();
fdui->form->fdui = fdui; fdui->form->fdui = fdui;

View File

@ -5,11 +5,10 @@
#define FD_form_graphics_h_ #define FD_form_graphics_h_
/** Callbacks, globals and object handlers **/ /** Callbacks, globals and object handlers **/
extern "C" void C_FormGraphicsInputCB(FL_OBJECT *, long); extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormGraphicsBrowseCB(FL_OBJECT *, long); extern "C" void C_FormBaseOKCB(FL_OBJECT *, long);
extern "C" void C_FormGraphicsOKCB(FL_OBJECT *, long); extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
extern "C" void C_FormGraphicsApplyCB(FL_OBJECT *, long); extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
extern "C" void C_FormGraphicsCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/

View 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"))); 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_button_shortcut(obj, scex(_("Close|#C")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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, ""); 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_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Append Column|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Delete Column|#O")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Append Row|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Delete Row|#w")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Set Borders|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Unset Borders|#U")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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")); 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"))); 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_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")); obj = fl_add_text(FL_NORMAL_TEXT, 285, 10, 100, 20, _("Spec. Table"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); 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_button_shortcut(obj, scex(_("Top|#t")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Bottom|#b")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Left|#l")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Right|#r")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT); 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, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 200, 20, 130, 105, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
obj = fl_add_text(FL_NORMAL_TEXT, 205, 10, 115, 20, _("H. Alignment")); 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"))); 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_button_shortcut(obj, scex(_("Left|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Right|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Center|#c")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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:")); 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_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, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 340, 20, 130, 105, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
obj = fl_add_text(FL_NORMAL_TEXT, 345, 10, 115, 20, _("V. Alignment")); 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); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT, 30, 150, 200, 30, ""); 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_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")); 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_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); 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"))); 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_button_shortcut(obj, scex(_("Top|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Center|#n")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Bottom|#o")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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(); fl_end_form();
fdui->form->fdui = fdui; fdui->form->fdui = fdui;
@ -246,69 +246,69 @@ FD_form_cell_options * FormTabular::build_cell_options()
fl_set_object_lstyle(obj, FL_BOLD_STYLE); 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"))); 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_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°")); 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, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 165, 15, 325, 90, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT, 175, 30, 310, 30, ""); 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_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")); 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_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE); 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:")); 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_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"))); 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_button_shortcut(obj, scex(_("Top|#t")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Bottom|#b")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Left|#l")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT); 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"))); 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_button_shortcut(obj, scex(_("Right|#r")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT); 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"))); 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_button_shortcut(obj, scex(_("Left|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Right|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Center|#c")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Top|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Center|#n")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_button_shortcut(obj, scex(_("Bottom|#o")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); 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"))); 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_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(); fl_end_form();
fdui->form->fdui = fdui; 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_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE); 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")); 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")); 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_frame(FL_ENGRAVED_FRAME, 130, 20, 100, 75, "");
obj = fl_add_text(FL_NORMAL_TEXT, 135, 10, 85, 20, _("Footer")); obj = fl_add_text(FL_NORMAL_TEXT, 135, 10, 85, 20, _("Footer"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 135, 30, 90, 25, _("Foot")); 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")); 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_frame(FL_ENGRAVED_FRAME, 245, 20, 95, 75, "");
obj = fl_add_text(FL_NORMAL_TEXT, 250, 10, 85, 20, _("Special")); obj = fl_add_text(FL_NORMAL_TEXT, 250, 10, 85, 20, _("Special"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE); 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")); 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_set_object_callback(obj, C_FormBaseInputCB, 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_end_form(); fl_end_form();
fdui->form->fdui = fdui; fdui->form->fdui = fdui;

View File

@ -5,19 +5,15 @@
#define FD_form_tabular_h_ #define FD_form_tabular_h_
/** Callbacks, globals and object handlers **/ /** 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_FormBaseInputCB(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);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
@ -91,15 +87,5 @@ struct FD_form_longtable_options {
FL_OBJECT *radio_lt_lastfoot; FL_OBJECT *radio_lt_lastfoot;
FL_OBJECT *radio_lt_newpage; 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_ */ #endif /* FD_form_tabular_h_ */

View File

@ -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;
}
/*---------------------------------------*/

View File

@ -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_ */

View File

@ -10,51 +10,70 @@ if [ ! -f $1 ]; then
fi fi
FDESIGN=fdesign 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" echo "Input file is not a .fd file. Cannot continue"
exit 1 exit 1
fi fi
cin=$base.c CIN=$BASE.c
cout=$base.C COUT=$BASE.C
hin=$base.h HIN=$BASE.h
hout=$base.H HOUT=$BASE.H
classname=`echo $base | cut -c6-` # Ascertain the class name from the name of the file
firstchar=`echo $classname | cut -c1 | tr a-z A-Z` # eg form_my_new_dialog -> FormMyNewDialog
rest=`echo $classname | cut -c2-` CLASSNAME=""
classname=Form$firstchar$rest SECTION="start"
i=1
while :
do
SECTION=`echo $BASE | cut -d_ -f$i`
i=`expr $i + 1 `
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 # Create .c and .h files
$FDESIGN -convert $1 $FDESIGN -convert $1
FDFIXH=fdfixh.sed
FDFIXC=fdfixc.sed
# Modify .h file for use by LyX # Modify .h file for use by LyX
echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $hout echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $HOUT
sed -f fdfixh.sed < $hin >> $hout sed -f $FDFIXH < $HIN >> $HOUT
# Patch the .h file if a patch exists # Patch the .h file if a patch exists
if [ -f "$hout.patch" ] ; then if [ -f "$HOUT.patch" ] ; then
echo "Patching $hout with $hout.patch" echo "Patching $HOUT with $HOUT.patch"
patch -s $hout < $hout.patch patch -s $HOUT < $HOUT.patch
fi fi
# Modify .c file for use by LyX # 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 "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $COUT
echo "#include <config.h>" >> $cout echo "#include <config.h>" >> $COUT
echo "#include \"lyx_gui_misc.h\"" >> $cout echo "#include \"lyx_gui_misc.h\"" >> $COUT
echo "#include \"gettext.h\"" >> $cout echo "#include \"gettext.h\"" >> $COUT
echo >> $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 # Patch the .C file if a patch exists
if [ -f "$cout.patch" ] ; then if [ -f "$COUT.patch" ] ; then
echo "Patching $cout with $cout.patch" echo "Patching $COUT with $COUT.patch"
patch -s $cout < $cout.patch patch -s $COUT < $COUT.patch
fi fi
# Clean up, to leave .C and .h files # Clean up, to leave .C and .h files
rm -f $cin $hin rm -f $CIN $HIN
mv $hout $hin mv $HOUT $HIN

View File

@ -24,8 +24,8 @@ size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: label:
shortcut: shortcut:
resize: FL_RESIZE_NONE resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NorthWest FL_SouthEast
name: name:
callback: callback:
argument: argument:
@ -81,8 +81,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_filename name: input_filename
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
@ -99,8 +99,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_browse name: button_browse
callback: C_FormGraphicsBrowseCB callback: C_FormBaseInputCB
argument: 0 argument: BROWSE
-------------------- --------------------
class: FL_LABELFRAME class: FL_LABELFRAME
@ -153,8 +153,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_width name: input_width
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_INPUT class: FL_INPUT
@ -171,8 +171,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_height name: input_height
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_LABELFRAME class: FL_LABELFRAME
@ -207,7 +207,7 @@ shortcut: ^M
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_ok name: button_ok
callback: C_FormGraphicsOKCB callback: C_FormBaseOKCB
argument: 0 argument: 0
-------------------- --------------------
@ -225,7 +225,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_apply name: button_apply
callback: C_FormGraphicsApplyCB callback: C_FormBaseApplyCB
argument: 0 argument: 0
-------------------- --------------------
@ -243,7 +243,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_cancel name: button_cancel
callback: C_FormGraphicsCancelCB callback: C_FormBaseCancelCB
argument: 0 argument: 0
-------------------- --------------------
@ -279,8 +279,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_width_percent_page name: radio_width_percent_page
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -297,8 +297,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_width_default name: radio_width_default
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
value: 1 value: 1
-------------------- --------------------
@ -316,8 +316,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_width_cm name: radio_width_cm
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -334,8 +334,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_width_inch name: radio_width_inch
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -352,8 +352,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_width_percent_column name: radio_width_percent_column
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_END_GROUP class: FL_END_GROUP
@ -406,8 +406,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_height_percent_page name: radio_height_percent_page
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -424,8 +424,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_height_inch name: radio_height_inch
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -442,8 +442,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_height_cm name: radio_height_cm
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -460,8 +460,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_height_default name: radio_height_default
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
value: 1 value: 1
-------------------- --------------------
@ -624,8 +624,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_rotate_angle name: input_rotate_angle
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -642,8 +642,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: check_inline name: check_inline
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_INPUT class: FL_INPUT
@ -660,8 +660,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_subcaption name: input_subcaption
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
@ -678,8 +678,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: check_subcaption name: check_subcaption
callback: C_FormGraphicsInputCB callback: C_FormBaseInputCB
argument: 0 argument: CHECKINPUT
============================== ==============================
create_the_forms create_the_forms

View File

@ -3,7 +3,7 @@ Magic: 13000
Internal Form Definition File Internal Form Definition File
(do not change) (do not change)
Number of forms: 6 Number of forms: 5
Unit of measure: FL_COORD_PIXEL Unit of measure: FL_COORD_PIXEL
SnapGrid: 5 SnapGrid: 5
@ -64,7 +64,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_close name: button_close
callback: C_FormTabularCloseCB callback: C_FormBaseCancelCB
argument: 0 argument: 0
-------------------- --------------------
@ -178,7 +178,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_append_column name: button_append_column
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -196,7 +196,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_delete_column name: button_delete_column
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -214,7 +214,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_append_row name: button_append_row
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -232,7 +232,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_delete_row name: button_delete_row
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -250,7 +250,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_set_borders name: button_set_borders
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -268,7 +268,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_unset_borders name: button_unset_borders
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -286,7 +286,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_longtable name: radio_longtable
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -304,7 +304,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_rotate_tabular name: radio_rotate_tabular
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -400,7 +400,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_top name: radio_border_top
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -418,7 +418,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_bottom name: radio_border_bottom
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -436,7 +436,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_left name: radio_border_left
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -454,7 +454,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_right name: radio_border_right
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -508,7 +508,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_align_left name: radio_align_left
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -526,7 +526,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_align_right name: radio_align_right
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -544,7 +544,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_align_center name: radio_align_center
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -562,7 +562,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_column_width name: input_column_width
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -634,7 +634,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_special_alignment name: input_special_alignment
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -670,7 +670,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_valign_top name: radio_valign_top
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -688,7 +688,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_valign_center name: radio_valign_center
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -706,7 +706,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_valign_bottom name: radio_valign_bottom
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
=============== FORM =============== =============== FORM ===============
@ -892,7 +892,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_multicolumn name: radio_multicolumn
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -910,7 +910,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_rotate_cell name: radio_rotate_cell
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -946,7 +946,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_special_multialign name: input_special_multialign
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -982,7 +982,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_mcolumn_width name: input_mcolumn_width
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1000,7 +1000,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_top name: radio_border_top
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1018,7 +1018,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_bottom name: radio_border_bottom
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1036,7 +1036,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_left name: radio_border_left
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1054,7 +1054,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_border_right name: radio_border_right
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1072,7 +1072,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_align_left name: radio_align_left
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1090,7 +1090,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_align_right name: radio_align_right
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1108,7 +1108,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_align_center name: radio_align_center
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1126,7 +1126,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_valign_top name: radio_valign_top
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1144,7 +1144,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_valign_center name: radio_valign_center
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1162,7 +1162,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_valign_bottom name: radio_valign_bottom
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1180,7 +1180,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_useminipage name: radio_useminipage
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
=============== FORM =============== =============== FORM ===============
@ -1258,7 +1258,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_lt_firsthead name: radio_lt_firsthead
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1276,7 +1276,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_lt_head name: radio_lt_head
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1330,7 +1330,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_lt_foot name: radio_lt_foot
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1348,7 +1348,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_lt_lastfoot name: radio_lt_lastfoot
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 argument: 0
-------------------- --------------------
@ -1402,122 +1402,8 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_lt_newpage name: radio_lt_newpage
callback: C_FormTabularInputCB callback: C_FormBaseInputCB
argument: 0 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 create_the_forms

View File

@ -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

View File

@ -31,6 +31,7 @@ SRCS := form_citation.fd \
form_print.fd \ form_print.fd \
form_ref.fd \ form_ref.fd \
form_tabular.fd \ form_tabular.fd \
form_tabular_create.fd \
form_toc.fd \ form_toc.fd \
form_url.fd form_url.fd

View File

@ -132,7 +132,6 @@ InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns)
actcell = 0; actcell = 0;
cursor.pos(0); cursor.pos(0);
sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0; sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
dialogs_ = 0;
need_update = INIT; need_update = INIT;
} }
@ -148,7 +147,6 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
actcell = 0; actcell = 0;
cursor.pos(0); cursor.pos(0);
sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0; sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
dialogs_ = 0;
need_update = INIT; need_update = INIT;
} }
@ -156,8 +154,7 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
InsetTabular::~InsetTabular() InsetTabular::~InsetTabular()
{ {
delete tabular; delete tabular;
if (dialogs_) hideDialog();
dialogs_->hideTabular(this);
} }
@ -534,9 +531,8 @@ bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
if (inset->LyxCode() == TABULAR_CODE && if (inset->LyxCode() == TABULAR_CODE &&
!the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE))
{ {
dialogs_ = bv->owner()->getDialogs(); bv->owner()->getDialogs()->updateTabular(this);
dialogs_->updateTabular(this); oldcell = actcell;
oldcell = actcell;
} }
return true; return true;
} }
@ -639,8 +635,7 @@ void InsetTabular::InsetButtonRelease(BufferView * bv,
return; return;
} }
} }
dialogs_ = bv->owner()->getDialogs(); bv->owner()->getDialogs()->showTabular(this);
dialogs_->showTabular(this);
return; return;
} }
if (the_locking_inset) { if (the_locking_inset) {
@ -848,8 +843,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
break; break;
case LFUN_LAYOUT_TABULAR: case LFUN_LAYOUT_TABULAR:
{ {
dialogs_ = bv->owner()->getDialogs(); bv->owner()->getDialogs()->showTabular(this);
dialogs_->showTabular(this);
} }
break; break;
case LFUN_TABULAR_FEATURE: case LFUN_TABULAR_FEATURE:
@ -1135,9 +1129,9 @@ void InsetTabular::resetPos(BufferView * bv) const
if ((!the_locking_inset || if ((!the_locking_inset ||
!the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) && !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) &&
(actcell != oldcell)) { (actcell != oldcell)) {
dialogs_ = bv->owner()->getDialogs(); InsetTabular * inset = const_cast<InsetTabular *>(this);
dialogs_->updateTabular(const_cast<InsetTabular *>(this)); bv->owner()->getDialogs()->updateTabular(inset);
oldcell = actcell; oldcell = actcell;
} }
} }
@ -1673,8 +1667,7 @@ void InsetTabular::OpenLayoutDialog(BufferView * bv) const
return; return;
} }
} }
dialogs_ = bv->owner()->getDialogs(); bv->owner()->getDialogs()->showTabular(const_cast<InsetTabular *>(this));
dialogs_->showTabular(const_cast<InsetTabular *>(this));
} }
// //

View File

@ -54,12 +54,16 @@
#include "LString.h" #include "LString.h"
#include "lyxcursor.h" #include "lyxcursor.h"
#include "lyxfunc.h" #include "lyxfunc.h"
#include <sigc++/signal_system.h>
#ifdef SIGC_CXX_NAMESPACES
using SigC::Signal0;
#endif
class LyXLex; class LyXLex;
class Painter; class Painter;
class BufferView; class BufferView;
class Buffer; class Buffer;
class Dialogs;
class InsetTabular : public UpdatableInset { class InsetTabular : public UpdatableInset {
public: public:
@ -174,6 +178,8 @@ public:
// Public structures and variables // Public structures and variables
/// ///
LyXTabular * tabular; LyXTabular * tabular;
///
Signal0<void> hideDialog;
private: private:
/// ///
@ -268,7 +274,5 @@ private:
mutable bool locked; mutable bool locked;
/// ///
mutable UpdateCodes need_update; mutable UpdateCodes need_update;
///
mutable Dialogs * dialogs_;
}; };
#endif #endif

View File

@ -70,7 +70,7 @@ template<typename T>
inline inline
string const tostr(T const & t) string const tostr(T const & t)
{ {
std::ostringstream ostr; ostringstream ostr;
ostr << t; ostr << t;
return ostr.str().c_str(); return ostr.str().c_str();
// We need to use the .c_str since we sometimes are using // We need to use the .c_str since we sometimes are using