Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User ovtchinnikov's Avatar
    Join Date
    Mar 2003
    Posts
    4
    In the CreateSettingItemL of my setting list i'm trying to set the time format for my setting item:
    CAknTimeOrDateSettingItem* i = new (ELeave) CAknTimeOrDateSettingItem ( aIdentifier, CAknTimeOrDateSettingItem::ETime, time);
    _LIT(KFormatTimeString,"%-B%:0%J%:1%T%:3%+B");
    i->SetTimeFormatStringL(KFormatTimeString);

    For some reason this just does not seem to work.

    Is it a known bug or should I do something differently?

  2. #2
    Registered User Anssi Nurminen's Avatar
    Join Date
    Jan 2006
    Posts
    15
    I think the best way to accomplish what you're trying to do is to derive your own class from CAknTimeOrDateSettingItem and reimplement the CompleteConstructionL() method from the base class something like this:

    Code:
    class CMyTimeSettingItem : public CAknTimeOrDateSettingItem
    {
    	protected:
    		void CompleteConstructionL();	
    };
    
    void CMyTimeSettingItem::CompleteConstructionL()
    {	
    	CAknTimeOrDateSettingItem::CompleteConstructionL();
    	//See TTime for string format
    	SetTimeFormatStringL( _L("%H:%T:%S") );	
    }

  3. #3
    Registered User samantha_sun's Avatar
    Join Date
    Jul 2009
    Posts
    1
    Quote Originally Posted by Anssi Nurminen View Post
    I think the best way to accomplish what you're trying to do is to derive your own class from CAknTimeOrDateSettingItem and reimplement the CompleteConstructionL() method from the base class something like this:

    Code:
    class CMyTimeSettingItem : public CAknTimeOrDateSettingItem
    {
    	protected:
    		void CompleteConstructionL();	
    };
    
    void CMyTimeSettingItem::CompleteConstructionL()
    {	
    	CAknTimeOrDateSettingItem::CompleteConstructionL();
    	//See TTime for string format
    	SetTimeFormatStringL( _L("%H:%T:%S") );	
    }
    i have test what you said.
    you are very correct!!
    but its format is +HH:MM:SS
    which "+" hasn't been removed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved