home *** CD-ROM | disk | FTP | other *** search
- //=======================================================================
- //@V@:Note: This file generated by vgen V1.04 (12:03:15 22 Jun 1998).
- // sboxcmdw.cpp: Source for sboxCmdWindow class
- //=======================================================================
-
- #include <v/vnotice.h> // for vNoticeDialog
- #include <v/vkeys.h> // to map keys
-
- #include "sboxcmdw.h" // our header
-
- // Start defines for the main window with 100
-
- //@V@:BeginIDs
- enum {
- m_FirstCmd = 100, // Dummy Command
- cmdAuxTimer, // AuxTimer
- blkLast // Last item
- };
- //@V@:EndIDs
-
- //@V@:BeginPulldownMenu FileMenu
- static vMenu FileMenu[] =
- {
- {"&New", M_New, isSens, notChk, noKeyLbl, noKey, noSub},
- {"&Open...", M_Open, isSens, notChk, noKeyLbl, noKey, noSub},
- {"&Save", M_Save, isSens, notChk, noKeyLbl, noKey, noSub},
- {"Save &as...", M_SaveAs, isSens, notChk, noKeyLbl, noKey, noSub},
- {"&Close...", M_CloseFile, isSens, notChk, noKeyLbl, noKey, noSub},
- {"-", M_Line, notSens, notChk, noKeyLbl, noKey, noSub},
- {"E&xit", M_Exit, isSens, notChk, noKeyLbl, noKey, noSub},
- {NULL}
- };
- //@V@:EndPulldownMenu
-
- //@V@:BeginPulldownMenu EditMenu
- static vMenu EditMenu[] =
- {
- {"Cut ", M_Cut, isSens, notChk, "Ctrl-X", 'X'-'@', noSub},
- {"Copy ", M_Copy, isSens, notChk, "Ctrl-C", 'C'-'@', noSub},
- {"Paste", M_Paste, isSens, notChk, "Ctrl-V", 'V'-'@', noSub},
- {NULL}
- };
- //@V@:EndPulldownMenu
-
- //@V@:BeginMenu StandardMenu
- static vMenu StandardMenu[] =
- {
- {"&File", M_File, isSens, notUsed, notUsed, noKey, &FileMenu[0]},
- {"&Edit", M_Edit, isSens, notUsed, notUsed, noKey, &EditMenu[0]},
- {NULL}
- };
- //@V@:EndMenu
-
- //@V@:BeginCmdPane ToolBar
- static CommandObject ToolBar[] =
- {
- {C_Button,M_Exit,0,"Exit",NoList,CA_None,isSens,NoFrame,0,0},
- {C_EndOfList,0,0,0,0,CA_None,0,0,0}
- };
- //@V@:EndCmdPane
-
- //====================>>> sboxAuxTimer::TimerTick <<<====================
- void sboxAuxTimer::TimerTick()
- {
- cmdw->WindowCommand(cmdAuxTimer, cmdAuxTimer, C_Button); // update clock
- }
-
- //====================>>> sboxCmdWindow::sboxCmdWindow <<<====================
- sboxCmdWindow::sboxCmdWindow(char* name, int width, int height) :
- vCmdWindow(name, width, height)
- {
- UserDebug1(Constructor,"sboxCmdWindow::sboxCmdWindow(%s) Constructor\n",name)
-
- // The Menu Bar
- sboxMenu = new vMenuPane(StandardMenu);
- AddPane(sboxMenu);
-
- // The Command Pane
- sboxCmdPane = new vCommandPane(ToolBar);
- AddPane(sboxCmdPane);
-
- // The Canvas
- sboxCanvas = new sboxOGLCanvasPane;
- AddPane(sboxCanvas);
-
- _auxTimer = new sboxAuxTimer(this); // create aux timer
- _auxTimer->TimerSet(50); // 1/2 second intervals
- // Associated dialogs
-
-
- // Show Window
-
- ShowWindow();
- WindowCommand(cmdAuxTimer,cmdAuxTimer,C_Button); // update clock
- }
-
- //====================>>> sboxCmdWindow::~sboxCmdWindow <<<====================
- sboxCmdWindow::~sboxCmdWindow()
- {
- UserDebug(Destructor,"sboxCmdWindow::~sboxCmdWindow() destructor\n")
-
- // Now put a delete for each new in the constructor.
-
- delete sboxMenu;
- delete sboxCanvas;
- delete sboxCmdPane;
- _auxTimer->TimerStop(); // end it
- delete _auxTimer; // free it
- }
-
- //====================>>> sboxCmdWindow::KeyIn <<<====================
- void sboxCmdWindow::KeyIn(vKey keysym, unsigned int shift)
- {
- vCmdWindow::KeyIn(keysym, shift);
- }
-
- //====================>>> sboxCmdWindow::WindowCommand <<<====================
- void sboxCmdWindow::WindowCommand(ItemVal id, ItemVal val, CmdType cType)
- {
- // Default: route menu and toolbar commands here
-
-
- UserDebug1(CmdEvents,"sboxCmdWindow:WindowCommand(%d)\n",id)
-
- switch (id)
- {
- //@V@:Case M_New
- case M_New:
- {
- vNoticeDialog note(this);
- note.Notice("New");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_Open
- case M_Open:
- {
- vNoticeDialog note(this);
- note.Notice("Open");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_Save
- case M_Save:
- {
- vNoticeDialog note(this);
- note.Notice("Save");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_SaveAs
- case M_SaveAs:
- {
- vNoticeDialog note(this);
- note.Notice("Save As");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_CloseFile
- case M_CloseFile:
- {
- vNoticeDialog note(this);
- note.Notice("Close File");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_Exit
- case M_Exit:
- {
- theApp->Exit();
- break;
- } //@V@:EndCase
-
- //@V@:Case M_Cut
- case M_Cut:
- {
- vNoticeDialog note(this);
- note.Notice("Cut");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_Copy
- case M_Copy:
- {
- vNoticeDialog note(this);
- note.Notice("Copy");
- break;
- } //@V@:EndCase
-
- //@V@:Case M_Paste
- case M_Paste:
- {
- vNoticeDialog note(this);
- note.Notice("Paste");
- break;
- } //@V@:EndCase
-
- //@V@:Case auxTimer
- case cmdAuxTimer: // Event from aux timer
- {
- sboxCanvas->TimerAnimate();
- break;
- } //@V@:EndCase
- default: // route unhandled commands up
- {
- vCmdWindow::WindowCommand(id, val, cType);
- break;
- }
- }
- }
-