home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / contrib / pstest.tar / testapp.cpp < prev    next >
C/C++ Source or Header  |  1996-08-28  |  3KB  |  103 lines

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