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
|
2002-08-15 16:02:22 +00:00
|
|
|
* \author Angus Leeming <leeming@lyx.org>
|
2001-03-19 15:38:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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
|
|
|
|
2002-04-23 08:16:27 +00:00
|
|
|
#ifdef __GNUG__
|
2001-03-19 15:38:22 +00:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2002-08-30 16:36:02 +00:00
|
|
|
#include "MathsCallbacks.h"
|
2001-03-19 15:38:22 +00:00
|
|
|
#include "FormBaseDeprecated.h"
|
|
|
|
|
2002-05-22 01:16:37 +00:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
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;
|
2002-06-13 13:43:51 +00:00
|
|
|
struct FD_maths_panel;
|
2001-03-19 15:38:22 +00:00
|
|
|
|
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:
|
|
|
|
///
|
2002-08-15 16:02:22 +00:00
|
|
|
FormMathsPanel(LyXView &, Dialogs &);
|
2001-03-19 15:38:22 +00:00
|
|
|
///
|
|
|
|
void setActive(FormMathsSub *) 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;
|
2002-08-30 16:36:02 +00:00
|
|
|
/// dispatch a symbol insert
|
|
|
|
void insertSymbol(string const & sym, bool bs = true) 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;
|
|
|
|
|
2002-06-13 13:43:51 +00:00
|
|
|
// Real GUI implementation
|
|
|
|
boost::scoped_ptr<FD_maths_panel> dialog_;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
/// send LFUN_MATH_DISPLAY
|
|
|
|
void mathDisplay() const;
|
|
|
|
|
|
|
|
/// 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:
|
|
|
|
///
|
2002-08-15 16:02:22 +00:00
|
|
|
FormMathsSub(LyXView &, Dialogs &, FormMathsPanel const &,
|
2002-06-18 15:44:30 +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
|