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

  1. //=======================================================================
  2. //@V@:Note: This file generated by vgen V1.04 (12:03:15 22 Jun 1998).
  3. //    sboxapp.cpp:    Source for sboxApp class
  4. //=======================================================================
  5.  
  6. #include "sboxapp.h"        // Header file
  7.  
  8. //=========================>>> sboxApp::sboxApp <<<==========================
  9.   sboxApp::sboxApp(char* name, int sdi, int h, int w) : vApp(name, sdi, h, w)
  10.   {
  11.     // Constructor
  12.  
  13.    _sboxCmdWin = 0;
  14.   }
  15.  
  16. //=========================>>> sboxApp::sboxApp <<<==========================
  17.   sboxApp::~sboxApp()
  18.   {
  19.     // Destructor
  20.   }
  21.  
  22. //=====================>>> sboxApp::NewAppWin <<<==========================
  23.   vWindow* sboxApp::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 = "Spin Box";        // Default name
  32.       }
  33.     
  34.     UserDebug1(Build,"sboxApp::NewAppWin(%s)\n",appname);
  35.  
  36.     // Create the first window using provided CmdWindow
  37.  
  38.     _sboxCmdWin = (sboxCmdWindow*) win;
  39.     if (!_sboxCmdWin)
  40.       {
  41.     _sboxCmdWin = new sboxCmdWindow(appname, w, h);
  42.       }
  43.  
  44.     if (!awinfo)
  45.     awinfo = new vAppWinInfo(appname);
  46.  
  47.     return vApp::NewAppWin(_sboxCmdWin, appname, w, h, awinfo);
  48.   }
  49.  
  50. //============================>>> sboxApp::Exit <<<===========================
  51.   void sboxApp::Exit(void)
  52.   {
  53.     // This is called to close all windows.
  54.  
  55.     UserDebug(Build,"sboxApp::Exit()\n");
  56.  
  57.     vApp::Exit();        // Default behavior
  58.   }
  59.  
  60. //======================>>> sboxApp::CloseAppWin <<<===========================
  61.   int sboxApp::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,"sboxApp::CloseAppWin()\n");
  67.  
  68.     return vApp::CloseAppWin(win);
  69.   }
  70.  
  71. //=====================>>> sboxApp::AppCommand <<<==============================
  72.   void sboxApp::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,"sboxApp::AppCmd(ID: %d)\n",id);
  77.     vApp::AppCommand(win, id, val, cType);
  78.   }
  79.  
  80. //=========================>>> sboxApp::KeyIn <<<==============================
  81.   void sboxApp::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 sboxApp sbox_App("Spin Box",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, "Spin Box", 300, 300);
  98.  
  99.     return 0;
  100.   }
  101.