Loading ...
Sorry, an error occurred while loading the content.

Re: SVG context menu coordinates

Expand Messages
  • pilatfr
    ... if u ... dipending on what ... menu with ... easy to ... file (i.e. ... getURL. It ... menu. ... circle ... and the ... You can define directly menus in
    Message 1 of 11 , Mar 31, 2004
    • 0 Attachment
      --- In svg-developers@yahoogroups.com, "Nicomede" <nonsai@y...>
      wrote:
      > HI all, hi peter!
      > i'm new of this ML and i'm also working on a context menu problem,
      if u
      > repost your question maybe i can help you.
      > For as reguard me, i'm working on a SVG application that,
      dipending on what
      > svg element i'm rightclicking, it show up different context menu.
      > For example, if i rightclick on a circle, it show up a context
      menu with
      > just the "this is a circle" item, and so on.
      > I've developed it, but i don't like how it look, because it is not
      easy to
      > update.
      > So my idea was to put different contextual menu in different svg
      file (i.e.
      > defaultMenu.svg, circleMenu.svg and so on), and getting they via
      getURL. It
      > work, but first show up the old version of menu, than update the
      menu.
      > that is: i click on a circle, the default menu is show up, and the
      circle
      > menu is loaded, then i click on a rect, the circle menu is show up
      and the
      > rect menu is loaded, and so on.
      > I hope to be clear, english and me are not really friend ;-)
      > Any hint for me?

      You can define directly menus in main svg because when pointer go on
      shape it will be more easy to get new menu.

      You can use two events

      onmouseover="context_menus('menu_shape',evt)"
      onmouseout="context_menus('menu_defaut',evt)"

      and single function to replace menu
      function context_menus(menu_id,evt)
      {
      var newMenuRoot =
      parseXML(printNode(evt.target.ownerDocument.getElementById
      (menu_id)),contextMenu);
      contextMenu.replaceChild
      (newMenuRoot.firstChild,contextMenu.firstChild)
      }

      menu_defaut can also be user menu when pointer is not on a shape.

      Michel
    • Peter Kalev
      That is a very interesting approach, I will have to try it and see if it serves my purposes... Oh, and your English is fine... :-) Peter Kalev Senior Web
      Message 2 of 11 , Mar 31, 2004
      • 0 Attachment
        That is a very interesting approach, I will have to try it and see if it serves my purposes...

        Oh, and your English is fine... :-)

        Peter Kalev
        Senior Web Developer,
        SWF, LLC

        -----Original Message-----
        From: Nicomede [mailto:nonsai@...]
        Sent: Wednesday, March 31, 2004 12:39 AM
        To: svg-developers@yahoogroups.com
        Subject: Re: [svg-developers] Re: SVG context menu coordinates

        HI all, hi peter!
        i'm new of this ML and i'm also working on a context menu problem, if u
        repost your question maybe i can help you.
        For as reguard me, i'm working on a SVG application that, dipending on what
        svg element i'm rightclicking, it show up different context menu.
        For example, if i rightclick on a circle, it show up a context menu with
        just the "this is a circle" item, and so on.
        I've developed it, but i don't like how it look, because it is not easy to
        update.
        So my idea was to put different contextual menu in different svg file (i.e.
        defaultMenu.svg, circleMenu.svg and so on), and getting they via getURL. It
        work, but first show up the old version of menu, than update the menu.
        that is: i click on a circle, the default menu is show up, and the circle
        menu is loaded, then i click on a rect, the circle menu is show up and the
        rect menu is loaded, and so on.
        I hope to be clear, english and me are not really friend ;-)
        Any hint for me?

        See ya
        Nicomede

        -----Messaggio Originale-----
        Da: "peterkalev2002" <peter@...>
        A: <svg-developers@yahoogroups.com>
        Data invio: mercoledì 31 marzo 2004 0.31
        Oggetto: [svg-developers] Re: SVG context menu coordinates


        > I already tried this approach, but the problem is that the context
        > menu takes presedence over all other right click events and they do
        > not even register... :(
        >
        > I actually read more on the subject and I guess I am asking for a bit
        > more then this otherwise wonderful technology, can provide...
        >
        > I guess I will have to fake the whole menu from scratch... :)
        >
        >
        >
        > -----
        > To unsubscribe send a message to:
        svg-developers-unsubscribe@yahoogroups.com
        > -or-
        > visit http://groups.yahoo.com/group/svg-developers and click "edit my
        membership"
        > ----
        > Yahoo! Groups Links
        >
        >
        >
        >
        >



        -----
        To unsubscribe send a message to: svg-developers-unsubscribe@yahoogroups.com
        -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:
        svg-developers-unsubscribe@yahoogroups.com <mailto:svg-developers-unsubscribe@yahoogroups.com?subject=Unsubscribe>

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


        [Non-text portions of this message have been removed]
      • Arnaud CAYROL
        Hi, have you tried to use a script called by onmousedown event function MyOnMouseDown(evt){ if (evt.button == 2){ MyUpdateMenu(MyGetElement(evt)); } } where
        Message 3 of 11 , Mar 31, 2004
        • 0 Attachment
          Hi,
          have you tried to use a script called by onmousedown event
          function MyOnMouseDown(evt){
          if (evt.button == 2){
          MyUpdateMenu(MyGetElement(evt));
          }
          }

          where MyGetElement() gets the target element and
          MyUpdateMenu() changes the context menu on target type
          Example without any test of valid element:
          function MyUpdateMenu (target){
          var tgType=target.tagName;
          for(var
          tgDefMenu=contextMenu.firstChild.firstChild;tgDefMenu;tgDefMenu=tgDefM
          enu.nextSibling){
          // you must have defined for this example an attribute on
          // menu items in your menu def part
          if(tgDefMenu.getAttribute("MyAttTypeOnMenuItem")!=tgType){
          tgDefMenu.setAttribute("display","none");
          }else{
          tgDefMenu.setAttribute("display","");
          }
          }
          }

          arnaud

          --- In svg-developers@yahoogroups.com, "Peter Kalev" <peter@s...>
          wrote:
          > That is a very interesting approach, I will have to try it and see
          if it serves my purposes...
          >
          > Oh, and your English is fine... :-)
          >
          > Peter Kalev
          > Senior Web Developer,
          > SWF, LLC
          >
          > -----Original Message-----
          > From: Nicomede [mailto:nonsai@y...]
          > Sent: Wednesday, March 31, 2004 12:39 AM
          > To: svg-developers@yahoogroups.com
          > Subject: Re: [svg-developers] Re: SVG context menu coordinates
          >
          > HI all, hi peter!
          > i'm new of this ML and i'm also working on a context menu problem,
          if u
          > repost your question maybe i can help you.
          > For as reguard me, i'm working on a SVG application that, dipending
          on what
          > svg element i'm rightclicking, it show up different context menu.
          > For example, if i rightclick on a circle, it show up a context menu
          with
          > just the "this is a circle" item, and so on.
          > I've developed it, but i don't like how it look, because it is not
          easy to
          > update.
          > So my idea was to put different contextual menu in different svg
          file (i.e.
          > defaultMenu.svg, circleMenu.svg and so on), and getting they via
          getURL. It
          > work, but first show up the old version of menu, than update the
          menu.
          > that is: i click on a circle, the default menu is show up, and the
          circle
          > menu is loaded, then i click on a rect, the circle menu is show up
          and the
          > rect menu is loaded, and so on.
          > I hope to be clear, english and me are not really friend ;-)
          > Any hint for me?
          >
          > See ya
          > Nicomede
          >
          > -----Messaggio Originale-----
          > Da: "peterkalev2002" <peter@s...>
          > A: <svg-developers@yahoogroups.com>
          > Data invio: mercoledì 31 marzo 2004 0.31
          > Oggetto: [svg-developers] Re: SVG context menu coordinates
          >
          >
          > > I already tried this approach, but the problem is that the context
          > > menu takes presedence over all other right click events and they
          do
          > > not even register... :(
          > >
          > > I actually read more on the subject and I guess I am asking for a
          bit
          > > more then this otherwise wonderful technology, can provide...
          > >
          > > I guess I will have to fake the whole menu from scratch... :)
          > >
          > >
          > >
          > > -----
          > > To unsubscribe send a message to:
          > svg-developers-unsubscribe@yahoogroups.com
          > > -or-
          > > visit http://groups.yahoo.com/group/svg-developers and
          click "edit my
          > membership"
          > > ----
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          >
          >
          >
          > -----
          > To unsubscribe send a message to: svg-developers-
          unsubscribe@yahoogroups.com
          > -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:
          > svg-developers-unsubscribe@yahoogroups.com <mailto:svg-developers-
          unsubscribe@yahoogroups.com?subject=Unsubscribe>
          >
          > * Your use of Yahoo! Groups is subject to the Yahoo! Terms
          of Service <http://docs.yahoo.com/info/terms/> .
          >
          >
          > [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.