problem with SetTextL() in CEikEdwin

Login to reply to this topic.
Tue, 2006-04-04 11:51
Joined: 2006-01-16
Forum posts: 7
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

Tue, 2006-04-04 12:06
Joined: 2006-01-09
Forum posts: 105
Re: problem with SetTextL() in CEikEdwin
Hi,

try this --

(your object)->SetCursorPosL(1,ETrue);

it is tested already.........


Cheers !!
CodePupil

Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!

Tue, 2006-04-04 12:19
Joined: 2006-01-16
Forum posts: 7
Re: problem with SetTextL() in CEikEdwin
Tried that....
But no change. Still only the last part of the text is displayed.
Any other suggestions.....
Tue, 2006-04-04 12:34
Joined: 2006-01-09
Forum posts: 105
Re: problem with SetTextL() in CEikEdwin
Hi,

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 .. !!

Tue, 2006-04-04 13:55
Joined: 2006-01-16
Forum posts: 7
Re: problem with SetTextL() in CEikEdwin
HI,

Tried the old one, ie,

(your object)->SetCursorPosL(1,ETrue);

with different flags in the resource element. Now it is fine.

Thanks a lot...
Tue, 2006-04-04 15:04
Joined: 2006-01-09
Forum posts: 105
Re: problem with SetTextL() in CEikEdwin
Welcome...........my chum     !!!



Cheers !!
CodePupil

Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!

Wed, 2007-04-18 17:03
Joined: 2007-04-18
Forum posts: 10
Re: problem with SetTextL() in CEikEdwin
Hi there,

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
  • Login to reply to this topic.