]> git.lyx.org Git - lyx.git/commitdiff
* A controller-view split of the math panel and its daughter dialogs.
authorAngus Leeming <leeming@lyx.org>
Mon, 25 Nov 2002 18:58:15 +0000 (18:58 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 25 Nov 2002 18:58:15 +0000 (18:58 +0000)
* Get rid of FormBaseDeprecated.
* Merge FormBase and FeedbackController.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5715 a592a061-630c-0410-9148-cb99ea01b6c8

34 files changed:
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlDialog.h
src/frontends/controllers/ControlMath.C
src/frontends/controllers/ControlMath.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs2.C
src/frontends/xforms/Dialogs_impl.h
src/frontends/xforms/FeedbackController.C [deleted file]
src/frontends/xforms/FeedbackController.h [deleted file]
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormBase.h
src/frontends/xforms/FormBaseDeprecated.C [deleted file]
src/frontends/xforms/FormBaseDeprecated.h [deleted file]
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsBitmap.h
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/FormMathsDeco.h
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/FormMathsDelim.h
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormMathsMatrix.h
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/FormMathsPanel.h
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/FormMathsSpace.h
src/frontends/xforms/FormMathsStyle.C
src/frontends/xforms/FormMathsStyle.h
src/frontends/xforms/Makefile.am
src/frontends/xforms/forms/form_maths_deco.fd
src/frontends/xforms/forms/form_maths_delim.fd
src/frontends/xforms/forms/form_maths_matrix.fd
src/frontends/xforms/forms/form_maths_panel.fd
src/frontends/xforms/forms/form_maths_space.fd
src/frontends/xforms/forms/form_maths_style.fd

index 1b59357705354bf16410698bd1fad75e83a56d15..42264b85dda3472e65de5ddbd03471a14b0b4de3 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-25  Angus Leeming  <leeming@lyx.org>
+
+       * ControlDialog.h (hide, update): move from protected to public.
+
+       * ControlMath.[Ch]: add controllers for the main math panel dialog and
+       for any daughter dialogs stored by the main panel.
+
 2002-11-21  Angus Leeming  <leeming@lyx.org>
 
        * ControlDocument.[Ch] (classApply): no longer returns bool.
index e6a5e3657e4d380fe4b732e74842e0fc5a778806..27b988a6f90d3c8a8d07fca7e2d49d0350baa156 100644 (file)
@@ -34,12 +34,12 @@ public:
         *  Publicly accessible so that it can be invoked by the Dialogs class.
         */
        virtual void show();
-protected:
        /// Hide the dialog.
        virtual void hide();
        /// Update the dialog.
        virtual void update();
 
+protected:
        /// clean-up on hide.
        virtual void clearParams() {}
        /// set the params before show or update
index 62fa32cc7821794a54510837038565e194cdb343..6004d5e1be0f2208b086af49fa592a87a970c51e 100644 (file)
 #include <config.h>
 
 #include "ControlMath.h"
+#include "ViewBase.h"
+
+#include "debug.h" 
+#include "funcrequest.h"
+
+#include "frontends/LyXView.h"
 
 #include "support/lstrings.h"
 #include "support/filetools.h"
-#include "debug.h" 
+
+
+ControlMath::ControlMath(LyXView & lv, Dialogs & d)
+       : ControlDialogBD(lv, d)
+{}
+
+
+void ControlMath::apply()
+{
+       view().apply();
+}
+
+
+void ControlMath::dispatchFunc(kb_action action, string const & arg) const
+{
+       lv_.dispatch(FuncRequest(action, arg));
+}
+
+
+void ControlMath::insertSymbol(string const & sym, bool bs) const
+{
+       if (bs)
+               lv_.dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + sym));
+       else
+               lv_.dispatch(FuncRequest(LFUN_INSERT_MATH, sym));
+}
+
+
+void ControlMath::addDaughter(void * key, ViewBase * v,
+                             ButtonControllerBase * bc)
+{
+       if (daughters_.find(key) != daughters_.end())
+               return;
+
+       daughters_[key] = DaughterPtr(new GUIMathSub(lv_, d_, *this, v, bc));
+}
+
+
+void ControlMath::showDaughter(void * key)
+{
+       Store::iterator it = daughters_.find(key);
+       GUIMathSub * const new_active =
+               (it == daughters_.end()) ? 0 : it->second.get();
+
+       if (active_ != new_active) {
+               if (active_ )
+                       active_->controller().hide();
+               active_ = new_active;
+       }
+
+       if (active_)
+               active_->controller().show();
+}
+
+
+
+ControlMathSub::ControlMathSub(LyXView & lv, Dialogs & d, ControlMath const & p)
+       : ControlDialogBD(lv, d),
+         parent_(p)
+{}
+
+
+void ControlMathSub::apply()
+{
+       view().apply();
+}
+
+
+void ControlMathSub::dispatchFunc(kb_action action, string const & arg) const
+{
+       parent_.dispatchFunc(action, arg);
+}
+
+
+void ControlMathSub::insertSymbol(string const & sym, bool bs) const
+{
+       parent_.insertSymbol(sym, bs);
+}
+
+
+GUIMathSub::GUIMathSub(LyXView & lv, Dialogs & d,
+                      ControlMath const & p,
+                      ViewBase * v,
+                      ButtonControllerBase * bc)
+       : controller_(lv, d, p), bc_(bc), view_(v)
+{
+       controller_.setView(*view_);
+       controller_.setButtonController(*bc_);
+       view_->setController(controller_);
+}
+
 
 char const * function_names[] = {
        "arccos", "arcsin", "arctan", "arg", "bmod",
index 2391a5f6ee114c24ce03896c8dcb42b5c7f5d08f..597ab179ecb1fb6edad1e29b54aabfe3017cbcc8 100644 (file)
@@ -6,6 +6,7 @@
  *
  * \author Alejandro Aguilar Sierra
  * \author John Levon
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
 #ifndef CONTROL_MATH_H
 #define CONTROL_MATH_H
 
+#include "commandtags.h"
+#include "ControlDialog_impl.h"
+
+#include "ButtonController.h"
+#include "ButtonPolicies.h"
+
 #include "LString.h"
+#include <boost/shared_ptr.hpp>
+#include <map>
+
+
+class GUIMathSub;
+
+
+class ControlMath : public ControlDialogBD {
+public:
+       ///
+       ControlMath(LyXView &, Dialogs &);
+
+       /// dispatch an LFUN
+       void dispatchFunc(kb_action act, string const & arg = string()) const;
+       /// dispatch a symbol insert
+       void insertSymbol(string const & sym, bool bs = true) const;
+
+       ///
+       void addDaughter(void * key, ViewBase * v, ButtonControllerBase * bc);
+       ///
+       void showDaughter(void *);
+       
+private:
+       ///
+       virtual void apply();
+
+       ///
+       typedef boost::shared_ptr<GUIMathSub> DaughterPtr;
+       ///
+       typedef std::map<void *, DaughterPtr> 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.
+       GUIMathSub * active_;
+};
+
+
+class ControlMathSub : public ControlDialogBD {
+public:
+       ///
+       ControlMathSub(LyXView &, Dialogs &, ControlMath const & p);
+
+       /// dispatch an LFUN
+       void dispatchFunc(kb_action act, string const & arg = string()) const;
+       /// dispatch a symbol insert
+       void insertSymbol(string const & sym, bool bs = true) const;
+
+private:
+       ///
+       virtual void apply();
+       ///
+       ControlMath const & parent_;
+};
+
+
+class GUIMathSub {
+public:
+       ///
+       GUIMathSub(LyXView & lv, Dialogs & d,
+                  ControlMath const & p,
+                  ViewBase * v,
+                  ButtonControllerBase * bc);
+       ///
+       ControlMathSub & controller() { return controller_; }
+
+private:
+       ///
+       ControlMathSub controller_;
+       ///
+       boost::scoped_ptr<ButtonControllerBase> bc_;
+       ///
+       boost::scoped_ptr<ViewBase> view_;
+};
+
+
 extern char const * function_names[];
 extern int const nr_function_names;
 extern char const * latex_arrow[];
index d617cf5a98948ac91b71d7eb5f79c9921aed1e24..b2105f524c334c714c001d28c2e553d778b9d65b 100644 (file)
@@ -1,3 +1,32 @@
+2002-11-25  Angus Leeming  <leeming@lyx.org>
+
+       * Dialogs_impl.h:
+       * Dialogs2.C: no need to include math sub dialog header files.
+       Use standard MCV implementation of main math panel dialog.
+
+       * FormBaseDeprecated.[Ch]:
+       * FeedbackController.[Ch]: removed.
+
+       * FormBase.[Ch]: Merge the contents of FeedbackController into here
+       also.
+       (FormCB): make the controller methods publicly accessible.
+
+       * forms/form_maths_deco.fd:
+       * forms/form_maths_delim.fd:
+       * forms/form_maths_matrix.fd:
+       * forms/form_maths_panel.fd:
+       * forms/form_maths_space.fd:
+       * forms/form_maths_style.fd: s/Deprecated//
+
+       * FormMathsBitmap.[Ch]:
+       * FormMathsDeco.[Ch]:
+       * FormMathsDelim.[Ch]:
+       * FormMathsMatrix.[Ch]:
+       * FormMathsPanel.[Ch]:
+       * FormMathsSpace.[Ch]:
+       * FormMathsStyle.[Ch]: implement a Controller-View split of the math
+       dialogs.
+
 2002-11-22  Angus Leeming  <leeming@lyx.org>
 
        The first step towards a math dialog controller...
index 2544acd6ac0b820ba9cd8932c8144956bed6ae6e..4a2767a2acf048f83c268b238e1d1a12f5a464de 100644 (file)
@@ -141,7 +141,7 @@ void Dialogs::showLogFile()
 
 void Dialogs::showMathPanel()
 {
-       pimpl_->mathpanel.show();
+       pimpl_->mathpanel.controller().show();
 }
 
 
index d5852dbe5fa1439eb78c333de76aa12238bc3408..591682988a626b22a0808209a50e5ad635fddf6f 100644 (file)
 #include "ControlShowFile.h"
 #include "FormShowFile.h"
 
-#include "FormMathsBitmap.h"
-
+#include "ControlMath.h"
 #include "FormMathsPanel.h"
 #include "forms/form_maths_panel.h"
 
-#include "FormMathsDeco.h"
-#include "forms/form_maths_deco.h"
-
-#include "FormMathsDelim.h"
-#include "forms/form_maths_delim.h"
-
-#include "FormMathsMatrix.h"
-#include "forms/form_maths_matrix.h"
-
-#include "FormMathsSpace.h"
-#include "forms/form_maths_space.h"
-
-#include "FormMathsStyle.h"
-#include "forms/form_maths_style.h"
-
 #include "ControlMinipage.h"
 #include "FormMinipage.h"
 #include "forms/form_minipage.h"
@@ -225,7 +209,8 @@ IndexDialog;
 typedef GUI<ControlLog, FormLog, OkCancelPolicy, xformsBC>
 LogFileDialog;
 
-typedef FormMathsPanel MathPanelDialog;
+typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
+MathPanelDialog;
 
 typedef GUI<ControlMinipage, FormMinipage, NoRepeatedApplyReadOnlyPolicy, xformsBC>
 MinipageDialog;
diff --git a/src/frontends/xforms/FeedbackController.C b/src/frontends/xforms/FeedbackController.C
deleted file mode 100644 (file)
index 2060264..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- * \file FeedbackController.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming
- *
- * Full author contact details are available in file CREDITS
- */
-
-/* A common interface for posting feedback messages to a message widget in
- * xforms.
- * Derive FormBase and FormBaseDeprecated from it, so daughter classes of
- * either can use the same interface.
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "FeedbackController.h"
-#include "gettext.h"        // _()
-#include "xforms_helpers.h" // formatted
-#include "support/LAssert.h"
-
-#include "BoostFormat.h"
-
-#include FORMS_H_LOCATION
-
-FeedbackController::FeedbackController()
-       : warning_posted_(false), message_widget_(0)
-{}
-
-
-FeedbackController::~FeedbackController()
-{}
-
-
-void FeedbackController::setMessageWidget(FL_OBJECT * ob)
-{
-       lyx::Assert(ob && ob->objclass == FL_TEXT);
-       message_widget_ = ob;
-       fl_set_object_lsize(message_widget_, FL_NORMAL_SIZE);
-}
-
-
-// preemptive handler for feedback messages
-void FeedbackController::MessageCB(FL_OBJECT * ob, int event)
-{
-       lyx::Assert(ob);
-
-       switch (event) {
-       case FL_ENTER:
-       {
-               string const feedback = getFeedback(ob);
-               if (feedback.empty() && warning_posted_)
-                       break;
-
-               warning_posted_ = false;
-               postMessage(getFeedback(ob));
-               break;
-       }
-
-       case FL_LEAVE:
-               if (!warning_posted_)
-                       clearMessage();
-               break;
-
-       default:
-               break;
-       }
-}
-
-#if FL_VERSION > 0 || FL_REVISION >= 89
-extern "C" {
-
-void fl_show_tooltip(const char *, int, int);
-
-void fl_hide_tooltip();
-
-}
-#endif
-
-void FeedbackController::PrehandlerCB(FL_OBJECT * ob, int event, int key)
-{
-       lyx::Assert(ob);
-
-       if (ob->objclass == FL_INPUT && event == FL_PUSH && key == 2) {
-               // Trigger an input event when pasting in an xforms input object
-               // using the middle mouse button.
-               InputCB(ob, 0);
-               return;
-       }
-
-
-       if (event != FL_ENTER && event != FL_LEAVE)
-               return;
-
-       if (ob->objclass == FL_TABFOLDER) {
-               // This prehandler is used to work-around an xforms bug and
-               // ensures that the form->x, form->y coords of the active
-               // tabfolder are up to date.
-
-               // The tabfolder itself can be very narrow, being just
-               // the visible border to the tabs.
-               // We thus use both FL_ENTER and FL_LEAVE as flags,
-               // in case the FL_ENTER event is not caught.
-
-               FL_FORM * const folder = fl_get_active_folder(ob);
-               if (folder && folder->window) {
-                       fl_get_winorigin(folder->window,
-                                        &(folder->x), &(folder->y));
-               }
-
-       }
-
-       if (message_widget_) {
-               // Post feedback as the mouse enters the object,
-               // remove it as the mouse leaves.
-               MessageCB(ob, event);
-       }
-
-#if FL_VERSION > 0 || FL_REVISION >= 89
-       // Tooltips are not displayed on browser widgets due to an xforms' bug.
-       // This is a work-around:
-       if (ob->objclass == FL_BROWSER) {
-               if (event == FL_ENTER && ob->tooltip && *(ob->tooltip)) {
-                       fl_show_tooltip(ob->tooltip, ob->form->x + ob->x,
-                                       ob->form->y + ob->y + ob->h + 1);
-               } else if (event == FL_LEAVE) {
-                       fl_hide_tooltip();
-               }
-       }
-#endif
-}
-
-
-void FeedbackController::postWarning(string const & warning)
-{
-       warning_posted_ = true;
-       postMessage(warning);
-}
-
-
-void FeedbackController::clearMessage()
-{
-       lyx::Assert(message_widget_);
-
-       warning_posted_ = false;
-
-       string const existing = message_widget_->label
-               ? message_widget_->label : string();
-       if (existing.empty())
-               return;
-
-       // This trick is needed to get xforms to clear the label...
-       fl_set_object_label(message_widget_, "");
-       fl_hide_object(message_widget_);
-}
-
-
-void FeedbackController::postMessage(string const & message)
-{
-       lyx::Assert(message_widget_);
-
-       int const width = message_widget_->w - 10;
-
-#if USE_BOOST_FORMAT
-       boost::format fmter = warning_posted_ ?
-               boost::format(_("WARNING! %1$s")) :
-               boost::format("%1$s");
-       fmter % message;
-
-       string const str = formatted(fmter.str(), width, FL_NORMAL_SIZE);
-#else
-       string const tmp = warning_posted_ ?
-               _("WARNING!") + string(" ") + message :
-               message;
-
-       string const str = formatted(tmp, width, FL_NORMAL_SIZE);
-#endif
-
-       fl_set_object_label(message_widget_, str.c_str());
-       FL_COLOR const label_color = warning_posted_ ? FL_RED : FL_LCOL;
-       fl_set_object_lcol(message_widget_, label_color);
-
-       if (!message_widget_->visible)
-               fl_show_object(message_widget_);
-}
diff --git a/src/frontends/xforms/FeedbackController.h b/src/frontends/xforms/FeedbackController.h
deleted file mode 100644 (file)
index 8d512a2..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- C++ -*-
-/**
- * \file FeedbackController.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming 
- *
- * Full author contact details are available in file CREDITS
- **/
-
-/* A common interface for posting feedback messages to a message widget in
- * xforms.
- * Derive FormBase and FormBaseDeprecated from it, so daughter classes of
- * either can interface tooltips in the same way.
- */
-
-#ifndef FEEDBACKCONTROLLER_H
-#define FEEDBACKCONTROLLER_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "forms_fwd.h"
-#include "LString.h"
-
-class FeedbackController
-{
-public:
-       ///
-       FeedbackController();
-       ///
-       virtual ~FeedbackController();
-
-       /** Input callback function, invoked only by the xforms callback
-           interface. Is defined by FormBase, FormBaseDeprecated. */
-       virtual void InputCB(FL_OBJECT *, long) = 0;
-
-       /** Message callback function, invoked only by the xforms callback
-           interface */
-       void MessageCB(FL_OBJECT *, int event);
-
-       /** Prehandler callback function, invoked only by the xforms callback
-           interface */
-       void PrehandlerCB(FL_OBJECT * ob, int event, int key);
-
-protected:
-       /** Pass the class a pointer to the message_widget so that it can
-           post the message */
-       void setMessageWidget(FL_OBJECT * message_widget);
-
-       /** Send the warning message from the daughter class to the
-           message_widget direct. The message will persist till the mouse
-           movesto a new object. */
-       void postWarning(string const & warning);
-       /// Reset the message_widget_
-       void clearMessage();
-
-private:
-       /** Get the feedback message for ob.
-           Called if warning_posted_ == false. */
-       virtual string const getFeedback(FL_OBJECT * /* ob */)
-               { return string(); }
-
-       /// Post the feedback message for ob to message_widget_
-       void postMessage(string const & message);
-
-       /** Variable used to decide whether to remove the existing feedback
-           message or not (if it is in fact a warning) */
-       bool warning_posted_;
-
-       /// The widget to display the feedback
-       FL_OBJECT * message_widget_;
-};
-
-#endif // FEEDBACKCONTROLLER_H
index 18b59ba0182de8e34c621d6957781ac100391cdb..f8f896a6eea2d4257c87f210e6d4bfd1ab33f6d1 100644 (file)
 #include "xformsBC.h"
 #include "xforms_resize.h"
 #include "Tooltips.h"
+#include "xforms_helpers.h" // formatted
+
+#include "gettext.h"        // _()
+#include "BoostFormat.h"
 
 #include "support/LAssert.h"
 #include "support/filetools.h" //  LibFileSearch
 extern "C" {
 
 #if FL_VERSION > 0 || FL_REVISION >= 89
-// This should be in forms.h but isn't
+
+// These should be in forms.h but aren't
+void fl_show_tooltip(const char *, int, int);
+
 void fl_hide_tooltip();
+
 #endif
 
 // Callback function invoked by xforms when the dialog is closed by the
-// window manager
+// window manager.
 static int C_WMHideCB(FL_FORM * form, void *);
 
-// Callback function invoked by the xforms pre- and post-handler routines
+// Callback function invoked by the xforms pre-handler routine.
 static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *);
 
 } // extern "C"
 
 
 FormBase::FormBase(string const & t, bool allowResize)
-       : ViewBase(), minw_(0), minh_(0), allow_resize_(allowResize),
+       : ViewBase(),
+         warning_posted_(false), message_widget_(0),
+         minw_(0), minh_(0), allow_resize_(allowResize),
          title_(t), icon_pixmap_(0), icon_mask_(0),
          tooltips_(new Tooltips())
 {}
@@ -184,6 +194,14 @@ void FormBase::setPrehandler(FL_OBJECT * ob)
 }
 
 
+void FormBase::setMessageWidget(FL_OBJECT * ob)
+{
+       lyx::Assert(ob && ob->objclass == FL_TEXT);
+       message_widget_ = ob;
+       fl_set_object_lsize(message_widget_, FL_NORMAL_SIZE);
+}
+
+
 void FormBase::InputCB(FL_OBJECT * ob, long data)
 {
        // It is possible to set the choice to 0 when using the
@@ -202,6 +220,141 @@ ButtonPolicy::SMInput FormBase::input(FL_OBJECT *, long)
 }
 
 
+// preemptive handler for feedback messages
+void FormBase::MessageCB(FL_OBJECT * ob, int event)
+{
+       lyx::Assert(ob);
+
+       switch (event) {
+       case FL_ENTER:
+       {
+               string const feedback = getFeedback(ob);
+               if (feedback.empty() && warning_posted_)
+                       break;
+
+               warning_posted_ = false;
+               postMessage(getFeedback(ob));
+               break;
+       }
+
+       case FL_LEAVE:
+               if (!warning_posted_)
+                       clearMessage();
+               break;
+
+       default:
+               break;
+       }
+}
+
+
+void FormBase::PrehandlerCB(FL_OBJECT * ob, int event, int key)
+{
+       lyx::Assert(ob);
+
+       if (ob->objclass == FL_INPUT && event == FL_PUSH && key == 2) {
+               // Trigger an input event when pasting in an xforms input object
+               // using the middle mouse button.
+               InputCB(ob, 0);
+               return;
+       }
+
+
+       if (event != FL_ENTER && event != FL_LEAVE)
+               return;
+
+       if (ob->objclass == FL_TABFOLDER) {
+               // This prehandler is used to work-around an xforms bug and
+               // ensures that the form->x, form->y coords of the active
+               // tabfolder are up to date.
+
+               // The tabfolder itself can be very narrow, being just
+               // the visible border to the tabs.
+               // We thus use both FL_ENTER and FL_LEAVE as flags,
+               // in case the FL_ENTER event is not caught.
+
+               FL_FORM * const folder = fl_get_active_folder(ob);
+               if (folder && folder->window) {
+                       fl_get_winorigin(folder->window,
+                                        &(folder->x), &(folder->y));
+               }
+
+       }
+
+       if (message_widget_) {
+               // Post feedback as the mouse enters the object,
+               // remove it as the mouse leaves.
+               MessageCB(ob, event);
+       }
+
+#if FL_VERSION > 0 || FL_REVISION >= 89
+       // Tooltips are not displayed on browser widgets due to an xforms' bug.
+       // This is a work-around:
+       if (ob->objclass == FL_BROWSER) {
+               if (event == FL_ENTER && ob->tooltip && *(ob->tooltip)) {
+                       fl_show_tooltip(ob->tooltip, ob->form->x + ob->x,
+                                       ob->form->y + ob->y + ob->h + 1);
+               } else if (event == FL_LEAVE) {
+                       fl_hide_tooltip();
+               }
+       }
+#endif
+}
+
+
+void FormBase::postWarning(string const & warning)
+{
+       warning_posted_ = true;
+       postMessage(warning);
+}
+
+
+void FormBase::clearMessage()
+{
+       lyx::Assert(message_widget_);
+
+       warning_posted_ = false;
+
+       string const existing = message_widget_->label
+               ? message_widget_->label : string();
+       if (existing.empty())
+               return;
+
+       // This trick is needed to get xforms to clear the label...
+       fl_set_object_label(message_widget_, "");
+       fl_hide_object(message_widget_);
+}
+
+
+void FormBase::postMessage(string const & message)
+{
+       lyx::Assert(message_widget_);
+
+#if USE_BOOST_FORMAT
+       boost::format fmter = warning_posted_ ?
+               boost::format(_("WARNING! %1$s")) :
+               boost::format("%1$s");
+
+       int const width = message_widget_->w - 10;
+       string const str = formatted(boost::io::str(fmter % message),
+                                    width, FL_NORMAL_SIZE);
+#else
+       string const tmp = warning_posted_ ?
+               _("WARNING!") + string(" ") + message :
+               message;
+
+       string const str = formatted(tmp, width, FL_NORMAL_SIZE);
+#endif
+
+       fl_set_object_label(message_widget_, str.c_str());
+       FL_COLOR const label_color = warning_posted_ ? FL_RED : FL_LCOL;
+       fl_set_object_lcol(message_widget_, label_color);
+
+       if (!message_widget_->visible)
+               fl_show_object(message_widget_);
+}
+
+
 namespace {
 
 FormBase * GetForm(FL_OBJECT * ob)
index a7bc62951f3ac10903082eeb284652e8479edf08..9fe1f6eba7ca55d915b4d30cc069c60de741bdfc 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "ViewBase.h"
 #include "ButtonPolicies.h"
-#include "FeedbackController.h"
 #include "forms_fwd.h"
 
 #include "LString.h"
@@ -34,7 +33,7 @@ class Tooltips;
 
 /** This class is an XForms GUI base class.
  */
-class FormBase : public ViewBase, public FeedbackController
+class FormBase : public ViewBase
 {
 public:
        ///
@@ -42,11 +41,22 @@ public:
        ///
        virtual ~FormBase();
 
-       /** input callback function. invoked only by the xforms callback
-        *  interface
+       /** Input callback function.
+        *  Invoked only by the xforms callback interface
         */
        void InputCB(FL_OBJECT *, long);
 
+       /** Message callback function.
+        *  Invoked only by the xforms callback interface
+        */
+       void MessageCB(FL_OBJECT *, int event);
+
+       /** Prehandler callback function.
+        *  Invoked only by the xforms callback interface
+        */
+       void PrehandlerCB(FL_OBJECT * ob, int event, int key);
+
+       ///
        Tooltips & tooltips();
 
 protected:
@@ -65,6 +75,17 @@ protected:
         */
        static void setPrehandler(FL_OBJECT * ob);
 
+       /** Pass the class a pointer to the message_widget so that it can
+           post the message */
+       void setMessageWidget(FL_OBJECT * message_widget);
+
+       /** Send the warning message from the daughter class to the
+           message_widget direct. The message will persist till the mouse
+           movesto a new object. */
+       void postWarning(string const & warning);
+       /// Reset the message_widget_
+       void clearMessage();
+
        ///
        xformsBC & bc();
 
@@ -84,6 +105,20 @@ private:
         */
        void prepare_to_show();
 
+       /** Get the feedback message for ob.
+           Called if warning_posted_ == false. */
+       virtual string const getFeedback(FL_OBJECT * /* ob */)
+               { return string(); }
+
+       /// Post the feedback message for ob to message_widget_
+       void postMessage(string const & message);
+
+       /** Variable used to decide whether to remove the existing feedback
+           message or not (if it is in fact a warning) */
+       bool warning_posted_;
+       /// The widget to display the feedback
+       FL_OBJECT * message_widget_;
+
        /// The dialog's minimum allowable dimensions.
        int minw_;
        ///
@@ -131,13 +166,15 @@ FL_FORM * FormDB<Dialog>::form() const
 template <class Controller, class Base>
 class FormCB: public Base
 {
-protected:
-       ///
-       FormCB(string const &, bool allowResize = true);
+public:
        /// The parent controller
        Controller & controller();
        ///
        Controller const & controller() const;
+
+protected:
+       ///
+       FormCB(string const &, bool allowResize = true);
 };
 
 
diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C
deleted file mode 100644 (file)
index 681e428..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-/**
- * \file FormBaseDeprecated.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming 
- *
- * Full author contact details are available in file CREDITS
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "Dialogs.h"
-#include "FormBaseDeprecated.h"
-#include "xformsBC.h"
-#include "xforms_resize.h"
-#include "Tooltips.h"
-#include FORMS_H_LOCATION
-
-#include "lyxrc.h"
-
-#include "frontends/LyXView.h"
-
-#include "support/LAssert.h"
-#include "support/filetools.h" //  LibFileSearch
-
-#include <boost/bind.hpp>
-
-extern "C" {
-
-#if FL_VERSION > 0 || FL_REVISION >= 89
-// This should be in forms.h but isn't
-void fl_hide_tooltip();
-#endif
-
-// Callback function invoked by xforms when the dialog is closed by the
-// window manager
-static int C_WMHideCB(FL_FORM *, void *);
-
-// Callback function invoked by the xforms pre- and post-handler routines
-static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *);
-
-} // extern "C"
-
-
-FormBaseDeprecated::FormBaseDeprecated(LyXView & lv, Dialogs & d,
-                                      string const & t, bool allowResize)
-       : lv_(lv), d_(d), title_(t), icon_pixmap_(0), icon_mask_(0),
-         minw_(0), minh_(0), allow_resize_(allowResize),
-         tooltips_(new Tooltips())
-{}
-
-
-FormBaseDeprecated::~FormBaseDeprecated()
-{
-       if (icon_pixmap_)
-               XFreePixmap(fl_get_display(), icon_pixmap_);
-
-       delete tooltips_;
-}
-
-
-Tooltips & FormBaseDeprecated::tooltips()
-{
-       return *tooltips_;
-}
-
-
-void FormBaseDeprecated::redraw()
-{
-       if (form() && form()->visible)
-               fl_redraw_form(form());
-}
-
-
-void FormBaseDeprecated::connect()
-{
-       fl_set_form_minsize(form(), minw_, minh_);
-       r_ = d_.redrawGUI().connect(boost::bind(&FormBaseDeprecated::redraw, this));
-}
-
-
-void FormBaseDeprecated::disconnect()
-{
-       h_.disconnect();
-       r_.disconnect();
-}
-
-
-void FormBaseDeprecated::prepare_to_show()
-{
-       build();
-
-       double const scale = get_scale_to_fit(form());
-       if (scale > 1.001)
-               scale_form_horizontally(form(), scale);
-
-       bc().refresh();
-
-       // work around dumb xforms sizing bug
-       minw_ = form()->w;
-       minh_ = form()->h;
-
-       fl_set_form_atclose(form(), C_WMHideCB, 0);
-
-       // set the title for the minimized form
-       if (!lyxrc.dialogs_iconify_with_main)
-               fl_winicontitle(form()->window, title_.c_str());
-
-       //  assign an icon to the form
-       string const iconname = LibFileSearch("images", "lyx", "xpm");
-       if (!iconname.empty()) {
-               unsigned int w, h;
-               icon_pixmap_ = fl_read_pixmapfile(fl_root,
-                                                 iconname.c_str(),
-                                                 &w,
-                                                 &h,
-                                                 &icon_mask_,
-                                                 0, 0, 0);
-               fl_set_form_icon(form(), icon_pixmap_, icon_mask_);
-       }
-}
-
-
-void FormBaseDeprecated::show()
-{
-       if (!form()) {
-               prepare_to_show();
-       }
-
-       // make sure the form is up to date.
-       fl_freeze_form(form());
-       update();
-       fl_unfreeze_form(form());
-
-       if (form()->visible) {
-               fl_raise_form(form());
-               /* This XMapWindow() will hopefully ensure that
-                * iconified dialogs are de-iconified. Mad props
-                * out to those crazy Xlib guys for forgetting a
-                * XDeiconifyWindow(). At least WindowMaker, when
-                * being notified of the redirected MapRequest will
-                * specifically de-iconify. From source, fvwm2 seems
-                * to do the same.
-                */
-               XMapWindow(fl_get_display(), form()->window);
-       } else {
-               connect();
-
-               // calls to fl_set_form_minsize/maxsize apply only to the next
-               // fl_show_form(), so this comes first.
-               fl_set_form_minsize(form(), minw_, minh_);
-               if (!allow_resize_)
-                       fl_set_form_maxsize(form(), minw_, minh_);
-
-               string const maximize_title = "LyX: " + title_;
-               int const iconify_policy =
-                       lyxrc.dialogs_iconify_with_main ? FL_TRANSIENT : 0;
-
-               fl_show_form(form(),
-                            FL_PLACE_MOUSE | FL_FREE_SIZE,
-                            iconify_policy,
-                            maximize_title.c_str());
-       }
-}
-
-
-void FormBaseDeprecated::hide()
-{
-#if FL_VERSION > 0 || FL_REVISION >= 89
-       // Does no harm if none is visible and ensures that the tooltip form
-       // is hidden should the dialog be closed from the keyboard.
-       fl_hide_tooltip();
-#endif
-
-       // xforms sometimes tries to process a hint-type MotionNotify, and
-       // use XQueryPointer, without verifying if the window still exists.
-       // So we try to clear out motion events in the queue before the
-       // DestroyNotify
-       XSync(fl_get_display(), false);
-
-       if (form() && form()->visible) {
-               // some dialogs might do things to the form first
-               // such as the nested tabfolder problem in Preferences
-               disconnect();
-               fl_hide_form(form());
-       }
-}
-
-
-void FormBaseDeprecated::setPrehandler(FL_OBJECT * ob)
-{
-       lyx::Assert(ob);
-       fl_set_object_prehandler(ob, C_PrehandlerCB);
-}
-
-
-void FormBaseDeprecated::WMHideCB()
-{
-       hide();
-       bc().hide();
-}
-
-
-void FormBaseDeprecated::ApplyCB()
-{
-       apply();
-       bc().apply();
-}
-
-
-void FormBaseDeprecated::OKCB()
-{
-       ok();
-       bc().ok();
-}
-
-
-void FormBaseDeprecated::CancelCB()
-{
-       cancel();
-       bc().cancel();
-}
-
-
-void FormBaseDeprecated::InputCB(FL_OBJECT * ob, long data)
-{
-       // It is possible to set the choice to 0 when using the
-       // keyboard shortcuts. This work-around deals with the problem.
-       if (ob && ob->objclass == FL_CHOICE && fl_get_choice(ob) < 1) {
-               fl_set_choice(ob, 1);
-       }
-
-       bc().valid(input(ob, data));
-}
-
-
-void FormBaseDeprecated::RestoreCB()
-{
-       bc().restore();
-       restore();
-}
-
-
-FormBaseBI::FormBaseBI(LyXView & lv, Dialogs & d, string const & t,
-                      bool allowResize)
-       : FormBaseDeprecated(lv, d, t, allowResize)
-{}
-
-
-void FormBaseBI::connect()
-{
-       h_ = d_.hideAll.connect(boost::bind(&FormBaseBI::hide, this));
-       FormBaseDeprecated::connect();
-}
-
-
-FormBaseBD::FormBaseBD(LyXView & lv, Dialogs & d, string const & t,
-                      bool allowResize)
-       : FormBaseDeprecated(lv, d, t, allowResize)
-{}
-
-
-void FormBaseBD::connect()
-{
-       u_ = d_.updateBufferDependent.
-               connect(boost::bind(&FormBaseBD::updateSlot, this, _1));
-       h_ = d_.hideBufferDependent.
-               connect(boost::bind(&FormBaseBD::hide, this));
-       FormBaseDeprecated::connect();
-}
-
-
-void FormBaseBD::disconnect()
-{
-       u_.disconnect();
-       FormBaseDeprecated::disconnect();
-}
-
-
-namespace {
-
-FormBaseDeprecated * GetForm(FL_OBJECT * ob)
-{
-       lyx::Assert(ob && ob->form && ob->form->u_vdata);
-       FormBaseDeprecated * ptr =
-               static_cast<FormBaseDeprecated *>(ob->form->u_vdata);
-       return ptr;
-}
-
-} // namespace anon
-
-
-extern "C" {
-
-void C_FormBaseDeprecatedApplyCB(FL_OBJECT * ob, long)
-{
-       GetForm(ob)->ApplyCB();
-}
-
-
-void C_FormBaseDeprecatedOKCB(FL_OBJECT * ob, long)
-{
-       GetForm(ob)->OKCB();
-}
-
-
-void C_FormBaseDeprecatedCancelCB(FL_OBJECT * ob, long)
-{
-       GetForm(ob)->CancelCB();
-}
-
-
-void C_FormBaseDeprecatedInputCB(FL_OBJECT * ob, long d)
-{
-       GetForm(ob)->InputCB(ob, d);
-}
-
-
-void C_FormBaseDeprecatedRestoreCB(FL_OBJECT * ob, long)
-{
-       GetForm(ob)->RestoreCB();
-}
-
-static int C_WMHideCB(FL_FORM * form, void *)
-{
-       // Close the dialog cleanly, even if the WM is used to do so.
-       lyx::Assert(form && form->u_vdata);
-       FormBaseDeprecated * ptr =
-               static_cast<FormBaseDeprecated *>(form->u_vdata);
-       ptr->WMHideCB();
-       return FL_CANCEL;
-}
-
-static int C_PrehandlerCB(FL_OBJECT * ob, int event,
-                         FL_Coord, FL_Coord, int key, void *)
-{
-       // Note that the return value is important in the pre-emptive handler.
-       // Don't return anything other than 0.
-       lyx::Assert(ob);
-
-       // Don't Assert this one, as it can happen quite naturally when things
-       // are being deleted in the d-tor.
-       //Assert(ob->form);
-       if (!ob->form) return 0;
-
-       FormBaseDeprecated * ptr =
-               static_cast<FormBaseDeprecated *>(ob->form->u_vdata);
-
-       if (ptr)
-               ptr->PrehandlerCB(ob, event, key);
-
-       return 0;
-}
-
-} // extern "C"
diff --git a/src/frontends/xforms/FormBaseDeprecated.h b/src/frontends/xforms/FormBaseDeprecated.h
deleted file mode 100644 (file)
index a1cb301..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-// -*- C++ -*-
-/**
- * \file FormBaseDeprecated.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming 
- *
- * Full author contact details are available in file CREDITS
- */
-
-/* A base class for those remaining xforms dialogs that haven't yet undergone
- * the controller-view split.
- * It is meant to be used solely as the parent class to FormBaseBI
- * and FormBaseBD.
- */
-
-#ifndef FORMBASEDEPRECATED_H
-#define FORMBASEDEPRECATED_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "xformsBC.h"
-#include "FeedbackController.h"
-#include "forms_fwd.h"
-
-#include "LString.h"
-#include <boost/utility.hpp>
-#include <boost/signals/connection.hpp>
-#include <X11/Xlib.h> // for Pixmap
-
-class Buffer;
-class Dialogs;
-class LyXView;
-class Tooltips;
-
-class FormBaseDeprecated : boost::noncopyable, public FeedbackController
-{
-public:
-       ///
-       FormBaseDeprecated(LyXView &, Dialogs &, string const &, bool);
-       ///
-       virtual ~FormBaseDeprecated();
-
-       /// Callback functions
-       void WMHideCB();
-       ///
-       void ApplyCB();
-       ///
-       void OKCB();
-       ///
-       void CancelCB();
-       ///
-       void InputCB(FL_OBJECT *, long);
-       ///
-       void RestoreCB();
-
-       Tooltips & tooltips();
-
-       /// Create the dialog if necessary, update it and display it.
-       virtual void show();
-       /// Hide the dialog.
-       virtual void hide();
-
-protected: // methods
-
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc() = 0;
-
-       /** Redraw the form (on receipt of a Signal indicating, for example,
-        *  that the xform colors have been re-mapped).
-        *  Must be virtual because dialogs with tabbed folders will need to
-        *  redraw the form for each tab.
-        */
-       virtual void redraw();
-
-       /// Update the dialog.
-       virtual void update() {}
-       /// Connect signals. Also perform any necessary initialisation.
-       virtual void connect();
-       /// Disconnect signals. Also perform any necessary housekeeping.
-       virtual void disconnect();
-       /// Build the dialog
-       virtual void build() = 0;
-       /** Filter the inputs on callback from xforms
-        *  Return true if inputs are valid.
-        */
-       virtual bool input(FL_OBJECT *, long) {
-               return true;
-       }
-       /// Apply from dialog (modify or create inset)
-       virtual void apply() {}
-       /// OK from dialog
-       virtual void ok() {
-               apply();
-               hide();
-       }
-       /// Cancel from dialog
-       virtual void cancel() {
-               hide();
-       }
-       /// Restore from dialog
-       virtual void restore() {
-               update();
-       }
-       /// Pointer to the actual instantiation of xform's form
-       virtual FL_FORM * form() const = 0;
-
-       /** Prepare the way to:
-        *  1. display feedback as the mouse moves over ob. This feedback will
-        *  typically be rather more verbose than just a tooltip.
-        *  2. activate the button controller after a paste with the middle
-        *  mouse button.
-        */
-       static void setPrehandler(FL_OBJECT * ob);
-
-       /** Which LyXFunc do we use?
-        *  We could modify Dialogs to have a visible LyXFunc* instead and
-        *  save a couple of bytes per dialog.
-        */
-       LyXView & lv_;
-       /// Used so we can get at the signals we have to connect to.
-       Dialogs & d_;
-       /// Hide connection.
-       boost::signals::connection h_;
-       /// Redraw connection.
-       boost::signals::connection r_;
-       /// dialog title, displayed by WM.
-       string title_;
-
-private:
-       /** Called on the first show() request, initialising various bits and
-        *  pieces.
-        */
-       void prepare_to_show();
-
-       /// Passed to the window manager to give a pretty little symbol ;-)
-       Pixmap icon_pixmap_;
-       ///
-       Pixmap icon_mask_;
-       /// The dialog's minimum allowable dimensions.
-       int minw_;
-       ///
-       int minh_;
-       /// Can the dialog be resized after it has been created?
-       bool allow_resize_;
-       ///
-       Tooltips * tooltips_;
-};
-
-
-/** This class is an XForms GUI base class for Buffer Independent dialogs.
- *  Such dialogs do not require an update Connection although they may use
- *  an update() function which is also supported by restore().
- */
-class FormBaseBI : public FormBaseDeprecated {
-protected:
-       /// Constructor
-       FormBaseBI(LyXView &, Dialogs &, string const &,
-                  bool allowResize = true);
-
-       /// Connect signals
-       virtual void connect();
-};
-
-
-/** This class is an XForms GUI base class for Buffer Dependent dialogs
- */
-class FormBaseBD : public FormBaseDeprecated {
-protected:
-       /// Constructor
-       FormBaseBD(LyXView &, Dialogs &, string const &,
-                  bool allowResize = true);
-
-       /// Connect signals
-       virtual void connect();
-       /// Disconnect signals
-       virtual void disconnect();
-       /// bool indicates if a buffer switch took place
-       virtual void updateSlot(bool) { update(); }
-
-       /// Update connection.
-       boost::signals::connection u_;
-};
-
-
-#endif // FORMBASEDEPRECATED_H
index 518650e739c3ff8b4f9053ebf18a310d73d2a14a..9b0595c46eee0c8023202d811fde7449bbdd87d6 100644 (file)
 #endif
 
 #include "FormMathsBitmap.h"
+#include "ControlMath.h"
+#include "xformsBC.h"
+
 #include "bmtable.h"
-#include "debug.h"
 #include "forms_gettext.h"
 #include "gettext.h"
 #include "support/LAssert.h"
 #include XPM_H_LOCATION
 
 #include <algorithm>
-#include <iomanip>
+
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
 using std::vector;
-using std::endl;
-using std::setw;
 using std::max;
 
-extern  "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long);
 
-FormMathsBitmap::FormMathsBitmap(LyXView & lv, Dialogs & d,
-                                FormMathsPanel const & p, string const & t,
-                                vector<string> const & l)
-       : FormMathsSub(lv, d, p, t, false),
+FD_maths_bitmap::~FD_maths_bitmap()
+{
+       if (form->visible) fl_hide_form(form);
+       fl_free_form(form);
+}
+
+
+typedef FormCB<ControlMathSub, FormDB<FD_maths_bitmap> > base_class;
+
+
+FormMathsBitmap::FormMathsBitmap(string const & t, vector<string> const & l)
+       : base_class(t, false),
          latex_(l), ww_(0), x_(0), y_(0), w_(0), h_(0)
 {
        ww_ = 2 * FL_abs(FL_BOUND_WIDTH);
@@ -48,62 +56,74 @@ FormMathsBitmap::FormMathsBitmap(LyXView & lv, Dialogs & d,
 }
 
 
-FormMathsBitmap::~FormMathsBitmap()
+void FormMathsBitmap::addBitmap(int nt, int nx, int ny, int bw, int bh,
+                               unsigned char const * data, bool vert)
 {
-       if (!form())
-               return;
-
-       if (form()->visible) fl_hide_form(form());
-       fl_free_form(form());
-}
+       bitmaps_.push_back(BitmapStore(nt, nx, ny, bw, bh, data, vert));
 
+       int wx = bw + ww_ / 2;
+       int wy = bh + ww_ / 2;
+       wx += (wx % nx);
+       wy += (wy % ny);
 
-FL_FORM * FormMathsBitmap::form() const
-{
-       return form_.get();
+       if (vert) {
+               y_ += wy + 8;
+               h_ = max(y_, h_);
+               w_ = max(x_ + wx + ww_, w_);
+       } else  {
+               x_ += wx + 8;
+               w_ = max(x_, w_);
+               h_ = max(y_ + wy + ww_, h_);
+       }
 }
-
 
 void FormMathsBitmap::build()
 {
        lyx::Assert(bitmaps_.size() > 0);
 
-       h_+= 50; // Allow room for a Close button
+       h_+= 42; // Allow room for a Close button
+
+       FD_maths_bitmap * fdui = new FD_maths_bitmap;
 
-       form_.reset(fl_bgn_form(FL_UP_BOX, w_, h_), fl_free_form);
-       form_->u_vdata = this;
+       fdui->form = fl_bgn_form(FL_UP_BOX, w_, h_);
+       fdui->form->u_vdata = this;
 
        fl_add_box(FL_UP_BOX, 0, 0, w_, h_, "");
 
+       x_ = 0;
        y_ = 0;
-       for (vector<bm_ptr>::const_iterator it = bitmaps_.begin();
+       int y_close = 0;
+       for (vector<BitmapStore>::const_iterator it = bitmaps_.begin();
             it < bitmaps_.end(); ++it) {
-               FL_OBJECT * obj = it->get();
+               FL_OBJECT * obj = buildBitmap(*it);
 
-               fl_add_object(form_.get(), obj);
                bc().addReadOnly(obj);
-
-               y_ = max(y_, obj->y + obj->h);
+               y_close = max(y_close, obj->y + obj->h);
        }
+       bitmaps_.clear();
 
        char const * const label = _("Close|^[");
-       x_ = (form_->w - 90) / 2;
-       y_ += 10;
+       x_ = (fdui->form->w - 90) / 2;
+       y_ = y_close + 10;
 
        FL_OBJECT * button_close =
                fl_add_button(FL_NORMAL_BUTTON, x_, y_, 90, 30, idex(_(label)));
        fl_set_button_shortcut(button_close, scex(_(label)), 1);
        fl_set_object_lsize(button_close, FL_NORMAL_SIZE);
-       fl_set_object_callback(button_close, C_FormBaseDeprecatedCancelCB, 0);
+       fl_set_object_callback(button_close, C_FormBaseCancelCB, 0);
 
        fl_end_form();
 
-       bc().setCancel(button_close);
+       fdui->form->fdui = fdui;
+
+       dialog_.reset(fdui);
+       bc().setCancel(dialog_->button_close);
 }
 
 
-void FormMathsBitmap::addBitmap(int nt, int nx, int ny, int bw, int bh,
-                               unsigned char const * data, bool vert)
+                       
+FL_OBJECT * FormMathsBitmap::buildBitmap(BitmapStore const & bmstore)
 {
        // Add a bitmap to a button panel: one bitmap per panel.
        // nt is the number of buttons and nx, ny the nr. of buttons
@@ -116,41 +136,43 @@ void FormMathsBitmap::addBitmap(int nt, int nx, int ny, int bw, int bh,
        //
        // The scaling of the bitmap on top of the buttons will be
        // correct if the nx, ny values are given correctly.
-       int wx = bw + ww_ / 2;
-       int wy = bh + ww_ / 2;
-       wx += (wx % nx);
-       wy += (wy % ny);
-       FL_OBJECT * obj = fl_create_bmtable(1, x_, y_, wx, wy, "");
+       int wx = bmstore.bw + ww_ / 2;
+       int wy = bmstore.bh + ww_ / 2;
+       wx += (wx % bmstore.nx);
+       wy += (wy % bmstore.ny);
+
+       FL_OBJECT * obj = fl_add_bmtable(1, x_, y_, wx, wy, "");
        fl_set_object_lcol(obj, FL_BLUE);
        fl_set_object_boxtype(obj, FL_UP_BOX);
-       fl_set_bmtable_data(obj, nx, ny, bw, bh, data);
-       fl_set_bmtable_maxitems(obj, nt);
-       fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+       fl_set_bmtable_data(obj, bmstore.nx, bmstore.ny, bmstore.bw, bmstore.bh,
+                           bmstore.data);
+       fl_set_bmtable_maxitems(obj, bmstore.nt);
+       fl_set_object_callback(obj, C_FormBaseInputCB, 0);
 
-       if (vert) {
+       if (bmstore.vert) {
                y_ += wy + 8;
-               h_ = max(y_, h_);
-               w_ = max(x_ + wx + ww_, w_);
        } else  {
                x_ += wx + 8;
-               w_ = max(x_, w_);
-               h_ = max(y_ + wy + ww_, h_);
        }
 
-       bitmaps_.push_back(bm_ptr(obj, fl_free_object));
+       return obj;
 }
 
 
-int FormMathsBitmap::GetIndex(FL_OBJECT * ob)
+int FormMathsBitmap::GetIndex(FL_OBJECT * ob_in)
 {
        int k = 0;
-       for (vector<bm_ptr>::const_iterator it = bitmaps_.begin();
-            it < bitmaps_.end(); ++it) {
-               if (it->get() == ob)
+
+       for (FL_OBJECT * ob = form()->first; ob; ob = ob->next) {
+               if (ob->objclass != FL_BMTABLE)
+                       continue;
+
+               if (ob == ob_in)
                        return k + fl_get_bmtable(ob);
                else
-                       k += fl_get_bmtable_maxitems(it->get());
+                       k += fl_get_bmtable_maxitems(ob);
        }
+
        return -1;
 }
 
@@ -159,22 +181,22 @@ void FormMathsBitmap::apply()
 {
        string::size_type const i = latex_chosen_.find(' ');
        if (i != string::npos) {
-               parent_.dispatchFunc(LFUN_MATH_MODE);
-               parent_.insertSymbol(latex_chosen_.substr(0,i));
-               parent_.insertSymbol(latex_chosen_.substr(i + 1), false);
+               controller().dispatchFunc(LFUN_MATH_MODE);
+               controller().insertSymbol(latex_chosen_.substr(0,i));
+               controller().insertSymbol(latex_chosen_.substr(i + 1), false);
        } else
-               parent_.insertSymbol(latex_chosen_);
+               controller().insertSymbol(latex_chosen_);
 }
 
 
-bool FormMathsBitmap::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormMathsBitmap::input(FL_OBJECT * ob, long)
 {
        int const i = GetIndex(ob);
 
        if (i < 0)
-               return false;
+               return ButtonPolicy::SMI_INVALID;
 
        latex_chosen_ = latex_[i];
        apply();
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }
index e6ff7ace90f66522d88a2cfea07a83a18fd8dea3..82f0e854220d0b618bfa723bc7e5acc209de1ba9 100644 (file)
 #ifndef FORM_MATHSBITMAP_H
 #define FORM_MATHSBITMAP_H
 
-#include "LString.h"
-#include "FormMathsPanel.h"
+#ifdef __GNUG__
+#pragma interface
+#endif
 
+#include "FormBase.h"
 #include <boost/shared_ptr.hpp>
-
 #include <vector>
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+struct BitmapStore 
+{
+       BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
+                   unsigned char const * data_in, bool vert_in)
+               : nt(nt_in), nx(nx_in), ny(ny_in), bw(bw_in), bh(bh_in),
+                 data(data_in), vert(vert_in)
+       {}
+
+       int nt;
+       int nx;
+       int ny;
+       int bw;
+       int bh;
+       unsigned char const * data;
+       bool vert;
+};
+
+
+struct FD_maths_bitmap 
+{
+       ~FD_maths_bitmap();
+       FL_FORM * form;
+       FL_OBJECT * button_close;
+};
+
 
 /**
  * This class provides an XForms implementation of a maths bitmap form.
  */
-class FormMathsBitmap : public FormMathsSub {
-       ///
-       friend class FormMathsPanel;
 
-public:
-       ///
-       typedef boost::shared_ptr<FL_OBJECT> bm_ptr;
-       ///
-       typedef boost::shared_ptr<FL_FORM> fl_ptr;
+class ControlMathSub;
 
+class FormMathsBitmap : public FormCB<ControlMathSub, FormDB<FD_maths_bitmap> >
+{
+public:
        ///
-       FormMathsBitmap(LyXView &, Dialogs & d, FormMathsPanel const &,
-                       string const &, std::vector<string> const &);
-       ///
-       ~FormMathsBitmap();
+       FormMathsBitmap(string const &, std::vector<string> const &);
        ///
        void addBitmap(int, int, int, int, int, unsigned char const *,
                       bool = true);
@@ -51,24 +67,27 @@ private:
        ///
        int GetIndex(FL_OBJECT *);
 
-       /// Build the dialog
-       virtual void build();
-       /// apply the data
+       ///
        virtual void apply();
-       /// input handler
-       bool input(FL_OBJECT *, long);
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       /// Not needed.
+       virtual void update() {}
 
-       /// Pointer to the actual instantiation of the xforms form
-       virtual FL_FORM * form() const;
+       ///
+       FL_OBJECT * buildBitmap(BitmapStore const & bmstore);
 
        /// The latex names associated with each symbol
        std::vector<string> latex_;
        /// The latex name chosen
        string latex_chosen_;
-       /// Real GUI implementation
-       fl_ptr form_;
-       /// The bitmap tables
-       std::vector<bm_ptr> bitmaps_;
+
+       /** Temporary store for bitmap data passed to addBitmap()
+        *  but before the FL_OBJECT is created in build().
+        */
+       std::vector<BitmapStore> bitmaps_;
 
        /// Border width
        int ww_;
index ec0c43a6fe49e0d8f2057819f2a4e24f0fa320fd..56e9a8f0c61db8a3ec92f1f46b7cabf3f91521f9 100644 (file)
 #include "ControlMath.h"
 #include "FormMathsDeco.h"
 #include "forms/form_maths_deco.h"
+#include "xformsBC.h"
+
 #include "bmtable.h"
 #include FORMS_H_LOCATION
 
 #include "deco.xbm"
 
 
-FormMathsDeco::FormMathsDeco(LyXView & lv, Dialogs & d,
-                            FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Decorations & Accents"), false)
-{}
-
+typedef FormCB<ControlMathSub, FormDB<FD_maths_deco> > base_class;
 
-FL_FORM * FormMathsDeco::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
+FormMathsDeco::FormMathsDeco()
+       : base_class(_("Maths Decorations & Accents"), false)
+{}
 
 
 void FormMathsDeco::build()
@@ -61,19 +56,19 @@ void FormMathsDeco::build()
 void FormMathsDeco::apply()
 {
        if (deco_ < nr_latex_deco)
-               parent_.insertSymbol(latex_deco[deco_]);
+               controller().insertSymbol(latex_deco[deco_]);
 }
 
 
-bool FormMathsDeco::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormMathsDeco::input(FL_OBJECT * ob, long)
 {
        deco_ = fl_get_bmtable(ob);
        if (deco_ < 0)
-               return false;
+               return ButtonPolicy::SMI_INVALID;
        //if (ob == dialog_->bmtable_deco1)
        //      deco_ += 0;
        if (ob == dialog_->bmtable_deco2)
                deco_ += 12;
        apply();
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }
index ac17572a5e9db60e27c49b91a055389aa01530c3..8584aede8df30fcf496fc2f2d47e98b6c1479d73 100644 (file)
 #pragma interface
 #endif
 
-#include "FormMathsPanel.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "FormBase.h"
 
+class ControlMathSub;
 struct FD_maths_deco;
 
 /**
  * This class provides an XForms implementation of the maths deco.
  */
-class FormMathsDeco : public FormMathsSub {
+class FormMathsDeco : public FormCB<ControlMathSub, FormDB<FD_maths_deco> > {
 public:
        ///
-       FormMathsDeco(LyXView &, Dialogs &, FormMathsPanel const &);
+       FormMathsDeco();
 
 private:
-       /// Build the dialog
-       virtual void build();
-       /// Apply from dialog (modify or create inset)
+       ///
        virtual void apply();
-       /// Input selection:
-       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_deco> dialog_;
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       /// Not needed.
+       virtual void update() {}
 
        /// Current choice
        int deco_;
-
 };
 
 #endif //  FORM_MATHSDECO_H
index 743dab08173c95155595122732aa510648b8bc15..2707032fa0f257d9a481c2b0ae74b6f829500826 100644 (file)
 
 #include "FormMathsDelim.h"
 #include "forms/form_maths_delim.h"
+#include "ControlMath.h"
+#include "xformsBC.h"
 
 #include "bmtable.h"
 
-#include "debug.h"
-#include "funcrequest.h"
-#include "lyxfunc.h"
-
-#include "frontends/LyXView.h"
-
 #include "support/lstrings.h"
 
 #include "Lsstream.h"
@@ -54,18 +50,12 @@ static char const * delim_values[] = {
 
 using std::endl;
 
-FormMathsDelim::FormMathsDelim(LyXView & lv, Dialogs & d,
-                              FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Delimiters"), false)
-{}
 
+typedef FormCB<ControlMathSub, FormDB<FD_maths_delim> > base_class;
 
-FL_FORM * FormMathsDelim::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
+FormMathsDelim::FormMathsDelim()
+       : base_class(_("Maths Delimiters"), false)
+{}
 
 
 void FormMathsDelim::build()
@@ -102,11 +92,17 @@ void FormMathsDelim::apply()
 
        ostringstream os;
        os << delim_values[left] << ' ' << delim_values[right];
-       parent_.dispatchFunc(LFUN_MATH_DELIM, STRCONV(os.str()));
+       controller().dispatchFunc(LFUN_MATH_DELIM, STRCONV(os.str()));
+}
+
+
+void FormMathsDelim::update()
+{
+       bc().valid();
 }
 
 
-bool FormMathsDelim::input(FL_OBJECT *, long)
+ButtonPolicy::SMInput FormMathsDelim::input(FL_OBJECT *, long)
 {
        int left = int(dialog_->radio_left->u_ldata);
        int right= int(dialog_->radio_right->u_ldata);
@@ -149,5 +145,5 @@ bool FormMathsDelim::input(FL_OBJECT *, long)
        dialog_->radio_left->u_ldata  = left;
        dialog_->radio_right->u_ldata = right;
 
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }
index 7289a2d84147be9da896bf898d1066c581f3c4d0..6ac0232a66ae9f37c0e53d5238558ba823941d8c 100644 (file)
 #pragma interface
 #endif
 
-#include "FormMathsPanel.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "FormBase.h"
 
+class ControlMathSub;
 struct FD_maths_delim;
 
 /**
  * This class provides an XForms implementation of the maths delim.
  */
-class FormMathsDelim : public FormMathsSub {
+class FormMathsDelim : public FormCB<ControlMathSub, FormDB<FD_maths_delim> > {
 public:
        ///
-       FormMathsDelim(LyXView &, Dialogs &, FormMathsPanel const &);
+       FormMathsDelim();
 
 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;
-
-       // Real GUI implementation
-       boost::scoped_ptr<FD_maths_delim> dialog_;
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       ///
+       virtual void update();
 };
 
 #endif //  FORM_MATHSDELIM_H
index 7d8f6996d02e1b898bf1eee7835283f238d53a12..2e1eda7ea2bee1f625e69ba36599b0bedd71385f 100644 (file)
 
 #include "FormMathsMatrix.h"
 #include "forms/form_maths_matrix.h"
-
-#include "funcrequest.h"
-#include "lyxfunc.h"
-
-#include "frontends/LyXView.h"
+#include "ControlMath.h"
+#include "xformsBC.h"
 
 #include "support/LAssert.h"
 #include "support/lyxalgo.h" // lyx::count
@@ -59,18 +56,11 @@ extern "C" {
 }
 
 
-FormMathsMatrix::FormMathsMatrix(LyXView & lv, Dialogs & d,
-                                FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Matrix"), false)
-{}
+typedef FormCB<ControlMathSub, FormDB<FD_maths_matrix> > base_class;
 
-
-FL_FORM * FormMathsMatrix::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
+FormMathsMatrix::FormMathsMatrix()
+       : base_class(_("Maths Matrix"), false)
+{}
 
 
 void FormMathsMatrix::build()
@@ -105,15 +95,20 @@ void FormMathsMatrix::apply()
 
        ostringstream os;
        os << nx << ' ' << ny << ' ' << c << ' ' << sh;
-       parent_.dispatchFunc(LFUN_INSERT_MATRIX, STRCONV(os.str()));
+       controller().dispatchFunc(LFUN_INSERT_MATRIX, STRCONV(os.str()));
 }
 
                              
+void FormMathsMatrix::update()
+{
+       bc().valid();
+}
+
 
-bool FormMathsMatrix::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormMathsMatrix::input(FL_OBJECT * ob, long)
 {
        if (ob == dialog_->choice_valign ||
-           ob == dialog_->slider_rows) return true;
+           ob == dialog_->slider_rows) return ButtonPolicy::SMI_VALID;
 
        int const nx = int(fl_get_slider_value(dialog_->slider_columns)+0.5);
        for (int i = 0; i < nx; ++i)
@@ -123,7 +118,7 @@ bool FormMathsMatrix::input(FL_OBJECT * ob, long)
 
        fl_set_input(dialog_->input_halign, h_align_str);
        fl_redraw_object(dialog_->input_halign);
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }
 
 
index c54a6d51bb9858a765b1e6fb4046b80fab160905..f08fe69087e466ad171fe5ea108a8cb20a846ed8 100644 (file)
 #pragma interface
 #endif
 
-#include "FormMathsPanel.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "FormBase.h"
 
+class ControlMathSub;
 struct FD_maths_matrix;
 
 /**
  * This class provides an XForms implementation of the maths matrix.
  */
-class FormMathsMatrix : public FormMathsSub {
+class FormMathsMatrix : public FormCB<ControlMathSub, FormDB<FD_maths_matrix> >
+{
 public:
-       FormMathsMatrix(LyXView &, Dialogs &, FormMathsPanel const &);
+       ///
+       FormMathsMatrix();
        ///
        int AlignFilter(char const *, int);
 
 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;
-
-       // Real GUI implementation
-       boost::scoped_ptr<FD_maths_matrix> dialog_;
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       ///
+       virtual void update();
 };
 
 #endif //  FORM_MATHSMATRIX_H
index 635f7a57dd2913b1d657fa9cd3f31d1bf2712d1b..9487348f9b3ae3e9d30b84851e2f726c26f2beaa 100644 (file)
 #endif
 
 #include "ControlMath.h"
-
-#include "frontends/LyXView.h"
 #include "FormMathsPanel.h"
 #include "forms/form_maths_panel.h"
-#include "funcrequest.h"
-
-#include "forms/form_maths_deco.h"
-#include "forms/form_maths_delim.h"
-#include "forms/form_maths_matrix.h"
-#include "forms/form_maths_space.h"
-#include "forms/form_maths_style.h"
+#include "xformsBC.h"
 
 #include "FormMathsBitmap.h"
 #include "FormMathsDeco.h"
 #include "FormMathsSpace.h"
 #include "FormMathsStyle.h"
 
+#include "forms/form_maths_deco.h"
+#include "forms/form_maths_delim.h"
+#include "forms/form_maths_matrix.h"
+#include "forms/form_maths_space.h"
+#include "forms/form_maths_style.h"
+
 #include FORMS_H_LOCATION
-#include <boost/bind.hpp>
 
 #include "deco.xpm"
 #include "delim.xpm"
 #include "ams_ops.xbm"
 
 
-FormMathsPanel::FormMathsPanel(LyXView & lv, Dialogs & d)
-       : FormBaseBD(lv, d, _("Maths Panel")),
-         active_(0), bc_(_("Close"))
-{}
+typedef FormCB<ControlMath, FormDB<FD_maths_panel> > base_class;
 
-
-FL_FORM * FormMathsPanel::form() const
-{
-       return dialog_.get() ? dialog_->form : 0;
-}
+FormMathsPanel::FormMathsPanel()
+       : base_class(_("Maths Panel"))
+{}
 
 
-FormMathsBitmap * FormMathsPanel::addDaughter(FL_OBJECT * button,
+FormMathsBitmap * FormMathsPanel::addDaughter(void * key,
                                              string const & title,
                                              char const * const * data,
                                              int size)
 {
-       char const * const * end = data + size;
-       FormMathsBitmap * bitmap =
-               new FormMathsBitmap(lv_, d_, *this, title,
-                                   std::vector<string>(data, end));
-       daughters_[button] = DaughterDialog(bitmap);
-       return bitmap;
+       char const * const * const end = data + size;
+       FormMathsBitmap * const view =
+               new FormMathsBitmap(title, std::vector<string>(data, end));
+
+       typedef ButtonController<IgnorantPolicy, xformsBC> BC;
+       BC * const bc = new BC;
+
+       controller().addDaughter(key, view, bc);
+       return view;
 }
 
 
@@ -121,16 +116,19 @@ void FormMathsPanel::build()
        fl_set_pixmap_data(dialog_->button_equation,
                           const_cast<char**>(equation));
 
-       daughters_[dialog_->button_deco] =
-               DaughterDialog(new FormMathsDeco(lv_, d_, *this));
-       daughters_[dialog_->button_delim] =
-               DaughterDialog(new FormMathsDelim(lv_, d_, *this));
-       daughters_[dialog_->button_matrix] =
-               DaughterDialog(new FormMathsMatrix(lv_, d_, *this));
-       daughters_[dialog_->button_space] =
-               DaughterDialog(new FormMathsSpace(lv_, d_, *this));
-       daughters_[dialog_->button_style] =
-               DaughterDialog(new FormMathsStyle(lv_, d_, *this));
+       typedef ButtonController<IgnorantPolicy, xformsBC> BC_ignorant;
+       typedef ButtonController<OkApplyCancelReadOnlyPolicy, xformsBC> BC_ok;
+
+       controller().addDaughter(dialog_->button_deco,
+                                new FormMathsDeco, new BC_ignorant);
+       controller().addDaughter(dialog_->button_delim,
+                                new FormMathsDelim, new BC_ok);
+       controller().addDaughter(dialog_->button_matrix,
+                                new FormMathsMatrix, new BC_ok);
+       controller().addDaughter(dialog_->button_space,
+                                new FormMathsSpace, new BC_ignorant);
+       controller().addDaughter(dialog_->button_style,
+                                new FormMathsStyle,  new BC_ignorant);
 
        FormMathsBitmap * bitmap;
        bitmap = addDaughter(dialog_->button_arrow, _("Arrows"),
@@ -198,24 +196,7 @@ void FormMathsPanel::build()
 }
 
 
-void FormMathsPanel::showDaughter(FL_OBJECT * button)
-{
-       Store::iterator it = daughters_.find(button);
-       FormMathsSub * const new_active =
-               (it == daughters_.end()) ? 0 : it->second.get();
-
-       if (active_ != new_active) {
-               if (active_ && active_->isVisible())
-                       active_->hide();
-               active_ = new_active;
-       }
-
-       if (active_ && !active_->isVisible())
-               active_->show();
-}
-
-
-bool FormMathsPanel::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormMathsPanel::input(FL_OBJECT * ob, long)
 {
        if (ob == dialog_->button_arrow ||
            ob == dialog_->button_boperator ||
@@ -234,59 +215,32 @@ bool FormMathsPanel::input(FL_OBJECT * ob, long)
            ob == dialog_->button_deco ||
            ob == dialog_->button_space ||
            ob == dialog_->button_style) {
-               showDaughter(ob);
+               controller().showDaughter(ob);
 
        } else if (ob == dialog_->button_super) {
-               dispatchFunc(LFUN_SUPERSCRIPT);
+               controller().dispatchFunc(LFUN_SUPERSCRIPT);
 
        } else if (ob == dialog_->button_sub) {
-               dispatchFunc(LFUN_SUBSCRIPT);
+               controller().dispatchFunc(LFUN_SUBSCRIPT);
 
 //     } else if (ob == dialog_->???) {
-//             dispatchFunc(LFUN_SUBSCRIPT);
-//             dispatchFunc(LFUN_LEFT);
-//             dispatchFunc(LFUN_SUPERSCRIPT);
+//             controller().dispatchFunc(LFUN_SUBSCRIPT);
+//             controller().dispatchFunc(LFUN_LEFT);
+//             controller().dispatchFunc(LFUN_SUPERSCRIPT);
 
        } else if (ob == dialog_->button_equation) {
-               dispatchFunc(LFUN_MATH_DISPLAY);
+               controller().dispatchFunc(LFUN_MATH_DISPLAY);
 
        } else if (ob == dialog_->button_frac) {
-               insertSymbol("frac");
+               controller().insertSymbol("frac");
 
        } else if (ob == dialog_->button_sqrt) {
-               insertSymbol("sqrt");
+               controller().insertSymbol("sqrt");
 
        } else if (ob == dialog_->browser_funcs) {
                int const i = fl_get_browser(dialog_->browser_funcs) - 1;
-               insertSymbol(function_names[i]);
+               controller().insertSymbol(function_names[i]);
        }
 
-       return true;
-}
-
-
-void FormMathsPanel::insertSymbol(string const & sym, bool bs) const
-{
-       if (bs)
-               lv_.dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + sym));
-       else
-               lv_.dispatch(FuncRequest(LFUN_INSERT_MATH, sym));
-}
-
-
-void FormMathsPanel::dispatchFunc(kb_action action, string const & arg) const
-{
-       lv_.dispatch(FuncRequest(action, arg));
-}
-
-
-FormMathsSub::FormMathsSub(LyXView & lv, Dialogs & d, FormMathsPanel const & p,
-                          string const & t, bool allowResize)
-       : FormBaseBD(lv, d, t, allowResize), parent_(p), bc_(_("Close"))
-{}
-
-
-bool FormMathsSub::isVisible() const
-{
-       return form() ? form()->visible : false;
+       return ButtonPolicy::SMI_VALID;
 }
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
index 19139bff1e843a66c2a2b0f61ce634f52bd71c5d..b22f11c2edf5c66581cbc5a8e94ea859e94f0814 100644 (file)
 
 #include "FormMathsSpace.h"
 #include "forms/form_maths_space.h"
+#include "ControlMath.h"
+#include "xformsBC.h"
+
 #include FORMS_H_LOCATION
 
 extern char * latex_mathspace[];
 
-FormMathsSpace::FormMathsSpace(LyXView & lv, Dialogs & d,
-                              FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Spacing"), false),
+typedef FormCB<ControlMathSub, FormDB<FD_maths_space> > base_class;
+
+FormMathsSpace::FormMathsSpace()
+       : base_class(_("Maths Spacing"), false),
          space_(-1)
 {}
 
 
-FL_FORM * FormMathsSpace::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
-
-
 void FormMathsSpace::build()
 {
        dialog_.reset(build_maths_space(this));
@@ -60,10 +56,10 @@ void FormMathsSpace::build()
 void FormMathsSpace::apply()
 {
        if (space_ >= 0)
-               parent_.insertSymbol(latex_mathspace[space_]);
+               controller().insertSymbol(latex_mathspace[space_]);
 }
 
-bool FormMathsSpace::input(FL_OBJECT *, long data)
+ButtonPolicy::SMInput FormMathsSpace::input(FL_OBJECT *, long data)
 {
        space_ = -1;
 
@@ -71,5 +67,5 @@ bool FormMathsSpace::input(FL_OBJECT *, long data)
                space_ = short(data);
                apply();
        }
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }
index b390cf3d6a5638233c71caa13b3006f15467f06b..e7a784576e7b10fcab0fac1e4184a85a23bfba64 100644 (file)
 #pragma interface
 #endif
 
-#include "FormMathsPanel.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "FormBase.h"
 
+class ControlMathSub;
 struct FD_maths_space;
 
 /**
  * This class provides an XForms implementation of the maths space.
  */
-class FormMathsSpace : public FormMathsSub {
+class FormMathsSpace : public FormCB<ControlMathSub, FormDB<FD_maths_space> > {
 public:
        ///
-       FormMathsSpace(LyXView &, Dialogs &, FormMathsPanel const &);
+       FormMathsSpace();
 
 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;
-
-       // Real GUI implementation
-       boost::scoped_ptr<FD_maths_space> dialog_;
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       /// Not needed.
+       virtual void update() {}
 
        /// The current choice.
        int space_;
index 31c87871d001d03cd60af3c0e97b3b4be67c86a6..0d784d23ef67f7e980bab03b9319738b93ae2200 100644 (file)
 
 #include "FormMathsStyle.h"
 #include "forms/form_maths_style.h"
-#include "bmtable.h"
+#include "ControlMath.h"
+#include "xformsBC.h"
 
-#include "debug.h"
+#include "bmtable.h"
 
 #include FORMS_H_LOCATION
 
@@ -39,22 +40,14 @@ kb_action latex_mathfontcmds[] = {
 };
 
 
+typedef FormCB<ControlMathSub, FormDB<FD_maths_style> > base_class;
 
-FormMathsStyle::FormMathsStyle(LyXView & lv, Dialogs & d,
-                              FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Styles & Fonts"), false),
+FormMathsStyle::FormMathsStyle()
+       : base_class(_("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(this));
@@ -86,21 +79,23 @@ void FormMathsStyle::build()
 void FormMathsStyle::apply()
 {
        if ((style_ >= 0) && (style_ < 4))
-               parent_.insertSymbol(latex_mathstyle[style_]);
+               controller().insertSymbol(latex_mathstyle[style_]);
        else if ((style_ >= 4) && (style_ < 14))
-               parent_.dispatchFunc(latex_mathfontcmds[style_ - 4]);
+               controller().dispatchFunc(latex_mathfontcmds[style_-4]);
 }
 
 
-bool FormMathsStyle::input(FL_OBJECT * ob, long data)
+ButtonPolicy::SMInput FormMathsStyle::input(FL_OBJECT * ob, long data)
 {
        style_ = fl_get_bmtable(ob);
-       if (style_ < 0) return false;
+       if (style_ < 0) return ButtonPolicy::SMI_INVALID;
+
        //if (ob == dialog_->bmtable_style1) style_ += 0;
        if (ob == dialog_->bmtable_style2) style_ += 1;
        if (ob == dialog_->bmtable_font1)  style_ += 4;
        if (ob == dialog_->bmtable_font2)  style_ += 9;
        if (data >= 12) style_ = short(data);
        apply();
-       return true;
+
+       return ButtonPolicy::SMI_VALID;
 }
index 20e4c955bc094df2c69edd9c1b516482fafe8dad..0c15347da41d93f939a98ecde7f96679b6292a0d 100644 (file)
 #pragma interface
 #endif
 
-#include "FormMathsPanel.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "FormBase.h"
 
+class ControlMathSub;
 struct FD_maths_style;
 
 /**
  * This class provides an XForms implementation of the maths style.
  */
-class FormMathsStyle : public FormMathsSub {
+class FormMathsStyle : public FormCB<ControlMathSub, FormDB<FD_maths_style> > {
 public:
        ///
-       FormMathsStyle(LyXView &, Dialogs &, FormMathsPanel const &);
+       FormMathsStyle();
 
 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;
-
-       // Real GUI implementation
-       boost::scoped_ptr<FD_maths_style> dialog_;
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       /// Not needed.
+       virtual void update() {}
 
        /// The current choice.
        int style_;
index 6ca9df76d4dca10592214239338efe9303da295c..57cbad72be30abc5578c8a73c833ab04668ec57e 100644 (file)
@@ -54,8 +54,6 @@ libxforms_la_SOURCES = \
        Dialogs_impl.h \
        DropDown.h \
        DropDown.C \
-       FeedbackController.C \
-       FeedbackController.h \
        FileDialog.C \
        FontInfo.C \
        FontInfo.h \
@@ -65,8 +63,6 @@ libxforms_la_SOURCES = \
        FormAboutlyx.h \
        FormBase.C \
        FormBase.h \
-       FormBaseDeprecated.C \
-       FormBaseDeprecated.h \
        FormBibitem.C \
        FormBibitem.h \
        FormBibtex.C \
index b26e7b229e36041b38764dd0b741420379805b91..9b26f613ec3c32834a916431e33e6f76656ac924 100644 (file)
@@ -46,7 +46,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable_deco1
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -64,7 +64,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -82,7 +82,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable_deco2
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 ==============================
index d543119de7679a0cf9bf6afc58a9052d89cf04d0..c70e672e9eb0ca54d442bf89ba43aca792c14425 100644 (file)
@@ -46,7 +46,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -64,7 +64,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -82,7 +82,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_pix
-callback: C_FormBaseDeprecatedApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -100,7 +100,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_apply
-callback: C_FormBaseDeprecatedApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -118,7 +118,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ok
-callback: C_FormBaseDeprecatedOKCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
index 401fc84bebca13d60a020de644b8e2278c41a3fc..55da21b3c126958b1a0aa5c1240714205a7137a6 100644 (file)
@@ -46,7 +46,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: slider_rows
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
        bounds: 1 20
        precision: 0
@@ -67,7 +67,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: slider_columns
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
        bounds: 1 20
        precision: 0
@@ -88,7 +88,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: choice_valign
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -106,7 +106,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_halign
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -124,7 +124,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ok
-callback: C_FormBaseDeprecatedOKCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -142,7 +142,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_apply
-callback: C_FormBaseDeprecatedApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -160,7 +160,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 ==============================
index 27b81926fc77d614661897b0ffa5e51accc52850..baac9816d1c03bbb0bbee5dd00978a7fe58b4991 100644 (file)
@@ -46,7 +46,7 @@ shortcut: ^M
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -64,7 +64,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_SouthEast
 name: browser_funcs
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
   h_pref: FL_OFF
 
@@ -83,7 +83,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_greek
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -101,7 +101,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_arrow
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -119,7 +119,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_boperator
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -137,7 +137,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_brelats
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -155,7 +155,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_misc
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -173,7 +173,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_equation
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -191,7 +191,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_sqrt
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -209,7 +209,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_frac
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -227,7 +227,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_delim
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -245,7 +245,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_matrix
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -263,7 +263,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_deco
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -281,7 +281,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_space
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -299,7 +299,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_dots
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -317,7 +317,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_varsize
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -335,7 +335,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_sub
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -353,7 +353,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_super
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -371,7 +371,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_style
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -389,7 +389,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ams_arrows
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -407,7 +407,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ams_brel
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -425,7 +425,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ams_nrel
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -443,7 +443,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ams_ops
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 --------------------
@@ -461,7 +461,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ams_misc
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 
 
 ==============================
index aebd6f7d254530d8f6125381e018b5e898fc3f4a..095de3709632a34a737b31122d9afe5a823bf41d 100644 (file)
@@ -64,7 +64,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_negative
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -82,7 +82,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_negmedspace
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 1
 
 --------------------
@@ -100,7 +100,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_negthickspace
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 2
 
 --------------------
@@ -118,7 +118,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_thick
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 5
 
 --------------------
@@ -136,7 +136,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_twoquadratin
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 7
 
 --------------------
@@ -172,7 +172,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -190,7 +190,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_quadratin
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 6
 
 --------------------
@@ -208,7 +208,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_thin
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 3
 
 --------------------
@@ -226,7 +226,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_medium
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 4
 
 ==============================
index 7262178d854088f137df2dc9209b6305422d0143..c47a63a6121ddd7d36e5ba361445b5565434917b 100644 (file)
@@ -46,7 +46,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable_font2
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -64,7 +64,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable_style1
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -82,7 +82,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -100,7 +100,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable_style2
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -118,7 +118,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: bmtable_font1
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -136,7 +136,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_reset
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 13
 
 --------------------
@@ -154,7 +154,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_textrm
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
 argument: 12
 
 ==============================