2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2002-03-21 21:21:28 +00:00
|
|
|
/**
|
2001-03-19 15:38:22 +00:00
|
|
|
* \file FormMathsPanel.h
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
* See the file COPYING.
|
2002-03-21 21:21:28 +00:00
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
2001-03-19 15:38:22 +00:00
|
|
|
* \author John Levon, moz@compsoc.man.ac.uk
|
|
|
|
* \author Angus Leeming, a.leeming@ic.ac.uk
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FORM_MATHSPANEL_H
|
|
|
|
#define FORM_MATHSPANEL_H
|
|
|
|
|
2002-01-12 20:00:47 +00:00
|
|
|
#include "commandtags.h"
|
2001-03-19 15:38:22 +00:00
|
|
|
#include <boost/smart_ptr.hpp>
|
|
|
|
|
|
|
|
#ifdef __GNUG_
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "FormBaseDeprecated.h"
|
|
|
|
|
|
|
|
class FormMathsBitmap;
|
|
|
|
class FormMathsDeco;
|
|
|
|
class FormMathsDelim;
|
|
|
|
class FormMathsMatrix;
|
|
|
|
class FormMathsSpace;
|
2002-01-09 14:40:34 +00:00
|
|
|
class FormMathsStyle;
|
2001-03-19 15:38:22 +00:00
|
|
|
class FormMathsSub;
|
|
|
|
struct FD_form_maths_panel;
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
/// values used by the xforms callbacks
|
2001-03-19 15:38:22 +00:00
|
|
|
enum MathsCallbackValues {
|
|
|
|
MM_GREEK,
|
|
|
|
MM_ARROW,
|
|
|
|
MM_BOP,
|
|
|
|
MM_BRELATS,
|
|
|
|
MM_VARSIZE,
|
|
|
|
MM_MISC,
|
|
|
|
MM_FRAC,
|
|
|
|
MM_SQRT,
|
|
|
|
MM_DELIM,
|
2002-01-03 16:17:16 +00:00
|
|
|
MM_SUPER,
|
|
|
|
MM_SUB,
|
|
|
|
MM_SUBSUPER,
|
2001-03-19 15:38:22 +00:00
|
|
|
MM_MATRIX,
|
|
|
|
MM_EQU,
|
|
|
|
MM_DECO,
|
|
|
|
MM_SPACE,
|
2002-01-09 14:40:34 +00:00
|
|
|
MM_STYLE,
|
2001-03-19 15:38:22 +00:00
|
|
|
MM_DOTS,
|
2002-01-18 12:18:20 +00:00
|
|
|
MM_AMS_MISC,
|
|
|
|
MM_AMS_ARROWS,
|
|
|
|
MM_AMS_BREL,
|
|
|
|
MM_AMS_NREL,
|
|
|
|
MM_AMS_OPS,
|
2001-03-19 15:38:22 +00:00
|
|
|
MM_FUNC
|
|
|
|
};
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
|
|
/**
|
2001-03-19 15:38:22 +00:00
|
|
|
* This class provides an XForms implementation of the maths panel.
|
|
|
|
*/
|
|
|
|
class FormMathsPanel : public FormBaseBD {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
FormMathsPanel(LyXView *, Dialogs *);
|
|
|
|
///
|
|
|
|
void setActive(FormMathsSub *) const;
|
2002-03-21 21:21:28 +00:00
|
|
|
/// dispatch a symbol insert
|
2002-01-15 15:31:19 +00:00
|
|
|
void insertSymbol(string const & sym, bool bs = true) const;
|
2002-01-10 16:47:03 +00:00
|
|
|
/// dispatch an LFUN:
|
2002-01-12 20:00:47 +00:00
|
|
|
void dispatchFunc(kb_action action) const;
|
2001-03-19 15:38:22 +00:00
|
|
|
private:
|
|
|
|
/// Pointer to the actual instantiation of the ButtonController.
|
|
|
|
virtual xformsBC & bc();
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-04-03 14:30:58 +00:00
|
|
|
/// Build the dialog
|
2001-03-19 15:38:22 +00:00
|
|
|
virtual void build();
|
|
|
|
/// input handler
|
|
|
|
virtual bool input(FL_OBJECT *, long);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
/// Pointer to the actual instantiation of the xforms form
|
|
|
|
virtual FL_FORM * form() const;
|
|
|
|
|
|
|
|
// build the panels
|
|
|
|
FD_form_maths_panel * build_maths_panel();
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
/// send LFUN_MATH_DISPLAY
|
|
|
|
void mathDisplay() const;
|
|
|
|
|
|
|
|
// Real GUI implementation
|
|
|
|
boost::scoped_ptr<FD_form_maths_panel> dialog_;
|
|
|
|
|
|
|
|
/// Subdialogs
|
|
|
|
boost::scoped_ptr<FormMathsDeco> deco_;
|
|
|
|
boost::scoped_ptr<FormMathsDelim> delim_;
|
|
|
|
boost::scoped_ptr<FormMathsMatrix> matrix_;
|
|
|
|
boost::scoped_ptr<FormMathsSpace> space_;
|
2002-01-09 14:40:34 +00:00
|
|
|
boost::scoped_ptr<FormMathsStyle> style_;
|
2001-03-19 15:38:22 +00:00
|
|
|
boost::scoped_ptr<FormMathsBitmap> arrow_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> boperator_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> brelats_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> greek_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> misc_;
|
2001-08-01 10:08:53 +00:00
|
|
|
boost::scoped_ptr<FormMathsBitmap> dots_;
|
2001-03-19 15:38:22 +00:00
|
|
|
boost::scoped_ptr<FormMathsBitmap> varsize_;
|
2002-01-18 12:18:20 +00:00
|
|
|
boost::scoped_ptr<FormMathsBitmap> ams_misc_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> ams_arrows_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> ams_rel_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> ams_nrel_;
|
|
|
|
boost::scoped_ptr<FormMathsBitmap> ams_ops_;
|
2001-03-19 15:38:22 +00:00
|
|
|
|
|
|
|
/// A pointer to the currently active subdialog
|
|
|
|
mutable FormMathsSub * active_;
|
|
|
|
|
|
|
|
/// The ButtonController
|
|
|
|
ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FormMathsSub : public FormBaseBD {
|
|
|
|
friend class FormMathsPanel; // has subdialogs to manipulate
|
|
|
|
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
FormMathsSub(LyXView *, Dialogs *, FormMathsPanel const &,
|
2001-09-07 17:55:37 +00:00
|
|
|
string const &, bool allowResize=true);
|
2001-03-19 15:38:22 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/// Pointer to the actual instantiation of the ButtonController.
|
|
|
|
virtual xformsBC & bc();
|
|
|
|
/// The parent Maths Panel
|
|
|
|
FormMathsPanel const & parent_;
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
virtual void connect();
|
|
|
|
///
|
|
|
|
virtual void disconnect();
|
|
|
|
/// The ButtonController
|
2001-09-02 11:40:33 +00:00
|
|
|
ButtonController<IgnorantPolicy, xformsBC> bc_;
|
2001-03-19 15:38:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
xformsBC & FormMathsSub::bc()
|
|
|
|
{
|
|
|
|
return bc_;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
xformsBC & FormMathsPanel::bc()
|
|
|
|
{
|
|
|
|
return bc_;
|
|
|
|
}
|
|
|
|
#endif // FORM_MATHSPANEL_H
|