]> git.lyx.org Git - features.git/commitdiff
FormBase extends its reach into the codebase and gains a ButtonController
authorAllan Rae <rae@lyx.org>
Mon, 2 Oct 2000 00:10:25 +0000 (00:10 +0000)
committerAllan Rae <rae@lyx.org>
Mon, 2 Oct 2000 00:10:25 +0000 (00:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1062 a592a061-630c-0410-9148-cb99ea01b6c8

59 files changed:
ChangeLog
src/PrinterParams.h
src/frontends/xforms/ButtonController.h
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormBase.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/FormCommand.C
src/frontends/xforms/FormCommand.h
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormCopyright.h
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormDocument.h
src/frontends/xforms/FormError.h
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormIndex.h
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormParagraph.h
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreferences.h
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPrint.h
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormRef.h
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormToc.h
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormUrl.h
src/frontends/xforms/RadioButtonGroup.h
src/frontends/xforms/form_citation.C
src/frontends/xforms/form_citation.h
src/frontends/xforms/form_copyright.C
src/frontends/xforms/form_copyright.h
src/frontends/xforms/form_document.C
src/frontends/xforms/form_document.h
src/frontends/xforms/form_error.C
src/frontends/xforms/form_error.h
src/frontends/xforms/form_index.C
src/frontends/xforms/form_index.h
src/frontends/xforms/form_preferences.C
src/frontends/xforms/form_preferences.h
src/frontends/xforms/form_print.C
src/frontends/xforms/form_print.h
src/frontends/xforms/form_ref.C
src/frontends/xforms/form_ref.h
src/frontends/xforms/form_toc.C
src/frontends/xforms/form_toc.h
src/frontends/xforms/form_url.C
src/frontends/xforms/form_url.h
src/frontends/xforms/forms/form_citation.fd
src/frontends/xforms/forms/form_copyright.fd
src/frontends/xforms/forms/form_document.fd
src/frontends/xforms/forms/form_error.fd
src/frontends/xforms/forms/form_index.fd
src/frontends/xforms/forms/form_preferences.fd
src/frontends/xforms/forms/form_print.fd
src/frontends/xforms/forms/form_ref.fd
src/frontends/xforms/forms/form_toc.fd
src/frontends/xforms/forms/form_url.fd

index daf4846950dfd6223cb4ffea9003fecefc713331..c1a0f1100c5a1858e3e4ecc9c9e8934362733265 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2000-10-01  Allan Rae  <rae@lyx.org>
+
+       * src/PrinterParams.h: moved things around to avoid the "can't
+       inline call" warning.
+
+       * src/frontends/xforms/RadioButtonGroup.h: turned a comment
+       into doc++ documentation.
+
+       * src/frontends/xforms/FormCommand.[Ch]: support button policy
+
+       * src/frontends/xforms/FormRef.C: make use of button controller
+       * src/frontends/xforms/FormDocument.[Ch]: convert to use FormBase
+       cleaned up button controller usage.
+       * src/frontends/xforms/FormPreferences.[Ch]: convert to use FormBase
+       * src/frontends/xforms/FormPrint.[Ch]: convert to use FormBase and
+       use the button controller
+
+       * src/frontends/xforms/forms/*.fd: and associated generated files
+       updated to reflect changes to FormBase.  Some other FormXxxx files
+       also got minor updates to reflect changes to FormBase.
+
+       * src/frontends/xforms/FormBase.[Ch]: (ok, cancel): new
+       (hide): made virtual.
+       (input): return a bool. true == valid input
+       (RestoreCB, restore): new
+       (CancelCB, OKCB): renamed from HideCB and ApplyHideCB.
+       Changes to allow derived dialogs to use a ButtonController and
+       make sense when doing so: OK button calls ok() and so on.
+
+       * src/frontends/xforms/ButtonController.h (class ButtonController):
+       Switch from template implementation to taking Policy parameter.
+        Allows FormBase to provide a ButtonController for any dialog.
+
+       * src/frontends/xforms/FormPrint.C (connect): setup sizing at show-time
+       Probably should rename connect and disconnect.
+       (apply): use the radio button groups
+       (form): needed by FormBase
+       (build): setup the radio button groups
+
 2000-09-29  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * several files: type canges to reduce the number of warnings and
index 670c32ae2207af39fa39191781a7b5d3bbb25995..a5609e262e7e38792309c2df5c9a588e042ca859 100644 (file)
@@ -84,6 +84,46 @@ struct PrinterParams {
        // Override document settings for duplex.
        // bool duplex;
 
+       /** Test that all the fields contain valid entries.  It's unlikely
+           that the internal code will get this wrong (at least for the
+           xforms code anyway) however new ports and external scripts
+           might drive the wrong values in.
+        */
+       void testInvariant() const
+               {
+#ifdef ENABLE_ASSERTIONS
+                       if (!from_page.empty()) {
+                               // Assert(from_page == number or empty)
+                               Assert(containsOnly(from_page, "1234567890"));
+                       }
+                       if (to_page) {
+                               // Assert(to_page == empty
+                               //        or number iff from_page set)
+                               Assert(!from_page.empty());
+                       }
+                       switch (target) {
+                       case PRINTER:
+//                             Assert(!printer_name.empty());
+                               break;
+                       case FILE:
+                               Assert(!file_name.empty());
+                               break;
+                       default:
+                               Assert(false);
+                               break;
+                       }
+                       switch (which_pages) {
+                       case ALL:
+                       case ODD:
+                       case EVEN:
+                               break;
+                       default:
+                               Assert(false);
+                               break;
+                       }
+#endif
+               }
+
        ///
        PrinterParams(Target const & t = PRINTER,
                      string const & pname = lyxrc.printer,
@@ -125,45 +165,6 @@ struct PrinterParams {
 //     friend bool operator==(PrinterParams const &, PrinterParams const &);
 //     friend bool operator<(PrinterParams const &, PrinterParams const &);
 
-       /** Test that all the fields contain valid entries.  It's unlikely
-           that the internal code will get this wrong (at least for the
-           xforms code anyway) however new ports and external scripts
-           might drive the wrong values in.
-        */
-       void testInvariant() const
-               {
-#ifdef ENABLE_ASSERTIONS
-                       if (!from_page.empty()) {
-                               // Assert(from_page == number or empty)
-                               Assert(containsOnly(from_page, "1234567890"));
-                       }
-                       if (to_page) {
-                               // Assert(to_page == empty
-                               //        or number iff from_page set)
-                               Assert(!from_page.empty());
-                       }
-                       switch (target) {
-                       case PRINTER:
-//                             Assert(!printer_name.empty());
-                               break;
-                       case FILE:
-                               Assert(!file_name.empty());
-                               break;
-                       default:
-                               Assert(false);
-                               break;
-                       }
-                       switch (which_pages) {
-                       case ALL:
-                       case ODD:
-                       case EVEN:
-                               break;
-                       default:
-                               Assert(false);
-                               break;
-                       }
-#endif
-               }
 };
 
 #endif
index 17462efcf482e9d1d3c08be51c601ccbcd9aef5b..5f4c6462a6cee6697f7936f8a159a99118453e02 100644 (file)
@@ -30,8 +30,9 @@
     the activation policy and which buttons correspond to which output of the
     state machine.
     @author Allan Rae <rae@lyx.org>
+    20001001 Switch from template implementation to taking Policy parameter.
+             Allows FormBase to provide a ButtonController for any dialog.
 */
-template <class Policy>
 class ButtonController : public noncopyable
 {
 public:
@@ -43,8 +44,8 @@ public:
            you can just assign "Cancel" to both labels.  Or even reuse this
            class for something completely different.
         */
-       ButtonController(char const * cancel, char const * close)
-               : bp_(), okay_(0), apply_(0), cancel_(0), undo_all_(0),
+       ButtonController(ButtonPolicy * bp, char const * cancel, char const * close)
+               : bp_(bp), okay_(0), apply_(0), cancel_(0), undo_all_(0),
                  read_only_(), cancel_label(cancel), close_label(close) {}
        /// Somebody else owns the FL_OBJECTs we just manipulate them.
        ~ButtonController() {}
@@ -84,61 +85,10 @@ public:
        }
 
        /* Action Functions */
-       ///
-       void input(ButtonPolicy::SMInput in) {
-               bp_.input(in);
-               refresh();
-       }
-       ///
-       void ok() {
-               input(ButtonPolicy::SMI_OKAY);
-       }
-       ///
-       void apply() {
-               input(ButtonPolicy::SMI_APPLY);
-       }
-       ///
-       void cancel() {
-               input(ButtonPolicy::SMI_CANCEL);
-       }
-       ///
-       void undoAll() {
-               input(ButtonPolicy::SMI_UNDO_ALL);
-       }
-       ///
-       void hide() {
-               input(ButtonPolicy::SMI_HIDE);
-       }
-       /// Passthrough function -- returns its input value
-       bool readOnly(bool ro = true) {
-               if (ro) {
-                       input(ButtonPolicy::SMI_READ_ONLY);
-               } else {
-                       input(ButtonPolicy::SMI_READ_WRITE);
-               }
-               return ro;
-       }
-       ///
-       void readWrite() {
-               read_only(false);
-       }
-       /// Passthrough function -- returns its input value
-       bool valid(bool v = true) { 
-               if (v) {
-                       input(ButtonPolicy::SMI_VALID);
-               } else {
-                       input(ButtonPolicy::SMI_INVALID);
-               }
-               return v;
-       }
-       ///
-       void invalid() {
-               valid(false);
-       }
        /// force a refresh of the buttons
        void refresh() {
                if (okay_) {
-                       if (bp_.buttonStatus(ButtonPolicy::OKAY)) {
+                       if (bp_->buttonStatus(ButtonPolicy::OKAY)) {
                                fl_activate_object(okay_);
                                fl_set_object_lcol(okay_, FL_BLACK);
                        } else {
@@ -147,7 +97,7 @@ public:
                        }
                }
                if (apply_) {
-                       if (bp_.buttonStatus(ButtonPolicy::APPLY)) {
+                       if (bp_->buttonStatus(ButtonPolicy::APPLY)) {
                                fl_activate_object(apply_);
                                fl_set_object_lcol(apply_, FL_BLACK);
                        } else {
@@ -156,7 +106,7 @@ public:
                        }
                }
                if (undo_all_) {
-                       if (bp_.buttonStatus(ButtonPolicy::UNDO_ALL)) {
+                       if (bp_->buttonStatus(ButtonPolicy::UNDO_ALL)) {
                                fl_activate_object(undo_all_);
                                fl_set_object_lcol(undo_all_, FL_BLACK);
                        } else {
@@ -166,7 +116,7 @@ public:
                        }
                }
                if (cancel_) {
-                       if (bp_.buttonStatus(ButtonPolicy::CANCEL)) {
+                       if (bp_->buttonStatus(ButtonPolicy::CANCEL)) {
                                fl_set_object_label(cancel_,
                                                    cancel_label);
                        } else {
@@ -175,7 +125,7 @@ public:
                        }
                }
                if (!read_only_.empty()) {
-                       if (bp_.isReadOnly()) {
+                       if (bp_->isReadOnly()) {
                                std::list<FL_OBJECT *>::iterator
                                        end = read_only_.end();
                                for (std::list<FL_OBJECT *>::iterator
@@ -200,9 +150,60 @@ public:
                        }
                }
        }
+       ///
+       void input(ButtonPolicy::SMInput in) {
+               bp_->input(in);
+               refresh();
+       }
+       ///
+       void ok() {
+               input(ButtonPolicy::SMI_OKAY);
+       }
+       ///
+       void apply() {
+               input(ButtonPolicy::SMI_APPLY);
+       }
+       ///
+       void cancel() {
+               input(ButtonPolicy::SMI_CANCEL);
+       }
+       ///
+       void undoAll() {
+               input(ButtonPolicy::SMI_UNDO_ALL);
+       }
+       ///
+       void hide() {
+               input(ButtonPolicy::SMI_HIDE);
+       }
+       /// Passthrough function -- returns its input value
+       bool readOnly(bool ro = true) {
+               if (ro) {
+                       input(ButtonPolicy::SMI_READ_ONLY);
+               } else {
+                       input(ButtonPolicy::SMI_READ_WRITE);
+               }
+               return ro;
+       }
+       ///
+       void readWrite() {
+               readOnly(false);
+       }
+       /// Passthrough function -- returns its input value
+       bool valid(bool v = true) { 
+               if (v) {
+                       input(ButtonPolicy::SMI_VALID);
+               } else {
+                       input(ButtonPolicy::SMI_INVALID);
+               }
+               return v;
+       }
+       ///
+       void invalid() {
+               valid(false);
+       }
 private:
        ///
-       Policy bp_;
+       ButtonPolicy * bp_;
        ///
        FL_OBJECT * okay_;
        ///
index 51eaa3b2aa55a41b56eea4acab81b293705d0455..d300d9fc1327df3ad23ddba055748217c2af6d70 100644 (file)
 
 C_RETURNCB (FormBase, WMHideCB)
 C_GENERICCB(FormBase, ApplyCB)
-C_GENERICCB(FormBase, ApplyHideCB)
-C_GENERICCB(FormBase, HideCB)
+C_GENERICCB(FormBase, OKCB)
+C_GENERICCB(FormBase, CancelCB)
 C_GENERICCB(FormBase, InputCB)
+C_GENERICCB(FormBase, RestoreCB)
 
 
-FormBase::FormBase(LyXView * lv, Dialogs * d, BufferDependency bd, string const & t)
-       : dialogIsOpen(false), lv_(lv), u_(0), h_(0), title(t)
+FormBase::FormBase(LyXView * lv, Dialogs * d, BufferDependency bd, string const & t,
+                  ButtonPolicy * bp, char const * close, char const * cancel)
+       : dialogIsOpen(false), lv_(lv), bc_(bp, cancel, close),
+         u_(0), h_(0), title(t), bp_(bp)
 {
        switch( bd ) {
        case BUFFER_DEPENDENT:
@@ -43,7 +46,13 @@ FormBase::FormBase(LyXView * lv, Dialogs * d, BufferDependency bd, string const
        }
 }
 
-               
+
+FormBase::~FormBase()
+{
+       delete bp_;
+}
+
+
 void FormBase::show()
 {
        if (!form()) {
@@ -104,6 +113,7 @@ int FormBase::WMHideCB(FL_FORM * form, void *)
        // window manager is used to close the dialog.
        FormBase * pre = static_cast<FormBase*>(form->u_vdata);
        pre->hide();
+       pre->bc_.hide();
        return FL_CANCEL;
 }
 
@@ -112,26 +122,36 @@ void FormBase::ApplyCB(FL_OBJECT * ob, long)
 {
        FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
        pre->apply();
+       pre->bc_.apply();
 }
 
 
-void FormBase::ApplyHideCB(FL_OBJECT * ob, long)
+void FormBase::OKCB(FL_OBJECT * ob, long)
 {
        FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
-       pre->apply();
-       pre->hide();
+       pre->ok();
+       pre->bc_.ok();
 }
 
 
-void FormBase::HideCB(FL_OBJECT * ob, long)
+void FormBase::CancelCB(FL_OBJECT * ob, long)
 {
        FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
-       pre->hide();
+       pre->cancel();
+       pre->bc_.cancel();
+}
+
+
+void FormBase::InputCB(FL_OBJECT * ob, long data )
+{
+       FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
+       pre->bc_.valid( pre->input( data ) );
 }
 
 
-void FormBase::InputCB(FL_OBJECT * ob, long data)
+void FormBase::RestoreCB(FL_OBJECT * ob, long)
 {
        FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
-       pre->input( data );
+       pre->restore();
+       pre->bc_.undoAll();
 }
index 45c2c41536c458f5cf03223e427a91fc09cc6df2..2524d88723e3e7fbf55c59b872ba3afbef3f5696 100644 (file)
@@ -16,6 +16,8 @@
 #include "LString.h"
 #include "support/utility.hpp"
 #include FORMS_H_LOCATION
+#include "ButtonController.h"
+#include "gettext.h"
 
 class Dialogs;
 class LyXView;
@@ -41,37 +43,61 @@ public:
                BUFFER_INDEPENDENT
        };
 
-       /// Constructor
-       FormBase(LyXView *, Dialogs *, BufferDependency, string const &);
+       /** Constructor.
+           #FormBase(lv, d, BUFFER_DEPENDENT, _("DialogName"), new ButtonPolicy)#
+        */
+       FormBase(LyXView *, Dialogs *, BufferDependency, string const &,
+                ButtonPolicy * bp = new OkApplyCancelReadOnlyPolicy,
+                char const * close = N_("Close"),
+                char const * cancel = N_("Cancel"));
+       ///
+       virtual ~FormBase();
 
        /// Callback functions
        static  int WMHideCB(FL_FORM *, void *);
        ///
        static void ApplyCB(FL_OBJECT *, long);
        ///
-       static void ApplyHideCB(FL_OBJECT *, long);
+       static void OKCB(FL_OBJECT *, long);
        ///
-       static void HideCB(FL_OBJECT *, long);
+       static void CancelCB(FL_OBJECT *, long);
        ///
        static void InputCB(FL_OBJECT *, long);
+       ///
+       static void RestoreCB(FL_OBJECT *, long);
 
 protected:
        /// Create the dialog if necessary, update it and display it.
        void show();
        /// Hide the dialog.
-       void hide();
+       virtual void hide();
        /// Connect signals
        virtual void connect();
        /// Disconnect signals
        virtual void disconnect();
        /// Build the dialog
        virtual void build() = 0;
-       /// Filter the inputs on callback from xforms
-       virtual void input( long ) {}
+       /** Filter the inputs on callback from xforms
+           Return true if inputs are valid.
+        */
+       virtual bool input( long ) {
+               return true;
+       }
        /// Update dialog before showing it
        virtual void update() {}
        /// 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() {}
        /// delete derived class variables when hide()ing
        virtual void clearStore() {}
        /// Pointer to the actual instantiation of xform's form
@@ -84,6 +110,8 @@ protected:
            save a couple of bytes per dialog.
        */
        LyXView * lv_;
+       /// Useable even in derived-class's const functions
+       mutable ButtonController bc_;
 
 private:
        /// Hide signal
@@ -96,6 +124,8 @@ private:
        Connection h_;
        /// dialog title, displayed by WM.
        string title;
+       ///
+       ButtonPolicy * bp_;
 };
 
 #endif
index 6e66de9d350ba43061d9f1bb9f80175fedd91e9b..6c54e3f706e549eda93d10d0942264ae6b02f768 100644 (file)
@@ -20,7 +20,6 @@
 #endif
 
 
-#include "gettext.h"
 #include "Dialogs.h"
 #include "FormCitation.h"
 #include "LyXView.h"
@@ -40,7 +39,6 @@ static int min_wform;
 FormCitation::FormCitation(LyXView * lv, Dialogs * d)
        : FormCommand(lv, d, _("Citation")), dialog_(0)
 {
-       dialog_ = 0;
        // let the dialog be shown
        // These are permanent connections so we won't bother
        // storing a copy because we won't be disconnecting.
@@ -290,7 +288,10 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
 }
 
 
-void FormCitation::input(long data)
+#ifdef WITH_WARNINGS
+#warning convert this to use the buttoncontroller
+#endif
+bool FormCitation::input( long data )
 {
        State cb = static_cast<FormCitation::State>( data );
 
@@ -433,6 +434,7 @@ void FormCitation::input(long data)
        default:
                break;
        }
+       return true;
 }
 
 
index de5de6000841b9793c1164893f0de4b3b0e3d603..f7c129cf78b5b7cd1d1b490678e7d579fec44862 100644 (file)
@@ -50,7 +50,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Filter the inputs
-       virtual void input(long);
+       virtual bool input( long );
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index 73021bc8569db23dc611c78f58b4279fb5fe78f2..2e721033d943590fddd1977deae04e3239844640 100644 (file)
 #include "Dialogs.h"
 #include "FormCommand.h"
 
-FormCommand::FormCommand( LyXView * lv, Dialogs * d, string const & t )
-       : FormBase( lv, d, BUFFER_DEPENDENT, t ),
+FormCommand::FormCommand( LyXView * lv, Dialogs * d, string const & t,
+                         ButtonPolicy * bp )
+       : FormBase( lv, d, BUFFER_DEPENDENT, t, bp ),
          inset_(0), ih_(0)
 {}
 
 
 void FormCommand::showInset( InsetCommand * const inset )
 {
-       if( dialogIsOpen || inset == 0 ) return;
+       if ( dialogIsOpen || inset == 0 ) return;
 
        inset_ = inset;
        ih_ = inset_->hide.connect(slot(this, &FormCommand::hide));
@@ -41,7 +42,7 @@ void FormCommand::showInset( InsetCommand * const inset )
 
 void FormCommand::createInset( string const & arg )
 {
-       if( dialogIsOpen ) return;
+       if ( dialogIsOpen ) return;
 
        params.setFromString( arg );
        show();
index 0818a6e6d185553edc617e84c61391918968b7a1..7f5fd0bada19ebe880f4477ec1578791d15ba673 100644 (file)
@@ -25,7 +25,8 @@
 class FormCommand : public FormBase {
 public:
        /// Constructor
-       FormCommand( LyXView *, Dialogs *, string const & );
+       FormCommand( LyXView *, Dialogs *, string const &,
+                    ButtonPolicy * bp = new OkCancelReadOnlyPolicy );
 
 protected:
        /// Slot launching dialog to (possibly) create a new inset
index 9d0bef431dbea2a7826bef89a519226201fee27e..dab2a72af7a8d3b4d808a083a3fe55f2a4bf6791 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "Dialogs.h"
 #include "LyXView.h"
-#include "gettext.h"
 #include "form_copyright.h"
 #include "FormCopyright.h"
 
@@ -41,8 +40,6 @@ void FormCopyright::build()
 
 FL_FORM * const FormCopyright::form() const
 {
-       if( dialog_ ) // no need to test for dialog_->form
-               return dialog_->form;
-       else
-               return 0;
+       if ( dialog_ ) return dialog_->form;
+       return 0;
 }
index fc56a2d9d1ca99066d616666f10a9cba262b1d07..9ade098984bd4c77ad6ed143f17726d6f3e17606 100644 (file)
@@ -18,7 +18,6 @@
 #define FORMCOPYRIGHT_H
 
 #include "FormBase.h"
-#include "form_copyright.h"
 
 #ifdef __GNUG__
 #pragma interface
@@ -37,9 +36,9 @@ public:
 
 private:
        /// Build the dialog
-       void build();
+       virtual void build();
        /// Pointer to the actual instantiation of the xform's form
-       FL_FORM * const form() const;
+       virtual FL_FORM * const form() const;
        /// Fdesign generated method
        FD_form_copyright * build_copyright();
 
index 05e80ab334918372c23f7a63b79fd4c381f29cec..268c27abbab93228793f6f3c3765d29e9aa6cba3 100644 (file)
@@ -16,7 +16,6 @@
 #endif
 
 #include "lyx_gui_misc.h"
-#include "gettext.h"
 #include FORMS_H_LOCATION
 #include XPM_H_LOCATION
 
@@ -39,7 +38,6 @@
 #include "Liason.h"
 #include "CutAndPaste.h"
 #include "bufferview_funcs.h"
-#include "ButtonController.h"
 
 #ifdef SIGC_CXX_NAMESPACES
 using SigC::slot;
@@ -51,12 +49,7 @@ using Liason::setMinibuffer;
 
 #define USE_CLASS_COMBO 1
 
-C_RETURNCB(FormDocument,  WMHideCB)
 C_GENERICCB(FormDocument, InputCB)
-C_GENERICCB(FormDocument, OKCB)
-C_GENERICCB(FormDocument, ApplyCB)
-C_GENERICCB(FormDocument, CancelCB)
-C_GENERICCB(FormDocument, RestoreCB)
 C_GENERICCB(FormDocument, ChoiceClassCB)
 C_GENERICCB(FormDocument, BulletPanelCB)
 C_GENERICCB(FormDocument, BulletDepthCB)
@@ -65,11 +58,10 @@ C_GENERICCB(FormDocument, ChoiceBulletSizeCB)
 
        
 FormDocument::FormDocument(LyXView * lv, Dialogs * d)
-       : dialog_(0), paper_(0), class_(0), language_(0), options_(0),
-         bullets_(0), lv_(lv), d_(d), u_(0), h_(0),
-         status(POPUP_UNMODIFIED) ,
-         bc_(new ButtonController<NoRepeatedApplyReadOnlyPolicy>(_("Cancel"),
-                                                                 _("Close")))
+       : FormBase(lv, d, BUFFER_DEPENDENT, _("Document Layout"),
+                  new NoRepeatedApplyReadOnlyPolicy),
+         dialog_(0), paper_(0), class_(0), language_(0), options_(0),
+         bullets_(0)
 {
     // let the popup be shown
     // This is a permanent connection so we won't bother
@@ -82,8 +74,23 @@ FormDocument::FormDocument(LyXView * lv, Dialogs * d)
 
 FormDocument::~FormDocument()
 {
-    free();
-    delete bc_;
+#ifdef USE_CLASS_COMBO
+    delete combo_doc_class;
+#endif
+    delete class_;
+    delete paper_;
+    delete combo_language;
+    delete language_;
+    delete options_;
+    delete bullets_;
+    delete dialog_;
+}
+
+
+FL_FORM * const FormDocument::form() const
+{
+    if (dialog_) return dialog_->form;
+    return 0;
 }
 
 
@@ -95,11 +102,11 @@ void FormDocument::build()
     dialog_ = build_tabbed_document();
 
     // manage the restore, ok, apply and cancel/close buttons
-    bc_->setOK(dialog_->button_ok);
-    bc_->setApply(dialog_->button_apply);
-    bc_->setCancel(dialog_->button_cancel);
-    bc_->setUndoAll(dialog_->button_restore);
-    bc_->refresh();
+    bc_.setOK(dialog_->button_ok);
+    bc_.setApply(dialog_->button_apply);
+    bc_.setCancel(dialog_->button_cancel);
+    bc_.setUndoAll(dialog_->button_restore);
+    bc_.refresh();
 
     // the document paper form
     paper_ = build_doc_paper();
@@ -121,21 +128,21 @@ void FormDocument::build()
     fl_set_input_return(paper_->input_head_sep, FL_RETURN_ALWAYS);
     fl_set_input_return(paper_->input_foot_skip, FL_RETURN_ALWAYS);
 
-    bc_->addReadOnly (paper_->choice_paperpackage);
-    bc_->addReadOnly (paper_->greoup_radio_orientation);
-    bc_->addReadOnly (paper_->radio_portrait);
-    bc_->addReadOnly (paper_->radio_landscape);
-    bc_->addReadOnly (paper_->choice_papersize2);
-    bc_->addReadOnly (paper_->push_use_geometry);
-    bc_->addReadOnly (paper_->input_custom_width);
-    bc_->addReadOnly (paper_->input_custom_height);
-    bc_->addReadOnly (paper_->input_top_margin);
-    bc_->addReadOnly (paper_->input_bottom_margin);
-    bc_->addReadOnly (paper_->input_left_margin);
-    bc_->addReadOnly (paper_->input_right_margin);
-    bc_->addReadOnly (paper_->input_head_height);
-    bc_->addReadOnly (paper_->input_head_sep);
-    bc_->addReadOnly (paper_->input_foot_skip);
+    bc_.addReadOnly (paper_->choice_paperpackage);
+    bc_.addReadOnly (paper_->greoup_radio_orientation);
+    bc_.addReadOnly (paper_->radio_portrait);
+    bc_.addReadOnly (paper_->radio_landscape);
+    bc_.addReadOnly (paper_->choice_papersize2);
+    bc_.addReadOnly (paper_->push_use_geometry);
+    bc_.addReadOnly (paper_->input_custom_width);
+    bc_.addReadOnly (paper_->input_custom_height);
+    bc_.addReadOnly (paper_->input_top_margin);
+    bc_.addReadOnly (paper_->input_bottom_margin);
+    bc_.addReadOnly (paper_->input_left_margin);
+    bc_.addReadOnly (paper_->input_right_margin);
+    bc_.addReadOnly (paper_->input_head_height);
+    bc_.addReadOnly (paper_->input_head_sep);
+    bc_.addReadOnly (paper_->input_foot_skip);
 
     // the document class form
     class_ = build_doc_class();
@@ -176,23 +183,23 @@ void FormDocument::build()
     fl_set_input_return(class_->input_doc_skip, FL_RETURN_ALWAYS);
     fl_set_input_return(class_->input_doc_spacing, FL_RETURN_ALWAYS);
 
-    bc_->addReadOnly (class_->radio_doc_indent);
-    bc_->addReadOnly (class_->radio_doc_skip);
+    bc_.addReadOnly (class_->radio_doc_indent);
+    bc_.addReadOnly (class_->radio_doc_skip);
 #ifndef USE_CLASS_COMBO
-    bc_->addReadOnly (class_->choice_doc_class);
+    bc_.addReadOnly (class_->choice_doc_class);
 #endif
-    bc_->addReadOnly (class_->choice_doc_pagestyle);
-    bc_->addReadOnly (class_->choice_doc_fonts);
-    bc_->addReadOnly (class_->choice_doc_fontsize);
-    bc_->addReadOnly (class_->radio_doc_sides_one);
-    bc_->addReadOnly (class_->radio_doc_sides_two);
-    bc_->addReadOnly (class_->radio_doc_columns_one);
-    bc_->addReadOnly (class_->radio_doc_columns_two);
-    bc_->addReadOnly (class_->input_doc_extra);
-    bc_->addReadOnly (class_->input_doc_skip);
-    bc_->addReadOnly (class_->choice_doc_skip);
-    bc_->addReadOnly (class_->choice_doc_spacing);
-    bc_->addReadOnly (class_->input_doc_spacing);
+    bc_.addReadOnly (class_->choice_doc_pagestyle);
+    bc_.addReadOnly (class_->choice_doc_fonts);
+    bc_.addReadOnly (class_->choice_doc_fontsize);
+    bc_.addReadOnly (class_->radio_doc_sides_one);
+    bc_.addReadOnly (class_->radio_doc_sides_two);
+    bc_.addReadOnly (class_->radio_doc_columns_one);
+    bc_.addReadOnly (class_->radio_doc_columns_two);
+    bc_.addReadOnly (class_->input_doc_extra);
+    bc_.addReadOnly (class_->input_doc_skip);
+    bc_.addReadOnly (class_->choice_doc_skip);
+    bc_.addReadOnly (class_->choice_doc_spacing);
+    bc_.addReadOnly (class_->input_doc_spacing);
 
     // the document language form
     language_ = build_doc_language();
@@ -221,8 +228,8 @@ void FormDocument::build()
                    _(" ``text'' | ''text'' | ,,text`` | ,,text'' |"
                      " «text» | »text« "));
 
-    bc_->addReadOnly (language_->choice_language);
-    bc_->addReadOnly (language_->choice_inputenc);
+    bc_.addReadOnly (language_->choice_language);
+    bc_.addReadOnly (language_->choice_inputenc);
 
     // the document options form
     options_ = build_doc_options();
@@ -236,11 +243,11 @@ void FormDocument::build()
        fl_addto_choice(options_->choice_postscript_driver, tex_graphics[n]);
     }
 
-    bc_->addReadOnly (options_->slider_secnumdepth);
-    bc_->addReadOnly (options_->slider_tocdepth);
-    bc_->addReadOnly (options_->check_use_amsmath);
-    bc_->addReadOnly (options_->input_float_placement);
-    bc_->addReadOnly (options_->choice_postscript_driver);
+    bc_.addReadOnly (options_->slider_secnumdepth);
+    bc_.addReadOnly (options_->slider_tocdepth);
+    bc_.addReadOnly (options_->check_use_amsmath);
+    bc_.addReadOnly (options_->input_float_placement);
+    bc_.addReadOnly (options_->choice_postscript_driver);
 
     // the document bullets form
     bullets_ = build_doc_bullet();
@@ -251,8 +258,10 @@ void FormDocument::build()
     fl_set_input_return(bullets_->input_bullet_latex, FL_RETURN_CHANGED);
     fl_set_input_maxchars(bullets_->input_bullet_latex, 80);
 
-    fl_set_form_atclose(dialog_->form,
-                       C_FormDocumentWMHideCB, 0);
+    bc_.addReadOnly (bullets_->bmtable_bullet_panel);
+    bc_.addReadOnly (bullets_->choice_bullet_size);
+    bc_.addReadOnly (bullets_->input_bullet_latex);
+
     fl_addto_tabfolder(dialog_->tabbed_folder,_("Document"),
                       class_->form);
     fl_addto_tabfolder(dialog_->tabbed_folder,_("Paper"),
@@ -273,36 +282,6 @@ void FormDocument::build()
 }
 
 
-void FormDocument::show()
-{
-    if (!dialog_)
-       build();
-
-    update();  // make sure its up-to-date
-    if (dialog_->form->visible) {
-        fl_raise_form(dialog_->form);
-    } else {
-        fl_show_form(dialog_->form,
-                     FL_PLACE_MOUSE | FL_FREE_SIZE,
-                     FL_TRANSIENT, _("Document Layout"));
-       u_ = d_->updateBufferDependent.connect(
-           slot(this, &FormDocument::update));
-       h_ = d_->hideBufferDependent.connect(
-           slot(this, &FormDocument::hide));
-    }
-}
-
-
-void FormDocument::hide()
-{
-    if (dialog_->form->visible) {
-        fl_hide_form(dialog_->form);
-        u_.disconnect();
-        h_.disconnect();
-    }
-}
-
-
 void FormDocument::apply()
 {
     if (!lv_->view()->available() || !dialog_)
@@ -571,6 +550,7 @@ void FormDocument::cancel()
     param.temp_bullets[1] = param.user_defined_bullets[1];
     param.temp_bullets[2] = param.user_defined_bullets[2];
     param.temp_bullets[3] = param.user_defined_bullets[3];
+    hide();
 }
 
 
@@ -761,15 +741,6 @@ void FormDocument::bullets_update(BufferParams const & params)
        fl_activate_object(fbullet);
        fl_set_object_lcol(fbullet, FL_BLACK);
     }
-    if (lv_->buffer()->isReadonly()) {
-       fl_deactivate_object (bullets_->bmtable_bullet_panel);
-       fl_deactivate_object (bullets_->choice_bullet_size);
-       fl_deactivate_object (bullets_->input_bullet_latex);
-    } else {
-       fl_activate_object (bullets_->bmtable_bullet_panel);
-       fl_activate_object (bullets_->choice_bullet_size);
-       fl_activate_object (bullets_->input_bullet_latex);
-    }
 
     fl_set_button(bullets_->radio_bullet_depth_1, 1);
     fl_set_input(bullets_->input_bullet_latex,
@@ -779,95 +750,10 @@ void FormDocument::bullets_update(BufferParams const & params)
 }
 
 
-void FormDocument::free()
-{
-    if (dialog_) {
-        hide();
-        if (class_) {
-#ifdef USE_CLASS_COMBO
-           delete combo_doc_class;
-#endif
-            fl_free_form(class_->form);
-            delete class_;
-            class_ = 0;
-        }
-        if (paper_) {
-            fl_free_form(paper_->form);
-            delete paper_;
-            paper_ = 0;
-        }
-        if (language_) {
-           delete combo_language;
-            fl_free_form(language_->form);
-            delete language_;
-            language_ = 0;
-        }
-        if (options_) {
-            fl_free_form(options_->form);
-            delete options_;
-            options_ = 0;
-        }
-        if (bullets_) {
-            fl_free_form(bullets_->form);
-            delete bullets_;
-            bullets_ = 0;
-        }
-        fl_free_form(dialog_->form);
-        delete dialog_;
-        dialog_ = 0;
-    }
-}
-
-
-int FormDocument::WMHideCB(FL_FORM * form, void *)
-{
-    // Ensure that the signals (u and h) are disconnected even if the
-    // window manager is used to close the popup.
-    FormDocument * pre = static_cast<FormDocument*>(form->u_vdata);
-    pre->hide();
-    pre->bc_->hide();
-    return FL_CANCEL;
-}
-
-
-void FormDocument::OKCB(FL_OBJECT * ob, long)
-{
-    FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
-    pre->apply();
-    pre->hide();
-    pre->bc_->ok();
-}
-
-
-void FormDocument::ApplyCB(FL_OBJECT * ob, long)
-{
-    FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
-    pre->apply();
-    pre->bc_->apply();
-}
-
-
-void FormDocument::CancelCB(FL_OBJECT * ob, long)
-{
-    FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
-    pre->cancel();
-    pre->hide();
-    pre->bc_->cancel();
-}
-
-
-void FormDocument::RestoreCB(FL_OBJECT * ob, long)
-{
-    FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
-    pre->update();
-    pre->bc_->undoAll();
-}
-
-
 void FormDocument::InputCB(FL_OBJECT * ob, long)
 {
     FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
-    pre->bc_->valid(pre->CheckDocumentInput(ob,0));
+    pre->bc_.valid(pre->CheckDocumentInput(ob,0));
 }
 
 
@@ -876,7 +762,7 @@ void FormDocument::ComboInputCB(int, void * v, Combox * combox)
     FormDocument * pre = static_cast<FormDocument*>(v);
     if (combox == pre->combo_doc_class)
        pre->CheckChoiceClass(0, 0);
-    pre->bc_->valid(pre->CheckDocumentInput(0,0));
+    pre->bc_.valid(pre->CheckDocumentInput(0,0));
 }
 
 
@@ -884,13 +770,13 @@ void FormDocument::ChoiceClassCB(FL_OBJECT * ob, long)
 {
     FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
     pre->CheckChoiceClass(ob,0);
-    pre->bc_->valid(pre->CheckDocumentInput(ob,0));
+    pre->bc_.valid(pre->CheckDocumentInput(ob,0));
 }
 
 
 void FormDocument::checkReadOnly()
 {
-    if (bc_->readOnly(lv_->buffer()->isReadonly())) {
+    if (bc_.readOnly(lv_->buffer()->isReadonly())) {
        combo_doc_class->deactivate();
        combo_language->deactivate();
        fl_set_object_label(dialog_->text_warning,
@@ -1014,7 +900,7 @@ void FormDocument::ChoiceBulletSizeCB(FL_OBJECT * ob, long)
 {
     FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
     pre->ChoiceBulletSize(ob,0);
-    pre->bc_->valid(pre->CheckDocumentInput(ob,0));
+    pre->bc_.valid(pre->CheckDocumentInput(ob,0));
 }
 
 
@@ -1033,7 +919,7 @@ void FormDocument::InputBulletLaTeXCB(FL_OBJECT * ob, long)
 {
     FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
     pre->InputBulletLaTeX(ob,0);
-    pre->bc_->valid(pre->CheckDocumentInput(ob,0));
+    pre->bc_.valid(pre->CheckDocumentInput(ob,0));
 }
 
 
@@ -1046,10 +932,10 @@ void FormDocument::InputBulletLaTeX(FL_OBJECT *, long)
 }
 
 
-void FormDocument::BulletDepthCB(FL_OBJECT * ob, long)
+void FormDocument::BulletDepthCB(FL_OBJECT * ob, long data)
 {
     FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
-    pre->BulletDepth(ob,0);
+    pre->BulletDepth(ob, data);
 }
 
 
@@ -1138,7 +1024,7 @@ void FormDocument::BulletBMTableCB(FL_OBJECT * ob, long)
 {
     FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
     pre->BulletBMTable(ob,0);
-    pre->bc_->valid(pre->CheckDocumentInput(ob,0));
+    pre->bc_.valid(pre->CheckDocumentInput(ob,0));
 }
 
 
index 3dadb8a5d8028ca6ace2272195e876c54dca5516..efc22c0e09b5fcb7f4ec58c290b780ac8b96bd77 100644 (file)
@@ -13,8 +13,7 @@
 #ifndef FORM_DOCUMENT_H
 #define FORM_DOCUMENT_H
 
-#include "DialogBase.h"
-#include "support/utility.hpp"
+#include "FormBase.h"
 #include <vector>
 
 #ifdef __GNUG_
@@ -25,8 +24,6 @@ class LyXView;
 class Dialogs;
 class Combox;
 class BufferParams;
-class NoRepeatedApplyReadOnlyPolicy;
-template <class x> class ButtonController;
 
 struct FD_form_tabbed_document;
 struct FD_form_doc_paper;
@@ -35,30 +32,16 @@ struct FD_form_doc_language;
 struct FD_form_doc_options;
 struct FD_form_doc_bullet;
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Connection;
-#endif
-
 /** This class provides an XForms implementation of the FormDocument Popup.
     The table-layout-form here changes values for latex-tabulars
  */
-class FormDocument : public DialogBase, public noncopyable {
+class FormDocument : public FormBase {
 public:
     /// #FormDocument x(Communicator ..., Popups ...);#
     FormDocument(LyXView *, Dialogs *);
     ///
     ~FormDocument();
-    ///
-    static  int WMHideCB(FL_FORM *, void *);
-    ///
-    static void OKCB(FL_OBJECT *, long);
-    ///
-    static void ApplyCB(FL_OBJECT *, long);
-    ///
-    static void CancelCB(FL_OBJECT *, long);
-    ///
-    static void RestoreCB(FL_OBJECT *, long);
-    ///
+    /// this operates very differently to FormBase::InputCB
     static void InputCB(FL_OBJECT *, long);
     ///
     static void ComboInputCB(int, void *, Combox *);
@@ -74,15 +57,6 @@ public:
     static void BulletPanelCB(FL_OBJECT * ob, long);
     ///
     static void BulletBMTableCB(FL_OBJECT * ob, long);
-    ///
-    enum EnumPopupStatus {
-       ///
-        POPUP_UNMODIFIED,
-       ///
-        POPUP_MODIFIED,
-       ///
-        POPUP_READONLY
-    };
 
 private:
     ///
@@ -106,12 +80,8 @@ private:
     ///
     void UpdateLayoutDocument(BufferParams const & params);
 
-    /// Create the popup if necessary, update it and display it.
-    void show();
-    /// Hide the popup.
-    void hide();
     /// Update the popup.
-    void update();
+    virtual void update();
     ///
     void paper_update(BufferParams const &);
     ///
@@ -123,7 +93,7 @@ private:
     ///
     void bullets_update(BufferParams const &);
     /// Apply from popup
-    void apply();
+    virtual void apply();
     ///
     void paper_apply();
     ///
@@ -135,11 +105,15 @@ private:
     ///
     void bullets_apply();
     /// Cancel from popup
-    void cancel();
+    virtual void cancel();
+    ///
+    virtual void restore() {
+       update();
+    }
     /// Build the popup
-    void build();
-    /// Explicitly free the popup.
-    void free();
+    virtual void build();
+    ///
+    virtual FL_FORM * const FormDocument::form() const;
 
     /// Typedefinitions from the fdesign produced Header file
     FD_form_tabbed_document * build_tabbed_document();
@@ -166,16 +140,6 @@ private:
     FD_form_doc_options     * options_;
     ///
     FD_form_doc_bullet      * bullets_;
-    /// Which LyXView do we belong to?
-    LyXView * lv_;
-    ///
-    Dialogs * d_;
-    /// Update connection.
-    Connection u_;
-    /// Hide connection.
-    Connection h_;
-    /// has form contents changed? Used to control OK/Apply
-    EnumPopupStatus status;
     ///
     int ActCell;
     ///
@@ -190,8 +154,6 @@ private:
     Combox * combo_language;
     ///
     Combox * combo_doc_class;
-    ///
-    ButtonController<NoRepeatedApplyReadOnlyPolicy> * bc_;
 };
 
 #endif
index d84e098e10eda29bd499ad509b37e6c897c284f4..d4f339ce45f760c9b1abbaa0c2479546ccdf0385 100644 (file)
@@ -33,13 +33,13 @@ private:
        /// Slot launching dialog to an existing inset
        void showInset( InsetError * const );
        /// Update dialog before showing it
-       void update();
+       virtual void update();
        /// Build the dialog
-       void build();
+       virtual void build();
        /// Reset data when hide() is called
-       void clearStore();
+       virtual void clearStore();
        /// Pointer to the actual instantiation of the xform's form
-       FL_FORM * const form() const;
+       virtual FL_FORM * const form() const;
        /// Fdesign generated method
        FD_form_error * build_error();
 
index db1753948586bb368597088cf1c816d542dbe3dc..1be5ca769469b267860294bc0146f5e4448ea47a 100644 (file)
@@ -18,7 +18,6 @@
 #endif
 
 
-#include "gettext.h"
 #include "Dialogs.h"
 #include "FormIndex.h"
 #include "LyXView.h"
index bcd94511cde546bd90cbc9c9712c74565beede74..2c2a3ac135ed89754c4463fd2b6a3ca35c63de63 100644 (file)
@@ -30,8 +30,6 @@ public:
 private:
        /// Build the dialog
        virtual void build();
-       /// Not used but must be instantiated
-       virtual void input(long) {}
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index 9fe672b52c8605f53644f14b88cabb6600c652c5..f75eb448c40433912e72c837862ecedb50661f5c 100644 (file)
@@ -50,9 +50,11 @@ C_GENERICCB(FormParagraph, VSpaceCB)
 FormParagraph::FormParagraph(LyXView * lv, Dialogs * d)
        : dialog_(0), general_(0), extra_(0),
          lv_(lv), d_(d), u_(0), h_(0),
-         status(POPUP_UNMODIFIED) ,
-         bc_(new ButtonController<NoRepeatedApplyReadOnlyPolicy>(_("Cancel"),
-                                                                 _("Close")))
+         status(POPUP_UNMODIFIED),
+// this will leak till converted to use FormBase
+         bc_(new ButtonController(new NoRepeatedApplyReadOnlyPolicy,
+                                  _("Cancel"),
+                                  _("Close")))
 {
     // let the popup be shown
     // This is a permanent connection so we won't bother
index 947cf094c97b0ad7eb4d61c34d2e1d0f95e123c6..ca2b970bc6f5d16ea38172c13e0b8061f9501fd2 100644 (file)
@@ -24,7 +24,8 @@
 class LyXView;
 class Dialogs;
 class NoRepeatedApplyReadOnlyPolicy;
-template <class x> class ButtonController;
+//template <class x> class ButtonController;
+class ButtonController;
 
 struct FD_form_tabbed_paragraph;
 struct FD_form_paragraph_general;
@@ -110,7 +111,7 @@ private:
     /// has form contents changed? Used to control OK/Apply
     EnumPopupStatus status;
     ///
-    ButtonController<NoRepeatedApplyReadOnlyPolicy> * bc_;
+       ButtonController/*<NoRepeatedApplyReadOnlyPolicy>*/ * bc_;
 };
 
 #endif
index b1b163572a783275a55ee09f2c2aff2b7b5807cc..b6b6f4e63b224c0350cba18939dfb632f9089ee4 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "FormPreferences.h"
 #include "form_preferences.h"
-#include "xform_macros.h"
 #include "input_validators.h"
 #include "LyXView.h"
 #include "lyxfunc.h"
 #include "support/FileInfo.h"
 #include "support/filetools.h"
 #include "lyx_gui_misc.h"
-#include "gettext.h"
-#include "ButtonController.h"
 
 #ifdef SIGC_CXX_NAMESPACES
 using SigC::slot;
 #endif
 
-C_RETURNCB(FormPreferences,  WMHideCB)
-C_GENERICCB(FormPreferences, OKCB)
-C_GENERICCB(FormPreferences, ApplyCB)
-C_GENERICCB(FormPreferences, CancelCB)
-C_GENERICCB(FormPreferences, InputCB)
-C_GENERICCB(FormPreferences, RestoreCB)
-
 
 FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
-       : dialog_(0), bind_(0), misc_(0), screen_fonts_(0), interface_fonts_(0),
-         printer_(0), paths_(0), lv_(lv), d_(d), u_(0), h_(0),
-         minw_(0), minh_(0),
-         bc_(new ButtonController<PreferencesPolicy>(_("Cancel"), _("Close")))
+       : FormBase(lv, d, BUFFER_INDEPENDENT, _("Preferences"), new PreferencesPolicy),
+         dialog_(0), bind_(0), misc_(0), screen_fonts_(0), interface_fonts_(0),
+         printer_(0), paths_(0), minw_(0), minh_(0)
 {
        // let the dialog be shown
        // This is a permanent connection so we won't bother
@@ -53,7 +42,12 @@ FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
 FormPreferences::~FormPreferences()
 {
        delete dialog_;
-       delete bc_;
+       delete bind_;
+       delete misc_;
+       delete screen_fonts_;
+       delete interface_fonts_;
+       delete printer_;
+       delete paths_;
 }
 
 
@@ -62,11 +56,11 @@ void FormPreferences::build()
        dialog_ = build_preferences();
 
        // manage the restore, save, apply and cancel/close buttons
-       bc_->setOK(dialog_->button_ok);
-       bc_->setApply(dialog_->button_apply);
-       bc_->setCancel(dialog_->button_cancel);
-       bc_->setUndoAll(dialog_->button_restore);
-       bc_->refresh();
+       bc_.setOK(dialog_->button_ok);
+       bc_.setApply(dialog_->button_apply);
+       bc_.setCancel(dialog_->button_cancel);
+       bc_.setUndoAll(dialog_->button_restore);
+       bc_.refresh();
 
        // Workaround dumb xforms sizing bug
        minw_ = dialog_->form->w;
@@ -156,9 +150,6 @@ void FormPreferences::build()
                           _("Paths"),
                           paths_->form);
 
-       fl_set_form_atclose(dialog_->form,
-                           C_FormPreferencesWMHideCB, 0);
-
        // deactivate the various browse buttons because they
        // currently aren't implemented
        fl_deactivate_object(bind_->button_bind_file_browse);
@@ -176,34 +167,19 @@ void FormPreferences::build()
 }
 
 
-void FormPreferences::show()
+FL_FORM * const FormPreferences::form() const
 {
-       if (!dialog_) {
-               build();
-       }
-       update();  // make sure its up-to-date
-
-       if (dialog_->form->visible) {
-               fl_raise_form(dialog_->form);
-       } else {
-               fl_set_form_minsize(dialog_->form,
-                                   minw_,
-                                   minh_);
-               fl_show_form(dialog_->form,
-                            FL_PLACE_MOUSE | FL_FREE_SIZE,
-                            FL_TRANSIENT,
-                            _("Preferences"));
-       }
+       if (dialog_) return dialog_->form;
+       return 0;
 }
 
 
-void FormPreferences::hide()
+void FormPreferences::connect()
 {
-       if (dialog_
-           && dialog_->form
-           && dialog_->form->visible) {
-               fl_hide_form(dialog_->form);
-       }
+       FormBase::connect();
+       fl_set_form_minsize(dialog_->form,
+                           minw_,
+                           minh_);
 }
 
 
@@ -464,7 +440,7 @@ void FormPreferences::update()
 }
 
 
-bool FormPreferences::input()
+bool FormPreferences::input(long)
 {
        bool activate = true;
        //
@@ -542,54 +518,8 @@ bool FormPreferences::input()
 }
 
 
-int FormPreferences::WMHideCB(FL_FORM * form, void *)
-{
-       // Ensure that the signals (u and h) are disconnected even if the
-       // window manager is used to close the dialog.
-       FormPreferences * pre = static_cast<FormPreferences*>(form->u_vdata);
-       pre->hide();
-       pre->bc_->hide();
-       return FL_CANCEL;
-}
-
-
-void FormPreferences::OKCB(FL_OBJECT * ob, long)
-{
-       FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
-       pre->apply();
-       pre->hide();
-       pre->bc_->ok();
-       pre->lv_->getLyXFunc()->Dispatch(LFUN_SAVEPREFERENCES);
-}
-
-
-void FormPreferences::ApplyCB(FL_OBJECT * ob, long)
-{
-       FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
-       pre->apply();
-       pre->bc_->apply();
-}
-
-
-void FormPreferences::CancelCB(FL_OBJECT * ob, long)
-{
-       FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
-       pre->hide();
-       pre->bc_->cancel();
-}
-
-
-void FormPreferences::InputCB(FL_OBJECT * ob, long)
-{
-       FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
-       pre->bc_->valid(pre->input());
-}
-
-
-void FormPreferences::RestoreCB(FL_OBJECT * ob, long)
+void FormPreferences::ok()
 {
-       FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
-       pre->update();
-       pre->input();
-       pre->bc_->undoAll();
+       FormBase::ok();
+       lv_->getLyXFunc()->Dispatch(LFUN_SAVEPREFERENCES);
 }
index ad69716354bb838b6fdb47ae69d481eda6080bf9..960b933f95477ef2f453d3e231491f87dc8b1161 100644 (file)
@@ -17,8 +17,7 @@
 #ifndef FORMPREFERENCES_H
 #define FORMPREFERENCES_H
 
-#include "DialogBase.h"
-#include "support/utility.hpp"
+#include "FormBase.h"
 
 #ifdef __GNUG_
 #pragma interface
@@ -26,8 +25,6 @@
 
 class LyXView;
 class Dialogs;
-class PreferencesPolicy;
-template <class x> class ButtonController;
 
 struct FD_form_preferences;
 struct FD_form_bind;
@@ -37,46 +34,30 @@ struct FD_form_interface_fonts;
 struct FD_form_printer;
 struct FD_form_paths;
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Connection;
-#endif
-
 /** This class provides an XForms implementation of the FormPreferences Dialog.
     The preferences dialog allows users to set/save their preferences.
  */
-class FormPreferences : public DialogBase, public noncopyable {
+class FormPreferences : public FormBase {
 public:
        /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
        FormPreferences(LyXView *, Dialogs *);
        ///
        ~FormPreferences();
-
-       ///
-       static  int WMHideCB(FL_FORM *, void *);
-       ///
-       static void OKCB(FL_OBJECT *, long);
-       ///
-       static void ApplyCB(FL_OBJECT *, long);
-       ///
-       static void CancelCB(FL_OBJECT *, long);
-       ///
-       static void InputCB(FL_OBJECT *, long);
-       ///
-       static void RestoreCB(FL_OBJECT *, long);
 private:
-       /// Create the dialog if necessary, update it and display it.
-       void show();
-       /// Hide the dialog.
-       void hide();
+       ///
+       virtual void connect();
        /// Update the dialog.
-       void update();
-
+       virtual void update();
+       /// OK from dialog
+       virtual void ok();
        /// Apply from dialog
-       void apply();
+       virtual void apply();
        /// Filter the inputs -- return true if entries are valid
-       bool input();
+       virtual bool input(long);
        /// Build the dialog
-       void build();
+       virtual void build();
+       ///
+       virtual FL_FORM * const form() const;
        ///
        FD_form_preferences * build_preferences();
        ///
@@ -106,20 +87,10 @@ private:
        FD_form_printer * printer_;
        ///
        FD_form_paths * paths_;
-       /// Which LyXView do we belong to?
-       LyXView * lv_;
-       ///
-       Dialogs * d_;
-       /// Update connection.
-       Connection u_;
-       /// Hide connection.
-       Connection h_;
        /// Overcome a dumb xforms sizing bug
        int minw_;
        ///
        int minh_;
-       ///
-       ButtonController<PreferencesPolicy> * bc_;
 };
 
 #endif
index 500963f067dca1a87da99f269446a3e290db28c1..83964a7d25dcc8982e3899618af22cc41c5b4ac3 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "FormPrint.h"
 #include "form_print.h"
-#include "xform_macros.h"
 #include "input_validators.h"
 #include "LyXView.h"
 #include "Dialogs.h"
@@ -22,9 +21,7 @@
 #include "Liason.h"
 #include "debug.h"
 #include "BufferView.h"
-#include "lyx_gui_misc.h"
-#include "gettext.h"
-
+#include "lyx_gui_misc.h"      // WriteAlert
 
 #ifdef SIGC_CXX_NAMESPACES
 using SigC::slot;
@@ -35,15 +32,10 @@ using Liason::printBuffer;
 using Liason::getPrinterParams;
 #endif
 
-C_RETURNCB(FormPrint,  WMHideCB)
-C_GENERICCB(FormPrint, OKCB)
-C_GENERICCB(FormPrint, ApplyCB)
-C_GENERICCB(FormPrint, CancelCB)
-C_GENERICCB(FormPrint, InputCB)
-
 
 FormPrint::FormPrint(LyXView * lv, Dialogs * d)
-       : dialog_(0), lv_(lv), d_(d), u_(0), h_(0)
+       : FormBase(lv, d, BUFFER_DEPENDENT, _("Print"), new OkApplyCancelPolicy),
+         dialog_(0), target_(2), order_(2), which_(3)
 {
        // let the dialog be shown
        // This is a permanent connection so we won't bother
@@ -62,6 +54,12 @@ void FormPrint::build()
 {
        dialog_ = build_print();
 
+       // manage the ok, apply and cancel/close buttons
+       bc_.setOK(dialog_->button_ok);
+       bc_.setApply(dialog_->button_apply);
+       bc_.setCancel(dialog_->button_cancel);
+       bc_.refresh();
+
        // allow controlling of input and ok/apply (de)activation
        fl_set_input_return(dialog_->input_printer,
                            FL_RETURN_CHANGED);
@@ -89,46 +87,39 @@ void FormPrint::build()
        fl_set_input_maxchars(dialog_->input_to_page, 4);   // 9999
        fl_set_input_maxchars(dialog_->input_count, 4);     // 9999
 
-       fl_set_form_atclose(dialog_->form,
-                           C_FormPrintWMHideCB, 0);
+       target_.reset();
+       target_.registerRadioButton(dialog_->radio_printer,
+                                   PrinterParams::PRINTER);
+       target_.registerRadioButton(dialog_->radio_file,
+                                   PrinterParams::FILE);
+       order_.reset();
+       order_.registerRadioButton(dialog_->radio_order_reverse,
+                                  true);
+       order_.registerRadioButton(dialog_->radio_order_normal,
+                                  false);
+       which_.reset();
+       which_.registerRadioButton(dialog_->radio_odd_pages,
+                                  PrinterParams::ODD);
+       which_.registerRadioButton(dialog_->radio_even_pages,
+                                  PrinterParams::EVEN);
+       which_.registerRadioButton(dialog_->radio_all_pages,
+                                  PrinterParams::ALL);
 }
 
 
-void FormPrint::show()
+void FormPrint::connect()
 {
-       if (!dialog_) {
-               build();
-       }
-
-       update();  // make sure its up-to-date
-
-       if (dialog_->form->visible) {
-               fl_raise_form(dialog_->form);
-       } else {
-               fl_show_form(dialog_->form,
-                            FL_PLACE_MOUSE | FL_FREE_SIZE,
-                            FL_TRANSIENT,
-                            _("Print"));
-               fl_set_form_minsize(dialog_->form,
-                                   dialog_->form->w,
-                                   dialog_->form->h);
-               u_ = d_->updateBufferDependent.connect(slot(this,
-                                                           &FormPrint::update));
-               h_ = d_->hideBufferDependent.connect(slot(this,
-                                                         &FormPrint::hide));
-       }
+       FormBase::connect();
+       fl_set_form_minsize(dialog_->form,
+                           dialog_->form->w,
+                           dialog_->form->h);
 }
 
 
-void FormPrint::hide()
+FL_FORM * const FormPrint::form() const
 {
-       if (dialog_
-           && dialog_->form
-           && dialog_->form->visible) {
-               fl_hide_form(dialog_->form);
-               u_.disconnect();
-               h_.disconnect();
-       }
+       if (dialog_) return dialog_->form;
+       return 0;
 }
 
 
@@ -138,12 +129,8 @@ void FormPrint::apply()
                return;
        }
 
-       PrinterParams::WhichPages wp(PrinterParams::ALL);
-       if (fl_get_button(dialog_->radio_even_pages)) {
-               wp = PrinterParams::EVEN;
-       } else if (fl_get_button(dialog_->radio_odd_pages)) {
-               wp = PrinterParams::ODD;
-       }
+       PrinterParams::WhichPages
+               wp(static_cast<PrinterParams::WhichPages>(which_.getButton()));
 
        string from;
        int to(0);
@@ -156,10 +143,8 @@ void FormPrint::apply()
                } // else we only print one page.
        }
 
-       PrinterParams::Target t(PrinterParams::PRINTER);
-       if (fl_get_button(dialog_->radio_file)) {
-               t = PrinterParams::FILE;
-       }
+       PrinterParams::Target
+               t(static_cast<PrinterParams::Target>(target_.getButton()));
 
        // we really should use the return value here I think.
        if (!printBuffer(lv_->buffer(),
@@ -167,8 +152,7 @@ void FormPrint::apply()
                                       string(fl_get_input(dialog_->input_printer)),
                                       string(fl_get_input(dialog_->input_file)),
                                       wp, from, to,
-                                      static_cast<bool>(fl_get_button(dialog_->
-                                                                      radio_order_reverse)),
+                                      static_cast<bool>(order_.getButton()),
                                       static_cast<bool>(fl_get_button(dialog_->
                                                                       radio_unsorted)),
                                       strToInt(fl_get_input(dialog_->input_count))))) {
@@ -188,50 +172,9 @@ void FormPrint::update()
                fl_set_input(dialog_->input_printer, pp.printer_name.c_str());
                fl_set_input(dialog_->input_file, pp.file_name.c_str());
 
-               switch (pp.target) {
-               case PrinterParams::FILE:
-                       fl_set_button(dialog_->radio_printer, 0);
-                       fl_set_button(dialog_->radio_file, 1);
-                       break;
-
-               case PrinterParams::PRINTER:
-               default:
-                       fl_set_button(dialog_->radio_printer, 1);
-                       fl_set_button(dialog_->radio_file, 0);
-                       break;
-               }
-
-               switch (pp.reverse_order) {
-               case true:
-                       fl_set_button(dialog_->radio_order_normal, 0);
-                       fl_set_button(dialog_->radio_order_reverse, 1);
-                       break;
-
-               case false:
-               default:
-                       fl_set_button(dialog_->radio_order_normal, 1);
-                       fl_set_button(dialog_->radio_order_reverse, 0);
-                       break;
-               }
-// should be able to remove the various set_button 0 and rely on radio button
-// action.  Provided xforms is smart enough :D
-               fl_set_button(dialog_->radio_all_pages, 0);
-               fl_set_button(dialog_->radio_odd_pages, 0);
-               fl_set_button(dialog_->radio_even_pages, 0);
-               switch (pp.which_pages) {
-               case PrinterParams::ODD:
-                       fl_set_button(dialog_->radio_odd_pages, 1);
-                       break;
-
-               case PrinterParams::EVEN:
-                       fl_set_button(dialog_->radio_even_pages, 1);
-                       break;
-
-               case PrinterParams::ALL:
-               default:
-                       fl_set_button(dialog_->radio_all_pages, 1);
-                       break;
-               }
+               target_.setButton(pp.target);
+               order_.setButton(pp.reverse_order);
+               which_.setButton(pp.which_pages);
 
                // hmmm... maybe a bit weird but maybe not
                // we might just be remembering the last
@@ -256,18 +199,6 @@ void FormPrint::update()
 
                fl_set_input(dialog_->input_count,
                             tostr(pp.count_copies).c_str());
-
-               // Even readonly docs can be printed
-               // these 4 activations are probably superfluous but I'm
-               // being explicit for a reason.
-               // They can probably be removed soon along with a few more
-               // of the de/activations above once input() is a bit smarter.
-               fl_activate_object(dialog_->input_count);
-               fl_activate_object(dialog_->input_file);
-               fl_activate_object(dialog_->input_from_page);
-               fl_activate_object(dialog_->input_printer);
-               // and we should always be in a working state upon exit
-               input();
        }
 }
 
@@ -275,7 +206,7 @@ void FormPrint::update()
 // It would be nice if we checked for cases like:
 // Print only-odd-pages and from_page == an even number
 //
-void FormPrint::input()
+bool FormPrint::input(long)
 {
        bool activate = true;
 
@@ -316,55 +247,5 @@ void FormPrint::input()
 //         && !strlen(fl_get_input(dialog_->input_printer))) {
 //             activate = false;
 //     }
-
-       if (activate) {
-               fl_activate_object(dialog_->button_ok);
-               fl_activate_object(dialog_->button_apply);
-               fl_set_object_lcol(dialog_->button_ok, FL_BLACK);
-               fl_set_object_lcol(dialog_->button_apply, FL_BLACK);
-       } else {
-               fl_deactivate_object(dialog_->button_ok);
-               fl_deactivate_object(dialog_->button_apply);
-               fl_set_object_lcol(dialog_->button_ok, FL_INACTIVE);
-               fl_set_object_lcol(dialog_->button_apply, FL_INACTIVE);
-       }
-}
-
-
-int FormPrint::WMHideCB(FL_FORM * form, void *)
-{
-       // Ensure that the signals (u and h) are disconnected even if the
-       // window manager is used to close the dialog.
-       FormPrint * pre = static_cast<FormPrint*>(form->u_vdata);
-       pre->hide();
-       return FL_CANCEL;
-}
-
-
-void FormPrint::OKCB(FL_OBJECT * ob, long)
-{
-       FormPrint * pre = static_cast<FormPrint*>(ob->form->u_vdata);
-       pre->apply();
-       pre->hide();
-}
-
-
-void FormPrint::ApplyCB(FL_OBJECT * ob, long)
-{
-       FormPrint * pre = static_cast<FormPrint*>(ob->form->u_vdata);
-       pre->apply();
-}
-
-
-void FormPrint::CancelCB(FL_OBJECT * ob, long)
-{
-       FormPrint * pre = static_cast<FormPrint*>(ob->form->u_vdata);
-       pre->hide();
-}
-
-
-void FormPrint::InputCB(FL_OBJECT * ob, long)
-{
-       FormPrint * pre = static_cast<FormPrint*>(ob->form->u_vdata);
-       pre->input();
+       return activate;
 }
index 1d9a568b420b97259202fa0d16b8de4baf9e6a20..55417b75db23c6488a20856886f58c230bb59d6f 100644 (file)
@@ -17,8 +17,8 @@
 #ifndef FORMPRINT_H
 #define FORMPRINT_H
 
-#include "DialogBase.h"
-#include "support/utility.hpp"
+#include "FormBase.h"
+#include "RadioButtonGroup.h"
 
 #ifdef __GNUG__
 #pragma interface
@@ -28,57 +28,41 @@ class LyXView;
 class Dialogs;
 struct FD_form_print;
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Connection;
-#endif
-
 /** This class provides an XForms implementation of the FormPrint Dialog.
     The print dialog allows users to print their documents.
  */
-class FormPrint : public DialogBase, public noncopyable {
+class FormPrint : public FormBase {
 public:
-       /// #FormPrint x(LyXFunc ..., Dialogs ...);#
+       /// #FormPrint x(LyXView ..., Dialogs ...);#
        FormPrint(LyXView *, Dialogs *);
        ///
        ~FormPrint();
 
-       ///
-       static  int WMHideCB(FL_FORM *, void *);
-       ///
-       static void OKCB(FL_OBJECT *, long);
-       ///
-       static void ApplyCB(FL_OBJECT *, long);
-       ///
-       static void CancelCB(FL_OBJECT *, long);
-       ///
-       static void InputCB(FL_OBJECT *, long);
 private:
-       /// Create the dialog if necessary, update it and display it.
-       void show();
-       /// Hide the dialog.
-       void hide();
        /// Update the dialog.
-       void update();
-
+       virtual void update();
        /// Apply from dialog
-       void apply();
+       virtual void apply();
        /// Filter the inputs
-       void input();
+       virtual bool input(long);
+       ///
+       virtual void connect();
+       /// Pointer to the actual instantiation of the xform's form
+       virtual FL_FORM * const form() const;
        /// Build the dialog
-       void build();
+       virtual void build();
+
        ///
        FD_form_print * build_print();
-
+       
        /// Real GUI implementation.
        FD_form_print * dialog_;
-       /// Which LyXView do we belong to?
-       LyXView * lv_;
-       ///
-       Dialogs * d_;
-       /// Update connection.
-       Connection u_;
-       /// Hide connection.
-       Connection h_;
+       /// print target
+       RadioButtonGroup target_;
+       /// page order
+       RadioButtonGroup order_;
+       /// which pages
+       RadioButtonGroup which_;
 };
 
 #endif
index bfe09ee2d776ccb1595a73c11696679b70498b19..c8c454e9333e9ae36d3d8937c689420485ab1da2 100644 (file)
@@ -18,7 +18,6 @@
 #endif
 
 
-#include "gettext.h"
 #include "Dialogs.h"
 #include "FormRef.h"
 #include "LyXView.h"
@@ -77,15 +76,10 @@ void FormRef::build()
        // Can change reference only through browser
        fl_deactivate_object( dialog_->ref );
 
-       if( lv_->buffer()->isReadonly() ) {
-               fl_deactivate_object( dialog_->type );
-               fl_deactivate_object( dialog_->ok );
-               fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
-       } else {
-               fl_activate_object( dialog_->type );
-               fl_activate_object( dialog_->ok );
-               fl_set_object_lcol( dialog_->ok, FL_BLACK );
-       }
+       bc_.setOK( dialog_->ok );
+       bc_.setCancel( dialog_->cancel );
+       bc_.addReadOnly( dialog_->type );
+       bc_.refresh();
 }
 
 
@@ -114,8 +108,10 @@ void FormRef::update()
                refs = lv_->buffer()->getLabelList();
                updateBrowser( refs );
                showBrowser();
-       } else
+       } else {
                hideBrowser();
+       }
+       bc_.readOnly( lv_->buffer()->isReadonly() );
 }
 
 
@@ -163,9 +159,8 @@ void FormRef::showBrowser() const
        fl_set_object_lcol( dialog_->type, FL_INACTIVE );
        fl_deactivate_object( dialog_->go );
        fl_set_object_lcol( dialog_->go, FL_INACTIVE );
-       fl_deactivate_object( dialog_->ok );
-       fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
        fl_set_object_lcol( dialog_->ref, FL_INACTIVE );
+       bc_.valid(false);
 }
 
 
@@ -181,9 +176,8 @@ void FormRef::hideBrowser() const
        fl_set_object_lcol( dialog_->type, FL_BLACK );
        fl_activate_object( dialog_->go );
        fl_set_object_lcol( dialog_->go, FL_BLACK );
-       fl_deactivate_object( dialog_->ok );
-       fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
        fl_set_object_lcol( dialog_->ref, FL_BLACK );
+       bc_.invalid();
 }
 
 
@@ -252,8 +246,14 @@ void FormRef::apply()
 }
 
 
-void FormRef::input(long data)
+#ifdef WITH_WARNINGS
+#warning check use of buttoncontroller
+// Seems okay except that goref and goback shouldn't
+// affect the status of ok.
+#endif
+bool FormRef::input( long data )
 {
+       bool activate( true );
        switch( data ) {
        // goto reference / go back
        case 1:
@@ -302,8 +302,6 @@ void FormRef::input(long data)
                fl_set_object_lcol( dialog_->type, FL_BLACK );
                fl_activate_object( dialog_->go );
                fl_set_object_lcol( dialog_->go, FL_BLACK );
-               fl_activate_object( dialog_->ok );
-               fl_set_object_lcol( dialog_->ok, FL_BLACK );
                fl_set_object_lcol( dialog_->ref, FL_BLACK );
        }
        break;
@@ -321,12 +319,9 @@ void FormRef::input(long data)
        case 4:
        {
                Type type = static_cast<Type>( fl_get_choice(dialog_->type)-1 );
-               if( params.getCmdName() != getName( type ) ) {
-                       fl_activate_object( dialog_->ok );
-                       fl_set_object_lcol( dialog_->ok, FL_BLACK );
-               } else if( inset_ != 0 ) {
-                       fl_deactivate_object( dialog_->ok );
-                       fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
+               if( params.getCmdName() == getName( type )
+                   && inset_ ) {
+                       activate = false;
                }
        }
        break;
@@ -334,6 +329,7 @@ void FormRef::input(long data)
        default:
                break;
        }
+       return activate;
 }
 
 
index f71931fa3174a6242ae45f8e7f6de37385f66add..b175dd8f5800c397e612d5f7eb8e413d83f7adb8 100644 (file)
@@ -54,7 +54,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Filter the input
-       virtual void input(long);
+       virtual bool input( long );
        /// Update dialog before showing it
        virtual void update();
        /// Not used but must be instantiated
index de2d583afb719c497a2daa831a96b593414b94c9..834753510b6a3ffa85687a870d6caa7a847d2dee 100644 (file)
@@ -19,7 +19,6 @@
 #endif
 
 
-#include "gettext.h"
 #include "Dialogs.h"
 #include "FormToc.h"
 #include "LyXView.h"
index c3e20a32182e194f889696f7612dc865fdc82115..b1b34664b8ecea4fd9a8a66e2f5535b5d5cbcd5a 100644 (file)
@@ -31,8 +31,6 @@ public:
 private:
        /// Build the dialog
        virtual void build();
-       /// Not used but must be instantiated
-       virtual void input(long) {}
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index 73bb1342cb1bddd86be3e6a41a7fcdc1636f55e3..92de2cea1a6b03b70b8dddf68fed9e8b60d55345 100644 (file)
@@ -18,7 +18,6 @@
 #endif
 
 
-#include "gettext.h"
 #include "Dialogs.h"
 #include "FormUrl.h"
 #include "LyXView.h"
index 981ab6b671ee445d8fed810a471d9d9ac6284a03..bc4d4ab12f160540816b1c4b01995999e7c1b8d7 100644 (file)
@@ -30,8 +30,6 @@ public:
 private:
        /// Build the dialog
        virtual void build();
-       /// Not used but must be instantiated
-       virtual void input(long) {}
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index dbb33337b889efb71f39e86f6b0b05e0bc69f064..658f8c30910f704f29a0884e95fd6552a33b0f80 100644 (file)
@@ -9,12 +9,6 @@
  *          This file Copyright 2000 Baruch Even
  * ================================================= */
 
-/*
- * This class simplifies the work with a group of radio buttons,
- * the idea is that you register a bunch of radio buttons with the accompanying
- * value for each radio button and then you get to query or set the active
- * button in a single function call.
- */
 
 #ifndef RADIOBUTTONGROUP_H
 #define RADIOBUTTONGROUP_H
@@ -31,7 +25,12 @@ using std::pair;
 
 #include FORMS_H_LOCATION
 
-///
+/** This class simplifies the work with a group of radio buttons,
+ * the idea is that you register a bunch of radio buttons with the accompanying
+ * value for each radio button and then you get to query or set the active
+ * button in a single function call.
+ * @author Baruch Even
+ */
 class RadioButtonGroup {
 public:
        /// Constructor. Allocate space for 'n' items in the group.
index fb662bb87417bd7dcbd5d7c05cbdba15ccde7a27..2ef63202f9b7f4407e40369b5643fd24a1fa0174 100644 (file)
@@ -58,11 +58,11 @@ FD_form_citation * FormCitation::build_citation()
     fl_set_object_resize(obj, FL_RESIZE_X);
   fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 630, 90, 30, _("OK"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, _("Cancel"));
     fl_set_button_shortcut(obj, _("^["), 1);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index dfc2b889b482a16a0a1cd88059bc1a9bc1a63c7a..0b19336386d41f930acf52761a6d4880d574345e 100644 (file)
@@ -6,8 +6,8 @@
 
 /** Callbacks, globals and object handlers **/
 extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index f47d7ea012154c7c3c165faf83f53422d99ee899..981942a654d44d2c599d940378ee1e49fd3c597f 100644 (file)
@@ -38,7 +38,7 @@ FD_form_copyright * FormCopyright::build_copyright()
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_gravity(obj, FL_South, FL_South);
     fl_set_object_resize(obj, FL_RESIZE_NONE);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   obj = fl_add_text(FL_NORMAL_TEXT, 10, 190, 430, 190, _("LyX is distributed in the hope that it will\nbe useful, but WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of\nthe GNU General Public License\nalong with this program; if not, write to\nthe Free Software Foundation, Inc., \n675 Mass Ave, Cambridge, MA 02139, USA."));
     fl_set_object_boxtype(obj, FL_FRAME_BOX);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
index 28f25ea400752c7498799c26a5d2a321adcdfffd..984b0c3461273a7734722f2238175db15779dbdc 100644 (file)
@@ -5,7 +5,7 @@
 #define FD_form_copyright_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 732b4a076a3615044f9c56f9ef918a80becef05e..d26c54c4564c808a31f86732503fb542af55eb01 100644 (file)
@@ -35,20 +35,20 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document()
   fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 410, 100, 30, idex(_("Cancel|^[")));
     fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormDocumentCancelCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 410, 100, 30, idex(_("Apply|#A")));
     fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormDocumentApplyCB, 0);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
   fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 410, 100, 30, _("OK"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormDocumentOKCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 380, 435, 30, "");
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
   fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 410, 100, 30, idex(_("Restore|#R")));
     fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormDocumentRestoreCB, 0);
+    fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index f999a6eb37ed19150a966f6905ec5d89164cc2ae..1f7aad2020c5b6c9d33bb4f3734ee497347da183 100644 (file)
@@ -5,10 +5,10 @@
 #define FD_form_tabbed_document_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormDocumentCancelCB(FL_OBJECT *, long);
-extern  "C" void C_FormDocumentApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormDocumentOKCB(FL_OBJECT *, long);
-extern  "C" void C_FormDocumentRestoreCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
 
 extern  "C" void C_FormDocumentInputCB(FL_OBJECT *, long);
 
index 4b25c96cde0aa02247a8918e94f360934cfabb2d..7bd23ef3547fa8d9c62b8110b3963529961df44d 100644 (file)
@@ -30,7 +30,7 @@ FD_form_error * FormError::build_error()
   obj = fl_add_button(FL_RETURN_BUTTON, 135, 200, 130, 30, _("Close"));
     fl_set_object_gravity(obj, FL_South, FL_South);
     fl_set_object_resize(obj, FL_RESIZE_NONE);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index e223e2d258530906264aae26225ebd55d8c0ced5..7df3f4e4dce4f57d3e28823bbf35fe813bdc7766 100644 (file)
@@ -5,7 +5,7 @@
 #define FD_form_error_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 17446bebe6c8fd89df8c25ed0e8f6e3cbc98757c..d44921f00ea3769130e7792a73a85071700fe07e 100644 (file)
@@ -33,10 +33,10 @@ FD_form_index * FormIndex::build_index()
     fl_set_button_shortcut(obj, _("^["), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 60, 100, 30, _("OK"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index a824df1ad7ca3dfc2741d10e2f6aa6caf5e59a97..41abbba5a77d3b5b5154b91fa7ecfa176c22b223 100644 (file)
@@ -5,8 +5,8 @@
 #define FD_form_index_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 476fa18a7196e1e6730c58a8aa70e36bd6993892..f835d51f1d0a914416e4e3bfd78e154a057abb92 100644 (file)
@@ -27,7 +27,7 @@ FD_form_bind * FormPreferences::build_bind()
   obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
   fdui->input_bind = obj = fl_add_input(FL_NORMAL_INPUT, 145, 80, 190, 30, _("Bind file"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_bind_file_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 335, 80, 80, 30, _("Browse..."));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fl_end_form();
@@ -55,24 +55,24 @@ FD_form_misc * FormPreferences::build_misc()
   obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
   fdui->check_banner = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 30, 240, 30, _("Show banner"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->check_auto_region_delete = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 60, 240, 30, _("Auto region delete"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->check_exit_confirm = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 90, 240, 30, _("Exit confirmation"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->check_display_shortcuts = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 120, 240, 30, _("Display keyboard shortcuts"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->counter_autosave = obj = fl_add_counter(FL_NORMAL_COUNTER, 240, 255, 170, 30, _("Autosave interval"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_counter_precision(obj, 0);
     fl_set_counter_bounds(obj, 0, 1200);
     fl_set_counter_value(obj, 300);
@@ -80,7 +80,7 @@ FD_form_misc * FormPreferences::build_misc()
   fdui->counter_line_len = obj = fl_add_counter(FL_NORMAL_COUNTER, 240, 225, 170, 30, _("Ascii line length"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_counter_precision(obj, 0);
     fl_set_counter_bounds(obj, 0, 120);
     fl_set_counter_value(obj, 75);
@@ -110,58 +110,58 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts()
   obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
   fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 210, 5, 200, 30, _("Roman"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_sans = obj = fl_add_input(FL_NORMAL_INPUT, 210, 35, 200, 30, _("Sans Serif"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT, 210, 65, 200, 30, _("Typewriter"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER, 210, 125, 200, 30, _("%"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_counter_precision(obj, 0);
     fl_set_counter_bounds(obj, 0, 999);
     fl_set_counter_value(obj, 150);
     fl_set_counter_step(obj, 1, 1);
   fdui->check_scalable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 50, 125, 160, 30, _("Allow scaling"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->input_screen_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 210, 95, 200, 30, _("Encoding"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 140, 165, 70, 30, _("tiny"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_script = obj = fl_add_input(FL_FLOAT_INPUT, 340, 165, 70, 30, _("script"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_footnote = obj = fl_add_input(FL_FLOAT_INPUT, 140, 195, 70, 30, _("footnote"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_small = obj = fl_add_input(FL_FLOAT_INPUT, 340, 195, 70, 30, _("small"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_large = obj = fl_add_input(FL_FLOAT_INPUT, 340, 225, 70, 30, _("large"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_larger = obj = fl_add_input(FL_FLOAT_INPUT, 140, 255, 70, 30, _("larger"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_largest = obj = fl_add_input(FL_FLOAT_INPUT, 340, 255, 70, 30, _("largest"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_normal = obj = fl_add_input(FL_FLOAT_INPUT, 140, 225, 70, 30, _("normal"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_huge = obj = fl_add_input(FL_FLOAT_INPUT, 140, 285, 70, 30, _("huge"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_huger = obj = fl_add_input(FL_FLOAT_INPUT, 340, 285, 70, 30, _("huger"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
@@ -187,13 +187,13 @@ FD_form_interface_fonts * FormPreferences::build_interface_fonts()
   obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
   fdui->input_popup_font = obj = fl_add_input(FL_NORMAL_INPUT, 215, 50, 200, 30, _("Popup"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_menu_font = obj = fl_add_input(FL_NORMAL_INPUT, 215, 80, 200, 30, _("Menu"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_popup_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 215, 110, 200, 30, _("Encoding"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
@@ -219,58 +219,58 @@ FD_form_printer * FormPreferences::build_printer()
   obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
   fdui->input_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 60, 80, 30, _("command"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_page_range = obj = fl_add_input(FL_NORMAL_INPUT, 130, 90, 80, 30, _("page range"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_copies = obj = fl_add_input(FL_NORMAL_INPUT, 130, 120, 80, 30, _("copies"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_reverse = obj = fl_add_input(FL_NORMAL_INPUT, 130, 150, 80, 30, _("reverse"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_to_printer = obj = fl_add_input(FL_NORMAL_INPUT, 130, 180, 80, 30, _("to printer"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_file_extension = obj = fl_add_input(FL_NORMAL_INPUT, 130, 210, 80, 30, _("file extension"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_spool_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 240, 80, 30, _("spool command"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_paper_type = obj = fl_add_input(FL_NORMAL_INPUT, 130, 270, 80, 30, _("paper type"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_even_pages = obj = fl_add_input(FL_NORMAL_INPUT, 360, 60, 80, 30, _("even pages"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_odd_pages = obj = fl_add_input(FL_NORMAL_INPUT, 360, 90, 80, 30, _("odd pages"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_collated = obj = fl_add_input(FL_NORMAL_INPUT, 360, 120, 80, 30, _("collated"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_landscape = obj = fl_add_input(FL_NORMAL_INPUT, 360, 150, 80, 30, _("landscape"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_to_file = obj = fl_add_input(FL_NORMAL_INPUT, 360, 180, 80, 30, _("to file"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_extra_options = obj = fl_add_input(FL_NORMAL_INPUT, 360, 210, 80, 30, _("extra options"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_spool_prefix = obj = fl_add_input(FL_NORMAL_INPUT, 360, 240, 80, 30, _("spool printer prefix"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_paper_size = obj = fl_add_input(FL_NORMAL_INPUT, 360, 270, 80, 30, _("paper size"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_name = obj = fl_add_input(FL_NORMAL_INPUT, 130, 10, 80, 30, _("name"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->check_adapt_output = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 240, 10, 120, 30, _("adapt output"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
@@ -296,48 +296,48 @@ FD_form_paths * FormPreferences::build_paths()
   obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
   fdui->input_default_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 10, 170, 30, _("Default path"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_document_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 10, 90, 30, _("Browse..."));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->counter_lastfiles = obj = fl_add_counter(FL_NORMAL_COUNTER, 170, 130, 110, 30, _("Last file count"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_counter_precision(obj, 0);
     fl_set_counter_bounds(obj, 0, 9);
     fl_set_counter_value(obj, 4);
     fl_set_counter_step(obj, 1, 1);
   fdui->input_template_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 40, 170, 30, _("Template path"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_template_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 40, 90, 30, _("Browse..."));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->check_last_files = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 290, 130, 140, 30, _("Check last files"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->input_temp_dir = obj = fl_add_input(FL_NORMAL_INPUT, 170, 70, 170, 30, _("Temp dir"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_temp_dir_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 70, 90, 30, _("Browse..."));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->input_lastfiles = obj = fl_add_input(FL_NORMAL_INPUT, 170, 100, 170, 30, _("Lastfiles"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_lastfiles_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 100, 90, 30, _("Browse..."));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->check_use_temp_dir = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 35, 70, 50, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->check_make_backups = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 170, 40, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
     fl_set_button(obj, 1);
   fdui->input_backup_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 170, 170, 30, _("Backup path"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->button_backup_path_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 170, 90, 30, _("Browse..."));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fl_end_form();
@@ -366,20 +366,20 @@ FD_form_preferences * FormPreferences::build_preferences()
   fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 275, 395, 90, 30, idex(_("Apply|#A")));
     fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesApplyCB, 0);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
   fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 375, 395, 90, 30, idex(_("Cancel|^[")));
     fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesCancelCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 175, 395, 90, 30, _("Save"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesOKCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 585, 385, "");
     fl_set_object_boxtype(obj, FL_FLAT_BOX);
   fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 395, 90, 30, idex(_("Restore|#R")));
     fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPreferencesRestoreCB, 0);
+    fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index c9b321b16eb93550c4f7844f7995b9c7e1f6ad58..621372478f600df3cdc7529e44e6362ece05c97c 100644 (file)
@@ -5,22 +5,22 @@
 #define FD_form_bind_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
 
-extern  "C" void C_FormPreferencesApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormPreferencesCancelCB(FL_OBJECT *, long);
-extern  "C" void C_FormPreferencesOKCB(FL_OBJECT *, long);
-extern  "C" void C_FormPreferencesRestoreCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index ba85d7477903e33c69350567b5684f03d533c44a..dd07f4f23c11394812793150f14fd57166701b91 100644 (file)
@@ -33,20 +33,20 @@ FD_form_print * FormPrint::build_print()
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
   fdui->input_printer = obj = fl_add_input(FL_NORMAL_INPUT, 90, 225, 230, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_file = obj = fl_add_input(FL_NORMAL_INPUT, 90, 265, 230, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
 
   fdui->group_radio_printto = fl_bgn_group();
   fdui->radio_printer = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 225, 80, 30, idex(_("Printer|#P")));
     fl_set_button_shortcut(obj, scex(_("Printer|#P")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_file = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 265, 80, 30, idex(_("File|#F")));
     fl_set_button_shortcut(obj, scex(_("File|#F")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_group();
 
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 180, 20, 150, 70, "");
@@ -55,29 +55,29 @@ FD_form_print * FormPrint::build_print()
     fl_set_object_color(obj, FL_COL1, FL_COL1);
   fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 315, 100, 30, _("OK"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintOKCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 120, 315, 100, 30, idex(_("Apply|#A")));
     fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintApplyCB, 0);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
   fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 315, 100, 30, idex(_("Cancel|^[")));
     fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintCancelCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
 
   fdui->group_radio_pages = fl_bgn_group();
   fdui->radio_all_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 160, 30, idex(_("All Pages|#G")));
     fl_set_button_shortcut(obj, scex(_("All Pages|#G")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_odd_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 160, 30, idex(_("Only Odd Pages|#O")));
     fl_set_button_shortcut(obj, scex(_("Only Odd Pages|#O")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_even_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 90, 160, 30, idex(_("Only Even Pages|#E")));
     fl_set_button_shortcut(obj, scex(_("Only Even Pages|#E")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_group();
 
 
@@ -85,11 +85,11 @@ FD_form_print * FormPrint::build_print()
   fdui->radio_order_normal = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 180, 30, 150, 30, idex(_("Normal Order|#N")));
     fl_set_button_shortcut(obj, scex(_("Normal Order|#N")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_order_reverse = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 180, 60, 150, 30, idex(_("Reverse Order|#R")));
     fl_set_button_shortcut(obj, scex(_("Reverse Order|#R")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_group();
 
   obj = fl_add_text(FL_NORMAL_TEXT, 200, 10, 60, 20, _("Order"));
@@ -103,7 +103,7 @@ FD_form_print * FormPrint::build_print()
   fdui->input_from_page = obj = fl_add_input(FL_INT_INPUT, 20, 160, 50, 30, _("Pages:"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_frame(FL_ENGRAVED_FRAME, 180, 110, 150, 90, "");
     fl_set_object_color(obj, FL_COL1, FL_COL1);
   obj = fl_add_text(FL_NORMAL_TEXT, 200, 95, 50, 20, _("Copies"));
@@ -113,13 +113,13 @@ FD_form_print * FormPrint::build_print()
   fdui->input_count = obj = fl_add_input(FL_INT_INPUT, 190, 160, 130, 30, _("Count:"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->radio_unsorted = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 180, 115, 140, 30, idex(_("Unsorted|#U")));
     fl_set_button_shortcut(obj, scex(_("Unsorted|#U")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fdui->input_to_page = obj = fl_add_input(FL_INT_INPUT, 110, 160, 50, 30, _("to"));
-    fl_set_object_callback(obj, C_FormPrintInputCB, 0);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index 458d1718066eebe94c7d8c52b14c2fb34f4f6d9e..7e1535febd7f6a18181a7be023b86adcc88c5410 100644 (file)
@@ -5,10 +5,10 @@
 #define FD_form_print_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormPrintInputCB(FL_OBJECT *, long);
-extern  "C" void C_FormPrintOKCB(FL_OBJECT *, long);
-extern  "C" void C_FormPrintApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormPrintCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index b28f33e32b67781727293d1e325f5377c3a8ce3a..cc7e8af9f9da9c3abc4a0eaec81902244f471127 100644 (file)
@@ -53,10 +53,10 @@ FD_form_ref * FormRef::build_ref()
     fl_set_object_callback(obj, C_FormBaseInputCB, 1);
   fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 330, 300, 90, 30, _("OK"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 300, 90, 30, _("Cancel"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index b756cef835906c812282baa05e99103dfea869b3..1891301ed29a5f61796ee681b2b8f5ec65e6305f 100644 (file)
@@ -6,8 +6,8 @@
 
 /** Callbacks, globals and object handlers **/
 extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 0f5eaf517f28a8178eff4b9a91180f071b0c85a4..d6339d7faae077f1ccbbaac9edd72b40ac7e48ac 100644 (file)
@@ -31,7 +31,7 @@ FD_form_toc * FormToc::build_toc()
   obj = fl_add_button(FL_RETURN_BUTTON, 310, 300, 100, 30, _("Close"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   obj = fl_add_button(FL_NORMAL_BUTTON, 200, 300, 100, 30, _("Update"));
     fl_set_button_shortcut(obj, scex(_("Update|#U#u")), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
index bbaa9c7d57b57d0010ed3b1eea3edd86874abf1e..ca758df4c8d2787ea8d086bc9d493d436d52ed20 100644 (file)
@@ -6,7 +6,7 @@
 
 /** Callbacks, globals and object handlers **/
 extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 00f4dfdadcafb6f0190e38ba4314298d63f1f16b..323bca758f9de97d453574303cbf93cfbfa54337 100644 (file)
@@ -44,10 +44,10 @@ FD_form_url * FormUrl::build_url()
     fl_set_button_shortcut(obj, _("^["), 1);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
   fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 100, 100, 30, _("OK"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, C_FormBaseApplyHideCB, 0);
+    fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index f0df9c20535bada9a66c65e5a0b701f119195483..8751ae3150b633d6c07aefcee203fa56539c4d99 100644 (file)
@@ -5,8 +5,8 @@
 #define FD_form_url_h_
 
 /** Callbacks, globals and object handlers **/
-extern  "C" void C_FormBaseHideCB(FL_OBJECT *, long);
-extern  "C" void C_FormBaseApplyHideCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseOKCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index c19618d0911b31bb0889686f0fa3ed5c71ae7d8b..afc7d23458f15844ad23e76055c6f7b24f7bb078 100644 (file)
@@ -225,7 +225,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_SouthEast FL_SouthEast
 name: ok
-callback: C_FormBaseApplyHideCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -243,7 +243,7 @@ shortcut: ^[
 resize: FL_RESIZE_ALL
 gravity: FL_SouthEast FL_SouthEast
 name: cancel
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 ==============================
index b97de7c6bb2ad15aa389418fad4c2b05f428a5f6..7a3be2570780c5e0158b0f5b71282ded213ddba2 100644 (file)
@@ -81,7 +81,7 @@ shortcut: ^M
 resize: FL_RESIZE_NONE
 gravity: FL_South FL_South
 name: button_ok
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
index ca35a70931be77a592bb317ce8fbd5ca395a159f..eecafbd0f17a5d2eaca8ad9320597145041c9296 100644 (file)
@@ -64,7 +64,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_cancel
-callback: C_FormDocumentCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -82,7 +82,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_apply
-callback: C_FormDocumentApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -100,7 +100,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ok
-callback: C_FormDocumentOKCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -136,7 +136,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_restore
-callback: C_FormDocumentRestoreCB
+callback: C_FormBaseRestoreCB
 argument: 0
 
 =============== FORM ===============
index dab91912418ef5617339373c9dbf6db37661f3ec..f452762ca9301ae15641a9d89e1aa552d1c0fd6e 100644 (file)
@@ -63,7 +63,7 @@ shortcut: ^M
 resize: FL_RESIZE_NONE
 gravity: FL_South FL_South
 name: 
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 ==============================
index 2dd81da7a9c6a6f6cd1481fb428a02e9a4dce500..a6f686519fa0fe85e1fe1559aa058f1c791361c2 100644 (file)
@@ -63,7 +63,7 @@ shortcut: ^[
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: cancel
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -81,7 +81,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_SouthEast FL_SouthEast
 name: ok
-callback: C_FormBaseApplyHideCB
+callback: C_FormBaseOKCB
 argument: 0
 
 ==============================
index 3b1c53e9dc4f9e410ab490b8d70a1ebeb87d8d61..57e640e25d6881d38c28885c44e740919b5a47db 100644 (file)
@@ -46,7 +46,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_bind
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -106,7 +106,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_banner
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -125,7 +125,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_auto_region_delete
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -144,7 +144,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_exit_confirm
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -163,7 +163,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_display_shortcuts
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -182,7 +182,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: counter_autosave
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
   bounds: 0 1200
   precision: 0
@@ -204,7 +204,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: counter_line_len
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
   bounds: 0 120
   precision: 0
@@ -250,7 +250,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_roman
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -268,7 +268,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_sans
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -286,7 +286,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_typewriter
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -304,7 +304,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: counter_zoom
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
   bounds: 0 999
   precision: 0
@@ -326,7 +326,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_scalable
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -345,7 +345,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_screen_encoding
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -363,7 +363,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_tiny
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -381,7 +381,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_script
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -399,7 +399,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_footnote
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -417,7 +417,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_small
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -435,7 +435,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_large
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -453,7 +453,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_larger
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -471,7 +471,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_largest
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -489,7 +489,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_normal
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -507,7 +507,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_huge
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -525,7 +525,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_huger
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 =============== FORM ===============
@@ -567,7 +567,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_popup_font
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -585,7 +585,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_menu_font
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -603,7 +603,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_popup_encoding
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 =============== FORM ===============
@@ -645,7 +645,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_command
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -663,7 +663,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_page_range
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -681,7 +681,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_copies
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -699,7 +699,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_reverse
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -717,7 +717,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_to_printer
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -735,7 +735,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_file_extension
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -753,7 +753,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_spool_command
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -771,7 +771,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_paper_type
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -789,7 +789,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_even_pages
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -807,7 +807,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_odd_pages
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -825,7 +825,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_collated
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -843,7 +843,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_landscape
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -861,7 +861,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_to_file
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -879,7 +879,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_extra_options
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -897,7 +897,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_spool_prefix
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -915,7 +915,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_paper_size
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -933,7 +933,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_name
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -951,7 +951,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_adapt_output
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 =============== FORM ===============
@@ -993,7 +993,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_default_path
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1029,7 +1029,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: counter_lastfiles
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
   bounds: 0 9
   precision: 0
@@ -1051,7 +1051,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_template_path
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1087,7 +1087,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_last_files
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -1106,7 +1106,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_temp_dir
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1142,7 +1142,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_lastfiles
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1178,7 +1178,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_use_temp_dir
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -1197,7 +1197,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: check_make_backups
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
        value: 1
 
@@ -1216,7 +1216,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_backup_path
-callback: C_FormPreferencesInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -1276,7 +1276,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_apply
-callback: C_FormPreferencesApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -1294,7 +1294,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_cancel
-callback: C_FormPreferencesCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -1312,7 +1312,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ok
-callback: C_FormPreferencesOKCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -1348,7 +1348,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_restore
-callback: C_FormPreferencesRestoreCB
+callback: C_FormBaseRestoreCB
 argument: 0
 
 ==============================
index ffde899db71a1becb597933a25bc5518c3f12f19..cd016997be6b418fe53f9a380fa184289a7a9c23 100644 (file)
@@ -81,7 +81,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_printer
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -99,7 +99,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_file
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -135,7 +135,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_printer
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -153,7 +153,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_file
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -225,7 +225,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_ok
-callback: C_FormPrintOKCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -243,7 +243,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_apply
-callback: C_FormPrintApplyCB
+callback: C_FormBaseApplyCB
 argument: 0
 
 --------------------
@@ -261,7 +261,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: button_cancel
-callback: C_FormPrintCancelCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -297,7 +297,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_all_pages
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -315,7 +315,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_odd_pages
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -333,7 +333,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_even_pages
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -387,7 +387,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_order_normal
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -405,7 +405,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_order_reverse
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -477,7 +477,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_from_page
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -531,7 +531,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_count
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -549,7 +549,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: radio_unsorted
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
@@ -567,7 +567,7 @@ shortcut:
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: input_to_page
-callback: C_FormPrintInputCB
+callback: C_FormBaseInputCB
 argument: 0
 
 ==============================
index 4356a56dd3594179d7532cb721641ea282ac7a9b..65d677f32ed5cc5cd359c14e3677016ec995bd4c 100644 (file)
@@ -171,7 +171,7 @@ shortcut: ^M
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: ok
-callback: C_FormBaseApplyHideCB
+callback: C_FormBaseOKCB
 argument: 0
 
 --------------------
@@ -189,7 +189,7 @@ shortcut:
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: cancel
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 ==============================
index a105682ecdc66deb6443d8f08d18f94ad308acc1..637d61c8ab4d3571598d101cf3f699c3fe3e1d07 100644 (file)
@@ -63,7 +63,7 @@ shortcut: ^M
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: 
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
index d60f5c1a90a59b7e4a982cc9537678f29ccd36f8..205dc145ddcc8e342adc987b094fefa8eeed400c 100644 (file)
@@ -99,7 +99,7 @@ shortcut: ^[
 resize: FL_RESIZE_NONE
 gravity: FL_SouthEast FL_SouthEast
 name: cancel
-callback: C_FormBaseHideCB
+callback: C_FormBaseCancelCB
 argument: 0
 
 --------------------
@@ -117,7 +117,7 @@ shortcut: ^M
 resize: FL_RESIZE_ALL
 gravity: FL_SouthEast FL_SouthEast
 name: ok
-callback: C_FormBaseApplyHideCB
+callback: C_FormBaseOKCB
 argument: 0
 
 ==============================