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 >
Wrap
C/C++ Source or Header
|
1996-08-28
|
3KB
|
103 lines
//=======================================================================
//@V@:Note: This file generated by vgen V1.00 (14:12:12 23 Aug 1996).
// testapp.cpp: Source for testApp class
//=======================================================================
#include "testapp.h" // Header file
//=========================>>> testApp::testApp <<<==========================
testApp::testApp(char* name, int sdi, int h, int w) : vApp(name, sdi, h, w)
{
// Constructor
_testCmdWin = 0;
}
//=========================>>> testApp::testApp <<<==========================
testApp::~testApp()
{
// Desstructor
if (_testCmdWin)
delete _testCmdWin;
}
//=====================>>> testApp::NewAppWin <<<==========================
vWindow* testApp::NewAppWin(vWindow* win, char* name,
int h, int w, vAppWinInfo* winInfo)
{
vAppWinInfo* awinfo = winInfo;
char *appname = name;
if (!*name)
{
appname = "My V App"; // Default name
}
UserDebug1(Build,"testApp::NewAppWin(%s)\n",appname);
// Create the first window using provided CmdWindow
_testCmdWin = (testCmdWindow*) win;
if (!_testCmdWin)
{
_testCmdWin = new testCmdWindow(appname,h, w);
}
if (!awinfo)
awinfo = new vAppWinInfo(appname);
return vApp::NewAppWin(_testCmdWin, appname, h, w, awinfo);
}
//============================>>> testApp::Exit <<<===========================
void testApp::Exit(void)
{
// This is called to close all windows.
UserDebug(Build,"testApp::Exit()\n");
vApp::Exit(); // Default behavior
}
//======================>>> testApp::CloseAppWin <<<===========================
void testApp::CloseAppWin(vWindow* win)
{
// This will be called BEFORE a window has been unregistered or
// closed. Default behavior: unregister and close the window.
UserDebug(Build,"testApp::CloseAppWin()\n");
vApp::CloseAppWin(win);
}
//=====================>>> testApp::AppCommand <<<==============================
void testApp::AppCommand(vWindow* win, ItemVal id, ItemVal val, CmdType cType)
{
// Commands not processed by the window will be passed here
UserDebug1(Build,"testApp::AppCmd(ID: %d)\n",id);
vApp::AppCommand(win, id, val, cType);
}
//=========================>>> testApp::KeyIn <<<==============================
void testApp::KeyIn(vWindow* win, vKey key, unsigned int shift)
{
// Key strokes not processed by the window will be passed here
vApp::KeyIn(win, key, shift);
}
//###########################################################################
static testApp test_App("My V App"); // The instance of the app
//============================>>> AppMain <<<==============================
int AppMain(int argc, char** argv)
{
// Use AppMain to create the main window
(void) theApp->NewAppWin(0, "My V App", 250, 450);
return 0;
}