www.pudn.com > Russian_Diamond(step2).zip > s60testappview.cpp


#include  
#include  
 
#include "S60TestAppView.h" 
#include "S60TestDocument.h" 
 
CS60TestAppView *CS60TestAppView::NewL(const TRect& aRect, CS60TestDocument *aDoc) 
{ 
  CS60TestAppView *self=CS60TestAppView::NewLC(aRect, aDoc); 
  CleanupStack::Pop(self); 
  return self; 
} 
 
CS60TestAppView* CS60TestAppView::NewLC(const TRect& aRect, CS60TestDocument *aDoc) 
{ 
  CS60TestAppView *self=new(ELeave) CS60TestAppView(aDoc); 
  CleanupStack::PushL(self); 
  self->ConstructL(aRect); 
  return self; 
} 
 
CS60TestAppView::CS60TestAppView(CS60TestDocument *aDoc) 
{ 
  iDoc=aDoc; 
} 
 
CS60TestAppView::~CS60TestAppView() 
{ 
} 
 
void CS60TestAppView::ConstructL(const TRect& aRect) 
{ 
  CreateWindowL(); 
  SetRect(aRect); 
  ActivateL(); 
} 
 
void CS60TestAppView::Draw(const TRect& /*aRect*/) const 
{ 
  CWindowGc &gc=SystemGc(); 
  TRect rect=Rect(); 
  gc.Clear(rect); 
 
  TBuf<64> napis; 
  _LIT(format, "Drawing area %dx%d"); 
  napis.Format(format, rect.Width(), rect.Height()); 
  gc.UseFont(iCoeEnv->NormalFont()); 
  gc.DrawText(napis, TPoint(5, 50)); 
}