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

  1. //=======================================================================
  2. //@V@:Note: This file generated by vgen V1.04 (09:06:20 22 Jun 1998).
  3. //    cubecmdw.cpp:    Source for cubeCmdWindow class
  4. //=======================================================================
  5.  
  6. #include <v/vnotice.h>    // for vNoticeDialog
  7. #include <v/vkeys.h>    // to map keys
  8.  
  9. #include "cubecmdw.h"    // our header
  10.  
  11. //    Start defines for the main window with 100
  12.  
  13. //@V@:BeginIDs
  14.     enum {
  15.     m_FirstCmd = 100, // Dummy Command
  16.     blkLast        // Last item
  17.       };
  18. //@V@:EndIDs
  19.  
  20. //@V@:BeginPulldownMenu FileMenu
  21.     static vMenu FileMenu[] =
  22.       {
  23.     {"&New", M_New, isSens, notChk, noKeyLbl, noKey, noSub},
  24.     {"&Open...", M_Open, isSens, notChk, noKeyLbl, noKey, noSub},
  25.     {"&Save", M_Save, isSens, notChk, noKeyLbl, noKey, noSub},
  26.     {"Save &as...", M_SaveAs, isSens, notChk, noKeyLbl, noKey, noSub},
  27.     {"&Close...", M_CloseFile, isSens, notChk, noKeyLbl, noKey, noSub},
  28.     {"-", M_Line, notSens, notChk, noKeyLbl, noKey, noSub},
  29.     {"E&xit", M_Exit, isSens, notChk, noKeyLbl, noKey, noSub},
  30.     {NULL}
  31.       };
  32. //@V@:EndPulldownMenu
  33.  
  34. //@V@:BeginPulldownMenu EditMenu
  35.     static vMenu EditMenu[] =
  36.       {
  37.     {"Cut  ", M_Cut, isSens, notChk, "Ctrl-X", 'X'-'@', noSub},
  38.     {"Copy ", M_Copy, isSens, notChk, "Ctrl-C", 'C'-'@', noSub},
  39.     {"Paste", M_Paste, isSens, notChk, "Ctrl-V", 'V'-'@', noSub},
  40.     {NULL}
  41.       };
  42. //@V@:EndPulldownMenu
  43.  
  44. //@V@:BeginMenu StandardMenu
  45.     static vMenu StandardMenu[] =
  46.       {
  47.     {"&File", M_File, isSens, notUsed, notUsed, noKey, &FileMenu[0]},
  48.     {"&Edit", M_Edit, isSens, notUsed, notUsed, noKey, &EditMenu[0]},
  49.     {NULL}
  50.       };
  51. //@V@:EndMenu
  52.  
  53. //@V@:BeginCmdPane ToolBar
  54.     static CommandObject ToolBar[] =
  55.       {
  56.     {C_Button,M_Exit,0,"Exit",NoList,CA_None,isSens,NoFrame,0,0},
  57.     {C_EndOfList,0,0,0,0,CA_None,0,0,0}
  58.       };
  59. //@V@:EndCmdPane
  60.  
  61. //====================>>> cubeCmdWindow::cubeCmdWindow <<<====================
  62.   cubeCmdWindow::cubeCmdWindow(char* name, int width, int height) :
  63.     vCmdWindow(name, width, height)
  64.   {
  65.     UserDebug1(Constructor,"cubeCmdWindow::cubeCmdWindow(%s) Constructor\n",name)
  66.  
  67.     // The Menu Bar
  68.     cubeMenu = new vMenuPane(StandardMenu);
  69.     AddPane(cubeMenu);
  70.  
  71.     // The Command Pane
  72.     cubeCmdPane = new vCommandPane(ToolBar);
  73.     AddPane(cubeCmdPane);
  74.  
  75.     // The Canvas
  76.     cubeCanvas = new cubeOGLCanvasPane;
  77.     AddPane(cubeCanvas);
  78.  
  79.     // Associated dialogs
  80.  
  81.     
  82.     // Show Window
  83.  
  84.     ShowWindow();
  85.   }
  86.  
  87. //====================>>> cubeCmdWindow::~cubeCmdWindow <<<====================
  88.   cubeCmdWindow::~cubeCmdWindow()
  89.   {
  90.     UserDebug(Destructor,"cubeCmdWindow::~cubeCmdWindow() destructor\n")
  91.  
  92.     // Now put a delete for each new in the constructor.
  93.  
  94.     delete cubeMenu;
  95.     delete cubeCanvas;
  96.     delete cubeCmdPane;
  97.   }
  98.  
  99. //====================>>> cubeCmdWindow::KeyIn <<<====================
  100.   void cubeCmdWindow::KeyIn(vKey keysym, unsigned int shift)
  101.   {
  102.     vCmdWindow::KeyIn(keysym, shift);
  103.   }
  104.  
  105. //====================>>> cubeCmdWindow::WindowCommand <<<====================
  106.   void cubeCmdWindow::WindowCommand(ItemVal id, ItemVal val, CmdType cType)
  107.   {
  108.     // Default: route menu and toolbar commands here
  109.  
  110.  
  111.     UserDebug1(CmdEvents,"cubeCmdWindow:WindowCommand(%d)\n",id)
  112.  
  113.     switch (id)
  114.       {
  115.     //@V@:Case M_New
  116.     case M_New:
  117.       {
  118.         vNoticeDialog note(this);
  119.         note.Notice("New");
  120.         break;
  121.       }    //@V@:EndCase
  122.  
  123.     //@V@:Case M_Open
  124.     case M_Open:
  125.       {
  126.         vNoticeDialog note(this);
  127.         note.Notice("Open");
  128.         break;
  129.       }    //@V@:EndCase
  130.  
  131.     //@V@:Case M_Save
  132.     case M_Save:
  133.       {
  134.         vNoticeDialog note(this);
  135.         note.Notice("Save");
  136.         break;
  137.       }    //@V@:EndCase
  138.  
  139.     //@V@:Case M_SaveAs
  140.     case M_SaveAs:
  141.       {
  142.         vNoticeDialog note(this);
  143.         note.Notice("Save As");
  144.         break;
  145.       }    //@V@:EndCase
  146.  
  147.     //@V@:Case M_CloseFile
  148.     case M_CloseFile:
  149.       {
  150.         vNoticeDialog note(this);
  151.         note.Notice("Close File");
  152.         break;
  153.       }    //@V@:EndCase
  154.  
  155.     //@V@:Case M_Exit
  156.     case M_Exit:
  157.       {
  158.         theApp->Exit();
  159.         break;
  160.       }    //@V@:EndCase
  161.  
  162.     //@V@:Case M_Cut
  163.     case M_Cut:
  164.       {
  165.         vNoticeDialog note(this);
  166.         note.Notice("Cut");
  167.         break;
  168.       }    //@V@:EndCase
  169.  
  170.     //@V@:Case M_Copy
  171.     case M_Copy:
  172.       {
  173.         vNoticeDialog note(this);
  174.         note.Notice("Copy");
  175.         break;
  176.       }    //@V@:EndCase
  177.  
  178.     //@V@:Case M_Paste
  179.     case M_Paste:
  180.       {
  181.         vNoticeDialog note(this);
  182.         note.Notice("Paste");
  183.         break;
  184.       }    //@V@:EndCase
  185.  
  186.     default:        // route unhandled commands up
  187.       {
  188.         vCmdWindow::WindowCommand(id, val, cType);
  189.         break;
  190.       }
  191.       }
  192.   }
  193.