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"
25 FormShowFile::FormShowFile(Dialog & parent)
26 : FormController<ControlShowFile, FormBrowser>(parent, _("Show File"))
30 void FormShowFile::update()
32 fl_hide_object(dialog_->button_update);
33 fl_clear_browser(dialog_->browser);
36 fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE);
38 string const title = controller().getFileName();
41 string const contents = controller().getFileContents();
43 fl_add_browser_line(dialog_->browser,
44 "Error -> Cannot load file!");
46 fl_add_browser_line(dialog_->browser, contents.c_str());