home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / drawex / drawapp.cpp next >
C/C++ Source or Header  |  1998-07-03  |  2KB  |  64 lines

  1. //================================================================
  2. //  drawapp.cxx:     Source file for simple draw V application
  3. //  Copyright (C) 1995  Bruce E. Wampler
  4. //================================================================
  5. //  Files required for draw application:
  6. //      drawapp.h:      Header for the draw app
  7. //      drawapp.cxx:    Source code for draw app class
  8. //      drawcmdw.h:     Header for draw command window class
  9. //      drawcmdw.cxx:   Source code for draw command window
  10. //      drawcnv.h:      Header for draw canvas class
  11. //      drawcnv.cxx:    Sorce for draw canvas class
  12. //
  13. #include "drawapp.h"    // our header
  14.  
  15. //==================>>> drawApp::NewAppWin <<<====================
  16.   vWindow* drawApp::NewAppWin(vWindow* win, char* name, int w, int h,
  17.     vAppWinInfo* winInfo)
  18.   {
  19.     // Create a new Draw window
  20.  
  21.     vWindow* thisWin = win;             // local copy to use
  22.     vAppWinInfo* awinfo = winInfo;
  23.  
  24.     if (!thisWin)                       // need to new a window
  25.       {
  26.         thisWin = new myCmdWindow(name, w, h);
  27.       }
  28.  
  29.     if (!awinfo)
  30.         awinfo = new vAppWinInfo(name);
  31.  
  32.     return vApp::NewAppWin(thisWin, name, w, h, awinfo);
  33.   }
  34.  
  35. //======================>>> drawApp::Exit <<<=====================
  36.   void drawApp::Exit(void)
  37.   {
  38.     // This is called to close all windows. 
  39.  
  40.     vApp::Exit();       // easy default behavior
  41.   }
  42.  
  43. //====================>>> drawApp::CloseAppWin <<<================
  44.   int drawApp::CloseAppWin(vWindow* win)
  45.   {
  46.     // Code to handle close of window (such as saving/closing
  47.     // a file) would go here...
  48.  
  49.     return vApp::CloseAppWin(win);
  50.   }
  51.  
  52. //***** EVERY V application needs to declare an app instance *****
  53.  
  54.   static drawApp draw_App("V Draw");    // The instance of the app
  55.  
  56. //========================>>> AppMain <<<=========================
  57.   int AppMain(int argc, char** argv)
  58.   {
  59.     // Use AppMain to create the main window
  60.  
  61.     theApp->NewAppWin(0, "V Draw - No Name", 500, 250, 0);
  62.     return 0;           // 0 means OK
  63.   }
  64.