2001-03-19 15:38:22 +00:00
|
|
|
/**
|
|
|
|
* \file FormMathsSpace.C
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
* See the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
* \author Pablo De Napoli, pdenapo@dm.uba.ar
|
|
|
|
* \author John Levon, moz@compsoc.man.ac.uk
|
|
|
|
* \author Angus Leeming, a.leeming@ic.ac.uk
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2002-04-23 08:16:27 +00:00
|
|
|
#ifdef __GNUG__
|
2001-03-19 15:38:22 +00:00
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "FormMathsSpace.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
#include "forms/form_maths_space.h"
|
|
|
|
#include FORMS_H_LOCATION
|
2001-03-19 15:38:22 +00:00
|
|
|
|
|
|
|
extern char * latex_mathspace[];
|
|
|
|
|
|
|
|
FormMathsSpace::FormMathsSpace(LyXView * lv, Dialogs * d,
|
|
|
|
FormMathsPanel const & p)
|
2001-09-07 17:55:37 +00:00
|
|
|
: FormMathsSub(lv, d, p, _("Maths Spacing"), false),
|
2001-03-19 15:38:22 +00:00
|
|
|
space_(-1)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
FL_FORM * FormMathsSpace::form() const
|
|
|
|
{
|
|
|
|
if (dialog_.get())
|
2002-03-21 21:21:28 +00:00
|
|
|
return dialog_->form;
|
2001-03-19 15:38:22 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2002-03-12 14:11:15 +00:00
|
|
|
bc().setCancel(dialog_->button_close);
|
2001-03-19 15:38:22 +00:00
|
|
|
|
2002-01-29 12:31:24 +00:00
|
|
|
bc().addReadOnly(dialog_->button_thin);
|
|
|
|
bc().addReadOnly(dialog_->button_medium);
|
|
|
|
bc().addReadOnly(dialog_->button_thick);
|
|
|
|
bc().addReadOnly(dialog_->button_negative);
|
|
|
|
bc().addReadOnly(dialog_->button_quadratin);
|
|
|
|
bc().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)
|
2001-03-19 15:38:22 +00:00
|
|
|
parent_.insertSymbol(latex_mathspace[space_]);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FormMathsSpace::input(FL_OBJECT *, long data)
|
|
|
|
{
|
|
|
|
space_ = -1;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
if (data >= 0 && data < 6) {
|
|
|
|
space_ = short(data);
|
2002-03-21 16:59:12 +00:00
|
|
|
apply();
|
2001-03-19 15:38:22 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|