Dynamic Menus


Subject: Dynamic Menus
From: Jared Davis (jared@kinowin.zeddiclan.com)
Date: Wed Sep 12 2001 - 11:03:07 CDT


Joaquin--

Thanks a lot for the dynamic menu stuff. I'm still a little hazy on some
of the implementation details...

First off, the XAP_Menu_Id that is needed to tie all the menus
together... how do I get one of these? Someone suggested using
AP_MENU_ID__BOGUS2__ + N (where N > 1) but I see that this is
probably not a good long term solution.

I have gone ahead and created new objects for the label, layout
item, and action classes. I'm not sure if what I've done is right, and
still have a few questions:

EV_Menu_Label* ThesaurusLabel = new EV_Menu_Label(
        ThesaurusID,
        "/&Tools/Thesaurus",
        "Open the thesaurus and search for synonyms"
);

EV_Menu_LayoutItem* ThesaurusLayoutItem = new EV_Menu_LayoutItem(
        ThesaurusID,
        EV_MLF_Normal
);

EV_Menu_Action* ThesaurusAction = new EV_Menu_Action(
        ThesaurusID,
        0, // no, it doesn't have a sub menu
        1, // yes, it raises a dialog
        0, // no, it's not a checkbox item
        "???", // what goes here?
        NULL,
        NULL
);

But once I create these objects, I'm not quite sure how to add them
to the menu. In other words, how do I get a pointer to the
EV_Menu_Layout*, EV_Menu_ActionSet*, and EV_Menu_LabelSet*
that I need in order to call the addLayout(), adAction(), and addLabel()
functions, respectively?

The XAP_App::getApp() function seems like the right place to start,
but the further I go into the code it seems like the menus are private
or protected members of the implementation classes and I don't see
how to get to them.

The only other question I have at present is how do I determine
when the menu item has been clicked by the user? Can I set up a
callback function of some sort?

Thanks a lot for your help,

        Jared



This archive was generated by hypermail 2b25 : Wed Sep 12 2001 - 11:03:17 CDT