Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User juannoguera's Avatar
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380
    How can I change dynamically the text/label/Tag of a CAknButton?

    I load the button from a resource:

    Code:
    RESOURCE AVKON_BUTTON r_button
    	{
    	states =
    		{
    		AVKON_BUTTON_STATE
    			{
    			txt = STR_13;
    			helptxt = STR_14;
    			dim_bmpmask = -1;
    			press_bmpmask = -1;
    			hover_bmpmask = -1;
    			bmpmask = -1;
    			}
    		};
    	}
    Initial text is STR_13, but I need to change it programmatically.
    ----------------------------------------------
    Every journey starts with a small step.

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,712
    you could check the SDK docs for the API: http://www.forum.nokia.com/infocente...AknButton.html

    Basically just check what public functions the class has, and use them.

    Wiki also has something on it: http://wiki.forum.nokia.com/index.ph...-_S60_Touch_UI

  3. #3
    Registered User juannoguera's Avatar
    Join Date
    Dec 2005
    Location
    Albacete, Spain
    Posts
    380
    Did check the library and wiki before asking, but did not see how to change the text of a button.
    Technically, I want to change the text associated to the state of a button.
    I don't want to add a new state or have different text for different states.
    ----------------------------------------------
    Every journey starts with a small step.

  4. #4
    Super Contributor shafali gupta's Avatar
    Join Date
    Nov 2004
    Posts
    1,009
    Quote Originally Posted by juannoguera View Post
    Did check the library and wiki before asking, but did not see how to change the text of a button.
    Technically, I want to change the text associated to the state of a button.
    I don't want to add a new state or have different text for different states.
    did you tried this

    IMPORT_C void CAknButtonState::SetTextL ( const TDesC & aText )

    Sets the text inside the button.
    Regards,
    Shafali

Similar Threads

  1. Change Selected text hbackground color
    By rakesh.jaiswal in forum General Development Questions
    Replies: 2
    Last Post: 2009-05-26, 13:51
  2. Change Carbide-Generated Navi Pane Text at runtime
    By tamhanna in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-02-22, 01:25
  3. How to change the text of title in messaging application?
    By shafali gupta in forum Symbian C++
    Replies: 0
    Last Post: 2008-09-18, 08:30
  4. Replies: 1
    Last Post: 2008-07-25, 14:41
  5. How to change Grid Selected Text Item?
    By ardc_21 in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-06-29, 09:15

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