2001-03-19 15:38:22 +00:00
|
|
|
/**
|
|
|
|
* \file FormMathsSpace.C
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-19 15:38:22 +00:00
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Pablo De Napoli
|
|
|
|
* \author John Levon
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Angus Leeming
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-03-19 15:38:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "FormMathsSpace.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
#include "forms/form_maths_space.h"
|
2002-11-25 18:58:15 +00:00
|
|
|
#include "ControlMath.h"
|
|
|
|
#include "xformsBC.h"
|
|
|
|
|
2003-05-14 09:17:22 +00:00
|
|
|
#include "lyx_forms.h"
|
2001-03-19 15:38:22 +00:00
|
|
|
|
|
|
|
extern char * latex_mathspace[];
|
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
typedef FormCB<ControlMathSub, FormDB<FD_maths_space> > base_class;
|
|
|
|
|
|
|
|
FormMathsSpace::FormMathsSpace()
|
2003-04-30 02:06:04 +00:00
|
|
|
: base_class(_("Math Spacing"), false),
|
2001-03-19 15:38:22 +00:00
|
|
|
space_(-1)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
void FormMathsSpace::build()
|
|
|
|
{
|
2002-06-13 13:43:51 +00:00
|
|
|
dialog_.reset(build_maths_space(this));
|
2001-03-19 15:38:22 +00:00
|
|
|
|
2002-01-29 12:31:24 +00:00
|
|
|
space_ = -1;
|
2001-03-19 15:38:22 +00:00
|
|
|
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().setCancel(dialog_->button_close);
|
|
|
|
|
|
|
|
bcview().addReadOnly(dialog_->button_negative);
|
|
|
|
bcview().addReadOnly(dialog_->button_negmedspace);
|
|
|
|
bcview().addReadOnly(dialog_->button_negthickspace);
|
|
|
|
bcview().addReadOnly(dialog_->button_thin);
|
|
|
|
bcview().addReadOnly(dialog_->button_medium);
|
|
|
|
bcview().addReadOnly(dialog_->button_thick);
|
|
|
|
bcview().addReadOnly(dialog_->button_quadratin);
|
|
|
|
bcview().addReadOnly(dialog_->button_twoquadratin);
|
2001-03-19 15:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FormMathsSpace::apply()
|
|
|
|
{
|
2001-09-07 16:12:20 +00:00
|
|
|
if (space_ >= 0)
|
2002-11-25 18:58:15 +00:00
|
|
|
controller().insertSymbol(latex_mathspace[space_]);
|
2001-03-19 15:38:22 +00:00
|
|
|
}
|
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
ButtonPolicy::SMInput FormMathsSpace::input(FL_OBJECT *, long data)
|
2001-03-19 15:38:22 +00:00
|
|
|
{
|
|
|
|
space_ = -1;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-09-20 12:38:48 +00:00
|
|
|
if (data >= 0 && data < 8) {
|
2001-03-19 15:38:22 +00:00
|
|
|
space_ = short(data);
|
2002-03-21 16:59:12 +00:00
|
|
|
apply();
|
2001-03-19 15:38:22 +00:00
|
|
|
}
|
2002-11-25 18:58:15 +00:00
|
|
|
return ButtonPolicy::SMI_VALID;
|
2001-03-19 15:38:22 +00:00
|
|
|
}
|