×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    10

    How to Change the font color of CEikDateEditor?

    Hi,
    how do I change the font color of CEikDateEditor? I have tried using:

    OverrideColorL(EColorControlText, TRgb(255,255,255));

    but it does not work. I have also found this function:

    SetSkinTextColorL ( TInt aAknSkinIDForTextColor,
    TInt aAknSkinIDForBgColor = KErrNotFound
    )

    but I don't know where to find values for aAknSkinIDForTextColor or
    aAknSkinIDForBgColor. Is there another way of changing the date editor's font color?

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    10

    Re: How to Change the font color of CEikDateEditor?

    Quote Originally Posted by cbpbenitez View Post
    Hi,
    how do I change the font color of CEikDateEditor? I have tried using:

    OverrideColorL(EColorControlText, TRgb(255,255,255));

    but it does not work. I have also found this function:

    SetSkinTextColorL ( TInt aAknSkinIDForTextColor,
    TInt aAknSkinIDForBgColor = KErrNotFound
    )

    but I don't know where to find values for aAknSkinIDForTextColor or
    aAknSkinIDForBgColor. Is there another way of changing the date editor's font color?
    i found out that the last function does indeed change the color of the date editor's font by setting constant integer values (0, 1, etc.), the problem is that I need to set the font color according to the active theme's text therefore the values must be dynamic. What values for aAknSkinIDForTextColor must I put?

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    10

    Re: How to Change the font color of CEikDateEditor?

    Problem Solved. Thanks cbpbenitez =)

  4. #4
    Registered User
    Join Date
    Aug 2008
    Posts
    10

    Re: How to Change the font color of CEikDateEditor?

    Your welcome, don't mention it. =)

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    69

    Re: How to Change the font color of CEikDateEditor?

    cbpbenitez,
    can you let me know how you change the text color of date editor? I met the same question. thank you.

    Landing

  6. #6
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: How to Change the font color of CEikDateEditor?

    Hi,

    Try to enable the color override by SetUseOverrideColors() and then use OverrideColorL() to override the text color

    Code:
    	iDateEditor1->SetUseOverrideColors(ETrue);
    	iDateEditor1->OverrideColorL(EColorControlText, KRgbRed);
    Code:
        /**
         * Sets the MFNE to use the CCoeControl::OverrideColorL() defined
         * color in drawing. If this is set, no skinning will be used
         * in drawing.
         *
         * @param aUseOverrideColors ETrue to make the MFNE use overridden colors.
         * @since S60 v3.2
         */
        IMPORT_C void SetUseOverrideColors( TBool aUseOverrideColors );
    Regards

    Ziteng Chen

  7. #7
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: How to Change the font color of CEikDateEditor?

    Hi,

    The SetSkinTextColorL() also works and it takes a TAknsQsnTextColorsIndex value as the first parameter.

    [/code]
    iDateEditor1->SetSkinTextColorL(EAknsCIQsnTextColorsCG74);
    [code]

    Code:
    // aknsconstants.h
    ...
    /**
    * Enumeration for values in QsnTextColors color table.
    *
    * @since 2.8
    */
    enum TAknsQsnTextColorsIndex
        {
        // text #1	status area	title text	#215
        EAknsCIQsnTextColorsCG1    = 0,
        // text #2	navi pane	navi pane texts	#0
        EAknsCIQsnTextColorsCG2    = 1,
    ...
    Regards

    Ziteng Chen

  8. #8
    Registered User
    Join Date
    Apr 2008
    Posts
    69

    Re: How to Change the font color of CEikDateEditor?

    ZiTeng,
    Thanks for the code sample on V2.8 and V3.2.
    SetSkinTextColorL()works for me.

    Landing

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    1

    Re: How to Change the font color of CEikDateEditor?

    Quote Originally Posted by chenziteng View Post
    Hi,

    Try to enable the color override by SetUseOverrideColors() and then use OverrideColorL() to override the text color

    Code:
    	iDateEditor1->SetUseOverrideColors(ETrue);
    	iDateEditor1->OverrideColorL(EColorControlText, KRgbRed);
    Code:
        /**
         * Sets the MFNE to use the CCoeControl::OverrideColorL() defined
         * color in drawing. If this is set, no skinning will be used
         * in drawing.
         *
         * @param aUseOverrideColors ETrue to make the MFNE use overridden colors.
         * @since S60 v3.2
         */
        IMPORT_C void SetUseOverrideColors( TBool aUseOverrideColors );
    Regards

    Ziteng Chen
    Unfortunately, it's invalid for S60 v3.1 and previous versions to change the background and the font color of a CEikDateEditor control.

    // Control context (background color etc). Deprecated (use MCoeControlBackground)
    IMPORT_C void SetControlContext(MCoeControlContext* aContext); // deprecated from 9.2
    IMPORT_C void CopyControlContextFrom(const CCoeControl* aControl); // deprecated from 9.2
    IMPORT_C MCoeControlContext* ControlContext() const; // deprecated from 9.2


    by Li Yiwei

    Chengdu Easygoing IT Company & Chengdu PalmEase IT Company
    Last edited by lyw; 2010-01-23 at 13:00.

  10. #10
    Registered User
    Join Date
    Dec 2008
    Posts
    16

    Re: How to Change the font color of CEikDateEditor?

    Hi,

    Would you show how to set the font color according to the active theme's text dynamically please? I met the same problem and i wants my DateEditor's text color changes according to the active theme.
    Thank you very much!

  11. #11
    Registered User
    Join Date
    Dec 2008
    Posts
    16

    Re: How to Change the font color of CEikDateEditor?

    Quote Originally Posted by beggar200 View Post
    Hi,

    Would you show how to set the font color according to the active theme's text dynamically please? I met the same problem and i wants my DateEditor's text color changes according to the active theme.
    Thank you very much!
    I got the method, just call only
    Code:
    iDateEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG6);
    if call
    Code:
    iDateEditor->SetUseOverrideColors(ETrue)
    firstly, the background of CEikDateEditor would not be set as skin.

    And EAknsCIQsnTextColorsCG6 is for main area text which defined in AknsConstants.h as following:
    Code:
    /**
    * Enumeration for values in QsnTextColors color table.
    *
    * @since 2.8
    */
    enum TAknsQsnTextColorsIndex
        {
        ...
        // text #6	main area	main area texts	#215
        EAknsCIQsnTextColorsCG6    = 5,
        ...
        };
    Last edited by beggar200; 2010-06-30 at 16:58.

Similar Threads

  1. how to change font size?
    By zeinab_b in forum Symbian
    Replies: 1
    Last Post: 2008-07-09, 14:17
  2. Replies: 0
    Last Post: 2008-01-17, 06:22
  3. Change Font in CEikRichTextEditor
    By Holler in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-08-06, 18:11
  4. [announce] full screen dot amtrix scroller
    By xchip in forum Symbian
    Replies: 7
    Last Post: 2006-06-08, 22:17
  5. Change the default font for 7650
    By edmundkkchan in forum Symbian
    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
  •  
×