本文整理汇总了C++中CWindowGc::CancelClippingRegion方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindowGc::CancelClippingRegion方法的具体用法?C++ CWindowGc::CancelClippingRegion怎么用?C++ CWindowGc::CancelClippingRegion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWindowGc
的用法示例。
在下文中一共展示了CWindowGc::CancelClippingRegion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleDraw
EXPORT_C void AknPopupLayouts::HandleDraw(CEikonEnv* /*aEikEnv*/,
CWindowGc &aGc,
const TAknPopupWindowLayoutDef &aDef,
CEikListBox* aListBox,
CAknPopupHeadingPane* aHeading)
{
TRect windowRect = MenuRect(const_cast<TAknPopupWindowLayoutDef&>(aDef));
MAknsSkinInstance *skin = AknsUtils::SkinInstance();
MAknsControlContext *cc = AknsDrawUtils::ControlContext( aListBox );
TBool windowFrameDrawn = EFalse;
if (!cc) cc = aListBox->View()->ItemDrawer()->SkinBackgroundControlContext();
TRegionFix<5> dontDrawRegion;
TRegionFix<22> drawRegion;
if ( aListBox )
{
dontDrawRegion.AddRect( aListBox->Rect() );
// If there are scroll bars and they draw their own background, take
// them out of clipping region
CEikScrollBarFrame* scrollBarFrame = aListBox->ScrollBarFrame();
if (scrollBarFrame)
{
CEikScrollBar* hBar = scrollBarFrame->GetScrollBarHandle(
CEikScrollBar::EHorizontal);
CEikScrollBar* vBar = scrollBarFrame->GetScrollBarHandle(
CEikScrollBar::EVertical);
TBool drawHorizontal = ETrue;
TBool drawVertical = ETrue;
scrollBarFrame->DrawBackgroundState(drawHorizontal, drawVertical);
drawHorizontal = drawHorizontal && hBar && hBar->IsVisible();
drawVertical = drawVertical && vBar && vBar->IsVisible();
if (drawHorizontal)
{
TRect scrollBarRect(hBar->Rect());
if (hBar->OwnsWindow())
{
TPoint windowPos = aDef.iWindowRect.iTl;
TPoint scrollBarPos = hBar->PositionRelativeToScreen();
scrollBarRect.Move(scrollBarPos - windowPos);
}
dontDrawRegion.AddRect(scrollBarRect);
}
if (drawVertical)
{
TRect scrollBarRect(vBar->Rect());
if (vBar->OwnsWindow())
{
TPoint windowPos = aDef.iWindowRect.iTl;
TPoint scrollBarPos = vBar->PositionRelativeToScreen();
scrollBarRect.Move(scrollBarPos - windowPos);
}
dontDrawRegion.AddRect(scrollBarRect);
}
}
}
if ( aHeading )
{
dontDrawRegion.AddRect( aHeading->Rect() );
}
drawRegion.AddRect( windowRect );
drawRegion.SubRegion( dontDrawRegion );
if (cc)
{
const TAknsItemID *popupBgId = &KAknsIIDQsnBgPopupBackground;
TAknLayoutRect popupBgRect;
popupBgRect.LayoutRect(windowRect, SkinLayout::Popup_windows_skin_placing__background_slice__Line_1(windowRect));
AknsDrawUtils::DrawCachedImage(skin, aGc, popupBgRect.Rect(), *popupBgId);
const TAknsItemID *sliceId = &KAknsIIDQsnBgSlicePopup;
TAknLayoutRect sliceRect;
sliceRect.LayoutRect(windowRect, SkinLayout::Popup_windows_skin_placing__background_slice__Line_2());
AknsDrawUtils::DrawCachedImage(skin, aGc, sliceRect.Rect(), *sliceId);
TAknLayoutRect topLeft;
topLeft.LayoutRect(windowRect, SkinLayout::Popup_windows_skin_placing__frame_general__Line_2());
TAknLayoutRect bottomRight;
bottomRight.LayoutRect(windowRect, SkinLayout::Popup_windows_skin_placing__frame_general__Line_5());
TRect outerRect = TRect(topLeft.Rect().iTl, bottomRight.Rect().iBr);
TRect innerRect = TRect(topLeft.Rect().iBr, bottomRight.Rect().iTl);
aGc.SetPenStyle(CGraphicsContext::ENullPen);
const TAknsItemID *frameId = &KAknsIIDQsnFrPopup;
const TAknsItemID *frameCenterId = &KAknsIIDQsnFrPopupCenter;
aGc.SetClippingRegion( drawRegion );
windowFrameDrawn = AknsDrawUtils::DrawFrame(skin, aGc, outerRect, innerRect, *frameId, *frameCenterId);
aGc.CancelClippingRegion();
}
if (!windowFrameDrawn)
{
AknDraw::DrawWindowShadow(aGc, aDef.iCover, aDef.iSecond, aDef.iFirst, aDef.iOutline, aDef.iInside);
}
}