*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file GuiHSpace.cpp
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "GuiHSpace.h"
|
|
|
|
|
|
|
|
|
|
#include "LengthCombo.h"
|
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
|
#include "Validator.h"
|
|
|
|
|
|
|
|
|
|
#include "LyXRC.h"
|
|
|
|
|
#include "Spacing.h"
|
|
|
|
|
#include "FuncRequest.h"
|
|
|
|
|
#include "insets/InsetSpace.h"
|
|
|
|
|
|
|
|
|
|
#include "support/gettext.h"
|
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QValidator>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
|
|
GuiHSpace::GuiHSpace(GuiView & lv)
|
|
|
|
|
: GuiDialog(lv, "space", qt_("Horizontal Space Settings"))
|
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|
|
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
|
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
|
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
|
|
|
|
|
|
|
|
|
connect(spacingCO, SIGNAL(highlighted(QString)),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(valueLE, SIGNAL(textChanged(QString)),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(spacingCO, SIGNAL(activated(int)),
|
|
|
|
|
this, SLOT(enableWidgets(int)));
|
|
|
|
|
connect(keepCB, SIGNAL(clicked()),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(unitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)),
|
|
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
connect(fillPatternCO, SIGNAL(activated(int)),
|
2008-03-18 12:11:28 +00:00
|
|
|
|
this, SLOT(patternChanged()));
|
*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
|
|
|
|
|
valueLE->setValidator(unsignedLengthValidator(valueLE));
|
|
|
|
|
|
|
|
|
|
// Manage the ok, apply, restore and cancel/close buttons
|
|
|
|
|
bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
|
|
|
|
|
bc().setOK(okPB);
|
|
|
|
|
bc().setApply(applyPB);
|
|
|
|
|
bc().setCancel(closePB);
|
|
|
|
|
|
|
|
|
|
// disable for read-only documents
|
|
|
|
|
bc().addReadOnly(spacingCO);
|
|
|
|
|
bc().addReadOnly(valueLE);
|
|
|
|
|
bc().addReadOnly(unitCO);
|
|
|
|
|
bc().addReadOnly(keepCB);
|
|
|
|
|
bc().addReadOnly(fillPatternCO);
|
|
|
|
|
|
|
|
|
|
// initialize the length validator
|
|
|
|
|
bc().addCheckedLineEdit(valueLE, valueL);
|
|
|
|
|
|
|
|
|
|
// remove the %-items from the unit choice
|
|
|
|
|
unitCO->noPercents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiHSpace::change_adaptor()
|
|
|
|
|
{
|
|
|
|
|
changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiHSpace::enableWidgets(int selection)
|
|
|
|
|
{
|
|
|
|
|
valueLE->setEnabled(selection == 7);
|
|
|
|
|
unitCO->setEnabled(selection == 7);
|
|
|
|
|
fillPatternCO->setEnabled(selection == 6);
|
2008-03-18 12:11:28 +00:00
|
|
|
|
int pattern = fillPatternCO->currentIndex();
|
*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
bool const enable_keep =
|
2008-03-18 12:11:28 +00:00
|
|
|
|
selection == 0 || selection == 3 ||
|
|
|
|
|
(selection == 6 && pattern == 0) || selection == 7;
|
*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
keepCB->setEnabled(enable_keep);
|
|
|
|
|
changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-03-18 12:11:28 +00:00
|
|
|
|
void GuiHSpace::patternChanged()
|
|
|
|
|
{
|
|
|
|
|
enableWidgets(spacingCO->currentIndex());
|
|
|
|
|
changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
static void setWidgetsFromHSpace(InsetSpaceParams const & params,
|
|
|
|
|
QComboBox * spacing,
|
|
|
|
|
QLineEdit * value,
|
|
|
|
|
LengthCombo * unit,
|
|
|
|
|
QCheckBox * keep,
|
|
|
|
|
QComboBox * fillPattern)
|
|
|
|
|
{
|
|
|
|
|
int item = 0;
|
|
|
|
|
int pattern = 0;
|
|
|
|
|
bool protect = false;
|
|
|
|
|
switch (params.kind) {
|
|
|
|
|
case InsetSpaceParams::NORMAL:
|
|
|
|
|
item = 0;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::PROTECTED:
|
|
|
|
|
item = 0;
|
|
|
|
|
protect = true;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::THIN:
|
|
|
|
|
item = 1;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::NEGTHIN:
|
|
|
|
|
item = 2;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::ENSKIP:
|
|
|
|
|
item = 3;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::ENSPACE:
|
|
|
|
|
item = 3;
|
|
|
|
|
protect = true;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::QUAD:
|
|
|
|
|
item = 4;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::QQUAD:
|
|
|
|
|
item = 5;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::HFILL:
|
|
|
|
|
item = 6;
|
|
|
|
|
break;
|
2008-03-18 12:11:28 +00:00
|
|
|
|
case InsetSpaceParams::HFILL_PROTECTED:
|
|
|
|
|
item = 6;
|
|
|
|
|
protect = true;
|
|
|
|
|
break;
|
*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
case InsetSpaceParams::DOTFILL:
|
|
|
|
|
item = 6;
|
|
|
|
|
pattern = 1;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::HRULEFILL:
|
|
|
|
|
item = 6;
|
|
|
|
|
pattern = 2;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::CUSTOM:
|
|
|
|
|
item = 7;
|
|
|
|
|
break;
|
|
|
|
|
case InsetSpaceParams::CUSTOM_PROTECTED:
|
|
|
|
|
item = 7;
|
|
|
|
|
protect = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
spacing->setCurrentIndex(item);
|
|
|
|
|
fillPattern->setCurrentIndex(pattern);
|
|
|
|
|
keep->setChecked(protect);
|
|
|
|
|
|
|
|
|
|
Length::UNIT default_unit =
|
|
|
|
|
(lyxrc.default_papersize > 3) ? Length::CM : Length::IN;
|
|
|
|
|
if (item == 7)
|
|
|
|
|
lengthToWidgets(value, unit, params.length, default_unit);
|
|
|
|
|
else
|
|
|
|
|
lengthToWidgets(value, unit, "", default_unit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static InsetSpaceParams setHSpaceFromWidgets(int spacing,
|
|
|
|
|
QLineEdit * value, LengthCombo * unit, bool keep, int fill)
|
|
|
|
|
{
|
|
|
|
|
InsetSpaceParams params;
|
|
|
|
|
switch (spacing) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (keep)
|
|
|
|
|
params.kind = InsetSpaceParams::PROTECTED;
|
|
|
|
|
else
|
|
|
|
|
params.kind = InsetSpaceParams::NORMAL;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
params.kind = InsetSpaceParams::THIN;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
params.kind = InsetSpaceParams::NEGTHIN;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
if (keep)
|
|
|
|
|
params.kind = InsetSpaceParams::ENSPACE;
|
|
|
|
|
else
|
|
|
|
|
params.kind = InsetSpaceParams::ENSKIP;
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
params.kind = InsetSpaceParams::QUAD;
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
params.kind = InsetSpaceParams::QQUAD;
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
if (fill == 1)
|
|
|
|
|
params.kind = InsetSpaceParams::DOTFILL;
|
|
|
|
|
else if (fill == 2)
|
|
|
|
|
params.kind = InsetSpaceParams::HRULEFILL;
|
2008-03-18 12:11:28 +00:00
|
|
|
|
else if (keep)
|
|
|
|
|
params.kind = InsetSpaceParams::HFILL_PROTECTED;
|
*** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
- merge in HFill inset, add support for dotfill, hrulefill,
hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
- remove
* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
- new GUI for Space insets.
* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
new Inset member isStretchableSpace() to indicate HFill and friends.
* Buffer.cpp:
- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
- conversion/reversion routines
* development/FORMAT:
- document file format change
* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
- deal with UI changes.
* src/LyXAction.cpp:
- remove LFUN_HFILL_INSERT
* src/LyXFunc.cpp:
- handle space dialog.
* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
- adapt to changes
* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
- add HSpace dialog, remove HFill.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
|
|
|
|
else
|
|
|
|
|
params.kind = InsetSpaceParams::HFILL;
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
if (keep)
|
|
|
|
|
params.kind = InsetSpaceParams::CUSTOM_PROTECTED;
|
|
|
|
|
else
|
|
|
|
|
params.kind = InsetSpaceParams::CUSTOM;
|
|
|
|
|
params.length = Length(widgetsToLength(value, unit));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return params;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiHSpace::applyView()
|
|
|
|
|
{
|
|
|
|
|
params_ = setHSpaceFromWidgets(spacingCO->currentIndex(),
|
|
|
|
|
valueLE, unitCO, keepCB->isChecked(),
|
|
|
|
|
fillPatternCO->currentIndex());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiHSpace::updateContents()
|
|
|
|
|
{
|
|
|
|
|
setWidgetsFromHSpace(params_, spacingCO, valueLE, unitCO, keepCB,
|
|
|
|
|
fillPatternCO);
|
|
|
|
|
enableWidgets(spacingCO->currentIndex());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool GuiHSpace::initialiseParams(string const & data)
|
|
|
|
|
{
|
|
|
|
|
InsetSpaceMailer::string2params(data, params_);
|
|
|
|
|
setButtonsValid(true);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiHSpace::clearParams()
|
|
|
|
|
{
|
|
|
|
|
params_ = InsetSpaceParams();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiHSpace::dispatchParams()
|
|
|
|
|
{
|
|
|
|
|
dispatch(FuncRequest(getLfun(), InsetSpaceMailer::params2string(params_)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool GuiHSpace::isValid()
|
|
|
|
|
{
|
|
|
|
|
return (spacingCO->currentIndex() != 7 || !valueLE->text().isEmpty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dialog * createGuiHSpace(GuiView & lv) { return new GuiHSpace(lv); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "GuiHSpace_moc.cpp"
|