]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormToc.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / FormToc.C
index eb23182e6255561b9cfa49e0ebb87822103fd7c5..62842e0342c0029ae6e25e43228e176a432b9431 100644 (file)
@@ -1,37 +1,39 @@
 /**
- * \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()
-       : base_class(_("Table of Contents"))
+FormToc::FormToc(Dialog & parent)
+       : base_class(parent, _("Table of Contents"))
 {}
 
 
@@ -40,14 +42,14 @@ void FormToc::build()
        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);
 }
 
 
@@ -98,7 +100,7 @@ void FormToc::updateContents()
        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;
        }
@@ -116,7 +118,7 @@ void FormToc::updateContents()
        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;
        }
@@ -138,3 +140,6 @@ void FormToc::updateContents()
        fl_set_browser_topline(dialog_->browser_toc, topline);
        fl_select_browser_line(dialog_->browser_toc, line);
 }
+
+} // namespace frontend
+} // namespace lyx