Hi
I use an sdk example and try to create a simple view with a white background and two text fields.
the text fields work fine , also the menu , but the white background doesnt cover the lower part of the view (I can see part of the the application menu in the view ...).
Please take a look at the relevant code I put here and tell me what I should change
Thanks a lot , TE
Code:class CMyAppTextView : public CAknView class CMyAppTextContainer : public CCoeControl, MCoeControlObserver // *** Container *** void CMyAppTextContainer::ConstructL(const TRect& aRect, CMyAppTextView* aView) { CreateWindowL(); iView = aView; TResourceReader reader; iUpperText = new(ELeave) CEikLabel; // defined as CEikLabel* in header file iUpperText->SetContainerWindowL(*this); _LIT(TEXT1,"Check upper"); iUpperText->SetTextL(TEXT1); iLowerText = new(ELeave) CEikLabel; // defined as CEikLabel* in header file iLowerText->SetContainerWindowL(*this); _LIT(TEXT2,"Check lower"); iLowerText->SetTextL(TEXT2); SetRect(aRect); ActivateL(); } void CMyAppTextContainer::SizeChanged() { TRect rect = Rect(); TSize size; size.iWidth = rect.iBr.iX + rect.iTl.iX; size.iHeight = (rect.iBr.iY + rect.iTl.iY) / 2; iUpperText->SetExtent(rect.iTl, size); size.iHeight+=1; iLowerText->SetExtent(TPoint(rect.iTl.iX, (rect.iBr.iY/2)+1), size); } void CMyAppTextContainer::Draw( const TRect& aRect ) const { CWindowGc& gc = SystemGc(); gc.SetPenStyle( CGraphicsContext::ENullPen ); gc.SetBrushColor(TRgb(0xffffff)); //White gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); gc.DrawRect( aRect ); } // *** View *** void CMyAppTextView::ConstructL() { BaseConstructL(R_MYAPPTEXT_MENU); } void CMyAppTextView::DoActivateL(const TVwsViewId& ,TUid ,const TDesC8&) { iContainer = new(ELeave) CMyAppTextContainer; iContainer->SetMopParent(this); iContainer->ConstructL(ClientRect(), this); SetTitlePaneL(); AppUi()->AddToStackL(*this, iContainer); } // *** RSS *** RESOURCE AVKON_VIEW r_myapptext_menu { menubar = r_myapptext_menubar; cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; }

Reply With Quote

