Mike,

> MenuCmdBarAddButton(menuCmdBarOnLeft, /* BarInfoBitmap */,
>                     menuCmdBarResultNotify, whatGoesHere,
>                     "Action");
> 
> However, there are two things that I don't know how to do:
> 1) How to get my bitmap/icon in place of the info bitmap/icon.  By the
> way,
> what is the size supposed to be?

"The bitmap's dimensions should be 13 pixels high by 16 pixels wide."

How-to : see a previous post I did a couple of days ago. Basically, you want to 
have the bitmap loaded and available when the Command Bar is actually displayed 
(which is after you processed the notification, therefore after your code has 
been unloaded...).

Someone suggested you open your resource database and let it open. However, I 
don't think it's clean, since :
1) you keep a database open, which is not a best practice in my opinion.
2) (more important) the resource IDs in your database can conflict with those 
of the current application.

> 2) When the bitmap/icon is pressed, how do I do my action?  I'm guessing
> that I need to send a notification back to myself using the
> menuCmdBarResultNotify option.  However, will I be the only one getting 
> that notification?  Can the whatGoesHere be a custom notification that 
> only I care about?

Yes, whatGoesHere is your notification code. Typically, use your Creator ID or 
a Creator ID you register for that use. This way, no one else should receive 
the notification.


BTW, I have an additional question to the topic. Is it possible to access the 
content (especially the active field) of the current form, when I get the 
sysNotifyMenuCmdBarOpenEvent ? I didn't manage to do so. What I tried :

(we are processing sysNotifyMenuCmdBarOpenEvent)
FormPtr frm = FrmGetActiveForm();  // this returns a non-null FormPtr
FieldPtr fld = FrmGetActiveField(frm); // this fails...

Any idea ?

-- Denis Faivre - [EMAIL PROTECTED]
-- Ablivio - http://www.ablivio.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to