home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / credits.C < prev    next >
C/C++ Source or Header  |  1998-04-23  |  3KB  |  109 lines

  1. /* This file is part of
  2. * ======================================================
  3. *           LyX, The Document Processor
  4. *      
  5. *        Copyright (C) 1995 Matthias Ettrich
  6. *           Copyright (C) 1995-1998 The LyX Team.
  7. *
  8. *======================================================*/
  9.  
  10. #include <config.h>
  11.  
  12. #include FORMS_H_LOCATION
  13. #include <stdlib.h>
  14.  
  15. #include "credits.h"
  16. #include "credits_form.h"
  17.  
  18. #include "LString.h"
  19. #include "filetools.h"
  20. #include "lyx_gui_misc.h" // CancelCloseBoxCB
  21. #include "gettext.h"
  22.  
  23. //     $Id: credits.C,v 1.1.1.1 1998/04/23 16:02:49 larsbj Exp $    
  24.  
  25. #if !defined(lint) && !defined(WITH_WARNINGS)
  26. static char vcid[] = "$Id: credits.C,v 1.1.1.1 1998/04/23 16:02:49 larsbj Exp $";
  27. #endif /* lint */
  28.  
  29. /* extern */
  30. extern LString system_lyxdir;
  31.  
  32. /**** Forms and Objects ****/
  33.  
  34. static FD_form_credits *fd_form_credits = NULL;
  35. static FD_copyright *fd_form_copyright = NULL;
  36.  
  37. void CreditsOKCB(FL_OBJECT *, long) {
  38.       fl_hide_form(fd_form_credits->form_credits);
  39.       fl_free_form(fd_form_credits->form_credits);
  40.       fd_form_credits->form_credits = NULL;
  41. }
  42.  
  43. /*---------------------------------------*/
  44. /* read credits from file and display them */
  45. void ShowCredits()
  46. {
  47.     /* generate the credits form if it doesn't exist */
  48.     if (!fd_form_credits || !fd_form_credits->form_credits) {
  49.         
  50.         /* read the credits into the browser */ 
  51.         
  52.         /* try file LYX_DIR/CREDITS */ 
  53.         LString real_file = AddName (system_lyxdir, "CREDITS");
  54.         fd_form_credits = create_form_form_credits();
  55.         fl_set_form_atclose(fd_form_credits->form_credits,
  56.                     CancelCloseBoxCB, NULL);
  57.  
  58.         if (!fl_load_browser(fd_form_credits->browser_credits, 
  59.                      real_file.c_str())) {
  60.             fl_add_browser_line(fd_form_credits->browser_credits,
  61.                         _("ERROR: LyX wasn't able to read"
  62.                         " CREDITS file"));
  63.             fl_add_browser_line(fd_form_credits->browser_credits, "");
  64.             fl_add_browser_line(fd_form_credits->browser_credits,
  65.                         _("Please install correctly to estimate"
  66.                         " the great"));
  67.             fl_add_browser_line(fd_form_credits->browser_credits,
  68.                         _("amount of work other people have done"
  69.                         " for the LyX project."));
  70.         }
  71.     }
  72.  
  73.     if (fd_form_credits->form_credits->visible) {
  74.         fl_raise_form(fd_form_credits->form_credits);
  75.     } else {
  76.         fl_show_form(fd_form_credits->form_credits,
  77.                  FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
  78.                  _("Credits"));
  79.     }
  80. }
  81.  
  82. // Callback for copyright and warranty form
  83. void CopyrightOKCB(FL_OBJECT *, long) {
  84.     fl_hide_form(fd_form_copyright->copyright);
  85.     fl_free_form(fd_form_copyright->copyright);
  86.     fd_form_copyright->copyright = NULL;
  87. }
  88.  
  89. // Show copyright and warranty form
  90. void ShowCopyright()
  91. {
  92.     if (!fd_form_copyright || !fd_form_copyright->copyright) {
  93.         fd_form_copyright = create_form_copyright();
  94.         fl_set_form_atclose(fd_form_copyright->copyright, 
  95.                     CancelCloseBoxCB, NULL);
  96.     }
  97.  
  98.     // Funny emotional remark by Asger deleted. (Lgb)
  99.     
  100.     if (fd_form_copyright->copyright->visible) {
  101.         fl_raise_form(fd_form_copyright->copyright);
  102.     } else {
  103.         fl_show_form(fd_form_copyright->copyright,
  104.                  FL_PLACE_MOUSE, FL_FULLBORDER,
  105.                  _("Copyright and Warranty"));
  106.     }
  107. }
  108.