Re: Dynamic Menus


Subject: Re: Dynamic Menus
From: Joaquin Cuenca Abela (cuenca@pacaterie.u-psud.fr)
Date: Thu Sep 13 2001 - 15:34:50 CDT


Jared wrote:
> Hrmn. I'm still pretty confused. Let me see if I can get some more
info...
>
> > The way to get a unused XAP_Menu_Id is to
> > ask EV_Menu_LayoutSet for a new one.
> >
> > Let's assume that you know:
> >
> > * The label that this item will carry (for instance: "Thesaurus") <- I
> > will call it "stLabel"
> > * A position to put your item <- I will call it "nPos"
> > * A function to callback (to simplify, let's assume that we only need
a
> > string with the name of the method to call back). <- I will call it
> > "stCallback"
> > You start creating a new menu item doing:
> >
> > XAP_Menu_Id id = m_pLayout->addLayoutItem(nPos, EV_MLF_Normal);
>
> Ok, right here I need a time out. What is m_pLayout? How do I get to it?

Fair enough.

The m_pLayout name is a fictive one. I was only trying to explain how to
add a menu item *when* you have a pointer to the right EV_Menu_Layout, etc.

To your question about how can you get a
EV_Menu_{Layout,ActionSet,LabelSet}, I replied saying that right now it's
*not* possible (if you're outside XAP_UnixFrame)

If you want to make it possible (and you want, belive me :) you should add
accessors to XAP_Frame (you can name it getMainMenuLayout(), or whatever).
If you're confused or you don't know how to do it, just drop me a note, I
will take a break to do that for you.

A Frame carries information about the layout and about the labelset, but not
about the actions (who are carried in the App object).

> Grep seems to show that there are a lot of different classes with
m_pLayout
> members (fl_BlockLayout.h, fl_DocListener.h, fl_SectionLayout.h,
fp_Page.h,
> fv_View.h, etc.).
>
> I'm think that where I'm not following you is when you refer to member
> functions and member data but I don't know what class it's in or how to
get
> to any of it.
>
> In other words, m_pLayout->addLayoutItem(...) is fine if I'm defining that
> class, but I'm inside a plugin and don't have access to class members. Is

> there a sequence of functions I can call that will get me to it?

Nope. Sorry if I was not clear enough. Hope that you will be able to do
these functions (as I said, if you don't know how to do it just drop me a
note)

> Thanks, and sorry I'm so slow. ;)

Entirely my fault. I was not clear enough
Sorry for the confusion

Cheers,

--
Joaquin Cuenca Abela
e98cuenc@yahoo.com



This archive was generated by hypermail 2b25 : Thu Sep 13 2001 - 15:34:16 CDT