Ejemplo n.º 1
0
EXPORT_C void CEikFloatingPointEditor::SetValueL(const TReal* aValue)
	{
    if (!aValue)
        {
		SetTextL(NULL);
        return;
        }

	iValue=*aValue;
	// !! Now check for validity?
	TBuf<EAknMaxIntegerDigits> des;
	TRealFormat format(iTextLimit);
	format.iType|=KAllowThreeDigitExp;
	des.Num(iValue,format);

	AknTextUtils::ConvertDigitsTo(des, AknTextUtils::NumericEditorDigitType());

	SetTextL(&des);
	if ( !(iEdwinUserFlags&ENoAutoSelection) )
		{
        SetCursorPosL(des.Length(), ETrue);
        }
	else
		{
		SetCursorPosL(des.Length(), EFalse);
		}
    DrawNow();
	}
// ---------------------------------------------------------
// CMsgBodyControlEditor::DoHandleParsingCompleteL
// ---------------------------------------------------------
//
void CMsgBodyControlEditor::DoHandleParsingCompleteL()
    {
    iTextParsed = ETrue;
    // this needs to be changed so that bottom init can also be set
    if ( iFocusChangedBeforeParseFinish )
        {
        iFocusChangedBeforeParseFinish = EFalse; // just to make sure this is done only once
        if ( iInitTop )
            {
            SetHighlightL( 0, EMsgFocusDown, ETrue ); 
            }
        else
            {
            SetHighlightL( TextLength(), EMsgFocusUp, ETrue ); 
            }
        
        if ( iBaseControlObserver )
            {
            iBaseControlObserver->HandleBaseControlEventRequestL( NULL, 
                                                                  EMsgUpdateScrollbar );
            }
        }
    else
        {
        // In some cases the text view is left to some
        // strange state. Make sure the view is in sync
        // with cursor position.
        SetCursorPosL( CursorPos(), EFalse );
        }
    }
// ---------------------------------------------------------
// CMsgBodyControlEditor::InsertTextL
//
// Inserts text to the editor.
// ---------------------------------------------------------
//
void CMsgBodyControlEditor::InsertTextL( const TDesC& aText )
    {
    if ( iTextView )
        {
        TCursorSelection selection = iTextView->Selection();
        const TInt selLength = selection.Length();
        const TInt lower = selection.LowerPos();

        if ( selLength )
            {
            // 107-24185 : Emoticon support for SMS and MMS, symbian call
            InsertDeleteCharsL( lower, aText, selection );
            }
        else
            {
            InsertDeleteCharsL( selection.iCursorPos, aText, selection );
            }

        SetCursorPosL( lower + aText.Length(), EFalse );

        NotifyNewFormatL();
        }
    else
        {
        iText->InsertL( 0, aText );
        }
    }