Example #1
0
	void BaseRenderable::PopulateMessageMap()
	{
		AddMessageHandler( MessageHandler( MSG_SET_BASE_RENDERSHAPE_LIST, OnSetRenderShapeList ) );
		AddMessageHandler( MessageHandler( MSG_FRUSTUM_TEST, OnFrustumTest ) );
		AddMessageHandler( MessageHandler( MSG_BUILD_LOCAL_AABB, OnBuildLocalAabb ) );
		AddMessageHandler( MessageHandler( MSG_GET_RENDERABLE_COUNT, OnGetRenderableCount ) );
		AddMessageHandler( MSG_ATTRIBUTE_CHANGED, OnAttributeChanged );		
	}
AppWindow :: AppWindow()
{												   
	CreateWindow(OpmStdFrame);					   // Create the frame
	SetCaption("Errors & Conditons Sample");					   // Set captions
	SetSwitchTitle("ErrorDemo");
	SetIcon(icon = new wIcon(ResIcon, ITriangle));   // Set the app's icon

	// This section create a menu bar and then adds items to the 
	// sub menu itself.  It is also possible to construct the menu
	// from the resource file if desired

	menubar = new wMenu(this, MBarError, "~Error\\~Condition\\~Help\\");
	menubar->SetSubMenuItems(MBarError, MiFatal, "~Fatal;~Error;~Warning;");
	menubar->SetSubMenuItems(MBarCondition, MiRecord, "~Record...;~Tell...;");
	menubar->SetSubMenuItems(MBarHelp, MiHelp, "~Help for help...;~General help...;Help ~index;");

	// Create a temporary system menu object for the purposes of adding
	// a seperator and the "About..." menu item.

	wSysMenu sm(this);
	sm.AppendSeparator();
	sm.AppendItem(ScAbout, "~About...");

	// Add event handlers for the menu items.  

	AddMessageHandler(this, EVENTMETHOD(AppWindow, ProcError), 
	                  WM_COMMAND, MiFatal, MiWarning);	
	
	AddMessageHandler(this, EVENTMETHOD(AppWindow, ProcRecordTell), 
	                  WM_COMMAND, MiRecord, MiTell);	

	AddMessageHandler(this, EVENTMETHOD(AppWindow, ProcHelp), 
	                  WM_COMMAND, MiHelp, MiHelpIndex);	

	AddMessageHandler(this, EVENTMETHOD(AppWindow, ProcAbout), 
	                  WM_COMMAND, ScAbout);	

	// connect to HelpManager object

	SetFrameID(AppFrame);
	AssociateHelp();	
	help = ThisThread->HelpInstance();

	// set the address of the frame window in the app's dictionary so that
	// the error dialog can use it as its parent window.

	ThisApp->PutObject("AppFrame", this);

	Show();				   // Make the frame visible
	ToTop();
}
Example #3
0
winapiwrapper::winapiwrapper(HINSTANCE hInstance):
				hWnd(0),
				hDC(0),
				vpFunc(0),
				wHeight(0),
				wWidth(0)
{
	selfptr = this;
	this->hInstance = hInstance;

	addWindowClass("mywrapperdefclass", CS_HREDRAW | CS_VREDRAW);

	AddMessageHandler(WM_DESTROY,&winapiwrapper::onDestroy);

	AddMessageHandler(WM_LBUTTONDOWN,&winapiwrapper::onLeftMouseDown);
	AddMessageHandler(WM_RBUTTONDOWN,&winapiwrapper::onRightMouseDown);
	AddMessageHandler(WM_MBUTTONDOWN,&winapiwrapper::onMidMouseDown);
	AddMessageHandler(WM_KEYDOWN,&winapiwrapper::onKeyDown);
	AddMessageHandler(WM_SIZE,&winapiwrapper::onResize);
	AddMessageHandler(WM_MOUSEWHEEL,&winapiwrapper::onWheel);

}
Example #4
0
	//-----------------------------------------------------------------------
	IModule::IModule()
	{
		AddMessageHandler();
	}
Example #5
0
	void Physics::PopulateMessageMap(void)
	{
		AddMessageHandler( MessageHandler( PhysicsMessages::MSG_UPDATE, OnUpdate ) );
		AddMessageHandler( MessageHandler( PhysicsMessages::MSG_APPLY_FORCE, OnApplyForce ) );
		AddMessageHandler( MessageHandler( PhysicsMessages::MSG_APPLY_REACTION, OnApplyReaction ) );
	}
	void SkyBoxBehavior::PopulateMessageMap()
	{
		AddMessageHandler( MessageHandler( SkyBoxBehaviorMessages::MSG_BUILD_LOCAL_AABB, 
			OnBuildLocalAabb ) );
	}
	void TurnToBehavior::PopulateMessageMap(void)
	{
		AddMessageHandler( MessageHandler( TurnToBehaviorMessages::MSG_SET_TARGET, OnSetTarget ) );
		AddMessageHandler( MessageHandler( TurnToBehaviorMessages::MSG_UPDATE, OnUpdate ) );
	}
	void TurretBehavior::PopulateMessageMap(void)
	{
		AddMessageHandler( MessageHandler( TurretBehaviorMessages::MSG_ROTATE_RIGHT, OnRotateRight ) );
		AddMessageHandler( MessageHandler( TurretBehaviorMessages::MSG_ROTATE_LEFT, OnRotateLeft ) );
		AddMessageHandler( MessageHandler( TurretBehaviorMessages::MSG_RIGHT_JOYSTICK, OnRightStick ) );
	}
	void CameraBehavior::PopulateMessageMap(void)
	{
		AddMessageHandler( MessageHandler( CameraBehaviorMessages::MSG_SET_PORT_INDEX, OnSetViewPortIndex ) );
		AddMessageHandler( MessageHandler( CameraBehaviorMessages::MSG_UPDATE, OnUpdate ) );
		AddMessageHandler( MessageHandler( CameraBehaviorMessages::MSG_BUILD_PROJECTION, OnBuildProjection ) );		
	}
Example #10
0
	void GroundClamp::PopulateMessageMap(void)
	{
		AddMessageHandler( MessageHandler( GroundClampMessages::MSG_COLLIDE, OnCollide ) );
		AddMessageHandler( MessageHandler( GroundClampMessages::MSG_UPDATE, OnUpdate ) );
	}
Example #11
0
	void SpotLightBehavior::PopulateMessageMap(void)
	{
		AddMessageHandler( MSG_FRUSTUM_TEST, OnFrustumTest );
		AddMessageHandler( MSG_BUILD_LOCAL_AABB, OnBuildLocalAabb );
		AddMessageHandler( MSG_GET_RENDERABLE_COUNT, OnGetRenderableCount );
	}