Пример #1
0
void CBackedUpWindow::ConstructL (const TRect& aRect, CWindow* aParent)
	{
	_LIT(KFontName,"Swiss");
	// If a parent window was specified, use it; if not, use the window group
	// (aParent defaults to 0).
	RWindowTreeNode* parent= aParent ? (RWindowTreeNode*) &(aParent->Window()) : &(iClient->iGroup);
	// Allocate and construct the window
	iWindow=RBackedUpWindow(iClient->iWs);
	User::LeaveIfError(iWindow.Construct(*parent, EGray4, (TUint32)this));
	// Store the window's extent
	iRect = aRect;
	// Set up the new window's extent
	User::LeaveIfError(iWindow.SetExtentErr(iRect.iTl, iRect.Size()));
	// Set its background color
	iWindow.AllocPointerMoveBuffer(KPointerMoveBufferSize, 0);
	iWindow.DisablePointerMoveBuffer();
	iWindow.PointerFilter(EPointerFilterDrag, 0);
	// Set pointer grab to enable drag and drop
	iWindow.SetPointerGrab (ETrue);
	// Set up font for displaying text
	TFontSpec fontSpec(KFontName,200);
	User::LeaveIfError(iClient->iScreen->GetNearestFontInTwips(iFont,fontSpec));
	// Activate the window
	iWindow.Activate();
	}
Пример #2
0
void CMicroDialog::CMicroDialogInt::ConstructL(void)
{
  User::LeaveIfError(iWsSession.Connect());
  iRootWin=RWindowGroup(iWsSession);
  User::LeaveIfError(iRootWin.Construct(Handle(),EFalse));

  CApaWindowGroupName* groupName=CApaWindowGroupName::NewLC(iWsSession);
  groupName->SetHidden(ETrue);
  groupName->SetWindowGroupName(iRootWin);
  CleanupStack::PopAndDestroy(); //groupName

  iWindow=RBackedUpWindow(iWsSession);
  User::LeaveIfError(iWindow.Construct(iRootWin,EColor4K,Handle()));
  User::LeaveIfError(iWindow.SetExtentErr(TPoint((KScreenWidth-iOwner->iSize.iWidth)/2,(KScreenHeight-iOwner->iSize.iHeight)/2),iOwner->iSize));
  iWindow.MaintainBackup();
  iBitmap=new(ELeave)CFbsBitmap;
  User::LeaveIfError(iBitmap->Duplicate(iWindow.BitmapHandle()));

  iBitmapDevice=CFbsBitmapDevice::NewL(iBitmap);
  iBitmapDevice->CreateBitmapContext(iBitmapContext);

  TAlgStyle style;
  User::LeaveIfError(iBitmapDevice->GetFontById(iFont,TUid::Uid(KScreenFontUidAlp12),style));
  iBitmapContext->UseFont(iFont);

  iWindow.Activate();
  iTimer.CreateLocal();

  iOwner->iCallback->MicroDialogStart(this);
}
Пример #3
0
void COomPointerBuffer::ConstructL()
	{
	COomSetup::ConstructL();
	iFailWin=RBackedUpWindow(iWs);
	User::LeaveIfError(iFailWin.Construct(iWinGroup,EGray16,55));
	User::LeaveIfError(iFailWin.SetSizeErr(TSize(10,10)));
	iFailWin.Activate();
	}
Пример #4
0
void COomPolygon::ConstructL()
	{
	COomSetup::ConstructL();
	iScrDev=new(ELeave) CWsScreenDevice(iWs);
	User::LeaveIfError(iScrDev->Construct(iTest->ScreenNumber()));
	User::LeaveIfError(iScrDev->CreateContext(iGc));
	iWin=RBackedUpWindow(iWs);
	User::LeaveIfError(iWin.Construct(iWinGroup,EGray16,33));
	User::LeaveIfError(iWin.SetSizeErr(TSize(40,40)));
	iWin.Activate();
	TInt index;
	for(index=0;index<20;index+=2)
		iPnts.AppendL(TPoint(20+index,index));
	for(index=0;index<20;index+=2)
		iPnts.AppendL(TPoint(40-index,20+index));
	for(index=0;index<20;index+=2)
		iPnts.AppendL(TPoint(20-index,40-index));
	for(index=0;index<20;index+=2)
		iPnts.AppendL(TPoint(index,20-index));
	}
Пример #5
0
/** Creates a RBackedUpWindow object
*/
TInt COomBackedUpWindow::Fail()
	{
	iFailWin=RBackedUpWindow(iWs);
	return(iFailWin.Construct(iWinGroup,EGray16,22));
	}