I think you need to look into how jQueryUI implements these. They are some
sort of object, I'm sure. AddItem will insert a <div> I'm guessing, in a
list of divs. But you can keep track of them with arrays yourself. I think
it makes sense to build some sort of structure that is basically an array
of arrays to hold the menu regardless of what jQuery does. Then, in the
future, if we wanted to implement some other scheme, we could.


On Tue, Dec 18, 2012 at 2:30 PM, Robert Hanson <[email protected]> wrote:

> super!
>
>
>
> On Tue, Dec 18, 2012 at 11:57 AM, Michael Evans <[email protected]>wrote:
>
>> Jmol community,
>> Here's a simple example of a context menu in JSmol:
>>
>> http://www.metallacycle.com/play/netmol/tests/popupMenu/popupMenu.html
>>
>> Dig into the document ready function and jmolPopupMenu.js for details.
>> The whole kit and kaboodle (including jQueryUI menu, which I used to handle
>> the visuals) is 165 KB at the moment. The JS file adds Jmol.Menu with its
>> associated functions:
>>
>> initializeMenu
>> menuAddItem(menu, item)
>> menuRemoveItem(menu, itemId)
>> menuAddSubmenu(menu, submenu)
>> menuAddSeparator(menu)
>> menuEnableItem(menu, itemId, boolEnable)
>>
>> Should the "items" sent to menuAddItem, etc. just be HTML, or something
>> more abstract like Javascript objects?
>>
>
> These should definitely be objects. I would say something that mirrors
> those in the Java system:
>
> import java.awt.Component;
> import java.awt.event.ActionEvent;
> import java.awt.event.ActionListener;
> import java.awt.event.ItemEvent;
> import java.awt.event.ItemListener;
> import java.awt.event.MouseEvent;
> import java.awt.event.MouseListener;
>
> import javax.swing.AbstractButton;
> import javax.swing.ButtonGroup;
> import javax.swing.ImageIcon;
> import javax.swing.JCheckBoxMenuItem;
> import javax.swing.JComponent;
> import javax.swing.JMenu;
> import javax.swing.JMenuItem;
> import javax.swing.JPopupMenu;
> import javax.swing.JRadioButtonMenuItem;
>
> Not saying we have to use all of those, but they are there for a reason,
> and every one is accessed in one way or another to set the menus.
>
>
>
>>  There are no jQueryUI objects for things like radio groups and
>> checkboxes...these would have to be handled by us somewhere on the path
>> from abstract menu object to final rendered menu. Would be interested to
>> hear your thoughts on the best way to implement addItem.
>>
>> Cheers, Mike
>>
>> ---
>> Michael Evans
>> Organic Chemistry Graduate Student, Moore Group
>> University of Illinois, Urbana-Champaign
>>
>>
>>
>> ------------------------------------------------------------------------------
>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>> Remotely access PCs and mobile devices and provide instant support
>> Improve your efficiency, and focus on delivering more value-add services
>> Discover what IT Professionals Know. Rescue delivers
>> http://p.sf.net/sfu/logmein_12329d2d
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Chemistry Department
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
>
>


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to