How to create a Toolbar with image button ?
I have just create a Toolbar by using [B]CAknToolbar[/B]. 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";
}
};
};
}
};
};
}
};
}[/CODE]
Re: How to create a Toolbar Icons ?
look at this page: [url]http://www.forum.nokia.com/infocenter/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-07DD47FD-86B7-4AFD-BEDB-DF6EA12DFC6C.html[/url]
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;
}
[/CODE]
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.
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.
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.
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.
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.