home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / vopengl / bounce / bncapp.cpp next >
C/C++ Source or Header  |  1998-06-22  |  3KB  |  101 lines

  1. //=======================================================================
  2. //@V@:Note: This file generated by vgen V1.04 (10:58:59 22 Jun 1998).
  3. //    bncapp.cpp:    Source for bncApp class
  4. //=======================================================================
  5.  
  6. #include "bncapp.h"        // Header file
  7.  
  8. //=========================>>> bncApp::bncApp <<<==========================
  9.   bncApp::bncApp(char* name, int sdi, int h, int w) : vApp(name, sdi, h, w)
  10.   {
  11.     // Constructor
  12.  
  13.    _bncCmdWin = 0;
  14.   }
  15.  
  16. //=========================>>> bncApp::bncApp <<<==========================
  17.   bncApp::~bncApp()
  18.   {
  19.     // Destructor
  20.   }
  21.  
  22. //=====================>>> bncApp::NewAppWin <<<==========================
  23.   vWindow* bncApp::NewAppWin(vWindow* win, char* name,
  24.     int w, int h, vAppWinInfo* winInfo)
  25.   {
  26.     vAppWinInfo* awinfo = winInfo;
  27.     char *appname = name;
  28.  
  29.     if (!*name)
  30.       {
  31.      appname = "Bounce Demo";        // Default name
  32.       }
  33.     
  34.     UserDebug1(Build,"bncApp::NewAppWin(%s)\n",appname);
  35.  
  36.     // Create the first window using provided CmdWindow
  37.  
  38.     _bncCmdWin = (bncCmdWindow*) win;
  39.     if (!_bncCmdWin)
  40.       {
  41.     _bncCmdWin = new bncCmdWindow(appname, w, h);
  42.       }
  43.  
  44.     if (!awinfo)
  45.     awinfo = new vAppWinInfo(appname);
  46.  
  47.     return vApp::NewAppWin(_bncCmdWin, appname, w, h, awinfo);
  48.   }
  49.  
  50. //============================>>> bncApp::Exit <<<===========================
  51.   void bncApp::Exit(void)
  52.   {
  53.     // This is called to close all windows.
  54.  
  55.     UserDebug(Build,"bncApp::Exit()\n");
  56.  
  57.     vApp::Exit();        // Default behavior
  58.   }
  59.  
  60. //======================>>> bncApp::CloseAppWin <<<===========================
  61.   int bncApp::CloseAppWin(vWindow* win)
  62.   {
  63.     // This will be called BEFORE a window has been unregistered or
  64.     // closed.  Default behavior: unregister and close the window.
  65.  
  66.     UserDebug(Build,"bncApp::CloseAppWin()\n");
  67.  
  68.     return vApp::CloseAppWin(win);
  69.   }
  70.  
  71. //=====================>>> bncApp::AppCommand <<<==============================
  72.   void bncApp::AppCommand(vWindow* win, ItemVal id, ItemVal val, CmdType cType)
  73.   {
  74.     // Commands not processed by the window will be passed here
  75.  
  76.     UserDebug1(Build,"bncApp::AppCmd(ID: %d)\n",id);
  77.     vApp::AppCommand(win, id, val, cType);
  78.   }
  79.  
  80. //=========================>>> bncApp::KeyIn <<<==============================
  81.   void bncApp::KeyIn(vWindow* win, vKey key, unsigned int shift)
  82.   {
  83.     // Key strokes not processed by the window will be passed here
  84.  
  85.     vApp::KeyIn(win, key, shift);
  86.   }
  87.  
  88. //###########################################################################
  89.  
  90.   static bncApp bnc_App("Bounce Demo",1);    // The instance of the app
  91.  
  92. //============================>>> AppMain <<<==============================
  93.   int AppMain(int argc, char** argv)
  94.   {
  95.     // Use AppMain to create the main window
  96.  
  97.     (void) theApp->NewAppWin(0, "Bounce Demo", 300, 300);
  98.  
  99.     return 0;
  100.   }
  101.