]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormShowFile.C
Really dull and boring header shit
[lyx.git] / src / frontends / xforms / FormShowFile.C
1 /**
2  * \file FormShowFile.C
3  * See the file COPYING.
4  *
5  * \author Herbert Voss
6  *
7  * Full author contact details are available in file CREDITS
8  */
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include "xformsBC.h"
17 #include "ControlShowFile.h"
18 #include "FormShowFile.h"
19 #include "forms/form_browser.h"
20 #include "gettext.h"
21 #include FORMS_H_LOCATION
22
23
24 FormShowFile::FormShowFile()
25         : FormCB<ControlShowFile, FormBrowser>(string())
26 {}
27
28
29 void FormShowFile::update()
30 {
31         fl_hide_object(dialog_->button_update);
32         fl_clear_browser(dialog_->browser);
33         // courier medium
34         fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE);
35         fl_set_form_title(dialog_->form, controller().getFileName().c_str());
36
37         string const contents = controller().getFileContents();
38         if (contents.empty())
39                 fl_add_browser_line(dialog_->browser,
40                                     "Error -> Cannot load file!");
41         else
42                 fl_add_browser_line(dialog_->browser, contents.c_str());
43 }