help????

Login to reply to this topic.
Fri, 2003-10-17 01:14
Joined: 2003-10-17
Forum posts: 16
I'm using this method from a class which is inherited from CCoeControl, MCoeControlObserver.  When it runs the code block in the if statement I loose the title pane, context pane and the top 1/2 of the navi pane.  Can anyone help me out?

Code:
void CLookupContainer::Draw(const TRect& aRect) const
   {
   CWindowGc& gc = SystemGc();
   gc.SetPenStyle(CGraphicsContext::ENullPen);
   gc.SetBrushColor(KRgbGray);
   gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
   gc.DrawRect(aRect);
   
if(SplashFlag) {    
SplashFlag = EFalse;
const CFont* font = iEikonEnv->TitleFont();
   gc.UseFont(font);
   gc.SetPenStyle(CGraphicsContext::ESolidPen);
   gc.SetPenColor(TRgb(10,10,10));

   //
   // Draw the text, horizontally centered and vertically slightly below center
   //
   TSize aSize(aRect.Width(),font->HeightInPixels()+5);
   aRect.SetRect(TPoint(0,(aRect.Height()/2)-font->HeightInPixels()-5),aSize);
   gc.DrawText(_L("Text"),aRect,font->AscentInPixels(),CGraphicsContext::ECenter);

   gc.DiscardFont();
   iEikonEnv->InfoMsg(_L(""));
   User::After(1500000);
}
   }

Also, it only prints the background and text if the line "iEikonEnv->InfoMsg(_L(""));", what am I doing wrong?

Thanks

Fri, 2003-10-17 08:58
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2009
help????
Dont't use User::After() nor InfoMsgL() in the Draw() method.
This method is supposed to be non-blocking and terminate quickly.

Cheers,
Eric

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

  • Login to reply to this topic.