CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TAppStarter

Unit

AppsInit

Declaration

type TAppStarter = class

Description

Application starter base class The class manages application startup process, creates window, forwards windows messages, etc

Fields

 NameDescription
PublicCallDefaultMsgHandlerDetermines if a default window message handler should be called
ProtectedFProgramExeDirApplication .exe directory
ProtectedFProgramExeNameApplication .exe file name
ProtectedFProgramNameApplication name
ProtectedFProgramVersionStrApplication version string
ProtectedFProgramWorkDirApplication working directory
ProtectedFWindowHandleApplication window handle
ProtectedFWindowStyleApplication window style
PublicHandleMessagesDetermines if message handling is needed. True by default.
PublicInactiveSleepAmountTime to sleep in milliseconds when the application is not active (60 default)
PublicMessageHandlerA message handler to forward Window messages to

Methods

Overview

Publicconstructor Create(const AProgramName: string; AWindowProc: TWndProc; Options: TStarterOptions);
Publicdestructor Destroy; override;
Protectedfunction GetTerminated: Boolean; virtual;
Protectedprocedure Init; virtual;
Publicfunction isAlreadyRunning(ActivateExisting: Boolean): Boolean; virtual; abstract;
Protectedprocedure ParseParamStr; virtual;
Publicprocedure PrintError(const Msg: string; ErrorType: TLogLevel); virtual; abstract;
Publicfunction Process: Boolean; virtual; abstract;
Protectedfunction ProcessMessage(Msg: Longword; wParam: Integer; lParam: Integer): Integer; virtual;
Publicprocedure Terminate; virtual;

Description

Publicconstructor Create(const AProgramName: string; AWindowProc: TWndProc; Options: TStarterOptions);

Create and setup an application with the given name. If AWindowProc is nil a default procedure will be used.

Publicdestructor Destroy; override;

Immediate termination

Protectedfunction GetTerminated: Boolean; virtual;

Returns True if the application is terminated

Protectedprocedure Init; virtual;

This method should be overridden for variables custom initialization

Publicfunction isAlreadyRunning(ActivateExisting: Boolean): Boolean; virtual; abstract;

Returns True if another instance of the application is already rinning. If ActivateExisting is True the other instance will be activated.

Protectedprocedure ParseParamStr; virtual;

This method should be overridden to do command line parameters parsing

Publicprocedure PrintError(const Msg: string; ErrorType: TLogLevel); virtual; abstract;

Prints an error information

Publicfunction Process: Boolean; virtual; abstract;

Should be called each application cycle. Usally overridden to perform message processing. Returns negate value of Terminated property.

Protectedfunction ProcessMessage(Msg: Longword; wParam: Integer; lParam: Integer): Integer; virtual;

Windows message handler

Publicprocedure Terminate; virtual;

Set Terminated flag. Normally the application will be terminated as soon as possible.

Properties

Overview

Publicproperty Active: Boolean;
Publicproperty ProgramExeDir: string;
Publicproperty ProgramExeName: string;
Publicproperty ProgramName: string;
Publicproperty ProgramWorkDir: string;
Publicproperty Terminated: Boolean;
Publicproperty WindowHandle: Cardinal;
Publicproperty WindowStyle: Cardinal;

Description

Publicproperty Active: Boolean;

True if the application's window is currently active

Publicproperty ProgramExeDir: string;

Application .exe directory including trailing path delimiter

Publicproperty ProgramExeName: string;

Application .exe file name

Publicproperty ProgramName: string;

Application name

Publicproperty ProgramWorkDir: string;

Application working directory including trailing path delimiter

Publicproperty Terminated: Boolean;

True if the application is terminated

Publicproperty WindowHandle: Cardinal;

Application window handle

Publicproperty WindowStyle: Cardinal;

Application window style

Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com