×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    5

    How change font color in CAknIntegerEdwin?

    How change font color in CAknIntegerEdwin?

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: How change font color in CAknIntegerEdwin?

    To set the colour of the text inside edwin, the following things required:
    first of all you have to set these things..

    TCharFormatMask charFormatMask;
    _LIT(KFontArial,"Arial");//its depend on ur choice.
    TFontSpec MyeFontSpec (KFontArial, aHeight);//aHeight will contain ur desired value..
    MyeFontSpec.iTypeface.SetIsProportional(ETrue);
    TCharFormat charFormat(MyeFontSpec.iTypeface.iName, MyeFontSpec.iHeight);
    charFormat.iFontPresentation.iTextColor=KRgbRed;//u can change this according to u
    charFormatMask.SetAttrib(EAttColor );

    after this you have to Create a character format layer based on the default format layer.
    then u will get, Format variable then contain the default formatting settings.like this..

    CCharFormatLayer* iCharform=CEikonEnv::NewDefaultCharFormatLayerL();
    iCharform->Sense( charFormat, charFormatMask );
    Set the Formatlayer's EAttColor format attribute to a value specified in charFormat.
    iCharform->SetL( charFormat, charFormatMask );
    now just Get a pointer to the Edwin control and apply the changes:
    Apply the changes to the CEikEdwin control
    urcontrol->SetCharFormatLayer(iCharform);
    NOTE:
    SetCharFormatLayer() is added as an Avkon related modification of the CEikEdwin control.The method copy all the format attributes of the new layer, apply to the already existing format layer, then delete the one passed in..
    hope it ll help u..

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    5

    Re: How change font color in CAknIntegerEdwin?

    It's work! :)
    Nitesh Bhardwaj - great thx!

Similar Threads

  1. Replies: 0
    Last Post: 2008-01-17, 06:22
  2. Change Font in CEikRichTextEditor
    By Holler in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-08-06, 18:11
  3. Replies: 7
    Last Post: 2006-06-08, 22:17
  4. How to change normal font (Environment Font) in series 80
    By jkatajai in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-01-14, 11:55
  5. Change the default font for 7650
    By edmundkkchan in forum Symbian C++
    Replies: 1
    Last Post: 2002-09-24, 07:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •