I am having some controls contained in a container instances of the following class.
and the are called into the container asCode:#include "hdrandfooter/CBand.h" #include <coemain.h> #include <EMail.mbg> CBand::CBand(TInt aBandType,MStateObserver& aStateObserver,MImageLoader& aImageLoader) :iStateObserver(aStateObserver),iImageLoader(aImageLoader) { iBandType=aBandType; } CBand::~CBand() { } void CBand::ConstructL() { CreateWindowL(); TRect iRect=TRect(); switch(iBandType) { case KBandHeader: iRect.iTl.iX=0; iRect.iTl.iY=0; iRect.iBr.iX=iImageLoader.GetClientScreen().iBr.iX; iRect.iBr.iY=CCoeEnv::Static()->NormalFont()->HeightInPixels(); break; case KBandFooter: iRect.iTl.iX=0; iRect.iTl.iY=iImageLoader.GetFullScreen().iBr.iY-CCoeEnv::Static()->NormalFont()->HeightInPixels(); iRect.iBr.iX=iImageLoader.GetClientScreen().iBr.iX; iRect.iBr.iY=iImageLoader.GetFullScreen().iBr.iY; break; } SetRect(iRect); ActivateL(); } void CBand::Draw(const TRect aRect)const { CWindowGc& gc=SystemGc(); gc.DrawBitmap(aRect,iImageLoader.GetImage(EMbmEmailTopper)); }
But my code does not enter the draw function of the iHeader ,iFooter and iOption .Code:void CEMailContainer::ConstructL() { iHeader=new (ELeave) CBand(CBand::KBandHeader,iStateObserver,iImageLoader); iHeader->SetMopParent(this); iHeader->ConstructL(); iFooter=new (ELeave) CBand(CBand::KBandFooter,iStateObserver,iImageLoader); iFooter->SetMopParent(this); iFooter->ConstructL(); iOption=new (ELeave) COptionScreen(iStateObserver,iImageLoader); iOption->SetMopParent(this); iOption->ConstructL(); iHeader->DrawNow(); iFooter->DrawNow(); iOption->DrawNow(); ActivateL(); } TInt CEMailContainer::CountComponentControls() const { return 3; // return nbr of controls inside this container } // --------------------------------------------------------- // CEMailContainer::ComponentControl(TInt aIndex) const // --------------------------------------------------------- // CCoeControl* CEMailContainer::ComponentControl(TInt aIndex) const { switch ( aIndex ) { case 0: return iHeader; case 1: return iFooter; case 2: return iOption; default: return NULL; } }

Reply With Quote
. Also I have seen that my debug pointer goes into relevant lines in ComponentControls of the container once in top to bottom oder and once bottom up order . Strange ?


