]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsPanel.h
fix crash with "save as"
[lyx.git] / src / frontends / xforms / FormMathsPanel.h
index e1a4fd3853fa684b82ab9c5881121a0b7cd45f1a..f70c1468674e4bdb478a0dbf1c657d77395ebeaa 100644 (file)
 #ifndef FORM_MATHSPANEL_H
 #define FORM_MATHSPANEL_H
 
-#include "commandtags.h"
-
 #ifdef __GNUG__
 #pragma interface
 #endif
 
-#include "FormBaseDeprecated.h"
-
-#include <boost/shared_ptr.hpp>
-#include <map>
+#include "FormBase.h"
 
-class FormMathsBitmap;
-class FormMathsSub;
+class ControlMath;
 struct FD_maths_panel;
+class FormMathsBitmap;
 
 /**
  * This class provides an XForms implementation of the maths panel.
  */
-class FormMathsPanel : public FormBaseBD {
+class FormMathsPanel : public FormCB<ControlMath, FormDB<FD_maths_panel> > {
 public:
        ///
-       FormMathsPanel(LyXView &, Dialogs &);
-       /// dispatch an LFUN:
-       void dispatchFunc(kb_action action,
-                         string const & arg = string()) const;
-       /// dispatch a symbol insert
-       void insertSymbol(string const & sym, bool bs = true) const;
+       FormMathsPanel();
 
 private:
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc();
+       /// Not needed.
+       virtual void apply() {}
+       ///
+       virtual void update() {}
 
-       /// Build the dialog
+       ///
        virtual void build();
-       /// input handler
-       virtual bool input(FL_OBJECT *, long);
-
-       /// Pointer to the actual instantiation of the xforms form
-       virtual FL_FORM * form() const;
-
-       // Real GUI implementation
-       boost::scoped_ptr<FD_maths_panel> dialog_;
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
 
        /** 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,
+       FormMathsBitmap * addDaughter(void * button, string const & title,
                                      char const * const * data, int size);
-
-       ///
-       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.
-       ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
-};
-
-
-class FormMathsSub : public FormBaseBD {
-public:
-       ///
-       FormMathsSub(LyXView &, Dialogs &, FormMathsPanel const &,
-                    string const &, bool allowResize = true);
-
-       ///
-       bool isVisible() const;
-
-protected:
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc();
-       /// The parent Maths Panel
-       FormMathsPanel const & parent_;
-private:
-       /// The ButtonController
-       ButtonController<IgnorantPolicy, xformsBC> bc_;
 };
 
-
-inline
-xformsBC & FormMathsSub::bc()
-{
-       return bc_;
-}
-
-inline
-xformsBC & FormMathsPanel::bc()
-{
-       return bc_;
-}
 #endif //  FORM_MATHSPANEL_H