Hey guys,

A made some significant changes to the menu-handling to make it more
flexible.

- First, a search can now modify the popup menu.  Here's an example of how I
tested it in the GoogleSpell addon:

1. Add a uniquely named 'menu hook' function with one parameter.  This
function will receive the MenuBuilder object with which you can do as you
please.  This example adds two cascading submenus, and one menu item.

function googlespellMenuHook( mb )
{
  var hm = mb.AppendSubMenu( "GoogleSpell" );
  hm = mb.AppendSubMenu( "GoogleSpell Subcategory", hm );
  mb.AppendMenuItem( "GoogleSpell Test",  // menu text
                           "googlespell",       // function invoked
                           "GoogleSpell Test",  // tooltip
                           hm );                        // menu handle
}

2. In the <script> tag (out side of any function), make a call to
'registerMenuHook( fn )' giving it the name of your menu hook function:

registerMenuHook( googlespellMenuHook );


- Second, searches can be grouped by subcategories by adding another
<category/> tag inside the first.  E.g.

<category>Genealogy
  <category>Subcategory</category>
</category>

There can be multiple levels of subcategories.


- Finally, if, for whatever reason, you want to exclude a search in the
popup you can use the "nomenu" attribute in a <category/> element:

<category nomenu="true">Whatever</category>


That's it.  Grab all the latest stuff and give it a try if your add-on,
search has a need for it.  As always, any testing would be appreciated.

Later,
Glenn



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-devel

Reply via email to