×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    2

    Question How to create a Toolbar with image button ?

    I have just create a Toolbar by using CAknToolbar. The Toolbar Items is button, now I want to change the button to Images. How can I do it?
    this is my code:
    Code:
    RESOURCE AVKON_TOOLBAR r_test_toolbar
    	{
    		flags = KAknToolbarFixed;
    		items =
    		{
    				TBAR_CTRL
    					{
    						type = EAknCtButton;
    						id = ECommand2; // We are using same set of commands as of used in AppUi:HandleCommandL
    						control = AVKON_BUTTON
    						{
    							flags = KAknButtonTextInsideFrame;
    							states =
    							{
    									AVKON_BUTTON_STATE
    										{
    											txt = "button3";
    											helptxt = "help text3";
    										}
    							};
    						};
    					},
    				TBAR_CTRL
    					{
    						type = EAknCtButton;
    						id = ECommand2;
    						control = AVKON_BUTTON
    						{
    							flags = KAknButtonTextInsideFrame;
    							states =
    							{
    									AVKON_BUTTON_STATE
    										{
    											txt = "button2";
    											helptxt = "help text2";
    										}/*,
    									AVKON_BUTTON_STATE
    										{
    											txt = "button2";
    											helptxt = "help text2";
    											flags = KAknButtonStateHasLatchedFrame;
    										}*/
    									
    							};
    						};
    					},
    					TBAR_CTRL
    						{
    							type = EAknCtToolbarExtension;
    							control = AVKON_TOOLBAR_EXTENSION
    							{
    								flags = KAknTbExtensionTransparent;
    								items =
    								{
    									TBAR_CTRL
    										{
    											type = EAknCtButton;
    											id = ECommand2;
    											control = AVKON_BUTTON
    											{
    												flags = KAknButtonTextInsideFrame;
    												states =
    												{
    													AVKON_BUTTON_STATE
    														{
    															txt = "b2";
    															helptxt = "help text2";
    														}
    												};
    											};
    										},
    										TBAR_CTRL
    										{
    											type = EAknCtButton;
    											id = ECommand2;
    											control = AVKON_BUTTON
    											{
    												flags = KAknButtonTextInsideFrame;
    												states =
    												{
    													AVKON_BUTTON_STATE
    														{
    															txt = "b5";
    															helptxt = "help text2";
    														}
    												};
    											};
    										},
    										TBAR_CTRL
    										{
    											type = EAknCtButton;
    											id = ECommand2;
    											control = AVKON_BUTTON
    											{
    												flags = KAknButtonTextInsideFrame;
    												states =
    												{
    													AVKON_BUTTON_STATE
    														{
    															txt = "b2";
    															helptxt = "help text2";
    														}
    												};
    											};
    										},
    										TBAR_CTRL
    										{
    											type = EAknCtButton;
    											id = ECommand2;
    											control = AVKON_BUTTON
    											{
    												flags = KAknButtonTextInsideFrame;
    												states =
    												{
    													AVKON_BUTTON_STATE
    														{
    															txt = "b2";
    															helptxt = "help text2";
    														}
    												};
    											};
    										}										
    								};
    							};
    						}
    		};
    	}
    Last edited by trung.vo; 2009-07-09 at 10:33.

  2. #2
    Registered User
    Join Date
    May 2008
    Posts
    5

    Re: How to create a Toolbar Icons ?

    look at this page: http://www.forum.nokia.com/infocente...EA12DFC6C.html

    there is such code:

    Code:
    AVKON_BUTTON_STATE 
                { 
                bmpfile = AVKON_BITMAP_FILE; 
                bmpid = EMbmAvkonQgn_indi_volume_arrow_down; 
                bmpmask = EMbmAvkonQgn_indi_volume_arrow_down_mask; 
                press_bmpid = EMbmAvkonQgn_indi_volume_arrow_down; 
                press_bmpmask = EMbmAvkonQgn_indi_volume_arrow_down_mask; 
                helptxt = "Volume down"; 
                // Skinning support for state icon 
                extension = r_myapp_command_button_extension; 
                }

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: How to create a Toolbar Icons ?

    Do you know which size must have the icon in a toolbar ? could they be in .bmp format ?

    Thanks,
    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  4. #4
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: How to create a Toolbar Icons ?

    No answer to my last post ? I'm fighing with this since a long time without success !

    Thanks !
    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  5. #5
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: How to create a Toolbar Icons ?

    I see no reason for them not to be in MBM format, although I see no reason for them to be so either :)
    As for the size of the thing, while it is likely defined somewhere in the layout info, it is more likely that it easier for you to find the right size by measuring a screenshot that it is for me to dig out the answer :) And then you will have the nasty surprize that the next device likes the icons to be one pixel smaller/bigger.

    My advice: use SVG.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  6. #6
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: How to create a Toolbar Icons ?

    yeah, I have tried the .svg too but some colors are not displayed ! (especially some green & yellow) ... very strange !
    and if I use the .mbm, the mask is not rended.

    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  7. #7
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: How to create a Toolbar Icons ?

    Hi,

    have found the solution this night, no need to use .svg !! bmp inside .mbm can be used too, for info, I use 24x24 bmp icons.

    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

Similar Threads

  1. ToolBar Problem
    By mallikachand in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-09-27, 20:02
  2. How to create Application Icons?
    By kssoumya in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-08-25, 07:16
  3. Replies: 1
    Last Post: 2008-03-12, 15:16
  4. I can't create 3rd Party Icons
    By rulirahm in forum Themes/Carbide.ui
    Replies: 6
    Last Post: 2007-01-24, 09:00
  5. how to create a grid
    By ddhungry in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-11-27, 08:08

Posting Permissions

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