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