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
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-03-19 15:38:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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[];
|
|
|
|
|
2002-08-15 16:02:22 +00:00
|
|
|
FormMathsSpace::FormMathsSpace(LyXView & lv, Dialogs & d,
|
2001-03-19 15:38:22 +00:00
|
|
|
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-09-20 12:38:48 +00:00
|
|
|
bc().addReadOnly(dialog_->button_negative);
|
|
|
|
bc().addReadOnly(dialog_->button_negmedspace);
|
|
|
|
bc().addReadOnly(dialog_->button_negthickspace);
|
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_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
|
|
|
|
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
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|