/**
- * \file xforms/FormToc.C
- * Copyright 2000-2001 The LyX Team.
- * See the file COPYING.
+ * \file FormToc.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "FormToc.h"
-#include "xformsBC.h"
-#include "xforms_helpers.h"
#include "ControlToc.h"
#include "forms/form_toc.h"
+
+#include "xforms_helpers.h"
+#include "xformsBC.h"
+
#include "support/lstrings.h" // frontStrip, strip
-#include "debug.h"
-#include "gettext.h"
-#include FORMS_H_LOCATION
-#include <vector>
+#include "lyx_forms.h"
using std::vector;
-using std::endl;
+using std::string;
+
+namespace lyx {
+
+using support::getStringFromVector;
+namespace frontend {
-typedef FormCB<ControlToc, FormDB<FD_toc> > base_class;
+typedef FormController<ControlToc, FormView<FD_toc> > base_class;
-FormToc::FormToc(ControlToc & c, Dialogs & d)
- : base_class(c, d, _("Table of Contents"))
+FormToc::FormToc(Dialog & parent)
+ : base_class(parent, _("Table of Contents"))
{}
dialog_.reset(build_toc(this));
vector<string> types = controller().getTypes();
-
-
+
+
string const choice =
- " " + getStringFromVector(controller().getTypes(), " | ") + " ";
+ ' ' + getStringFromVector(controller().getTypes(), " | ") + ' ';
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
// Manage the cancel/close button
- bc().setCancel(dialog_->button_close);
+ bcview().setCancel(dialog_->button_close);
}
if (type.empty()) {
fl_clear_browser(dialog_->browser_toc);
fl_add_browser_line(dialog_->browser_toc,
- _("*** No Lists ***"));
+ _("*** No Lists ***").c_str());
setEnabled(dialog_->browser_toc, false);
return;
}
if (contents.empty()) {
fl_clear_browser(dialog_->browser_toc);
fl_add_browser_line(dialog_->browser_toc,
- _("*** No Lists ***"));
+ _("*** No Lists ***").c_str());
setEnabled(dialog_->browser_toc, false);
return;
}
fl_set_browser_topline(dialog_->browser_toc, topline);
fl_select_browser_line(dialog_->browser_toc, line);
}
+
+} // namespace frontend
+} // namespace lyx