]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormSpellchecker.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / FormSpellchecker.C
index a9dcff8b4d7d5b66a36dae9fb2fec0717af6eea8..4f51c8d6640a88b1d6334e6e518bb527f4acb07c 100644 (file)
@@ -5,30 +5,33 @@
  *
  * \author Edwin Leuven
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-
-#include "xformsBC.h"
 #include "FormSpellchecker.h"
-#include "ControlSpellchecker.h"
 #include "forms/form_spellchecker.h"
 
-#include "forms_gettext.h"
+#include "controllers/ControlSpellchecker.h"
+
 #include "Tooltips.h"
 #include "xforms_helpers.h"
-#include "support/lstrings.h"
+#include "xformsBC.h"
+
+#include "support/tostr.h"
+
+#include "lyx_forms.h"
 
-#include FORMS_H_LOCATION
+using std::string;
 
-using std::endl;
+namespace lyx {
+namespace frontend {
 
-typedef FormCB<ControlSpellchecker, FormDB<FD_spellchecker> > base_class;
+typedef FormController<ControlSpellchecker, FormView<FD_spellchecker> > base_class;
 
-FormSpellchecker::FormSpellchecker()
-       : base_class(_("Spellchecker"))
+FormSpellchecker::FormSpellchecker(Dialog & parent)
+       : base_class(parent, _("Spell-check document"))
 {}
 
 
@@ -37,10 +40,10 @@ void FormSpellchecker::build()
        dialog_.reset(build_spellchecker(this));
 
        // Manage the buttons
-       bc().setCancel(dialog_->button_close);
+       bcview().setCancel(dialog_->button_close);
 
        // disable for read-only documents
-       bc().addReadOnly(dialog_->button_replace);
+       bcview().addReadOnly(dialog_->button_replace);
 
        // trigger an input event for cut&paste with middle mouse button.
        setPrehandler(dialog_->input_replacement);
@@ -49,7 +52,7 @@ void FormSpellchecker::build()
 
        // callback for double click in browser
        fl_set_browser_dblclick_callback(dialog_->browser_suggestions,
-                                        C_FormBaseInputCB, 2);
+                                        C_FormDialogView_InputCB, 2);
 
        // do not allow setting of slider by the mouse
        fl_deactivate_object(dialog_->slider_progress);
@@ -75,6 +78,12 @@ void FormSpellchecker::build()
 }
 
 
+void FormSpellchecker::update()
+{
+       controller().check();
+}
+
+
 void FormSpellchecker::partialUpdate(int s)
 {
        ControlSpellchecker::State const state =
@@ -151,3 +160,6 @@ ButtonPolicy::SMInput FormSpellchecker::input(FL_OBJECT * ob, long ob_value)
 
        return ButtonPolicy::SMI_VALID;
 }
+
+} // namespace frontend
+} // namespace lyx