home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Frameworks / SCAPI 0.85 / Cross-platform code / MySCAPIApp.cc next >
Encoding:
C/C++ Source or Header  |  1997-05-31  |  1.5 KB  |  67 lines  |  [TEXT/CWIE]

  1. #include "MySCAPIApp.h"
  2. #include "SCAPIMessageBox.h"
  3.  
  4.  
  5. // Constructor
  6.  
  7. MySCAPIApp::MySCAPIApp(int*    argcP, char***    argvP) : SCAPIApp(argcP, argvP)
  8. {
  9.     try
  10.     {
  11.         mDefaultMenuBarP = (MySCAPIDefaultMenuBar*) new MySCAPIDefaultMenuBar();
  12.         AssociateMenuBar(mDefaultMenuBarP);
  13.         
  14.         mWinP = (MySCAPIWindow*) new MySCAPIWindow(    this,
  15.                                                     "Window 1",
  16.                                                     SCAPIWindow_default_originx,
  17.                                                     SCAPIWindow_default_originy,
  18.                                                     400,
  19.                                                     300                                );
  20.         
  21.         mWinP2 = (MySCAPIWindow2*) new MySCAPIWindow2(    this,
  22.                                                         "Window 2",
  23.                                                         SCAPIWindow_default_originx +
  24.                                                             400 +
  25.                                                             SCAPIWindow_borders_width    );
  26.                                                             
  27.         mWinP3 = (MySCAPIWindow3*) new MySCAPIWindow3(    this,
  28.                                                         "Window 3",
  29.                                                         SCAPIWindow_default_originx,
  30.                                                         SCAPIWindow_default_originy +
  31.                                                             300 +
  32.                                                             SCAPIWindow_borders_height    );
  33.     }
  34.     catch (SCAPIError&    theError)
  35.     {
  36.         // This try-catch bloc is really necessary; as all the exceptions are
  37.         // re-thrown, there must be a catcher somewhere, otherwise the
  38.         // application simply exits. That's not a nice behaviour for an application.
  39.         
  40.         SCAPIMessageBox::Alert(theError.mMessage);
  41.     }
  42. }
  43.  
  44. // Member functions
  45.  
  46. void    MySCAPIApp::ExecuteCommand(int    inCommand)
  47. {
  48.     
  49. }
  50.  
  51. void    MySCAPIApp::CommandStatus(    int     inCommand,
  52.                                     bool     &outEnabled,
  53.                                     int     &outMark,
  54.                                     char*     outName        )
  55. {
  56.     switch (inCommand)
  57.     {
  58.         case 1000:
  59.             outMark = SCAPI_check_mark;
  60.             break;
  61.             
  62.         case 1011:
  63.             outMark = SCAPI_check_mark;
  64.             break;
  65.     }
  66. }
  67.