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 >
Wrap
C/C++ Source or Header
|
1998-06-22
|
5KB
|
193 lines
//=======================================================================
//@V@:Note: This file generated by vgen V1.04 (09:06:20 22 Jun 1998).
// cubecmdw.cpp: Source for cubeCmdWindow class
//=======================================================================
#include <v/vnotice.h> // for vNoticeDialog
#include <v/vkeys.h> // to map keys
#include "cubecmdw.h" // our header
// Start defines for the main window with 100
//@V@:BeginIDs
enum {
m_FirstCmd = 100, // Dummy Command
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
//====================>>> cubeCmdWindow::cubeCmdWindow <<<====================
cubeCmdWindow::cubeCmdWindow(char* name, int width, int height) :
vCmdWindow(name, width, height)
{
UserDebug1(Constructor,"cubeCmdWindow::cubeCmdWindow(%s) Constructor\n",name)
// The Menu Bar
cubeMenu = new vMenuPane(StandardMenu);
AddPane(cubeMenu);
// The Command Pane
cubeCmdPane = new vCommandPane(ToolBar);
AddPane(cubeCmdPane);
// The Canvas
cubeCanvas = new cubeOGLCanvasPane;
AddPane(cubeCanvas);
// Associated dialogs
// Show Window
ShowWindow();
}
//====================>>> cubeCmdWindow::~cubeCmdWindow <<<====================
cubeCmdWindow::~cubeCmdWindow()
{
UserDebug(Destructor,"cubeCmdWindow::~cubeCmdWindow() destructor\n")
// Now put a delete for each new in the constructor.
delete cubeMenu;
delete cubeCanvas;
delete cubeCmdPane;
}
//====================>>> cubeCmdWindow::KeyIn <<<====================
void cubeCmdWindow::KeyIn(vKey keysym, unsigned int shift)
{
vCmdWindow::KeyIn(keysym, shift);
}
//====================>>> cubeCmdWindow::WindowCommand <<<====================
void cubeCmdWindow::WindowCommand(ItemVal id, ItemVal val, CmdType cType)
{
// Default: route menu and toolbar commands here
UserDebug1(CmdEvents,"cubeCmdWindow: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
default: // route unhandled commands up
{
vCmdWindow::WindowCommand(id, val, cType);
break;
}
}
}