]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormErrorList.C
Change the semantics of 'none' and 'auto' viewers/editors: 'none' means now
[lyx.git] / src / frontends / xforms / FormErrorList.C
index afb0b723b3d0846898a2553d325221e960466158..20b6db069b7128b1bde4b408e5822a632eb8cbed 100644 (file)
@@ -5,23 +5,21 @@
  *
  * \author Alfredo Braunstein
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-
-#include "errorlist.h"
 #include "FormErrorList.h"
-#include "xformsBC.h"
-#include "xforms_helpers.h"
 #include "ControlErrorList.h"
 #include "forms/form_errorlist.h"
-#include "support/lstrings.h" // frontStrip, strip
-#include "debug.h"
-#include "gettext.h"
+
+#include "xformsBC.h"
+#include "xforms_helpers.h"
 #include "lyx_forms.h"
 
+namespace lyx {
+namespace frontend {
 
 typedef FormController<ControlErrorList, FormView<FD_errorlist> > base_class;
 
@@ -30,16 +28,22 @@ FormErrorList::FormErrorList(Dialog & parent)
 {}
 
 
+int dumb_validator(FL_OBJECT *, const char *, const char *, int)
+{
+       return FL_INVALID;
+}
+
+
 void FormErrorList::build()
 {
        dialog_.reset(build_errorlist(this));
-       setEnabled(dialog_->input_description, false);
+       fl_set_input_filter(dialog_->input_description, dumb_validator);
 }
 
 
 void FormErrorList::update()
 {
-        fl_set_form_title(dialog_->form, controller().name().c_str());
+       setTitle(controller().name());
        updateContents();
 }
 
@@ -50,7 +54,6 @@ ButtonPolicy::SMInput FormErrorList::input(FL_OBJECT * ob, long)
                //xforms return values 1..n
                int const choice = int(fl_get_browser(dialog_->browser_errors)) - 1;
                goTo(choice);
-               return ButtonPolicy::SMI_VALID;
        }
 
        return ButtonPolicy::SMI_VALID;
@@ -65,7 +68,7 @@ void FormErrorList::goTo(int where)
                controller().goTo(where);
                fl_set_input(dialog_->input_description,
                             errors[where].description.c_str());
-               setEnabled(dialog_->input_description, false);
+               fl_set_input_topline(dialog_->input_description, 1);
        }
 }
 
@@ -93,5 +96,8 @@ void FormErrorList::updateContents()
        }
 
        fl_select_browser_line(dialog_->browser_errors, 1);
-       goTo(1);
+       goTo(0);
 }
+
+} // namespace frontend
+} // namespace lyx