本文整理汇总了C++中TWsEvent::VisibilityChanged方法的典型用法代码示例。如果您正苦于以下问题:C++ TWsEvent::VisibilityChanged方法的具体用法?C++ TWsEvent::VisibilityChanged怎么用?C++ TWsEvent::VisibilityChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TWsEvent
的用法示例。
在下文中一共展示了TWsEvent::VisibilityChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleWsEvent
// -----------------------------------------------------------------------------
// CGameController::HandleWsEvent
// This function is called by the CWsEventReceiver
// Active Object, whenever it receives a Windows Server
// event.
// -----------------------------------------------------------------------------
//
void CGameController::HandleWsEvent( const TWsEvent& aWsEvent )
{
TInt eventType = aWsEvent.Type();
// Handle Key and Screen Size change Events.
switch( eventType )
{
case EEventKeyDown:
{
if( iGame )
iGame->HandleKeyEvent( aWsEvent.Key()->iScanCode, EFalse );
break;
}
case EEventKeyUp:
{
if( iGame )
iGame->HandleKeyEvent( aWsEvent.Key()->iScanCode, ETrue );
break;
}
case( EEventScreenDeviceChanged ): // The screen size has changed.
{
TPixelsTwipsAndRotation pixnrot;
iWsScreenDevice->GetScreenModeSizeAndRotation(
iWsScreenDevice->CurrentScreenMode(),
pixnrot
);
if( pixnrot.iPixelSize != iWindow->Size() )
{
// Update the window.
iWindow->SetExtent( TPoint( 0, 0 ),
pixnrot.iPixelSize
);
// If a game is running, notify it about the change.
if( iGame )
{
iGame->SetScreenSize( pixnrot.iPixelSize.iWidth,
pixnrot.iPixelSize.iHeight
);
// Call eglSwapBuffers after the window size has changed.
// This updates the window size used by egl.
eglSwapBuffers( iEglDisplay, iEglSurface );
}
}
break;
}
case EEventFocusLost:
{
iIsAppInFocus = EFalse;
break;
}
case EEventFocusGained:
{
iIsAppInFocus = ETrue;
break;
}
case EEventWindowVisibilityChanged:
{
// Check if the event is for the iWindow
if( aWsEvent.Handle() ==
reinterpret_cast<TUint32>( this )
)
{
if( aWsEvent.VisibilityChanged()->iFlags &
TWsVisibilityChangedEvent::ECanBeSeen
)
{
iIsVisible = ETrue;
}
else
iIsVisible = EFalse;
}
break;
}
case EEventNull:
case EEventKey:
case EEventUser:
case EEventWindowGroupListChanged:
case EEventModifiersChanged:
case EEventSwitchOn:
case EEventPassword:
case EEventWindowGroupsChanged:
case EEventErrorMessage:
case EEventPointer:
case EEventPointerEnter:
case EEventPointerExit:
//.........这里部分代码省略.........