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
|
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.
|
2002-03-21 21:21:28 +00:00
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author John Levon
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
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
|
|
|
|
|
|
|
|
#include "FormBaseDeprecated.h"
|
|
|
|
|
2002-11-22 11:56:43 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <map>
|
2002-05-22 01:16:37 +00:00
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
class FormMathsBitmap;
|
|
|
|
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 &);
|
2002-01-10 16:47:03 +00:00
|
|
|
/// dispatch an LFUN:
|
2002-11-22 11:56:43 +00:00
|
|
|
void dispatchFunc(kb_action action,
|
|
|
|
string const & arg = string()) const;
|
2002-08-30 16:36:02 +00:00
|
|
|
/// dispatch a symbol insert
|
|
|
|
void insertSymbol(string const & sym, bool bs = true) const;
|
2002-11-22 11:56:43 +00:00
|
|
|
|
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
|
|
|
|
2002-11-22 11:56:43 +00:00
|
|
|
/** Add a bitmap dialog to the store of all daughters_ and
|
|
|
|
* return a pointer to the dialog, so that bitmaps can be added to it.
|
|
|
|
*/
|
|
|
|
FormMathsBitmap * addDaughter(FL_OBJECT * button, string const & title,
|
|
|
|
char const * const * data, int size);
|
2001-03-19 15:38:22 +00:00
|
|
|
|
2002-11-22 11:56:43 +00:00
|
|
|
///
|
|
|
|
void showDaughter(FL_OBJECT *);
|
|
|
|
|
|
|
|
///
|
|
|
|
typedef boost::shared_ptr<FormMathsSub> DaughterDialog;
|
|
|
|
typedef std::map<FL_OBJECT *, DaughterDialog> Store;
|
|
|
|
|
|
|
|
/** The store of all daughter dialogs.
|
|
|
|
* The map uses the button on the main panel to identify them.
|
|
|
|
*/
|
|
|
|
Store daughters_;
|
|
|
|
|
|
|
|
/// A pointer to the currently active daughter dialog.
|
|
|
|
FormMathsSub * active_;
|
|
|
|
|
|
|
|
/// The ButtonController.
|
2001-03-19 15:38:22 +00:00
|
|
|
ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class FormMathsSub : public FormBaseBD {
|
|
|
|
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
|
|
|
|
2002-11-22 11:56:43 +00:00
|
|
|
///
|
|
|
|
bool isVisible() const;
|
|
|
|
|
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:
|
|
|
|
/// 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
|