3 * Copyright 2001 The LyX Team.
4 * See the file COPYING.
6 * \author Herbert Voss, voss@perce.de
12 #pragma implementation
16 #include "ControlShowFile.h"
17 #include "FormShowFile.h"
18 #include "forms/form_browser.h"
20 #include FORMS_H_LOCATION
23 FormShowFile::FormShowFile(ControlShowFile & c)
24 : FormCB<ControlShowFile, FormBrowser>(c, string())
28 void FormShowFile::update()
30 fl_hide_object(dialog_->button_update);
31 fl_clear_browser(dialog_->browser);
33 fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE);
34 fl_set_form_title(dialog_->form, controller().getFileName().c_str());
36 string const contents = controller().getFileContents();
38 fl_add_browser_line(dialog_->browser,
39 "Error -> Cannot load file!");
41 fl_add_browser_line(dialog_->browser, contents.c_str());