Cannot see the cursor

Login to reply to this topic.
Thu, 2008-05-29 11:35
Joined: 2008-04-14
Forum posts: 13

I tried to set cursor and it's not working. the code is as follows:

//constructor
tenChars = new (ELeave) CEikRichTextEditor();
CleanupStack::PushL(textControl);
tenChars->SetContainerWindowL(*this);
tenChars->ConstructL(this,20,10,EEikEdwinReadOnly,EGulFontControlAll,EGulNoSymbolFonts);
tenChars->CreateScrollBarFrameL();
tenChars->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
tenChars->SetObserver(this);
tenChars->SetExtent(TPoint(5,205),TSize(170,25));
tenChars->SetFocus(ETrue);
tenChars->ApplyCharFormatL(iCharFormat,iCharFormatMask);
tenChars->ClearSelectionL();
CleanupStack::Pop();
tenChars->NotifyNewDocumentL(); // Formats and draws a new document, updates scrollbars if necessary
tenChars->UpdateAllFieldsL(); // Updates all the fields in the document

//display function
tenChars->SetTextL(&displayTenString);
tenChars->SetCursorPosL(0,EFalse);
tenChars->NotifyNewDocumentL();
tenChars->UpdateAllFieldsL();

The text in the displayTenString can be shown on the screen, but the cursor is not

Anybody knows how to solve the problem?


Thu, 2008-05-29 12:26
Joined: 2005-11-20
Forum posts: 1210
Re: Cannot see the cursor

Did you make sure that the control has focus? Because the cursor will only show if the control has focus, and I think if you do not use stand-in controls i.e. have the EQikCtrlFlagIsEditInPlace flag set.


René Brunner

Thu, 2008-05-29 12:47
Joined: 2008-04-14
Forum posts: 13
Re: Cannot see the cursor

Thanks for the reply. However, it seems there is no such EQikCtrlFlagIsEditInPlace in the SDK(UIQ2.1) I use, anymore idea?

Thu, 2008-05-29 13:02
Joined: 2005-11-20
Forum posts: 1210
Re: Cannot see the cursor

Ok, that flag is UIQ3 stuff.

No, on UIQ2 it should be enough to properly give the control the focus to make the cursor visible. Did you do that?


René Brunner

Thu, 2008-05-29 13:25
Joined: 2008-04-14
Forum posts: 13
Re: Cannot see the cursor

Well, there should be. However, I am not familiar with the SDK. By checking the code found on Internet, they do not have any control being called.

Thu, 2008-05-29 13:47
Joined: 2005-11-20
Forum posts: 1210
Re: Cannot see the cursor

they do not have any control being called.

I don't understand what you mean with this.

Anyway, maybe your problem only looks like one but isn't. I except SetCursorPosL() to work, and even if you do not *see* the cursor right after that, everything will be ok, because if the user activates the control, the cursor will be there where you want it to be, i.e. at the start of the text, and all is well.


René Brunner

Thu, 2008-05-29 13:51
Joined: 2008-04-14
Forum posts: 13
Re: Cannot see the cursor

Well, I guess you are right. By calling CursorPos( ), it does return me the position of the cursor, just the cursor itself is not drawn on the screen.

  • Login to reply to this topic.