--- In svg-developers@yahoogroups.com, "jololivier"
<[EMAIL PROTECTED]> wrote:
> hello,
> 
> is that possible to add dynamically menu items to the right click menu?
> Thanks a lot,
> jollt


Hi Jerome,

I found an example for changing the context menu, but it only works
with Adobe SVG Viewer. Hope it helps:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"; [
   <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink";>
   <!-- experimentelle DTD-Erweiterung by TM 2003 -->
   <!ENTITY % defsExt "|menu">
   <!ELEMENT menu (header,(item|menu|separator)*)>
   <!ELEMENT header (#PCDATA)>
   <!ELEMENT item (#PCDATA)>
   <!ELEMENT separator EMPTY>
   <!ATTLIST menu id ID #IMPLIED>
   <!ATTLIST item action CDATA #IMPLIED checked CDATA #IMPLIED
onactivate CDATA #IMPLIED>
 ]>
 
 <!-- SVG - Learning By Coding - http://www.datenverdrahten.de/svglbc/ -->
 <!--    Author: Dr. Thomas Meinike 05/03 - [EMAIL PROTECTED]     -->
 
 <svg xmlns="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink";
   onload="setMenu('TMenuE')">
 
 
   <defs>
 
     <script type="text/javascript">
       <![CDATA[
 
         function setMenu(menuid)
         {
           var ver=getSVGViewerVersion();
           if(ver.indexOf("Adobe")!=-1)
           {
             var
newMenu=parseXML(printNode(getDocument().getElementById(menuid)),getContextMenu());
             if(ver.indexOf("6.0")!=-1)
             {
              
getContextMenu().replaceChild(newMenu.firstChild,getContextMenu().firstChild);
             }
             else
             {
              
getContextMenu().replaceChild(newMenu,getContextMenu().firstChild);
             }          
           }
         }
 
         function AboutInfo()
         {
           alert("SVG - Learning By Coding\n\n(C) 2002...2003\nby Dr.
Thomas Meinike");
         }
 
       ]]>
     </script>
 
     <!-- This is the menu -->
     <menu id="TMenuE">
 
       <header>Adobe SVG Viewer</header>
 
       <item action="Open">&amp;Open</item>
       <item action="OpenNew">Open in &amp;New Window</item>
 
       <separator/>
 
       <item action="ZoomIn">Zoom &amp;In</item>
       <item action="ZoomOut">Zoom &amp;Out</item>
       <item action="OriginalView">&amp;Original View</item>
 
       <separator/>
 
       <item action="Quality">Higher &amp;Quality</item>
       <item action="Pause">&amp;Pause</item>
       <item action="Mute">&amp;Mute</item>
 
       <separator/>
 
       <item action="Find">&amp;Find...</item>
       <item action="FindAgain">Find &amp;Again</item>
 
       <separator/>
 
       <item action="Copy">Copy Selected &amp;Text</item>
       <item action="CopySVG">&amp;Copy SVG</item>
       <item action="ViewSVG">&amp;View SVG</item>
       <item action="ViewSource">View Sourc&amp;e</item>
       <item action="SaveAs">&amp;Save SVG As...</item>
 
       <separator/>
 
       <item action="Help">&amp;Help</item>
       <item action="About">&amp;About Adobe SVG Viewer...</item>
 
       <separator/>
       
       <menu>
           <header>My Menu</header>
             <item onactivate="alert('menu 1\nwas called')">Menu 1</item>
             <item checked="yes" onactivate="alert('menu 2\nwas
called')">Menu 2</item>
             <item onactivate="alert('menu 3\nwas called')">Menu 3</item>
          </menu>
        
       <seperator/>
 
       <item onactivate="AboutInfo(evt)">About S&amp;VGLBC...</item> 
 
     </menu>
 
   </defs>
 
  <text x="20" y="30" style="fill: #000; font-size: 24px">
     Change context menu in Adobe SVG Viewer</text>
 
 </svg>

tam





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to