NOTES ON ADDING A MENU ITEM [was Re: Views (again)]

Jeff Hostetler (jeff@abisource.com)
Fri, 16 Jul 1999 13:22:20 -0500


At 10:28 AM 7/16/99 +0000, Aaron Lehmann wrote:
>I've been trying to implement menu items for view modes. I've followed
>everything that I can find in the source, but it still doesn't seem to
>work. So, it would be nice if someone who knows what they're doing
>could put this at the beginning of the view menu:
>
>Page Layout
>Normal
>Outline
><seperator>
>
>...

i'm not sure where you are or what you've tried so far, but
here's a quick summary of what you need to do to update the menu bar.

define the AP_MENU_ID_{...} ids in abi/src/wp/ap/xp/ap_Menu_Id.h
(this defines the symbols)

add the necessary lines in ap_Menu_Layouts_MainMenu.h
(this adds them to the menu layout)

add bindings for the ids in ap_Menu_ActionSet.cpp
(this maps an id to an EditMethods, a state callback, status
bar text, and contains some property bits to describe how
the item should be drawn)

create the necessary EV_GetMenuItemState_Fn's in ap_Menu_Functions.{h,cpp}
(these functions are used to dynamically compute the decoration/state of
the menu item (for example on win32, in response to the WM_INITMENU msg))

create the necessary EditMethods in ap_EditMethods.cpp
(these are called (by name) in response to the actual menu item selection)

i know that this sounds complicated, but the result will automagically
work on all 3 platforms.... :-)

hope this helps
jeff

ps. perhaps we should add this text to the FAQ...



This archive was generated by hypermail 1.03b2.