home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / misc / sci / cp / source / opengui.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-21  |  2.5 KB  |  99 lines

  1.  
  2. #include "cp.h"
  3.  
  4. int OpenGTXScreen()
  5. {
  6. int check;
  7. struct EasyStruct ES = {
  8.      sizeof(struct EasyStruct),
  9.      0,
  10.      "OpenGTXScreen()",
  11.      "%s",
  12.      "GoodBye!"
  13.     };
  14.  
  15.     check =  SetupScreen();
  16.  
  17.     if ( check ) {
  18.  
  19.           CloseDownScreen();
  20.  
  21.           switch ( check ) {
  22.                case 1:
  23.                     EasyRequest (NULL,&ES,NULL,"Could not open or lock the screen");
  24.                     return(1);
  25.                case 2:
  26.                     EasyRequest (NULL,&ES,NULL,"Could not get the screens' visual info");
  27.                     return(2);
  28.                case 3:
  29.                     EasyRequest (NULL,&ES,NULL,"Could not setup the GETFILE boopsi class");
  30.                     return(3);
  31.                case 4:
  32.                     EasyRequest (NULL,&ES,NULL,"Could not get a GETFILE boopsi object");
  33.                     return(4);
  34.                case 5:
  35.                     EasyRequest (NULL,&ES,NULL,"Could not open the font");
  36.                     return(5);
  37.                default:
  38.                     EasyRequest (NULL,&ES,NULL,"Unknown error in SetupScreen");
  39.                     return(20);
  40.           }
  41.      }
  42. }
  43.  
  44.  
  45. int ( *OpenWinX )( void );
  46.  
  47. int OpenGTXWindow( int ( *OpenWinX )( void ))
  48. {
  49. int check;
  50. struct EasyStruct ES = {
  51.      sizeof(struct EasyStruct),
  52.      0,
  53.      "OpenGTXWindow()",
  54.      "%s",
  55.      "GoodBye!"
  56.     };
  57.  
  58.      check =  OpenWinX();
  59.  
  60.      if ( check ) {
  61.  
  62.           ClosePlotWindowWindow();
  63.  
  64.           switch ( check ) {
  65.                case 1:
  66.                     EasyRequest (NULL,&ES,NULL,"Could not create a gadget context");
  67.                     return(1);
  68.                case 2:
  69.                     EasyRequest (NULL,&ES,NULL,"Error during the gadget creation");
  70.                     return(2);
  71.                case 3:
  72.                     EasyRequest (NULL,&ES,NULL,"Could not create the menus");
  73.                     return(3);
  74.                case 4:
  75.                     EasyRequest (NULL,&ES,NULL,"Could not open the window");
  76.                     return(4);
  77.                default:
  78.                     EasyRequest (NULL,&ES,NULL,"Unknown error in OpenProjectWindow");
  79.                     return(20);
  80.           }
  81.      }
  82.      return(0);
  83. }
  84.  
  85. struct TextFont *OpencPFont()
  86. {
  87. struct TextFont *FontPtr;
  88.  
  89.      FontPtr = ( struct TextFont *)OpenDiskFont( cPFont );
  90.  
  91.      if( FontPtr == NULL )
  92.        {
  93.           cPFont->ta_Name = "topaz.font";
  94.           cPFont->ta_YSize = 8;
  95.           FontPtr = ( struct TextFont *)OpenDiskFont( cPFont );
  96.        }
  97.  
  98.      return( FontPtr );
  99. }
  100.