]> git.lyx.org Git - features.git/commitdiff
Controller-view split for Ref popup.
authorAngus Leeming <leeming@lyx.org>
Mon, 26 Mar 2001 13:16:57 +0000 (13:16 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 26 Mar 2001 13:16:57 +0000 (13:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1826 a592a061-630c-0410-9148-cb99ea01b6c8

17 files changed:
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlConnections.C
src/frontends/controllers/ControlConnections.h
src/frontends/controllers/ControlRef.C [new file with mode: 0644]
src/frontends/controllers/ControlRef.h [new file with mode: 0644]
src/frontends/controllers/ControlUrl.h
src/frontends/controllers/GUI.h
src/frontends/controllers/Makefile.am
src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormRef.h
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormUrl.h
src/frontends/xforms/form_ref.C
src/frontends/xforms/form_ref.h
src/frontends/xforms/forms/form_ref.fd

index aac6150072eb13c2c6150a42631aef8be5e99d73..94ffd17afc674ae52554396e80e95d493dcbb9a5 100644 (file)
@@ -1,3 +1,13 @@
+2001-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * ControlConnections.[Ch]: (docType): new method; returns the type
+       of the buffer, LaTeX, Literate, LinuxDoc or DocBook.
+
+       * ControlRef.[Ch]: new files; controller for the Ref popup.
+
+       * GUI.h:
+       * Makefile.am: associated changes.
+
 2001-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * ControlCitation.C (getBibkeyInfo): get nasty and assert the info map
@@ -51,7 +61,7 @@
 2001-03-22  Lars Gullik Bjønnes  <larsbj@trylle.birdstep.com>
 
        * ControlCredits.C: remove using that is only used once, use
-       std::ios instead of std::iosbase, add som annoying comments.
+       std::ios instead of std::iosbase, add some annoying comments.
 
 2001-03-22  Angus Leeming  <a.leeming@ic.ac.uk>
 
index 050a00d9c85f85b24519c7afdca47ac4afc618ca..2446320a757de213b31d19beef3a1dc70dd0f35a 100644 (file)
@@ -58,6 +58,22 @@ bool ControlConnectBase::isReadonly() const
 }
 
 
+ControlConnectBase::DocTypes ControlConnectBase::docType() const
+{
+       if (!lv_.buffer())
+               return LATEX;
+
+       if (lv_.buffer()->isLatex())
+               return LATEX;
+       else if (lv_.buffer()->isLiterate())
+               return LITERATE;
+       else if (lv_.buffer()->isLinuxDoc())
+               return LINUXDOC;
+       /* else if (lv_.buffer()->isDocBook()) */
+               return DOCBOOK;
+}
+
+
 ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d)
         : ControlConnectBase(lv, d)
 {}
index ff8a805a09c1ac560570e62749e112e85daf1c67..f3401af66c1d21e47d07ae2892536c482c13fa52 100644 (file)
@@ -46,10 +46,23 @@ class LyXView;
 class ControlConnectBase : public ControlBase
 {
 public:
+       ///
+       enum DocTypes {
+               ///
+               LATEX,
+               ///
+               LITERATE,
+               ///
+               LINUXDOC,
+               ///
+               DOCBOOK
+       };
        ///
        ControlConnectBase(LyXView &, Dialogs &);
        /// The View may need to know if the buffer is read-only.
        bool isReadonly() const;
+       /// 
+       DocTypes docType() const;
 
 protected:
        /// True if the dialog depends on the buffer, else false.
diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C
new file mode 100644 (file)
index 0000000..6b8b854
--- /dev/null
@@ -0,0 +1,54 @@
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2001 The LyX Team.
+ *
+ * ======================================================
+ *
+ * \file ControlRef.C
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
+ */
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "Dialogs.h"
+#include "ControlRef.h"
+#include "Dialogs.h"
+#include "LyXView.h"
+#include "buffer.h"
+#include "lyxfunc.h"
+
+using SigC::slot;
+
+ControlRef::ControlRef(LyXView & lv, Dialogs & d)
+       : ControlCommand(lv, d, LFUN_REF_INSERT)
+{
+       d_.showRef.connect(slot(this, &ControlRef::showInset));
+       d_.createRef.connect(slot(this, &ControlRef::createInset));
+}
+
+
+std::vector<string> const ControlRef::getLabelList() const
+{
+       return lv_.buffer()->getLabelList();
+}
+
+
+void ControlRef::gotoRef(string const & ref) const
+{
+       lv_.getLyXFunc()->Dispatch(LFUN_BOOKMARK_SAVE, "0");
+       lv_.getLyXFunc()->Dispatch(LFUN_REF_GOTO, ref);
+}
+
+
+void ControlRef::gotoBookmark() const
+{
+       lv_.getLyXFunc()->Dispatch(LFUN_BOOKMARK_GOTO, "0");
+}
+
diff --git a/src/frontends/controllers/ControlRef.h b/src/frontends/controllers/ControlRef.h
new file mode 100644 (file)
index 0000000..0a125fb
--- /dev/null
@@ -0,0 +1,42 @@
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2001 The LyX Team.
+ *
+ * ======================================================
+ *
+ * \file ControlRef.h
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
+ */
+
+#ifndef CONTROLREF_H
+#define CONTROLREF_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "ControlCommand.h"
+
+/** A controller for the Ref Dialog.
+ */
+class ControlRef : public ControlCommand {
+public:
+       ///
+       ControlRef(LyXView &, Dialogs &);
+
+       ///
+       std::vector<string> const getLabelList() const;
+       ///
+       void gotoRef(string const &) const;
+       ///
+       void gotoBookmark() const;
+
+private:
+       /// not needed.
+       virtual void clearDaughterParams() {}
+};
+
+#endif // CONTROLREF_H
index de6eebc67a8a885e54d966fe15be6991422c79eb..6041f021dec3b1d2fbff3688341003fb689fda33 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "ControlCommand.h"
 
-/** This class provides an XForms implementation of the FormUrl Dialog.
+/** A controller for the Url Dialog.
  */
 class ControlUrl : public ControlCommand 
 {
index 5e966a7a9a9e88bab3dafdac9407b2eb5c378a56..10ef6529bf62ad96e879ec5ef7e6c571ad826de4 100644 (file)
@@ -151,6 +151,20 @@ public:
 };
 
 
+/** Specialization for Ref dialog
+ */
+class ControlRef;
+
+template <class GUIview, class GUIbc>
+class GUIRef :
+       public GUI<ControlRef, GUIview, NoRepeatedApplyPolicy, GUIbc> {
+public:
+       ///
+       GUIRef(LyXView & lv, Dialogs & d)
+               : GUI<ControlRef, GUIview, NoRepeatedApplyPolicy, GUIbc>(lv, d) {}
+};
+
+
 /** Specialization for Url dialog
  */
 class ControlUrl;
index 4fe9c841ba1da27ba5b13f461a1659e66a144cfc..853a71c3c60e5987633c18d566f19c5d0fdd4e54 100644 (file)
@@ -40,6 +40,8 @@ libcontrollers_la_SOURCES=\
        ControlInset.h \
        ControlLog.C \
        ControlLog.h \
+       ControlRef.C \
+       ControlRef.h \
        ControlUrl.C \
        ControlUrl.h \
        ControlVCLog.C \
index 9d5a69da4bf23983264876b422139cc21003ac2c..9947e2d20d9869fe2abd79811a0f20dd09b55586 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * FormRef.[Ch]:
+       * forms/form_ref.fd: implemented controller-view split.
+
 2001-03-23  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * FormError.[Ch]:
index b6a691f9966db16d79e65e8dc886fbb3545ed49b..b8b0cc80f4e63bd6b15ba4f3bebb6dd853efab10 100644 (file)
@@ -29,6 +29,7 @@
 #include "ControlInclude.h"
 #include "ControlLog.h"
 #include "ControlUrl.h"
+#include "ControlRef.h"
 #include "ControlVCLog.h"
 
 #include "GUI.h"
@@ -43,6 +44,7 @@
 #include "form_credits.h"
 #include "form_error.h"
 #include "form_include.h"
+#include "form_ref.h"
 #include "form_url.h"
 
 #include "FormBibitem.h"
@@ -54,6 +56,7 @@
 #include "FormError.h"
 #include "FormInclude.h"
 #include "FormLog.h"
+#include "FormRef.h"
 #include "FormUrl.h"
 #include "FormVCLog.h"
 
@@ -66,7 +69,6 @@
 #include "FormPreamble.h"
 #include "FormPreferences.h"
 #include "FormPrint.h"
-#include "FormRef.h"
 #include "FormSearch.h"
 #include "FormSplash.h"
 #include "FormTabular.h"
@@ -91,6 +93,7 @@ Dialogs::Dialogs(LyXView * lv)
        add(new GUIError<FormError, xformsBC>(*lv, *this));
        add(new GUIInclude<FormInclude, xformsBC>(*lv, *this));
        add(new GUILog<FormLog, xformsBC>(*lv, *this));
+       add(new GUIRef<FormRef, xformsBC>(*lv, *this));
        add(new GUIUrl<FormUrl, xformsBC>(*lv, *this));
        add(new GUIVCLog<FormVCLog, xformsBC>(*lv, *this));
 
@@ -103,7 +106,6 @@ Dialogs::Dialogs(LyXView * lv)
        add(new FormPreamble(lv, this));
        add(new FormPreferences(lv, this));
        add(new FormPrint(lv, this));
-       add(new FormRef(lv, this));
        add(new FormSearch(lv, this));
        add(new FormSplash(lv, this));
        add(new FormTabular(lv, this));
index 184bd2ac519f25e5fba1817e4eaee25f0a3b721f..7e245bb14f846906e488106f175a1095213f42d5 100644 (file)
@@ -1,65 +1,50 @@
-// -*- C++ -*-
 /* This file is part of
  * ====================================================== 
  *
  *           LyX, The Document Processor
  *
- *           Copyright 2000 The LyX Team.
+ *           Copyright 2000-2001 The LyX Team.
  *
  * ======================================================
+ * 
+ * \file FormRef.C
+ * \author Angus Leeming, a.leeming@ic.ac.uk 
  */
 
 #include <config.h>
-
 #include <algorithm>
-#include FORMS_H_LOCATION
 
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
+#include "xformsBC.h"
+#include "ControlRef.h"
+#include "FormRef.h"
+#include "form_ref.h"
+#include "xforms_helpers.h"
+#include "insets/insetref.h"
+
+/*
 #include "Dialogs.h"
 #include "FormRef.h"
 #include "LyXView.h"
 #include "buffer.h"
 #include "form_ref.h"
 #include "lyxfunc.h"
-#include "insets/insetref.h"
-#include "xforms_helpers.h"
+*/
 
 using std::find;
 using std::max;
 using std::sort;
 using std::vector;
-using SigC::slot;
-
-bool saved_position;
 
-FormRef::FormRef(LyXView * lv, Dialogs * d)
-       : FormCommand(lv, d, _("Reference")),
-         at_ref(false)
-{
-       // let the dialog be shown
-       // These are permanent connections so we won't bother
-       // storing a copy because we won't be disconnecting.
-       d->showRef.connect(slot(this, &FormRef::showInset));
-       d->createRef.connect(slot(this, &FormRef::createInset));
-}
+typedef FormCB<ControlRef, FormDB<FD_form_ref> > base_class;
 
-
-FL_FORM * FormRef::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
-
-
-void FormRef::disconnect()
-{
-       refs.clear();
-       FormCommand::disconnect();
-}
+FormRef::FormRef(ControlRef & c)
+       : base_class(c, _("Reference")),
+         at_ref_(false)
+{}
 
 
 void FormRef::build()
@@ -79,41 +64,40 @@ void FormRef::build()
        bc().setCancel(dialog_->button_cancel);
        bc().setUndoAll(dialog_->button_restore);
        bc().refresh();
-
-#warning I had to uncomment this so the buttons could be disabled in update() (dekel)
-       //bc().addReadOnly(dialog_->type);
-       //bc().addReadOnly(dialog_->name);
 }
 
 
 void FormRef::update()
 {
-       if (inset_) {
-               fl_set_input(dialog_->ref,  params.getContents().c_str());
-               fl_set_input(dialog_->name, params.getOptions().c_str());
-               fl_set_choice(dialog_->type, 
-                             InsetRef::getType(params.getCmdName()) + 1);
-       }
-
-       at_ref = false;
+       fl_set_input(dialog_->ref,
+                    controller().params().getContents().c_str());
+       fl_set_input(dialog_->name,
+                    controller().params().getOptions().c_str());
+       fl_set_choice(dialog_->type, 
+                     InsetRef::getType(controller().params().getCmdName()) + 1);
+
+       at_ref_ = false;
        fl_set_object_label(dialog_->button_go, _("Goto reference"));
 
-       // Name is irrelevant to LaTeX/Literate documents, while
-       // type is irrelevant to LinuxDoc/DocBook.
-       if (lv_->buffer()->isLatex() || lv_->buffer()->isLatex()) {
+       // Name is irrelevant to LaTeX/Literate documents
+       if (controller().docType() == ControlRef::LATEX ||
+           controller().docType() == ControlRef::LITERATE) {
                setEnabled(dialog_->name, false);
-               setEnabled(dialog_->type, true);
        } else {
-               fl_set_choice(dialog_->type, 1);
-
                setEnabled(dialog_->name, true);
-               setEnabled(dialog_->type, false);
        }
 
-       refs = lv_->buffer()->getLabelList();
-       updateBrowser(refs);
+       // type is irrelevant to LinuxDoc/DocBook.
+       if (controller().docType() == ControlRef::LINUXDOC ||
+           controller().docType() == ControlRef::DOCBOOK) {
+               fl_set_choice(dialog_->type, 1);
+               setEnabled(dialog_->type, false);
+       } else {
+               setEnabled(dialog_->type, true);
+       }
 
-       bc().readOnly(lv_->buffer()->isReadonly());
+       refs_ = controller().getLabelList();
+       updateBrowser(refs_);
 }
 
 
@@ -126,7 +110,7 @@ void FormRef::updateBrowser(vector<string> const & akeys) const
        fl_clear_browser(dialog_->browser);
        for (vector<string>::const_iterator it = keys.begin();
             it != keys.end(); ++it)
-               fl_add_browser_line(dialog_->browser, (*it).c_str());
+               fl_add_browser_line(dialog_->browser, it->c_str());
 
        if (keys.empty()) {
                fl_add_browser_line(dialog_->browser,
@@ -145,9 +129,9 @@ void FormRef::updateBrowser(vector<string> const & akeys) const
                        find(keys.begin(), keys.end(), ref);
                if (cit == keys.end()) {
                        cit = keys.begin();
-                       fl_set_input(dialog_->ref, (*cit).c_str());
+                       fl_set_input(dialog_->ref, cit->c_str());
                } else if (ref.empty())
-                       fl_set_input(dialog_->ref, (*cit).c_str());
+                       fl_set_input(dialog_->ref, cit->c_str());
 
                int const i = static_cast<int>(cit - keys.begin());
                fl_set_browser_topline(dialog_->browser, max(i-5, 1));
@@ -158,101 +142,72 @@ void FormRef::updateBrowser(vector<string> const & akeys) const
 
 void FormRef::apply()
 {
-       if (!lv_->view()->available())
-               return;
-
        int const type = fl_get_choice(dialog_->type) - 1;
-       params.setCmdName(InsetRef::getName(type));
-
-       params.setOptions(fl_get_input(dialog_->name));
-       params.setContents(fl_get_input(dialog_->ref));
+       controller().params().setCmdName(InsetRef::getName(type));
 
-       if (inset_ != 0) {
-               // Only update if contents have changed
-               if (params != inset_->params()) {
-                       inset_->setParams(params);
-                       lv_->view()->updateInset(inset_, true);
-               }
-       } else {
-               lv_->getLyXFunc()->Dispatch(LFUN_REF_INSERT,
-                                           params.getAsString());
-       }
+       controller().params().setOptions(fl_get_input(dialog_->name));
+       controller().params().setContents(fl_get_input(dialog_->ref));
 }
 
 
-bool FormRef::input(FL_OBJECT *, long data)
+ButtonPolicy::SMInput FormRef::input(FL_OBJECT * ob, long)
 {
-       bool activate(true);
-       switch (data) {
-       // goto reference / go back
-       case 1:
-       {
+       ButtonPolicy::SMInput activate(ButtonPolicy::SMI_VALID);
+
+       if (ob == dialog_->button_go) {
+               // goto reference / go back
+
                // No change to data
-               activate = false;
-               
-               at_ref = !at_ref;
-               if (at_ref) {
-                       lv_->getLyXFunc()->Dispatch(LFUN_BOOKMARK_SAVE, "0");
-                       lv_->getLyXFunc()->
-                               Dispatch(LFUN_REF_GOTO,
-                                        fl_get_input(dialog_->ref));
+               activate = ButtonPolicy::SMI_NOOP;
+
+               at_ref_ = !at_ref_;
+               if (at_ref_) {
+                       controller().gotoRef(fl_get_input(dialog_->ref));
                        fl_set_object_label(dialog_->button_go, _("Go back"));
                } else {
-                       lv_->getLyXFunc()->Dispatch(LFUN_BOOKMARK_GOTO, "0");
+                       controller().gotoBookmark();
                        fl_set_object_label(dialog_->button_go,
                                            _("Goto reference"));
                }
-       }
-       break;
 
-       // choose browser key
-       case 2:
-       {
+       } else if (ob == dialog_->browser) {
+
                unsigned int sel = fl_get_browser(dialog_->browser);
-               if (sel < 1 || sel > refs.size()) break;
+               if (sel < 1 || sel > refs_.size())
+                       return ButtonPolicy::SMI_NOOP;
 
-               if (!lv_->buffer()->isReadonly()) {
+               if (!controller().isReadonly()) {
                        string s = fl_get_browser_line(dialog_->browser, sel);
                        fl_set_input(dialog_->ref, s.c_str());
                }
 
-               if (at_ref)
-                       lv_->getLyXFunc()->Dispatch(LFUN_BOOKMARK_GOTO, "0");
-               at_ref = false;
+               if (at_ref_)
+                       controller().gotoBookmark();
+               at_ref_ = false;
                fl_set_object_label(dialog_->button_go, _("Goto reference"));
 
                setEnabled(dialog_->type,      true);
                setEnabled(dialog_->button_go, true);
                fl_set_object_lcol(dialog_->ref, FL_BLACK);
-       }
-       break;
 
-       // update or sort
-       case 3:
-               refs = lv_->buffer()->getLabelList();
+       } else if (ob == dialog_->button_update || 
+                  ob == dialog_->sort) {
+
+               if (ob == dialog_->button_update)
+                       refs_ = controller().getLabelList();
 
-               // fall through to...
-       case 4:
                fl_freeze_form(form());
-               updateBrowser(refs);
+               updateBrowser(refs_);
                fl_unfreeze_form(form());
-               break;
 
-       // changed reference type
-       case 5:
-       {
+       } else if (ob == dialog_->type) {
+
                int const type = fl_get_choice(dialog_->type) - 1;
-               if (params.getCmdName() == InsetRef::getName(type) && inset_) {
-                       activate = false;
+               if (controller().params().getCmdName() ==
+                   InsetRef::getName(type)) {
+                       activate = ButtonPolicy::SMI_NOOP;
                }
        }
-       break;
-
-       default:
-               break;
-       }
 
        return activate;
 }
-
-
index 85c8146cf15293b4dab238f6442cd5f6345162ec..bd6a84b2f39b6fae9e58f188afee98ab418dd98e 100644 (file)
@@ -1,70 +1,54 @@
-// -*- C++ -*-
 /* This file is part of
  * ====================================================== 
  *
  *           LyX, The Document Processor
  *
- *           Copyright 2000 The LyX Team.
+ *           Copyright 2000-2001 The LyX Team.
  *
  * ======================================================
+ *
+ * \file FormRef.h
+ * \author Angus Leeming, a.leeming@.ac.uk
  */
 
 #ifndef FORMREF_H
 #define FORMREF_H
 
-#include <boost/smart_ptr.hpp>
-
 #ifdef __GNUG__
 #pragma interface
 #endif
 
-#include "FormInset.h"
+#include "FormBase.h"
 
+class ControlRef;
 struct FD_form_ref;
 
 /** This class provides an XForms implementation of the FormRef Dialog.
  */
-class FormRef : public FormCommand {
+class FormRef : public FormCB<ControlRef, FormDB<FD_form_ref> > {
 public:
        ///
-       FormRef(LyXView *, Dialogs *);
-private:
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc();
-       /// Disconnect signals. Also perform any necessary housekeeping.
-       virtual void disconnect();
+       FormRef(ControlRef &);
 
+private:
+       /// Set the Params variable for the Controller.
+       virtual void apply();
        /// Build the dialog
        virtual void build();
-       /// Filter the input
-       virtual bool input(FL_OBJECT *, long);
+       /// Filter the inputs on callback from xforms
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
        /// Update dialog before showing it
        virtual void update();
-       /// Not used but must be instantiated
-       virtual void apply();
-       /// Pointer to the actual instantiation of the xforms form
-       virtual FL_FORM * form() const;
 
        ///
        void updateBrowser(std::vector<string> const &) const;
-       ///
+       /// Type definition from the fdesign produced header file.
        FD_form_ref * build_ref();
 
        ///
-       bool at_ref;
+       bool at_ref_;
        /// 
-       std::vector<string> refs;
-
-       /// Real GUI implementation.
-       boost::scoped_ptr<FD_form_ref> dialog_;
-       /// The ButtonController
-       ButtonController<NoRepeatedApplyPolicy, xformsBC> bc_;
+       std::vector<string> refs_;
 };
 
-
-inline
-xformsBC & FormRef::bc()
-{
-       return bc_;
-}
-#endif
+#endif // FORMREF_H
index bcea4376949f224a986dc411a58a80ed8f4aba46..62ef744794dc19f544efad39b99efcc7eb4502e1 100644 (file)
@@ -1,5 +1,4 @@
-/* \file FormUrl.C
- * This file is part of
+/* This file is part of
  * ====================================================== 
  *
  *           LyX, The Document Processor
@@ -8,6 +7,7 @@
  *
  * ======================================================
  * 
+ * \file FormUrl.C
  * \author Angus Leeming, a.leeming@ic.ac.uk 
  */
 
index 951ab9070b5a4b63b72d3eba8c983e239e88a664..d9d44f6953cc1778f74588e994d8478b9c1d5cc3 100644 (file)
@@ -1,5 +1,4 @@
-/* \file FormUrl.h
- * This file is part of
+/* This file is part of
  * ====================================================== 
  *
  *           LyX, The Document Processor
@@ -8,6 +7,7 @@
  *
  * ======================================================
  *
+ * \file FormUrl.h
  * \author Angus Leeming, a.leeming@.ac.uk
  */
 
index 651284a1c43f64eaf573ba2ae0d31d813261333e..486b6e7f2efcb1dc0180485fd7a21e7c5fa52b3b 100644 (file)
@@ -28,14 +28,14 @@ FD_form_ref * FormRef::build_ref()
   fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 240, "");
     fl_set_object_lalign(obj, FL_ALIGN_TOP);
     fl_set_object_gravity(obj, FL_NorthWest, FL_South);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 2);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   {
     char const * const dummy = N_("Update|#U");
     fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 260, 90, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 3);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   {
     char const * const dummy = N_("Sort|#S");
     fdui->sort = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 170, 260, 30, 30, idex(_(dummy)));
@@ -43,7 +43,7 @@ FD_form_ref * FormRef::build_ref()
   }
     fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
     fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 4);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   {
     char const * const dummy = N_("Name:|#N");
     fdui->name = obj = fl_add_input(FL_NORMAL_INPUT, 370, 10, 150, 40, idex(_(dummy)));
@@ -60,38 +60,38 @@ FD_form_ref * FormRef::build_ref()
     fl_set_object_boxtype(obj, FL_FRAME_BOX);
     fl_set_object_lalign(obj, FL_ALIGN_TOP);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 5);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   {
     char const * const dummy = N_("Goto reference|#G");
     fdui->button_go = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 200, 140, 40, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 1);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 300, 90, 30, _("OK"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   {
     char const * const dummy = N_("Cancel|^[");
     fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   {
     char const * const dummy = N_("Apply|#A");
     fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 300, 90, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
   {
     char const * const dummy = N_("Restore|#R");
     fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 300, 90, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0);
+    fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index 2ebce3212db31be14cecb7f904d72f02ed685b4d..e37f57ff18d54bddab5ed5c7da6bc6f3a23a4190 100644 (file)
@@ -5,11 +5,11 @@
 #define FD_form_ref_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index be0b7dcc5cf9548fea92c16db8989e6638c5c3fc..5fe3646b04bf02e5a87c78975c1f6825d2127ab4 100644 (file)
@@ -45,8 +45,8 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NorthWest FL_South
 name: browser
-callback: C_FormBaseDeprecatedInputCB
-argument: 2
+callback: C_FormBaseInputCB
+argument:
 
 --------------------
 class: FL_BUTTON
@@ -63,8 +63,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthWest FL_SouthWest
 name: button_update
-callback: C_FormBaseDeprecatedInputCB
-argument: 3
+callback: C_FormBaseInputCB
+argument:
 
 --------------------
 class: FL_CHECKBUTTON
@@ -81,8 +81,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthWest FL_SouthWest
 name: sort
-callback: C_FormBaseDeprecatedInputCB
-argument: 4
+callback: C_FormBaseInputCB
+argument:
 
 --------------------
 class: FL_INPUT
@@ -135,8 +135,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: type
-callback: C_FormBaseDeprecatedInputCB
-argument: 5
+callback: C_FormBaseInputCB
+argument:
 
 --------------------
 class: FL_BUTTON
@@ -153,8 +153,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: button_go
-callback: C_FormBaseDeprecatedInputCB
-argument: 1
+callback: C_FormBaseInputCB
+argument:
 
 --------------------
 class: FL_BUTTON
@@ -171,8 +171,8 @@ shortcut: ^M
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: button_ok
-callback: C_FormBaseDeprecatedOKCB
-argument: 0
+callback: C_FormBaseOKCB
+argument:
 
 --------------------
 class: FL_BUTTON
@@ -189,8 +189,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: button_cancel
-callback: C_FormBaseDeprecatedCancelCB
-argument: 0
+callback: C_FormBaseCancelCB
+argument:
 
 --------------------
 class: FL_BUTTON
@@ -207,8 +207,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: button_apply
-callback: C_FormBaseDeprecatedApplyCB
-argument: 0
+callback: C_FormBaseApplyCB
+argument:
 
 --------------------
 class: FL_BUTTON
@@ -225,8 +225,8 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: button_restore
-callback: C_FormBaseDeprecatedRestoreCB
-argument: 0
+callback: C_FormBaseRestoreCB
+argument:
 
 ==============================
 create_the_forms