Save Format v2.0(2)
@begin ClassFile "ApplicationClass"
 Exported 0;

 @begin UserFunction "ApplicationClass()"
  Compiler 1;
  GencodeFunction 1;
  GencodeSrcLine 15;
  FunctionName "ApplicationClass::ApplicationClass()";
 @end;

 @begin UserFunction "~ApplicationClass()"
  Compiler 1;
  GencodeFunction 1;
  GencodeSrcLine 32;
  FunctionName "ApplicationClass::~ApplicationClass()";
 @end;

 @begin UserFunction "__DefaultStartHandler( WObject *, WStartEventData *event )"
  Compiler 1;
  GencodeFunction 1;
  GencodeSrcLine 35;
  FunctionName "ApplicationClass::__DefaultStartHandler( WObject *, WStartEventData *event )";
 @end;

 @begin UserFunction "__DefaultRunHandler( WObject *, WRunEventData *event )"
  Compiler 1;
  GencodeFunction 1;
  GencodeSrcLine 51;
  FunctionName "ApplicationClass::__DefaultRunHandler( WObject *, WRunEventData *event )";
 @end;

 @begin UserFunction "__DefaultEndHandler( WObject *, WEndEventData *event )"
  Compiler 1;
  GencodeFunction 1;
  GencodeSrcLine 56;
  FunctionName "ApplicationClass::__DefaultEndHandler( WObject *, WEndEventData *event )";
 @end;

 @begin UserFunction "StartHandler( WObject *, WStartEventData *event )"
  Compiler 1;
  GencodeSrcLine 66;
  FunctionName "ApplicationClass::StartHandler( WObject *, WStartEventData *event )";
 @end;

 @begin UserFunction "RunHandler( WObject *, WRunEventData *event )"
  Compiler 1;
  GencodeSrcLine 72;
  FunctionName "ApplicationClass::RunHandler( WObject *, WRunEventData *event )";
 @end;

 @begin UserFunction "EndHandler( WObject *, WEndEventData *event )"
  Compiler 1;
  GencodeSrcLine 76;
  FunctionName "ApplicationClass::EndHandler( WObject *, WEndEventData *event )";
 @end;

 @begin HPPPrefixBlock
@begin-code HPPPrefix

class Form1;

@end-code;
  GencodeSrcLine 11;
 @end;

 @begin CPPPrefixBlock
@begin-code CPPPrefix

// Code added here will be included at the top of the .CPP file

//  Include definitions for resources.
#include "WRes.h"

@end-code;
  GencodeSrcLine 11;
 @end;

 @begin ClassContentsBlock
@begin-code ClassContents

    public:
        // add your public instance data here
    private:
        // add your private instance data here
    protected:
        // add your protected instance data here

@end-code;
  GencodeSrcLine 24;
 @end;

@begin-code BaseClassList

public WExeApplication

@end-code;

@begin-code GeneratedClassContents

        ApplicationClass();
        ~ApplicationClass();
        WBool __DefaultStartHandler( WObject *, WStartEventData *event );
        WBool __DefaultRunHandler( WObject *, WRunEventData *event );
        WBool __DefaultEndHandler( WObject *, WEndEventData *event );
        WBool StartHandler( WObject *, WStartEventData *event );
        WBool RunHandler( WObject *, WRunEventData *event );
        WBool EndHandler( WObject *, WEndEventData *event );

@end-code;

@begin-code Code "ApplicationClass::ApplicationClass()"

@@CLASSNAME@::@CLASSNAME@()
{
    SetEventHandler( WStartEvent, this,
        WEventHandlerCast( @CLASSNAME@,  __DefaultStartHandler ) );
    SetEventHandler( WStartEvent, this,
        WEventHandlerCast( @CLASSNAME@,  StartHandler ) );

    SetEventHandler( WRunEvent, this,
        WEventHandlerCast( @CLASSNAME@,  __DefaultRunHandler ) );
    SetEventHandler( WRunEvent, this,
        WEventHandlerCast( @CLASSNAME@,  RunHandler ) );

    SetEventHandler( WEndEvent, this,
        WEventHandlerCast( @CLASSNAME@,  __DefaultEndHandler ) );
    SetEventHandler( WEndEvent, this,
        WEventHandlerCast( @CLASSNAME@,  EndHandler ) );
}

@end-code;

@begin-code Code "ApplicationClass::~ApplicationClass()"

@@CLASSNAME@::~@CLASSNAME@()
{
}

@end-code;

@begin-code Code "ApplicationClass::__DefaultStartHandler( WObject *, WStartEventData *event )"

WOptimaCreateGlobal * TheFirstWOptimaCreateGlobal = NULL;

WBool @CLASSNAME@::__DefaultStartHandler( WObject *, WStartEventData *event )
{
    extern WForm *__MainForm;
    class Form1;
    extern WObject *_CreateForm1( WBool );

    _CreateForm1( TRUE );
    if( __MainForm == NULL ) {
        event->abortRun = TRUE;
        event->exitCode = -1;
    }
    WOptimaCreateGlobal::CreateGlobals( &TheFirstWOptimaCreateGlobal );
    return TRUE;
}

@end-code;

@begin-code Code "ApplicationClass::__DefaultRunHandler( WObject *, WRunEventData *event )"

WBool @CLASSNAME@::__DefaultRunHandler( WObject *, WRunEventData *event )
{
    WCurrentThread::ProcessMessages();
    return TRUE;
}

@end-code;

@begin-code Code "ApplicationClass::__DefaultEndHandler( WObject *, WEndEventData *event )"

WBool @CLASSNAME@::__DefaultEndHandler( WObject *, WEndEventData *event )
{
    extern WForm *__MainForm;
    extern void _DeleteForm1( WObject * );
    WOptimaCreateGlobal::DestroyGlobals( &TheFirstWOptimaCreateGlobal );

    _DeleteForm1( __MainForm );
    __MainForm = NULL;
    return TRUE;
}

@end-code;

@begin-code Code "ApplicationClass::StartHandler( WObject *, WStartEventData *event )"

WBool @CLASSNAME@::StartHandler( WObject *, WStartEventData *event )
{
    event->abortRun = FALSE;
    event->exitCode = 0;
    return FALSE;
}

@end-code;

@begin-code Code "ApplicationClass::RunHandler( WObject *, WRunEventData *event )"

WBool @CLASSNAME@::RunHandler( WObject *, WRunEventData *event )
{
    return FALSE;
}

@end-code;

@begin-code Code "ApplicationClass::EndHandler( WObject *, WEndEventData *event )"

WBool @CLASSNAME@::EndHandler( WObject *, WEndEventData *event )
{
    return FALSE;
}

@end-code;
@end;
