1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright (C) 1995 Matthias Ettrich
7 * Copyright (C) 1995-1998 The LyX Team.
9 *======================================================*/
13 #include FORMS_H_LOCATION
17 #include "credits_form.h"
20 #include "filetools.h"
21 #include "lyx_gui_misc.h" // CancelCloseBoxCB
24 // $Id: credits.C,v 1.1 1999/09/27 18:44:37 larsbj Exp $
26 #if !defined(lint) && !defined(WITH_WARNINGS)
27 static char vcid[] = "$Id: credits.C,v 1.1 1999/09/27 18:44:37 larsbj Exp $";
31 extern LString system_lyxdir;
33 /**** Forms and Objects ****/
35 static FD_form_credits *fd_form_credits = NULL;
36 static FD_copyright *fd_form_copyright = NULL;
38 void CreditsOKCB(FL_OBJECT *, long) {
39 fl_hide_form(fd_form_credits->form_credits);
40 fl_free_form(fd_form_credits->form_credits);
41 fd_form_credits->form_credits = NULL;
44 /*---------------------------------------*/
45 /* read credits from file and display them */
48 /* generate the credits form if it doesn't exist */
49 if (!fd_form_credits || !fd_form_credits->form_credits) {
51 /* read the credits into the browser */
53 /* try file LYX_DIR/CREDITS */
54 LString real_file = AddName (system_lyxdir, "CREDITS");
55 fd_form_credits = create_form_form_credits();
56 fl_set_form_atclose(fd_form_credits->form_credits,
57 CancelCloseBoxCB, NULL);
59 if (!fl_load_browser(fd_form_credits->browser_credits,
61 fl_add_browser_line(fd_form_credits->browser_credits,
62 _("ERROR: LyX wasn't able to read"
64 fl_add_browser_line(fd_form_credits->browser_credits, "");
65 fl_add_browser_line(fd_form_credits->browser_credits,
66 _("Please install correctly to estimate"
68 fl_add_browser_line(fd_form_credits->browser_credits,
69 _("amount of work other people have done"
70 " for the LyX project."));
74 if (fd_form_credits->form_credits->visible) {
75 fl_raise_form(fd_form_credits->form_credits);
77 fl_show_form(fd_form_credits->form_credits,
78 FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
83 // Callback for copyright and warranty form
84 void CopyrightOKCB(FL_OBJECT *, long) {
85 fl_hide_form(fd_form_copyright->copyright);
86 fl_free_form(fd_form_copyright->copyright);
87 fd_form_copyright->copyright = NULL;
90 // Show copyright and warranty form
93 if (!fd_form_copyright || !fd_form_copyright->copyright) {
94 fd_form_copyright = create_form_copyright();
95 fl_set_form_atclose(fd_form_copyright->copyright,
96 CancelCloseBoxCB, NULL);
99 // Funny emotional remark by Asger deleted. (Lgb)
101 if (fd_form_copyright->copyright->visible) {
102 fl_raise_form(fd_form_copyright->copyright);
104 fl_show_form(fd_form_copyright->copyright,
105 FL_PLACE_MOUSE, FL_FULLBORDER,
106 _("Copyright and Warranty"));