Category : Miscellaneous Language Source Code
Archive   : DLGDS411.ZIP
Filename : TESTCASE.CPP

 
Output of file : TESTCASE.CPP contained in archive : DLGDS411.ZIP
/*-------------------------------------------------------------------
testcase.cpp

A program to test type 1 source code generated by Dialog Design. Open
project, TEST.PRJ, copy this file to TEST.CPP and then insert the XXX.SRC
file generated by Dialog Design at the line of asterisks. Choose
Compile\Make (F9) to form the test program TEST.EXE.

In case of difficulty, check Options|Directories to make sure the directory
paths are correct for your system.

--------------------------------------------------------------------*/

#define Uses_TEventQueue
#define Uses_TEvent
#define Uses_TProgram
#define Uses_TApplication
#define Uses_TKeys
#define Uses_TRect
#define Uses_TMenuBar
#define Uses_TSubMenu
#define Uses_TMenuItem
#define Uses_TStatusLine
#define Uses_TStatusItem
#define Uses_TStatusDef
#define Uses_TDeskTop
#define Uses_TView
#define Uses_TWindow
#define Uses_TFrame
#define Uses_TScroller
#define Uses_TScrollBar
#define Uses_TDialog
#define Uses_TButton
#define Uses_TSItem
#define Uses_TCheckBoxes
#define Uses_TRadioButtons
#define Uses_TLabel
#define Uses_TInputLine
#define Uses_TCollection
#define Uses_THistory
#define Uses_THistoryWindow
#define Uses_TListBox
#define Uses_TStringCollection
#define Uses_TMemo
#define Uses_TColoredText
#define Uses_TInputLong
#include
#include "tcolortx.h"
#include "tinplong.h"

const cmTry = 150;

class TMyApp : public TApplication
{
public:
TMyApp();
static TStatusLine *initStatusLine(TRect r);
virtual void handleEvent(TEvent& event);
};

TMyApp::TMyApp() :
TProgInit( TMyApp::initStatusLine,
TMyApp::initMenuBar,
TMyApp::initDeskTop
)
{
}

TStatusLine *TMyApp::initStatusLine( TRect r )
{
r.a.y = r.b.y - 1; // move top to 1 line above bottom
return new TStatusLine( r,
*new TStatusDef(0, 0xFFFF) +
*new TStatusItem("~Alt-X~ Exit", kbAltX, cmQuit) +
*new TStatusItem("~F9~ Try dialog", kbF9, cmTry)
);
}

//******Insert makeDialog here*****

dataRec a;

void TMyApp::handleEvent(TEvent& event)
{
TApplication::handleEvent(event);
if( event.what == evCommand && event.message.command == cmTry )
{
TDialog* dialog = makeDialog();
if (validView(dialog))
{
dialog->setData(&a);
if (deskTop->execView(dialog) != cmCancel)
dialog->getData(&a);
destroy(dialog);
}
clearEvent(event);
}
}

int main()
{
TMyApp myApp;
myApp.run();
return 0;
}




  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : DLGDS411.ZIP
Filename : TESTCASE.CPP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/