1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * ====================================================== */
13 #include FORMS_H_LOCATION
17 #include "credits_form.h"
20 #include "support/filetools.h"
21 #include "lyx_gui_misc.h" // CancelCloseBoxCB
24 extern string system_lyxdir;
26 /**** Forms and Objects ****/
28 // Non-static so that it can be redrawn if the xforms colors are re-mapped
29 FD_form_credits *fd_form_credits = 0;
31 void CreditsOKCB(FL_OBJECT *, long) {
32 fl_hide_form(fd_form_credits->form_credits);
33 fl_free_form(fd_form_credits->form_credits);
34 fd_form_credits->form_credits = 0;
37 /*---------------------------------------*/
38 /* read credits from file and display them */
41 /* generate the credits form if it doesn't exist */
42 if (!fd_form_credits || !fd_form_credits->form_credits) {
44 /* read the credits into the browser */
46 /* try file LYX_DIR/CREDITS */
47 string real_file = AddName (system_lyxdir, "CREDITS");
48 fd_form_credits = create_form_form_credits();
49 fl_set_form_atclose(fd_form_credits->form_credits,
52 if (!fl_load_browser(fd_form_credits->browser_credits,
54 fl_add_browser_line(fd_form_credits->browser_credits,
55 _("ERROR: LyX wasn't able to read"
57 fl_add_browser_line(fd_form_credits->browser_credits, "");
58 fl_add_browser_line(fd_form_credits->browser_credits,
59 _("Please install correctly to estimate"
61 fl_add_browser_line(fd_form_credits->browser_credits,
62 _("amount of work other people have done"
63 " for the LyX project."));
67 if (fd_form_credits->form_credits->visible) {
68 fl_raise_form(fd_form_credits->form_credits);
70 fl_show_form(fd_form_credits->form_credits,
71 FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,