[Zope3-dev] Re: [AdaptersForMenuItems] Disabling and menu item icons

Casey Duncan casey at zope.com
Mon Jan 12 14:34:37 EST 2004


On Mon, 12 Jan 2004 08:58:58 -0500
Jim Fulton <jim at zope.com> wrote:

> Caseman wrote:
> > ++added:
> > 
> >>From Caseman Mon Jan 12 09:28:00 US/Eastern 2004 From: Caseman Date:
> > 2004/01/12 09:28 EST Subject: Disabling and menu item icons
> > Message-ID: <20040112092846EST at dev.zope.org>
> > 
> > I noticed that menu items lack an ability to be marked disabled
> > (i.e., still visible but dimmed and not selectable). From the doc
> > string it seems that 'available()' means that the item should not be
> > displayed at all.
> 
> Right.
> 
> So, would you suggest another filter to control whether an item is
> enabled?

Yes, you should be able to designate a menu item as disabled. This would
need to be dynamic like available(), since obviously it should be
enabled in some circumstances.

I suppose then that the interface for menu items (and possibly menus
too, since you might want to disable a whole menu) should grow an
'enabled()' method which returns a bool.
 
> > I'm assuming that menus could also be used to define toolbars, which
> > would require icons. There is also a convention in modern GUIs for
> > many menus to include icons.
> 
> Good point.

Icons might make disabled() problematic since it should dim the icon,
although most recent browsers support some form or alpha channel image
filtering that could accomplish this client-side. At worst, you could
specify two icons, one for enabled and one for disabled if needed.
 
> > Perhaps both of these should be configured with the view rather than
> > with the menu itself. Either way I think both are pretty important
> > to support.
> 
> I think it makes the most sense to configure these are part of the
> menu item definition.  This can be an additional feature of the
> browser menu item type.

It makes sense to me to make them part of the menu definition, but I
wasn't sure how much separation of the presentation particulars was
desired.

-Casey



More information about the Zope3-dev mailing list