problem with SetTextL() in CEikEdwin
| Tue, 2006-04-04 11:51 | |
|
Hi I am trying to use SetTextL() to set a long text to the edwin.
The text is almost three screens(pages) in length and is read only. When I run the program, the edwin displays only the last screen(page) of the text. When I scroll up and down I am able to see all the data. The following is the code that I am using. TResourceReader reader; iCoeEnv->CreateResourceReaderLC(reader, R_VIEW2_DISPLAY); iGTextEd = new (ELeave) CEikGlobalTextEditor; iGTextEd->CreatePreAllocatedScrollBarFrameL(); iGTextEd->SetContainerWindowL(*this); iGTextEd->ConstructFromResourceL(reader); iGTextEd->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); iGTextEd->ScrollBarFrame()->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead); iGTextEd->ScrollBarFrame()->DrawScrollBarsNow();Â Â Â Â CleanupStack::PopAndDestroy();Â // Resource reader iGTextEd->SetExtent(GTEXTED_POS, TSize(165,127)); this->SetFontL(); HBufC* opBuf = Convert(iHlpMsg->Des()); //this convert returns a HBufC iGTextEd->SetTextL(opBuf); iGTextEd->UpdateAllFieldsL(); iGTextEd->SetCursorPosL(0,EFalse);Â SetRect(aRect); ActivateL(); I have also used iGTextEd->SetFocus(EFalse); //the text is readonly so no need of cursor But of no use. The focus is always at the end of the text and only the last part of the text is shown with the upward scroll bar being activated. Could somebody tell me where I am going wrong / if there is any way to bring the focus back t the start of the text. Thanks |
|






Forum posts: 105
try this --
(your object)->SetCursorPosL(1,ETrue);
it is tested already.........
Cheers !!
CodePupil
Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!
Forum posts: 7
But no change. Still only the last part of the text is displayed.
Any other suggestions.....
Forum posts: 105
actually i used it with CEikRichTextEditor where it is working fine...it scrolls to given position when that position is currently not in the view..
try using CEikRichTextEditor....
Cheers !!
CodePupil
Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!
Forum posts: 7
Tried the old one, ie,
(your object)->SetCursorPosL(1,ETrue);
with different flags in the resource element. Now it is fine.
Thanks a lot...
Forum posts: 105
Cheers !!
CodePupil
Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!
Forum posts: 10
I am trying to use the text editor to display some help screens for my app. The screens are multipage, and need to be read only, just being scrollable, and not in inverse video, and start at the beginning of the text.
I have tried the (your object)->SetCursorPosL(1,ETrue); suggestion, but it seems that the flags in the GTXTED object must be the key to the solution. Which flags do I need to set in the GTXTED? I tried setting EAvkonNotEditable , but that just gave a panic.
perhaps poornap would give me a clue, he seems to have been doing a similar thing.
Thanks,
Richard