Subject: Re: Dynamic Menus
From: Joaquin Cuenca Abela (email@example.com)
Date: Sat Sep 15 2001 - 10:27:44 CDT
> On Sat, 15 Sep 2001, Joaquin Cuenca Abela wrote:
> > Martin wrote:
> > >
> > > Actually it is possible:
> > >
> > > XAP_App * pApp = XAP_App::getApp();
> > > XAP_Frame * pFrame = pApp->getLastFocussedFrame();
> > > XAP_UnixFrame * pUFrame = static_cast<XAP_UnixFrame *>(pFrame);
> > If my memory still serves me right, it's not possible.
> > This downcast has several disavantages, and still it doesn't achieves
> > goal (to be able to change the EV_Menu_Layout)
> > * This code will only work on unix specific code, when really it should
> > perfectly xp.
> > * If I remember right, there is no accesor to the layout & labels *even*
> > a UnixFrame (I will check that later)
> > * Even with one accesor in UnixFrame, this way we will only change the
> > of the last focussed frame, and that's hardly desired behaviour (I guess
> > that we want to change the menu of *all* the frames).
> Not a problem!
Nice, but that only solves third problem.
> Simply use the pApp pointer to get all the xp info you want. ie from the
> XAP_App.h file there are...
> UT_Bool updateClones(XAP_Frame * pFrame);
> UT_uint32 getFrameCount(void) const;
> XAP_Frame * getFrame(UT_uint32 ndx) const;
> UT_sint32 findFrame(XAP_Frame * pFrame);
> UT_sint32 findFrame(const char * szFilename);
> EV_EditMethodContainer * getEditMethodContainer(void) const;
> EV_EditBindingMap * getBindingMap(const char * szName);
> const EV_Menu_ActionSet * getMenuActionSet(void) const;
> const EV_Toolbar_ActionSet * getToolbarActionSet(void) const;
> Want to update all the frames? Just loop through them :-)
but we still need to expand a bit the XAP_Frame API to give access to the
internal EV_Menu_LabelSet & EV_Menu_Layout (right now, there are no such
internal variables, we should also add them and make derived classes use
these base members instead of their platform specific variants).
Ie, with the app (that we can get easily), we can get:
1) Set of actions
2) Set of frames
And for each frame, we should get:
3) Set of labels
Actually we can not get 3 & 4.
-- Joaquin Cuenca Abela firstname.lastname@example.org
This archive was generated by hypermail 2b25 : Sat Sep 15 2001 - 10:27:09 CDT