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 static FD_form_credits *fd_form_credits = 0;
30 void CreditsOKCB(FL_OBJECT *, long) {
31 fl_hide_form(fd_form_credits->form_credits);
32 fl_free_form(fd_form_credits->form_credits);
33 fd_form_credits->form_credits = 0;
36 /*---------------------------------------*/
37 /* read credits from file and display them */
40 /* generate the credits form if it doesn't exist */
41 if (!fd_form_credits || !fd_form_credits->form_credits) {
43 /* read the credits into the browser */
45 /* try file LYX_DIR/CREDITS */
46 string real_file = AddName (system_lyxdir, "CREDITS");
47 fd_form_credits = create_form_form_credits();
48 fl_set_form_atclose(fd_form_credits->form_credits,
51 if (!fl_load_browser(fd_form_credits->browser_credits,
53 fl_add_browser_line(fd_form_credits->browser_credits,
54 _("ERROR: LyX wasn't able to read"
56 fl_add_browser_line(fd_form_credits->browser_credits, "");
57 fl_add_browser_line(fd_form_credits->browser_credits,
58 _("Please install correctly to estimate"
60 fl_add_browser_line(fd_form_credits->browser_credits,
61 _("amount of work other people have done"
62 " for the LyX project."));
66 if (fd_form_credits->form_credits->visible) {
67 fl_raise_form(fd_form_credits->form_credits);
69 fl_show_form(fd_form_credits->form_credits,
70 FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,