[Laszlo-dev] Re: [Internal-Dev] Fwd: [JIRA] Created: (LPP-975) context menu stops working when modal dialog is displayed

Henry Minsky henry.minsky at gmail.com
Mon Nov 21 11:33:35 PST 2005


Here's a meta-issue also, for the language architects ...

If I want to define new LZX tags <contextmenu> and <contextmenuitem>,
I can add these manually to the primitive schema, and add an entry to the
magic
table that maps these to "Lz" class names (i.e., LzContextMenu,
LzContextMenuItem).

That means adding this stuff to the LFC. But we frown on bloating the LFC,
so instead we could put the whole implementation in an optional or
auto-loaded library. But if we're defining the classes in LZX, we don't have
this duality of class names. So would we name the tag <contextmenu> or
<LzContextMenu>? Because if someone wants to generate these menus
procedurally at runtime (Elliot does), then they would the expect the
classes to be named LzMumble, right?

We're digging ourselves into a hole either way -- we really need to bring
the LZX and script naming conventions for classes into better alignment
somehow.




On 11/21/05, Elliot Winard <ewinard at laszlosystems.com> wrote:
>
> Still, I think ppl would find it confusing if the onselected executes in
> the
> context of the contextmenu's parent.
> -e
>
> On Mon, 21 Nov 2005, Henry Minsky wrote:
>
> > On 11/21/05, Elliot Winard <ewinard at laszlosystems.com> wrote:
> > >
> > > It looks like the onselected() of item2 fires in the context of the
> > > enclosing
> > > view's parent - not too intuitive, imho.
> > >
> > > I'd think that item2selected would be something like
> > > parent.parent.item2selected, which is ugly but similar to
> > > parent.parent.blah
> > > shenanigans within <view>s.
> > > -e
> >
> >
> >
> > Yeah I don't see any nicer way to do it. If you're defining a class, you
> get
> > to refer to classroot, but if you're doing it in an instance, you can't
> do
> > that.
> >
> >
> >
> > On Mon, 21 Nov 2005, P T Withington wrote:
> > >
> > > > Someday, I want to be able to say:
> > > >
> > > > <view name="theview">
> > > > <contextmenu name="menu">>
> > > > <item name="item1">
> > > > my item1
> > > > </item>
> > > > <item name="item2
> > > > onselected="theview.item2selected()">
> > > > my item2
> > > > </item>
> > > > </contextmenu>
> > > >
> > > > <method event="onselected" reference="menu.item1">
> > > > Debug.write("item1 selected");
> > > > </method>
> > > >
> > > > <method name="item2selected">
> > > > Debug.write("item2 selected");
> > > > </method>
> > > > </view>
> > > >
> > > > On 21 Nov 2005, at 13:25, Henry Minsky wrote:
> > > >
> > > > > How would something like this be for an LzDelegate-ified API to
> use
> > > context
> > > > > menus?
> > > > >
> > > > > I'll make a more formal proposal after getting some feedback..
> > > > >
> > > > >
> > > > > <view width="100" height="100" bgcolor="#cccccc">
> > > > > <method event="oninit">
> > > > > var cm = new LzContextMenu();
> > > > > var item1 = cm.makeMenuItem('my item1' , new LzDelegate(this,
> > > > > "handlerightclick1"));
> > > > > var item2 = cm.makeMenuItem('my item2' , new LzDelegate(this,
> > > > > "handlerightclick2"));
> > > > > cm.addItem(item1);
> > > > > cm.addItem(item2);
> > > > > this.setContextMenu(cm);
> > > > > </method>
> > > > > <method name="handlerightclick1" args="item">
> > > > > Debug.write("handle item1 handlerightclick1", item);
> > > > > </method>
> > > > >
> > > > > <method name="handlerightclick2" args="item">
> > > > > Debug.write("handle item2 handlerightclick2", item);
> > > > > </method>
> > > > >
> > > > > </view>
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Laszlo-dev mailing list
> > > > > Laszlo-dev at openlaszlo.org
> > > > > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> > >
> >
> >
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com
> >
>



--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openlaszlo.org/pipermail/laszlo-dev/attachments/20051121/c1e062e9/attachment.html


More information about the Laszlo-dev mailing list