コード例 #1
0
/**
  @SYMTestCaseID UIF-TConeBackground-Test4L
 
  @SYMDEF PDEF112327
 
  @SYMTestCaseDesc Tests MCoeControlBackground, when a parent window owning control has one 
  child control not supporting background drawing and non window owning.\n
 
  @SYMTestPriority Critical
 
  @SYMTestStatus Implemented
  
  @SYMTestActions : Sets the background draw style.\n
  Instantiates a parent control (CConeBackgroundTestParent) which has capability of background drawing.\n
  After a new screen device has been instantiated,instantiates a second graphics context and assigns it to the child control.\n
  Thus a scenario of parent control and child control with different graphics context is created and tested.\n
  Activates the parent and child control\n
  Invokes the DrawNow function for the NonWindowOwningControl class which results in calling Draw() and DrawComponets() on the parent control itself.\n 
  
  @SYMTestType Manual
  @SYMTestExpectedResults : The background drawing should use the parent graphics context. \n
  All the test code does is to exercise the defect fix and thus the draw should complete without any error.\n
  */
void CConeBackgroundTestView::Test4L()
	{
	delete iControl;
	iControl = 0;
	
	iBgDrawer->SetBgStyle(1);
	iControl = CConeBackgroundTestParentWindowOwning::NewL(*this, Rect(),
				CConeBackgroundTestDrawer2::NewL());
	
	// create a new Gc
	CWsScreenDevice* screenDevice = new (ELeave) CWsScreenDevice((iControl->ControlEnv())->WsSession()); 
	CleanupStack::PushL(screenDevice);
	User::LeaveIfError(screenDevice->Construct());
	
	CWindowGc* gc=new(ELeave) CWindowGc(screenDevice);
	CleanupStack::PushL(gc);
	User::LeaveIfError(gc->Construct());
	
	gc->Activate(Window());
	(iControl->ComponentControl(0))->SetCustomGc(gc);
	gc->Deactivate();
	
	TSize rectSize(90,200);
	iControl->SetSize(rectSize);
	(iControl->ComponentControl(0))->SetSize(rectSize);
	
	iControl->ActivateL();
	(iControl->ComponentControl(0))->ActivateL();
	(iControl->ComponentControl(0))->DrawNow(); 
	
	CleanupStack::PopAndDestroy(gc);
	CleanupStack::PopAndDestroy(screenDevice);
	}
コード例 #2
0
/**
  @SYMTestCaseID UIF-TConeBackground-Test1L
 
  @SYMPREQ
 
  @SYMTestCaseDesc 
 
  @SYMTestPriority High
 
  @SYMTestStatus Implemented
  
  @SYMTestActions : Sets the background brush style to EVerticalHatchBrush.\n
  Instantiates a parent control (CConeBackgroundTestParent) which has capability of background drawing.\n
  Activates the Parent control.\n
  Invokes the DrawNow function for the View class which calls Draw() on the control itself,\n
  and also on all its component controls.\n.
  
  @SYMTestExpectedResults : The draw should complete with out any error.\n
 
  @SYMTestType : CIT
*/
void CConeBackgroundTestView::Test1L()
	{
	delete iControl;
	iControl = 0;

	iBgDrawer->SetBgStyle(1);
	iControl = CConeBackgroundTestParentWithBg::NewL(*this, Rect(),
				CConeBackgroundTestDrawer1::NewL(), ETrue);
	
	iControl->ActivateL();
	DrawNow();
	}
コード例 #3
0
/**
  @SYMTestCaseID UIF-TConeBackground-Test3L
 
  @SYMPREQ
 
  @SYMTestCaseDesc Tests MCoeControlBackground when a parent control has two 
  child controls,one supporting background drawing and the other without that support.\n
 
  @SYMTestPriority High
 
  @SYMTestStatus Implemented
  
  @SYMTestActions : Sets the background brush style to EVerticalHatchBrush.\n
  Instantiates a parent control (CConeBackgroundTestParent) which has capability of background drawing.\n
  Activates the Parent control.\n
  Also instantiates a secondary control of class CConeBackgroundTestParentWithBg.\n
  Later a third control without background drawing is instantiated.\n
  Thus a scenario of parent control containing child controls with and without background drawing support
  is created and tested.\n
  Invokes the DrawNow function for the View class which calls Draw() on the control itself,\n
  and also on all its component controls.\n
  
  @SYMTestExpectedResults : The draw should complete with out any error.\n
 
  @SYMTestType : CIT
*/
void CConeBackgroundTestView::Test3L()
	{
	delete iControl;
	iControl = 0;

	iBgDrawer->SetBgStyle(3);
	iControl = CConeBackgroundTestParentWithBg::NewL(*this, Rect(),
				CConeBackgroundTestDrawer1::NewL(), ETrue);
	TRect rect = Rect();
	rect.Shrink(rect.Width()/8, rect.Height()/8);
	CCoeControl* temp = CConeBackgroundTestParentWithBg::NewL(*iControl, rect, CConeBackgroundTestDrawer2::NewL());
	static_cast<CConeBackgroundTestParentWithBg*>(iControl)->SetSecondary(temp);
	iControl->ActivateL();
	DrawNow();
	}