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
14 #pragma implementation
18 #include "ControlShowFile.h"
19 #include "FormShowFile.h"
20 #include "forms/form_browser.h"
22 #include FORMS_H_LOCATION
25 FormShowFile::FormShowFile()
26 : FormCB<ControlShowFile, FormBrowser>(_("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 = "LyX: " + controller().getFileName();
39 fl_set_form_title(dialog_->form, title.c_str());
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());