mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
0be0fcfd59
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7598 a592a061-630c-0410-9148-cb99ea01b6c8
45 lines
1023 B
C
45 lines
1023 B
C
/**
|
|
* \file FormShowFile.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Herbert Voss
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
|
|
#include "xformsBC.h"
|
|
#include "ControlShowFile.h"
|
|
#include "FormShowFile.h"
|
|
#include "forms/form_browser.h"
|
|
#include "gettext.h"
|
|
#include "lyx_forms.h"
|
|
|
|
|
|
FormShowFile::FormShowFile(Dialog & parent)
|
|
: FormController<ControlShowFile, FormBrowser>(parent, _("Show File"))
|
|
{}
|
|
|
|
|
|
void FormShowFile::update()
|
|
{
|
|
fl_hide_object(dialog_->button_update);
|
|
fl_clear_browser(dialog_->browser);
|
|
|
|
// courier medium
|
|
fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE);
|
|
|
|
string const title = "LyX: " + controller().getFileName();
|
|
setTitle(title);
|
|
|
|
string const contents = controller().getFileContents();
|
|
if (contents.empty())
|
|
fl_add_browser_line(dialog_->browser,
|
|
"Error -> Cannot load file!");
|
|
else
|
|
fl_add_browser_line(dialog_->browser, contents.c_str());
|
|
}
|