I have a problem with Nokia 5800 (but not the 5th edition emulator) when when I try to drag the scroll bars in CEikEdwin control the phone crashes.
I have a resource for creating editor control which is defined as follows:
The edwin control is part of the compound control and is created as follows:Code:RESOURCE EDWIN R_LOCATION_EDITOR { width = 512; lines = 2; maxlength = KMaxMessageLength; flags = EEikEdwinWidthInPixels | EEikEdwinNoHorizScrolling | EEikEdwinNoAutoSelection | EEikEdwinInclusiveSizeFixed | EEikEdwinReadOnly; default_case = EAknEditorTextCase; allowed_input_modes = EAknEditorAllInputModes; default_input_mode = EAknEditorTextInputMode; avkon_flags = EAknEditorFlagForceTransparentFepModes | EAknEditorFlagEnableScrollBars; special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG; }
Then when the size of the compound control is set I set the size of the editor as follows:Code://Create edit control for location information const CFont* cntFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont); CEikEdwin* iEdwin = new (ELeave) CEikEdwin(); CleanupStack::PushL(iEdwin); iEdwin->SetContainerWindowL(*this); TResourceReader reader; CEikonEnv::Static()->CreateResourceReaderLC(reader, R_LOCATION_EDITOR); iEdwin->ConstructFromResourceL(reader); //Cleanup resource reader pushed by CreateResourceReaderLC CleanupStack::PopAndDestroy(); ipLocationEdt = iEdwin; CleanupStack::Pop(iEdwin); ipLocationEdt->SetFocus(EFalse); ipLocationEdt->SetReadOnly(ETrue); ipLocationEdt->SetObserver(this); ipLocationEdt->SetMopParent(this); ipLocationEdt->SetBorder(TGulBorder::ESingleBlack); ipLocationEdt->SetAlignment(EAknEditorAlignCenter); Components().AppendLC(ipLocationEdt); CleanupStack::Pop(ipLocationEdt); //Fill in the status bar with location information; //Get contact location information //Get the location string HBufC* pTxt = <some text> CleanupStack::PushL(pTxt); ipLocationEdt->SetTextL(pTxt); CleanupStack::PopAndDestroy(pTxt); //Create sroll bars CEikScrollBarFrame* pFrame = ipLocationEdt->CreatePreAllocatedScrollBarFrameL(); //Taken from 5th edtion documenation if( AknLayoutUtils::DefaultScrollBarType( iAvkonAppUi ) == CEikScrollBarFrame::EDoubleSpan ) { // window-owning scrollbar, non-remote, vertical, non-horizontal pFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse, ETrue, EFalse ); pFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EDoubleSpan ); }else { pFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EArrowHead ); } pFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
Now – all this works fine (without crashing) in the emulator. When I stick in on the phone and try to drag the scroll bar then the phone crashes. I tried running the phone with TRK and this is the error I am getting:Code:EXPORT_C void CLocationCtrlBase::SizeChanged(void) { if(!iSize.iHeight || !iSize.iWidth || !ipLocationEdt) return; //Set the height of the edwin control TSize locationSz = ipLocationEdt->Size(); if(locationSz.iHeight > iSize.iHeight) return; TRect locationRc = Rect(); locationRc.SetHeight(locationSz.iHeight); locationRc.Move(0,iSize.iHeight - locationSz.iHeight); CEikScrollBarFrame* pFrame = ipLocationEdt->ScrollBarFrame(); if(pFrame) { TInt scrlWidth = pFrame->ScrollBarBreadth(CEikScrollBar::EVertical); if(!scrlWidth) scrlWidth = CEikScrollBar::DefaultScrollBarBreadth(); locationRc.SetWidth(iSize.iWidth - scrlWidth ); } ipLocationEdt->SetRect(locationRc); //Set the height of the map control TRect mapRc=Rect(); mapRc.SetHeight(iSize.iHeight - locationRc.Height()); ipGMap->SetRect(mapRc); }
Thread [Thread id: 495] (Suspended: Signal 'Exception 100' received. Description: Thread 0x1ef has panicked. Category: Form; Reason: 300.)
Does anyone have any idea what I am missing? Thanks.



