/**
* \file FormThesaurus.C
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author Edwin Leuven, leuven@fee.uva.nl
+ * \author Edwin Leuven
+ *
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "FormThesaurus.h"
+#include "ControlThesaurus.h"
+#include "forms/form_thesaurus.h"
-#include <cctype>
-#include "support/lstrings.h"
-#include "xformsBC.h"
#include "xforms_helpers.h"
-#include "ControlThesaurus.h"
-#include "FormThesaurus.h"
-#include "form_thesaurus.h"
-#include "debug.h"
+#include "xformsBC.h"
+
+#include "support/lstrings.h"
+#include "lyx_forms.h"
+
+using lyx::support::lowercase;
+using lyx::support::trim;
+using lyx::support::uppercase;
+
+#ifndef CXX_GLOBAL_CSTD
+using std::islower;
+using std::isupper;
+#endif
using std::vector;
+using std::string;
-typedef FormCB<ControlThesaurus, FormDB<FD_form_thesaurus> > base_class;
+typedef FormController<ControlThesaurus, FormView<FD_thesaurus> > base_class;
-FormThesaurus::FormThesaurus(ControlThesaurus & c)
- : base_class(c, _("LyX: Thesaurus"), false),
+FormThesaurus::FormThesaurus(Dialog & parent)
+ : base_class(parent, _("Thesaurus"), false),
clickline_(-1)
{
}
void FormThesaurus::build()
{
- dialog_.reset(build_thesaurus());
+ dialog_.reset(build_thesaurus(this));
fl_set_input_return(dialog_->input_entry, FL_RETURN_CHANGED);
fl_set_input_return(dialog_->input_replace, FL_RETURN_CHANGED);
setPrehandler(dialog_->input_replace);
// Manage the ok, apply and cancel/close buttons
- bc().setCancel(dialog_->button_close);
- bc().addReadOnly(dialog_->input_replace);
+ bcview().setCancel(dialog_->button_close);
+ bcview().addReadOnly(dialog_->input_replace);
fl_set_input_return(dialog_->input_entry, FL_RETURN_END_CHANGED);
}
ButtonPolicy::SMInput FormThesaurus::input(FL_OBJECT * obj, long)
{
if (obj == dialog_->input_entry) {
- string s = strip(frontStrip(fl_get_input(dialog_->input_entry)));
+ string s = trim(fl_get_input(dialog_->input_entry));
updateMeanings(s);
int const line = fl_get_browser(obj);
if (line > 0) {
setReplace(fl_get_input(dialog_->input_entry),
- strip(frontStrip(fl_get_browser_line(obj, line))));
+ trim(fl_get_browser_line(obj, line)));
}
if (clickline_ == fl_get_browser(obj)) {