1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-1999 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;
29 static FD_copyright *fd_form_copyright = 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_FULLBORDER,
76 // Callback for copyright and warranty form
77 void CopyrightOKCB(FL_OBJECT *, long) {
78 fl_hide_form(fd_form_copyright->copyright);
79 fl_free_form(fd_form_copyright->copyright);
80 fd_form_copyright->copyright = 0;
83 // Show copyright and warranty form
86 if (!fd_form_copyright || !fd_form_copyright->copyright) {
87 fd_form_copyright = create_form_copyright();
88 fl_set_form_atclose(fd_form_copyright->copyright,
92 // Funny emotional remark by Asger deleted. (Lgb)
94 if (fd_form_copyright->copyright->visible) {
95 fl_raise_form(fd_form_copyright->copyright);
97 fl_show_form(fd_form_copyright->copyright,
98 FL_PLACE_MOUSE, FL_FULLBORDER,
99 _("Copyright and Warranty"));