Re: Dynamic Menus


Subject: Re: Dynamic Menus
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Sat Sep 15 2001 - 07:24:31 CDT


On Fri, 14 Sep 2001, Joaquin Cuenca Abela wrote:

> Mike wrote:
> > Joaquin Cuenca Abela wrote:
> > [Menus an their methods/actions...]
> > >
> > > A Frame carries information about the layout and about the labelset, but
> > not
> > > about the actions (who are carried in the App object).
> >
> > This is something that struck me as ... perhaps not optimal? Even if the
> App
> > owns the Frame, it's surely the Frame that is to know about its gfx
> elements
> > (including menu), no?
>
> Yes, that is why the Frame carries the information about the gfx elements
> (layout & labels).
> The set of callable actions is specific to the App.
>
> > In (my) perfect world the frame should be able to tell
> > its menu it wants to add a new menu item (possibly relative an exisiting
> > menu- or sub-menu item) that should perform "this action", where "this
> > action" could be either a "named" (scriptable) callback, or just a plain
> > C/C++ callback (I think it would be wrong to limit ourselves to just
> > scriptable items for menus).
>
> Right now we can only callback a C like function. *All* the functions that
> we can call back are in AP_EditMethods.cpp, indexed by his name.
> I would like to ear suggestions to extend the current "actions" to make it
> possible to have "named" callbacks, as this is mostly the only missing piece
> in the puzzle to get dynamic menu items call back perl functions.
>
> Ideas?
>

Sorry Joaquin, I don't quite understand you. Jeff explicitly allowed for new
methods to be added to the EV_EditMethodContainer using:

UT_Bool EV_EditMethodContainer::addEditMethod(EV_EditMethod * pem)
{
        UT_ASSERT(pem);

        int error = m_vecDynamicEditMethods.addItem(pem);
        return (error == 0);
}

These can be created on the fly within AbiWord. Why not use this?

Cheers,

Martin



This archive was generated by hypermail 2b25 : Sat Sep 15 2001 - 07:24:48 CDT