From d57d71fc5c72de3c616869761a8235771ca863b9 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 9 Jan 2002 14:40:34 +0000 Subject: [PATCH] Martin's math dialog patch. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3322 a592a061-630c-0410-9148-cb99ea01b6c8 --- images/ChangeLog | 4 + images/style.xpm | 28 ++ src/frontends/xforms/ChangeLog | 9 + src/frontends/xforms/FormMathsPanel.C | 12 + src/frontends/xforms/FormMathsPanel.h | 3 + src/frontends/xforms/FormMathsStyle.C | 81 ++++ src/frontends/xforms/FormMathsStyle.h | 54 +++ src/frontends/xforms/Makefile.am | 4 + src/frontends/xforms/MathsSymbols.C | 2 + src/frontends/xforms/form_maths_panel.C | 3 + src/frontends/xforms/form_maths_panel.h | 1 + src/frontends/xforms/form_maths_style.C | 175 ++++++++ src/frontends/xforms/form_maths_style.h | 39 ++ .../xforms/forms/form_maths_panel.fd | 20 +- .../xforms/forms/form_maths_style.fd | 414 ++++++++++++++++++ src/frontends/xforms/forms/makefile | 1 + src/mathed/ChangeLog | 5 + src/mathed/math_support.C | 7 + 18 files changed, 861 insertions(+), 1 deletion(-) create mode 100644 images/style.xpm create mode 100644 src/frontends/xforms/FormMathsStyle.C create mode 100644 src/frontends/xforms/FormMathsStyle.h create mode 100644 src/frontends/xforms/form_maths_style.C create mode 100644 src/frontends/xforms/form_maths_style.h create mode 100644 src/frontends/xforms/forms/form_maths_style.fd diff --git a/images/ChangeLog b/images/ChangeLog index 74f5cc4e6e..da349ea608 100644 --- a/images/ChangeLog +++ b/images/ChangeLog @@ -1,3 +1,7 @@ +2002-01-09 Martin Vermeer + + * style.xpm: style button for the math panel + 2002-01-03 Martin Vermeer * super.xpm: diff --git a/images/style.xpm b/images/style.xpm new file mode 100644 index 0000000000..bae6ca9c04 --- /dev/null +++ b/images/style.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char const * style_xpm[] = { +"20 20 5 1", +" c None", +". c Blue", +"X c Black", +"o c Blue", +"Y c Blue", +" ", +" ...... oooooo ", +" ...... oo oo ", +" .. .. oo oo ", +" ...... ooooooo ", +" ...... oo oo ", +" .. .. oo oo ", +" .. .. oo oo ", +" .. .. oo oo ", +" ", +" XX ", +" XXXX YYYYY ", +" XX XX Y Y ", +" XX XX Y Y ", +" XXXXXXXX YYYYYYY ", +" XX XX Y Y ", +" XX XX Y Y ", +" XX XX Y Y ", +" XX XX YYY YYY ", +" "}; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 8ad48492f6..2697bf5317 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,12 @@ +2002-01-09 Martin Vermeer + + * forms/form_maths_style.fd: + * FormMathsStyle.[Ch]: New files, Implementing a mathed pop-up for math + size "styles" and font types. + * FormMathsPanel.[Ch]: + * MathsSymbols.C: + * forms/form_maths_panel.fd: Modified too. + 2002-01-08 Martin Vermeer * Menubar_pimpl.C (create_submenu): diff --git a/src/frontends/xforms/FormMathsPanel.C b/src/frontends/xforms/FormMathsPanel.C index 8d3af6cdf0..149b235529 100644 --- a/src/frontends/xforms/FormMathsPanel.C +++ b/src/frontends/xforms/FormMathsPanel.C @@ -27,12 +27,14 @@ #include "form_maths_delim.h" #include "form_maths_matrix.h" #include "form_maths_space.h" +#include "form_maths_style.h" #include "FormMathsBitmap.h" #include "FormMathsDeco.h" #include "FormMathsDelim.h" #include "FormMathsMatrix.h" #include "FormMathsSpace.h" +#include "FormMathsStyle.h" #include "deco.xpm" #include "delim.xpm" @@ -40,6 +42,7 @@ #include "frac.xpm" #include "matrix.xpm" #include "space.xpm" +#include "style.xpm" #include "sqrt.xpm" #include "sub.xpm" #include "super.xpm" @@ -63,6 +66,7 @@ FormMathsPanel::FormMathsPanel(LyXView * lv, Dialogs * d) delim_.reset( new FormMathsDelim( lv, d, *this)); matrix_.reset(new FormMathsMatrix(lv, d, *this)); space_.reset( new FormMathsSpace( lv, d, *this)); + style_.reset( new FormMathsStyle( lv, d, *this)); typedef vector StringVec; @@ -149,6 +153,8 @@ void FormMathsPanel::build() const_cast(deco)); fl_set_pixmap_data(dialog_->button_space, const_cast(space_xpm)); + fl_set_pixmap_data(dialog_->button_style, + const_cast(style_xpm)); fl_set_pixmap_data(dialog_->button_matrix, const_cast(matrix)); fl_set_pixmap_data(dialog_->button_equation, @@ -270,6 +276,12 @@ bool FormMathsPanel::input(FL_OBJECT *, long data) space_->show(); break; + case MM_STYLE: + if (active_ && active_ != style_.get()) + active_->hide(); + style_->show(); + break; + case MM_EQU: mathDisplay(); break; diff --git a/src/frontends/xforms/FormMathsPanel.h b/src/frontends/xforms/FormMathsPanel.h index a6c9c133d3..77245cdbc4 100644 --- a/src/frontends/xforms/FormMathsPanel.h +++ b/src/frontends/xforms/FormMathsPanel.h @@ -25,6 +25,7 @@ class FormMathsDeco; class FormMathsDelim; class FormMathsMatrix; class FormMathsSpace; +class FormMathsStyle; class FormMathsSub; struct FD_form_maths_panel; @@ -46,6 +47,7 @@ enum MathsCallbackValues { MM_EQU, MM_DECO, MM_SPACE, + MM_STYLE, MM_DOTS, MM_FUNC }; @@ -88,6 +90,7 @@ private: boost::scoped_ptr delim_; boost::scoped_ptr matrix_; boost::scoped_ptr space_; + boost::scoped_ptr style_; boost::scoped_ptr arrow_; boost::scoped_ptr boperator_; boost::scoped_ptr brelats_; diff --git a/src/frontends/xforms/FormMathsStyle.C b/src/frontends/xforms/FormMathsStyle.C new file mode 100644 index 0000000000..37c73ece85 --- /dev/null +++ b/src/frontends/xforms/FormMathsStyle.C @@ -0,0 +1,81 @@ +/** + * \file FormMathsStyle.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 + * Adapted from FormMathsSpace martin.vermeer@hut.fi + */ + +#include + +#ifdef __GNUG_ +#pragma implementation +#endif + +#include "FormMathsStyle.h" +#include "form_maths_style.h" + +extern char * latex_mathstyle[]; + +FormMathsStyle::FormMathsStyle(LyXView * lv, Dialogs * d, + FormMathsPanel const & p) + : FormMathsSub(lv, d, p, _("Maths Styles & Fonts"), false), + style_(-1) +{} + + +FL_FORM * FormMathsStyle::form() const +{ + if (dialog_.get()) + return dialog_->form; + return 0; +} + + +void FormMathsStyle::build() +{ + dialog_.reset(build_maths_style()); + + fl_set_button(dialog_->radio_text, 1); + style_ = 1; + + bc().setOK(dialog_->button_ok); + bc().setApply(dialog_->button_apply); + bc().setCancel(dialog_->button_cancel); + + bc().addReadOnly(dialog_->radio_display); + bc().addReadOnly(dialog_->radio_text); + bc().addReadOnly(dialog_->radio_script); + bc().addReadOnly(dialog_->radio_scriptscript); + bc().addReadOnly(dialog_->radio_bold); + bc().addReadOnly(dialog_->radio_calligraphic); + bc().addReadOnly(dialog_->radio_roman); + bc().addReadOnly(dialog_->radio_typewriter); + bc().addReadOnly(dialog_->radio_sans); + bc().addReadOnly(dialog_->radio_italic); + bc().addReadOnly(dialog_->radio_bbbold); + bc().addReadOnly(dialog_->radio_fraktur); + bc().addReadOnly(dialog_->radio_textrm); + bc().addReadOnly(dialog_->radio_normal); +} + + +void FormMathsStyle::apply() +{ + if (style_ >= 0) + parent_.insertSymbol(latex_mathstyle[style_]); +} + +bool FormMathsStyle::input(FL_OBJECT *, long data) +{ + style_ = -1; + + if (data >= 0 && data < 14) { + style_ = short(data); + } + return true; +} diff --git a/src/frontends/xforms/FormMathsStyle.h b/src/frontends/xforms/FormMathsStyle.h new file mode 100644 index 0000000000..46f4f434fc --- /dev/null +++ b/src/frontends/xforms/FormMathsStyle.h @@ -0,0 +1,54 @@ +// -*- C++ -*- +/** + * \file FormMathsStyle.h + * Copyright 2001 The LyX Team. + * See the file COPYING. + * + * \author Alejandro Aguilar Sierra + * \author John Levon, moz@compsoc.man.ac.uk + * \author Angus Leeming, a.leeming@ic.ac.uk + */ + +#ifndef FORM_MATHSSTYLE_H +#define FORM_MATHSSTYLE_H + +#include + +#ifdef __GNUG_ +#pragma interface +#endif + +#include "FormMathsPanel.h" + +struct FD_form_maths_style; + +/** + * This class provides an XForms implementation of the maths style. + */ +class FormMathsStyle : public FormMathsSub { +public: + /// + FormMathsStyle(LyXView *, Dialogs *, FormMathsPanel const &); + +private: + /// Build the dialog + virtual void build(); + /// input handler + virtual bool input(FL_OBJECT *, long); + /// Apply from dialog (modify or create inset) + virtual void apply(); + + /// Pointer to the actual instantiation of the xforms form + virtual FL_FORM * form() const; + + // build the form + FD_form_maths_style * build_maths_style(); + + // Real GUI implementation + boost::scoped_ptr dialog_; + + /// The current choice. + short style_; +}; + +#endif // FORM_MATHSSTYLE_H diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index e9fcdf2bd1..5ed1ba0ea4 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -115,6 +115,10 @@ libxforms_la_SOURCES = \ FormMathsSpace.h \ form_maths_space.C \ form_maths_space.h \ + FormMathsStyle.C \ + FormMathsStyle.h \ + form_maths_style.C \ + form_maths_style.h \ FormMinipage.C \ FormMinipage.h \ form_minipage.C \ diff --git a/src/frontends/xforms/MathsSymbols.C b/src/frontends/xforms/MathsSymbols.C index 24703018e9..8c50a714a1 100644 --- a/src/frontends/xforms/MathsSymbols.C +++ b/src/frontends/xforms/MathsSymbols.C @@ -44,6 +44,7 @@ using std::strstr; #include "frac.xpm" #include "sub.xpm" #include "super.xpm" +#include "style.xpm" #include "sqrt.xpm" #include "delim.xbm" #include "delim.xpm" @@ -150,6 +151,7 @@ static char const ** mathed_get_pixmap_from_icon(int d) case MM_SQRT: return sqrt_xpm; case MM_SUPER: return super_xpm; case MM_SUB: return sub_xpm; + case MM_STYLE: return style_xpm; case MM_DELIM: return delim; case MM_MATRIX: return matrix; case MM_EQU: return equation; diff --git a/src/frontends/xforms/form_maths_panel.C b/src/frontends/xforms/form_maths_panel.C index e4e005a36a..c4e208cd8f 100644 --- a/src/frontends/xforms/form_maths_panel.C +++ b/src/frontends/xforms/form_maths_panel.C @@ -88,6 +88,9 @@ FD_form_maths_panel * FormMathsPanel::build_maths_panel() fdui->button_super = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 40, 30, 30, ""); fl_set_object_color(obj, FL_MCOL, FL_BLUE); fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_SUPER); + fdui->button_style = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 70, 40, 30, 30, ""); + fl_set_object_color(obj, FL_MCOL, FL_BLUE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, MM_STYLE); fl_end_form(); fdui->form->fdui = fdui; diff --git a/src/frontends/xforms/form_maths_panel.h b/src/frontends/xforms/form_maths_panel.h index 4d308aa10d..1977e420b8 100644 --- a/src/frontends/xforms/form_maths_panel.h +++ b/src/frontends/xforms/form_maths_panel.h @@ -32,6 +32,7 @@ struct FD_form_maths_panel { FL_OBJECT *button_varsize; FL_OBJECT *button_sub; FL_OBJECT *button_super; + FL_OBJECT *button_style; }; #endif /* FD_form_maths_panel_h_ */ diff --git a/src/frontends/xforms/form_maths_style.C b/src/frontends/xforms/form_maths_style.C new file mode 100644 index 0000000000..ab29b725af --- /dev/null +++ b/src/frontends/xforms/form_maths_style.C @@ -0,0 +1,175 @@ +// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext +#include +#include "xforms_helpers.h" +#include "gettext.h" + +/* Form definition file generated with fdesign. */ + +#include FORMS_H_LOCATION +#include +#include "form_maths_style.h" +#include "FormMathsStyle.h" + +FD_form_maths_style::~FD_form_maths_style() +{ + if ( form->visible ) fl_hide_form( form ); + fl_free_form( form ); +} + + +FD_form_maths_style * FormMathsStyle::build_maths_style() +{ + FL_OBJECT *obj; + FD_form_maths_style *fdui = new FD_form_maths_style; + + fdui->form = fl_bgn_form(FL_NO_BOX, 373, 251); + fdui->form->u_vdata = this; + obj = fl_add_box(FL_UP_BOX, 0, 0, 373, 251, ""); + { + char const * const dummy = N_("Apply|#A"); + fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 152, 212, 80, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0); + fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 62, 212, 80, 30, _("OK ")); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0); + { + char const * const dummy = N_("Cancel|^["); + fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 244, 212, 80, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0); + + fdui->styles = fl_bgn_group(); + { + char const * const dummy = N_("Display|#D"); + fdui->radio_display = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 15, 15, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_MEDIUM_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 1); + { + char const * const dummy = N_("Text|#T"); + fdui->radio_text = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 15, 45, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0); + fl_set_button(obj, 1); + { + char const * const dummy = N_("Script|#S"); + fdui->radio_script = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 15, 75, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 2); + { + char const * const dummy = N_("Bold|#B"); + fdui->radio_bold = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 140, 15, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lstyle(obj, FL_BOLD_STYLE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 4); + { + char const * const dummy = N_("Calligraphy|#C"); + fdui->radio_calligraphic = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 140, 45, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lstyle(obj, 14); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 5); + { + char const * const dummy = N_("Roman|#m"); + fdui->radio_roman = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 140, 75, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lstyle(obj, FL_TIMES_STYLE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 6); + { + char const * const dummy = N_("scriptscript|#p"); + fdui->radio_scriptscript = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 15, 105, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_TINY_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 3); + { + char const * const dummy = N_("Fixed|#x"); + fdui->radio_typewriter = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 140, 105, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lstyle(obj, FL_FIXED_STYLE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 7); + { + char const * const dummy = N_("Italic|#I"); + fdui->radio_italic = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 140, 165, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lstyle(obj, FL_TIMESITALIC_STYLE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 9); + { + char const * const dummy = N_("BB Bold|#o"); + fdui->radio_bbbold = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 260, 15, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 10); + { + char const * const dummy = N_("Fraktur|#F"); + fdui->radio_fraktur = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 260, 45, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 11); + { + char const * const dummy = N_("Reset|#R"); + fdui->radio_normal = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 260, 165, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 13); + { + char const * const dummy = N_("textrm|#e"); + fdui->radio_textrm = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 260, 105, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 12); + { + char const * const dummy = N_("Sans Serif|#n"); + fdui->radio_sans = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 140, 135, 120, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_color(obj, FL_MCOL, FL_YELLOW); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 8); + fl_end_group(); + + obj = fl_add_frame(FL_ENGRAVED_FRAME, 136, 16, 226, 184, ""); + obj = fl_add_frame(FL_ENGRAVED_FRAME, 14, 16, 110, 124, ""); + fl_end_form(); + + fdui->form->fdui = fdui; + + return fdui; +} +/*---------------------------------------*/ + diff --git a/src/frontends/xforms/form_maths_style.h b/src/frontends/xforms/form_maths_style.h new file mode 100644 index 0000000000..3e3a80d25b --- /dev/null +++ b/src/frontends/xforms/form_maths_style.h @@ -0,0 +1,39 @@ +// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext +/** Header file generated with fdesign **/ + +#ifndef FD_form_maths_style_h_ +#define FD_form_maths_style_h_ + +/** Callbacks, globals and object handlers **/ +extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long); +extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long); + + +/**** Forms and Objects ****/ +struct FD_form_maths_style { + ~FD_form_maths_style(); + + FL_FORM *form; + FL_OBJECT *button_apply; + FL_OBJECT *button_ok; + FL_OBJECT *button_cancel; + FL_OBJECT *styles; + FL_OBJECT *radio_display; + FL_OBJECT *radio_text; + FL_OBJECT *radio_script; + FL_OBJECT *radio_bold; + FL_OBJECT *radio_calligraphic; + FL_OBJECT *radio_roman; + FL_OBJECT *radio_scriptscript; + FL_OBJECT *radio_typewriter; + FL_OBJECT *radio_italic; + FL_OBJECT *radio_bbbold; + FL_OBJECT *radio_fraktur; + FL_OBJECT *radio_normal; + FL_OBJECT *radio_textrm; + FL_OBJECT *radio_sans; +}; + +#endif /* FD_form_maths_style_h_ */ diff --git a/src/frontends/xforms/forms/form_maths_panel.fd b/src/frontends/xforms/forms/form_maths_panel.fd index 210562b09b..4c7acece95 100644 --- a/src/frontends/xforms/forms/form_maths_panel.fd +++ b/src/frontends/xforms/forms/form_maths_panel.fd @@ -10,7 +10,7 @@ Unit of measure: FL_COORD_PIXEL Name: form_maths_panel Width: 260 Height: 180 -Number of Objects: 19 +Number of Objects: 20 -------------------- class: FL_BOX @@ -355,5 +355,23 @@ name: button_super callback: C_FormBaseDeprecatedInputCB argument: MM_SUPER +-------------------- +class: FL_PIXMAPBUTTON +type: NORMAL_BUTTON +box: 70 40 30 30 +boxtype: FL_UP_BOX +colors: FL_MCOL FL_BLUE +alignment: FL_ALIGN_BOTTOM +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: button_style +callback: C_FormBaseDeprecatedInputCB +argument: MM_STYLE + ============================== create_the_forms diff --git a/src/frontends/xforms/forms/form_maths_style.fd b/src/frontends/xforms/forms/form_maths_style.fd new file mode 100644 index 0000000000..0b5b5ba108 --- /dev/null +++ b/src/frontends/xforms/forms/form_maths_style.fd @@ -0,0 +1,414 @@ +Magic: 13000 + +Internal Form Definition File + (do not change) + +Number of forms: 1 +Unit of measure: FL_COORD_PIXEL +SnapGrid: 2 + +=============== FORM =============== +Name: form_maths_style +Width: 373 +Height: 251 +Number of Objects: 22 + +-------------------- +class: FL_BOX +type: UP_BOX +box: 0 0 373 251 +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: NORMAL_BUTTON +box: 152 212 80 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_FormBaseDeprecatedApplyCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: RETURN_BUTTON +box: 62 212 80 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_FormBaseDeprecatedOKCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 244 212 80 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_FormBaseDeprecatedCancelCB +argument: 0 + +-------------------- +class: FL_BEGIN_GROUP +type: 0 +box: 0 0 0 0 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_MCOL +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: styles +callback: +argument: + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 15 15 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_MEDIUM_SIZE +lcol: FL_BLACK +label: Display|#D +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_display +callback: C_FormBaseDeprecatedInputCB +argument: 1 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 15 45 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Text|#T +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_text +callback: C_FormBaseDeprecatedInputCB +argument: 0 + value: 1 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 15 75 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: Script|#S +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_script +callback: C_FormBaseDeprecatedInputCB +argument: 2 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 140 15 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_BOLD_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Bold|#B +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_bold +callback: C_FormBaseDeprecatedInputCB +argument: 4 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 140 45 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: 14 +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Calligraphy|#C +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_calligraphic +callback: C_FormBaseDeprecatedInputCB +argument: 5 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 140 75 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_TIMES_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Roman|#m +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_roman +callback: C_FormBaseDeprecatedInputCB +argument: 6 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 15 105 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_TINY_SIZE +lcol: FL_BLACK +label: scriptscript|#p +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_scriptscript +callback: C_FormBaseDeprecatedInputCB +argument: 3 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 140 105 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_FIXED_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Fixed|#x +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_typewriter +callback: C_FormBaseDeprecatedInputCB +argument: 7 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 140 165 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_TIMESITALIC_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Italic|#I +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_italic +callback: C_FormBaseDeprecatedInputCB +argument: 9 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 260 15 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: BB Bold|#o +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_bbbold +callback: C_FormBaseDeprecatedInputCB +argument: 10 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 260 45 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Fraktur|#F +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_fraktur +callback: C_FormBaseDeprecatedInputCB +argument: 11 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 260 165 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Reset|#R +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_normal +callback: C_FormBaseDeprecatedInputCB +argument: 13 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 260 105 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: textrm|#e +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_textrm +callback: C_FormBaseDeprecatedInputCB +argument: 12 + +-------------------- +class: FL_ROUND3DBUTTON +type: RADIO_BUTTON +box: 140 135 120 30 +boxtype: FL_NO_BOX +colors: FL_MCOL FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Sans Serif|#n +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: radio_sans +callback: C_FormBaseDeprecatedInputCB +argument: 8 + +-------------------- +class: FL_END_GROUP +type: 0 +box: 0 0 0 0 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_MCOL +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_FRAME +type: ENGRAVED_FRAME +box: 136 16 226 184 +boxtype: FL_NO_BOX +colors: FL_BLACK 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_FRAME +type: ENGRAVED_FRAME +box: 14 16 110 124 +boxtype: FL_FRAME_BOX +colors: FL_BLACK 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: + +============================== +create_the_forms diff --git a/src/frontends/xforms/forms/makefile b/src/frontends/xforms/forms/makefile index 240b646b18..8651dc5bb9 100644 --- a/src/frontends/xforms/forms/makefile +++ b/src/frontends/xforms/forms/makefile @@ -38,6 +38,7 @@ SRCS = form_aboutlyx.fd \ form_maths_matrix.fd \ form_maths_panel.fd \ form_maths_space.fd \ + form_maths_style.fd \ form_minipage.fd \ form_paragraph.fd \ form_preamble.fd \ diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index e36bf3dba5..ee3cda7a21 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2002-01-09 Martin Vermeer + + * math_support.C: modified to support a mathed pop-up for math + size "styles" and font types. + 2002-01-07 Angus Leeming * math_defs.h: remove trailing comma from enum MathTextCodes. diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index a7ffa7949c..fde9ff6b25 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -775,6 +775,13 @@ char const * latex_mathspace[] = { }; +char const * latex_mathstyle[] = { + "textstyle", "displaystyle", "scriptstyle", "scriptscriptstyle", + "mathbf", "mathcal","mathrm","mathtt", "mathsf", "mathit", + "mathbb","mathfrak", "textrm", "mathnormal" +}; + + char const * math_font_name(MathTextCodes code) { static char const * theFontNames[] = { -- 2.39.2