| 427 | } |
| 428 | |
| 429 | void 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 | |
| 466 | Point2I GuiCanvas::getWindowSize() |
| 467 | { |
nothing calls this directly
no test coverage detected