3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "FormShowFile.h"
14 #include "ControlShowFile.h"
15 #include "forms/form_browser.h"
19 #include "lyx_forms.h"
26 FormShowFile::FormShowFile(Dialog & parent)
27 : FormController<ControlShowFile, FormBrowser>(parent, _("Show File"))
31 void FormShowFile::update()
33 fl_hide_object(dialog_->button_update);
34 fl_clear_browser(dialog_->browser);
37 fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE);
39 string const title = controller().getFileName();
42 string const contents = controller().getFileContents();
44 fl_add_browser_line(dialog_->browser,
45 "Error -> Cannot load file!");
47 fl_add_browser_line(dialog_->browser, contents.c_str());
50 } // namespace frontend