When the inactivity timer fires, you can create the screen saver and present it. Also you have to establish a connection from your screen saver to the embedding owner. This you can do for example by defining a slot property within the screen saver and assign a slot from the owner to it.
Here examples for the methods shown in the previous screen shot.
onInactivityTimer
// create and display ScreenSaver
if ( screenSaver == null )
screenSaver = new Application::ScreenSaver;
if ( screenSaver != null )
{
screenSaver.OnTouch = onScreenSaverTouch;
if ( screenSaver.Owner == null )
{
ScreenContainer.Visible = false;
PresentDialog( screenSaver, Configs::ScreenSaverFadeIn, null,
null, null, null, null, null, null, true );
}
}
// stop inactivity timer
inactivityTimer.Enabled = false;
onScreenSaverTouch
// remove ScreenSaver
if( screenSaver != null && screenSaver.Owner == this )
{
DismissDialog( screenSaver, null, null, null, onScreenSaverFinished, null, true );
}
screenSaver = null;