|
|
User login
Feeds |
selection problem with CEikRichTextEditor
|
|||||
| Tue, 2005-03-22 13:07 | |
|
I've got a selection problem with CEikRichTextEditor. It seems the first time this container control is created and foregrounded, the entire CEikRichTextEditor is selected. Nothing I do programmatically (e.g. ClearSelectionL) seems to clear the selection. The selection goes away as soon as I move the cursor by hand, or if I background and the foreground the container. Code: MyContainer::ConstructL() { CreateWindowL(); // Create CEikRichTextEditor iBody = new (ELeave) CMultipleControlEdwin; iBody->ConstructL(this,0,0,0); SetRect(aRect); iBody->SetFocus(ETrue); iBody->SetWordWrapL(ETrue); iBody->SetReadOnly(ETrue); ActivateL(); } Then, at some point later when text becomes available for the object, but in practice immediately after ConstructL above: Code: MyContainer::SetText() { const TDesC8 & body = GetTextL(); HBufC * bodyBuf = HBufC::NewLC(body.Size()); TPtr bodyPtr = bodyBuf->Des(); bodyPtr.Copy(body); // Be sure to set cursor and clear selection before // setting text with new values or you'll get an ETEXT 12 panic. iBody->SetCursorPosL(0,EFalse); iBody->ClearSelectionL(); iBody->SetTextL(&(*bodyBuf)); iBody->ClearSelectionL(); DrawNow(); CleanupStack::PopAndDestroy(bodyBuf); } Michael Maguire |
|
Forum posts: 8
RESOURCE DIALOG r_help_dialog
{
flags = EEikDialogFlagFillScreen | EEikDialogFlagWait | EEikDialogFlagNoDrag;
title = STRING_r_help_title;
buttons = R_EIK_BUTTONS_OK;
items =
{
DLG_LINE
{
id = EHelpDialogEdwin0;
type = EEikCtEdwin;
control = EDWIN
{
flags = EEikEdwinNoAutoSelection | EEikEdwinReadOnly; // <-- add this
};
}
};
Attempting to do the equivalent via:
editor->SetCursorPosL(0, EFalse);
editor->SetSelectionL(0, 0);
editor->SetNonFocusing();
editor->SetReadOnly(ETrue);
etc. had no effect in the code.