MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / handleAppEvent

Method handleAppEvent

Engine/source/gui/core/guiCanvas.cpp:429–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429void GuiCanvas::handleAppEvent( WindowId did, S32 event )
430{
431 // Notify script if we gain or lose focus.
432 if(event == LoseFocus)
433 {
434 if(isMethod("onLoseFocus"))
435 Con::executef(this, "onLoseFocus");
436 }
437
438 if(event == GainFocus)
439 {
440 if(isMethod("onGainFocus"))
441 Con::executef(this, "onGainFocus");
442 }
443
444 if(event == WindowClose || event == WindowDestroy)
445 {
446
447 if(isMethod("onWindowClose"))
448 {
449 // First see if there is a method on this window to handle
450 // it's closure
451 Con::executef(this,"onWindowClose");
452 }
453 else if(Con::isFunction("onWindowClose"))
454 {
455 // otherwise check to see if there is a global function handling it
456 Con::executef("onWindowClose", getIdString());
457 }
458 else
459 {
460 // Else just shutdown
461 Process::requestShutdown();
462 }
463 }
464}
465
466Point2I GuiCanvas::getWindowSize()
467{

Callers

nothing calls this directly

Calls 2

executefFunction · 0.85
isFunctionFunction · 0.85

Tested by

no test coverage detected