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

changing cursor on mouse-over on text element

Expand Messages
  • biosoft_indore
    Hello everybody, I am new to svg , just begun development in it. I would like to know how to set the cursor property for a text element. my requirement is to
    Message 1 of 18 , Feb 2, 2002
    • 0 Attachment
      Hello everybody,
      I am new to svg , just begun development in it. I would like to know
      how to set the cursor property for a text element.
      my requirement is to show the arrowhhead cursor even when the mouse
      is over a text element.
      Please reply soon.
      Thanks in advance.
    • Tobias Reif
      ... http://www.w3.org/TR/SVG/interact.html#Cursors http://www.pinkjuice.com/temp/SVG/cursor.svg I don t know which viewer implements those. Tobi --
      Message 2 of 18 , Feb 2, 2002
      • 0 Attachment
        biosoft_indore wrote:

        > I would like to know
        > how to set the cursor property for a text element.
        > my requirement is to show the arrowhhead cursor even when the mouse
        > is over a text element.


        http://www.w3.org/TR/SVG/interact.html#Cursors

        http://www.pinkjuice.com/temp/SVG/cursor.svg

        I don't know which viewer implements those.

        Tobi

        --
        http://www.pinkjuice.com/
      • biosoft_indore
        I could not see any cursor changing , it was as it is in svg by default, arrow head on rect and I-shaped cursor on text. What could be the reason??? ... mouse
        Message 3 of 18 , Feb 2, 2002
        • 0 Attachment
          I could not see any cursor changing , it was as it is in svg
          by default, arrow head on rect and I-shaped cursor on text.
          What could be the reason???

          --- In svg-developers@y..., Tobias Reif <tobiasreif@p...> wrote:
          > biosoft_indore wrote:
          >
          > > I would like to know
          > > how to set the cursor property for a text element.
          > > my requirement is to show the arrowhhead cursor even when the
          mouse
          > > is over a text element.
          >
          >
          > http://www.w3.org/TR/SVG/interact.html#Cursors
          >
          > http://www.pinkjuice.com/temp/SVG/cursor.svg
          >
          > I don't know which viewer implements those.
          >
          > Tobi
          >
          > --
          > http://www.pinkjuice.com/
        • Tobias Reif
          ... Or there s an error in my SVG. Tobi -- http://www.pinkjuice.com/
          Message 4 of 18 , Feb 2, 2002
          • 0 Attachment
            biosoft_indore wrote:

            >
            > I could not see any cursor changing , it was as it is in svg
            > by default, arrow head on rect and I-shaped cursor on text.
            > What could be the reason???


            probably this:


            > --- In svg-developers@y..., Tobias Reif <tobiasreif@p...> wrote:
            >>I don't know which viewer implements those.


            Or there's an error in my SVG.


            Tobi



            --
            http://www.pinkjuice.com/
          • honnen_martin
            ... know ... mouse ... I think the intended way is CSS2
            Message 5 of 18 , Feb 2, 2002
            • 0 Attachment
              --- In svg-developers@y..., "biosoft_indore" <vector_graphic@r...>
              wrote:
              > Hello everybody,
              > I am new to svg , just begun development in it. I would like to
              know
              > how to set the cursor property for a text element.
              > my requirement is to show the arrowhhead cursor even when the
              mouse
              > is over a text element.
              > Please reply soon.
              > Thanks in advance.

              I think the intended way is CSS2

              <text x="50" y="60"
              style="cursor: default; text-anchor: middle;
              font-size: 20; fill: green;"
              >Kibology</text>

              but the CSS property cursor is not supported by the Adobe SVG viewer
              3.0.

              If you do not intend to capture events on the text then you can use

              <text x="50" y="60" pointer-events="none"
              style="cursor: default; text-anchor: middle;
              font-size: 20; fill: green;"
              >Kibology</text>

              which gives you the arrowhead cursor.

              Martin
            • arvind_sareen
              Hi I want to display the cursor in the textbox whenever I click on a button in svg(i.e. the cursor should blink in the empty textbox like it happens in HTML
              Message 6 of 18 , Jul 8, 2003
              • 0 Attachment
                Hi

                I want to display the cursor in the textbox whenever I click on a
                button in svg(i.e. the cursor should blink in the empty textbox like
                it happens in HTML when we pass the focus to a textbox) .

                Can anybody provide me with sample code or steps for executing this
                in my application.


                Regards

                Arvind
              • Francis Hemsher
                ... I want to display the cursor in the textbox whenever I click on a button in svg(i.e. the cursor should blink in the empty textbox like it happens in HTML
                Message 7 of 18 , Jul 8, 2003
                • 0 Attachment
                  Arvind Wrote:
                  ------------------------------------
                  I want to display the cursor in the textbox whenever I click on a
                  button in svg(i.e. the cursor should blink in the empty textbox like
                  it happens in HTML when we pass the focus to a textbox) .

                  Can anybody provide me with sample code or steps for executing this
                  in my application.
                  ---------------------------------------

                  Hi Arvind,
                  Below is a snippet I cut from some of my code. Generally, you are
                  incorporating a blinker as a tspan at the 'front' of an expanding
                  tspan that is being dynamcially filled from the keyboard. The process
                  is rather involved, but hopefully this will get you started.
                  Francis

                  <script>
                  ////---create the text blinker
                  blink="|"
                  textBlinker=docSVG.createElement("tspan")
                  textBlinker.setAttribute
                  ("style", "fill:black;font-size:12;font-family:arial;")
                  textBlinker.setAttribute("display", "visible")
                  blinkNode=docSVG.createTextNode(blink);
                  textBlinker.appendChild(blinkNode)

                  var textBlinkerInterval
                  function startBlinker()
                  {
                  textBlinkerInterval=setInterval("blinkIt()", 500)
                  }

                  function blinkIt()
                  {
                  blinkDisplay=textBlinker.getAttribute("display")
                  if(blinkDisplay=="visible")
                  textBlinker.setAttribute("display", "none")
                  else
                  textBlinker.setAttribute("display", "visible")
                  }
                  </script>
                • Arvind Sareen
                  Hi Francis, Thanks for the code. I incorporated it in my application but found that it is not blinking and moreover the focus does not shift to that textbox.
                  Message 8 of 18 , Jul 9, 2003
                  • 0 Attachment
                    Hi Francis,

                    Thanks for the code. I incorporated it in my
                    application but found that it is not blinking and
                    moreover the focus does not shift to that textbox. So
                    I have to keep the mouse on the textbox to enter any
                    character or number in it.

                    Please let me know how best i can acheive it and if
                    there is some sample code which does it . It will be
                    of great help.

                    Regards

                    Arvind
                    --- Francis Hemsher <francishemsher@...>
                    wrote:
                    >
                    > Arvind Wrote:
                    > ------------------------------------
                    > I want to display the cursor in the textbox whenever
                    > I click on a
                    > button in svg(i.e. the cursor should blink in the
                    > empty textbox like
                    > it happens in HTML when we pass the focus to a
                    > textbox) .
                    >
                    > Can anybody provide me with sample code or steps for
                    > executing this
                    > in my application.
                    > ---------------------------------------
                    >
                    > Hi Arvind,
                    > Below is a snippet I cut from some of my code.
                    > Generally, you are
                    > incorporating a blinker as a tspan at the 'front' of
                    > an expanding
                    > tspan that is being dynamcially filled from the
                    > keyboard. The process
                    > is rather involved, but hopefully this will get you
                    > started.
                    > Francis
                    >
                    > <script>
                    > ////---create the text blinker
                    > blink="|"
                    > textBlinker=docSVG.createElement("tspan")
                    > textBlinker.setAttribute
                    > ("style",
                    > "fill:black;font-size:12;font-family:arial;")
                    > textBlinker.setAttribute("display", "visible")
                    > blinkNode=docSVG.createTextNode(blink);
                    > textBlinker.appendChild(blinkNode)
                    >
                    > var textBlinkerInterval
                    > function startBlinker()
                    > {
                    > textBlinkerInterval=setInterval("blinkIt()", 500)
                    > }
                    >
                    > function blinkIt()
                    > {
                    > blinkDisplay=textBlinker.getAttribute("display")
                    > if(blinkDisplay=="visible")
                    > textBlinker.setAttribute("display", "none")
                    > else
                    > textBlinker.setAttribute("display", "visible")
                    > }
                    > </script>
                    >
                    >


                    __________________________________
                    Do you Yahoo!?
                    SBC Yahoo! DSL - Now only $29.95 per month!
                    http://sbc.yahoo.com
                  • Francis Hemsher
                    ... Thanks for the code. I incorporated it in my application but found that it is not blinking and moreover the focus does not shift to that textbox. So I have
                    Message 9 of 18 , Jul 9, 2003
                    • 0 Attachment
                      Arvind Wrote:
                      --------------------------------
                      Thanks for the code. I incorporated it in my
                      application but found that it is not blinking and
                      moreover the focus does not shift to that textbox. So
                      I have to keep the mouse on the textbox to enter any
                      character or number in it.

                      Please let me know how best i can acheive it and if
                      there is some sample code which does it . It will be
                      of great help.
                      ----------------------------------

                      Hi Arvind,
                      The method I've developed works like this:

                      The user points/clicks at any place in the SVG drawing. This starts a
                      text element with a tspan blinker. Then, via the keyboard, the user
                      types into a tspan that was automatically placed before the blinker.
                      As the user types in characters, that tspan responds dynamically,
                      receiving the characters. The blinker, contained in its own tspan,
                      meanwhile is moving 'in front' of the expanding character-filled
                      tspan.

                      If the user hits the Enter key, a new line is started directly below
                      the first line (i.e. a new tspan), with the blinker sitting at the
                      start of that line. To finish the line(s) and remove the blinker, the
                      user, in my application, would select the Ctrl key.

                      Now I suppose, if you have a textbox on your svg drawing, when the
                      user clicks anywhere within the box, you would force the x,y
                      coordinates for the text, and its tspans, to start relative to the
                      box's x, y coordinates.

                      If you want to go in this direction, I'll send this example to the
                      list; if you don't mind waiting a day or two. I have to slice it from
                      some files to create an the example.

                      Let me know,

                      Francis
                    • Arvind Sareen
                      Hi Francis, Please do but I don t need x and y co-ordinates exactly. What i need is that when i click on a button , the cursor should start blinking in the
                      Message 10 of 18 , Jul 9, 2003
                      • 0 Attachment
                        Hi Francis,

                        Please do but I don't need x and y co-ordinates
                        exactly. What i need is that when i click on a button
                        , the cursor should start blinking in the textbox and
                        focus should shift to that textbox.
                        With the help of the code provided by you , I was able
                        to place blinker in the textbox after i clicked on the
                        button , but it did not blink and moreover the focus
                        did not shift to that textbox , so that I could enter
                        the value in the textbox without keeping mouse over
                        the textbox.

                        Regards

                        Arvind

                        --- Francis Hemsher <francishemsher@...>
                        wrote:
                        > Arvind Wrote:
                        > --------------------------------
                        > Thanks for the code. I incorporated it in my
                        > application but found that it is not blinking and
                        > moreover the focus does not shift to that textbox.
                        > So
                        > I have to keep the mouse on the textbox to enter any
                        > character or number in it.
                        >
                        > Please let me know how best i can acheive it and if
                        > there is some sample code which does it . It will be
                        > of great help.
                        > ----------------------------------
                        >
                        > Hi Arvind,
                        > The method I've developed works like this:
                        >
                        > The user points/clicks at any place in the SVG
                        > drawing. This starts a
                        > text element with a tspan blinker. Then, via the
                        > keyboard, the user
                        > types into a tspan that was automatically placed
                        > before the blinker.
                        > As the user types in characters, that tspan responds
                        > dynamically,
                        > receiving the characters. The blinker, contained in
                        > its own tspan,
                        > meanwhile is moving 'in front' of the expanding
                        > character-filled
                        > tspan.
                        >
                        > If the user hits the Enter key, a new line is
                        > started directly below
                        > the first line (i.e. a new tspan), with the blinker
                        > sitting at the
                        > start of that line. To finish the line(s) and remove
                        > the blinker, the
                        > user, in my application, would select the Ctrl key.
                        >
                        > Now I suppose, if you have a textbox on your svg
                        > drawing, when the
                        > user clicks anywhere within the box, you would force
                        > the x,y
                        > coordinates for the text, and its tspans, to start
                        > relative to the
                        > box's x, y coordinates.
                        >
                        > If you want to go in this direction, I'll send this
                        > example to the
                        > list; if you don't mind waiting a day or two. I have
                        > to slice it from
                        > some files to create an the example.
                        >
                        > Let me know,
                        >
                        > Francis
                        >
                        >
                        >


                        __________________________________
                        Do you Yahoo!?
                        SBC Yahoo! DSL - Now only $29.95 per month!
                        http://sbc.yahoo.com
                      • Francis Hemsher
                        ... Please do but I don t need x and y co-ordinates exactly. What i need is that when i click on a button , the cursor should start blinking in the textbox and
                        Message 11 of 18 , Jul 10, 2003
                        • 0 Attachment
                          Arvind Wrote:
                          ------------------------------------------------
                          Please do but I don't need x and y co-ordinates
                          exactly. What i need is that when i click on a button
                          , the cursor should start blinking in the textbox and
                          focus should shift to that textbox.
                          With the help of the code provided by you , I was able
                          to place blinker in the textbox after i clicked on the
                          button , but it did not blink and moreover the focus
                          did not shift to that textbox , so that I could enter
                          the value in the textbox without keeping mouse over
                          the textbox.
                          -------------------------------------------------
                          Hi Arvind,
                          As I tell my clients, if you can describe what you want, then it can
                          be done. If you want to accomplish what you say above then it can be
                          done. Since this also may be helpful to others on this list, could
                          you post some code for review? I need more information before I can
                          be of further assistance, which I want to be.
                          I know we're in different time zones: it's 4:00 A.M. here so I am
                          about to end my day. I will be back online sometime later...

                          Cheers,
                          Francis
                        • Arvind Sareen
                          Hi Francis, The code is too lengthy , should I send u the whole code or just the part on which I am trying to implementing this thing. Please do et me know.
                          Message 12 of 18 , Jul 10, 2003
                          • 0 Attachment
                            Hi Francis,

                            The code is too lengthy , should I send u the whole
                            code or just the part on which I am trying to
                            implementing this thing.
                            Please do et me know.

                            Regards

                            Arvind

                            --- Francis Hemsher <francishemsher@...>
                            wrote:
                            >
                            > Arvind Wrote:
                            > ------------------------------------------------
                            > Please do but I don't need x and y co-ordinates
                            > exactly. What i need is that when i click on a
                            > button
                            > , the cursor should start blinking in the textbox
                            > and
                            > focus should shift to that textbox.
                            > With the help of the code provided by you , I was
                            > able
                            > to place blinker in the textbox after i clicked on
                            > the
                            > button , but it did not blink and moreover the focus
                            >
                            > did not shift to that textbox , so that I could
                            > enter
                            > the value in the textbox without keeping mouse over
                            > the textbox.
                            > -------------------------------------------------
                            > Hi Arvind,
                            > As I tell my clients, if you can describe what you
                            > want, then it can
                            > be done. If you want to accomplish what you say
                            > above then it can be
                            > done. Since this also may be helpful to others on
                            > this list, could
                            > you post some code for review? I need more
                            > information before I can
                            > be of further assistance, which I want to be.
                            > I know we're in different time zones: it's 4:00 A.M.
                            > here so I am
                            > about to end my day. I will be back online sometime
                            > later...
                            >
                            > Cheers,
                            > Francis
                            >
                            >
                            >
                            >


                            __________________________________
                            Do you Yahoo!?
                            SBC Yahoo! DSL - Now only $29.95 per month!
                            http://sbc.yahoo.com
                          • ctl271
                            Hi Arvind, IIRC the keyboard event is received by whatever SVG Element has the mouse focus, and focus follows the mouse. So I don t think it will be possible
                            Message 13 of 18 , Jul 10, 2003
                            • 0 Attachment
                              Hi Arvind,

                              IIRC the keyboard event is received by whatever SVG Element has the
                              mouse focus, and focus follows the mouse. So I don't think it will
                              be possible to swtich the focus to the text box... (I'm sure someone
                              will correct me if I'm wrong).

                              Regardless of what event actually has focus, you might try
                              registering an event listener on some top level SVG Element (like a
                              background rectangle) and have it capture the key and send it to the
                              textbox. Thus it would appear as though the textbox had focus...
                              Characters could be sent to the textbox until the user clicked
                              somewhere else in the interface... As the background is present in
                              the entire application it wouldn't matter where the mouse was so long
                              as it was over the application.

                              cheers,
                              Chris

                              --- In svg-developers@yahoogroups.com, Arvind Sareen
                              <arvind_sareen@y...> wrote:
                              > Hi Francis,
                              >
                              > Please do but I don't need x and y co-ordinates
                              > exactly. What i need is that when i click on a button
                              > , the cursor should start blinking in the textbox and
                              > focus should shift to that textbox.
                              > With the help of the code provided by you , I was able
                              > to place blinker in the textbox after i clicked on the
                              > button , but it did not blink and moreover the focus
                              > did not shift to that textbox , so that I could enter
                              > the value in the textbox without keeping mouse over
                              > the textbox.
                              >
                              > Regards
                              >
                              > Arvind
                              >
                              > --- Francis Hemsher <francishemsher@c...>
                              > wrote:
                              > > Arvind Wrote:
                              > > --------------------------------
                              > > Thanks for the code. I incorporated it in my
                              > > application but found that it is not blinking and
                              > > moreover the focus does not shift to that textbox.
                              > > So
                              > > I have to keep the mouse on the textbox to enter any
                              > > character or number in it.
                              > >
                              > > Please let me know how best i can acheive it and if
                              > > there is some sample code which does it . It will be
                              > > of great help.
                              > > ----------------------------------
                              > >
                              > > Hi Arvind,
                              > > The method I've developed works like this:
                              > >
                              > > The user points/clicks at any place in the SVG
                              > > drawing. This starts a
                              > > text element with a tspan blinker. Then, via the
                              > > keyboard, the user
                              > > types into a tspan that was automatically placed
                              > > before the blinker.
                              > > As the user types in characters, that tspan responds
                              > > dynamically,
                              > > receiving the characters. The blinker, contained in
                              > > its own tspan,
                              > > meanwhile is moving 'in front' of the expanding
                              > > character-filled
                              > > tspan.
                              > >
                              > > If the user hits the Enter key, a new line is
                              > > started directly below
                              > > the first line (i.e. a new tspan), with the blinker
                              > > sitting at the
                              > > start of that line. To finish the line(s) and remove
                              > > the blinker, the
                              > > user, in my application, would select the Ctrl key.
                              > >
                              > > Now I suppose, if you have a textbox on your svg
                              > > drawing, when the
                              > > user clicks anywhere within the box, you would force
                              > > the x,y
                              > > coordinates for the text, and its tspans, to start
                              > > relative to the
                              > > box's x, y coordinates.
                              > >
                              > > If you want to go in this direction, I'll send this
                              > > example to the
                              > > list; if you don't mind waiting a day or two. I have
                              > > to slice it from
                              > > some files to create an the example.
                              > >
                              > > Let me know,
                              > >
                              > > Francis
                              > >
                              > >
                              > >
                              >
                              >
                              > __________________________________
                              > Do you Yahoo!?
                              > SBC Yahoo! DSL - Now only $29.95 per month!
                              > http://sbc.yahoo.com
                            • Arvind Sareen
                              Hi Chris, Thanks for the information. Do u have sample code for the rectangle which can have focus. If so, please provide it. Regards Arvind ...
                              Message 14 of 18 , Jul 10, 2003
                              • 0 Attachment
                                Hi Chris,

                                Thanks for the information. Do u have sample code for
                                the rectangle which can have focus. If so, please
                                provide it.

                                Regards

                                Arvind
                                --- ctl271 <ctl271@...> wrote:
                                > Hi Arvind,
                                >
                                > IIRC the keyboard event is received by whatever SVG
                                > Element has the
                                > mouse focus, and focus follows the mouse. So I
                                > don't think it will
                                > be possible to swtich the focus to the text box...
                                > (I'm sure someone
                                > will correct me if I'm wrong).
                                >
                                > Regardless of what event actually has focus, you
                                > might try
                                > registering an event listener on some top level SVG
                                > Element (like a
                                > background rectangle) and have it capture the key
                                > and send it to the
                                > textbox. Thus it would appear as though the textbox
                                > had focus...
                                > Characters could be sent to the textbox until the
                                > user clicked
                                > somewhere else in the interface... As the
                                > background is present in
                                > the entire application it wouldn't matter where the
                                > mouse was so long
                                > as it was over the application.
                                >
                                > cheers,
                                > Chris
                                >
                                > --- In svg-developers@yahoogroups.com, Arvind Sareen
                                >
                                > <arvind_sareen@y...> wrote:
                                > > Hi Francis,
                                > >
                                > > Please do but I don't need x and y co-ordinates
                                > > exactly. What i need is that when i click on a
                                > button
                                > > , the cursor should start blinking in the textbox
                                > and
                                > > focus should shift to that textbox.
                                > > With the help of the code provided by you , I was
                                > able
                                > > to place blinker in the textbox after i clicked on
                                > the
                                > > button , but it did not blink and moreover the
                                > focus
                                > > did not shift to that textbox , so that I could
                                > enter
                                > > the value in the textbox without keeping mouse
                                > over
                                > > the textbox.
                                > >
                                > > Regards
                                > >
                                > > Arvind
                                > >
                                > > --- Francis Hemsher <francishemsher@c...>
                                > > wrote:
                                > > > Arvind Wrote:
                                > > > --------------------------------
                                > > > Thanks for the code. I incorporated it in my
                                > > > application but found that it is not blinking
                                > and
                                > > > moreover the focus does not shift to that
                                > textbox.
                                > > > So
                                > > > I have to keep the mouse on the textbox to enter
                                > any
                                > > > character or number in it.
                                > > >
                                > > > Please let me know how best i can acheive it and
                                > if
                                > > > there is some sample code which does it . It
                                > will be
                                > > > of great help.
                                > > > ----------------------------------
                                > > >
                                > > > Hi Arvind,
                                > > > The method I've developed works like this:
                                > > >
                                > > > The user points/clicks at any place in the SVG
                                > > > drawing. This starts a
                                > > > text element with a tspan blinker. Then, via the
                                > > > keyboard, the user
                                > > > types into a tspan that was automatically placed
                                > > > before the blinker.
                                > > > As the user types in characters, that tspan
                                > responds
                                > > > dynamically,
                                > > > receiving the characters. The blinker, contained
                                > in
                                > > > its own tspan,
                                > > > meanwhile is moving 'in front' of the expanding
                                > > > character-filled
                                > > > tspan.
                                > > >
                                > > > If the user hits the Enter key, a new line is
                                > > > started directly below
                                > > > the first line (i.e. a new tspan), with the
                                > blinker
                                > > > sitting at the
                                > > > start of that line. To finish the line(s) and
                                > remove
                                > > > the blinker, the
                                > > > user, in my application, would select the Ctrl
                                > key.
                                > > >
                                > > > Now I suppose, if you have a textbox on your svg
                                > > > drawing, when the
                                > > > user clicks anywhere within the box, you would
                                > force
                                > > > the x,y
                                > > > coordinates for the text, and its tspans, to
                                > start
                                > > > relative to the
                                > > > box's x, y coordinates.
                                > > >
                                > > > If you want to go in this direction, I'll send
                                > this
                                > > > example to the
                                > > > list; if you don't mind waiting a day or two. I
                                > have
                                > > > to slice it from
                                > > > some files to create an the example.
                                > > >
                                > > > Let me know,
                                > > >
                                > > > Francis
                                > > >
                                > > >
                                > > >
                                > >
                                > >
                                > > __________________________________
                                > > Do you Yahoo!?
                                > > SBC Yahoo! DSL - Now only $29.95 per month!
                                > > http://sbc.yahoo.com
                                >
                                >


                                __________________________________
                                Do you Yahoo!?
                                SBC Yahoo! DSL - Now only $29.95 per month!
                                http://sbc.yahoo.com
                              • ctl271
                                The only code I have is a little complicated. I ve posted a snippet which creates two MouseTracker objects and adds them as EventListeners on the root element.
                                Message 15 of 18 , Jul 13, 2003
                                • 0 Attachment
                                  The only code I have is a little complicated.

                                  I've posted a snippet which creates two MouseTracker objects and adds
                                  them as EventListeners on the root element. I use them to track the
                                  current x and y coordinates of the mouse relative to the current view
                                  and to handle dragging frames etc... but you could declare a
                                  variable that stores a reference to the object which has focus (say
                                  this.cursor_focus), and set that variable on the mousedown event.

                                  Then send your keypressed events to the element referenced by
                                  this.cursor_focus.

                                  Hope this helps, this is as much detail as I can provide for now...
                                  This fragment came from the CGUI source at
                                  http://homepage.usask.ca/~ctl271/cgui. Looking through it may help
                                  you to understand my meaning...

                                  cheers,
                                  Chris

                                  -----------

                                  var svgdoc = svgDocument;
                                  var root = svgDocument.getDocumentElement();

                                  root.addEventListener("mousemove", new MouseTracker
                                  ("mousemove"),false);
                                  root.addEventListener("mouseup", new MouseTracker("mouseup"),
                                  false);

                                  // create a MouseTracker object
                                  // It may track mousemove or mousedown events
                                  function MouseTracker (type) {
                                  this.cursor_focus;
                                  if (type == "mousemove") this.handleEvent = MouseTracker.mouseMove;
                                  else if (type == "mousedown") this.handleEvent =
                                  MouseTracker.mouseDown;
                                  }

                                  // method called when a mouseMove event is received
                                  MouseTracker.mouseMove = function (evt) {
                                  // Get the current x and y coordinate relative to the current view
                                  MouseTracker.x = (evt.clientX-CGUI.root.currentTranslate.x)/
                                  CGUI.root.currentScale;
                                  MouseTracker.y = (evt.clientY-CGUI.root.currentTranslate.y)/
                                  CGUI.root.currentScale;
                                  ...

                                  }

                                  // method called when a mousedown event is received
                                  MouseTracker.mouseDown = function (evt) {
                                  this.cursor_focus = evt.getTarget();
                                  }

                                  // Note this is pure pseudo-code... I'm sure it won't work as is, but
                                  // hopefully you see what I'm suggesting.
                                  MouseTracker.keyPressed (evt) {
                                  this.cursor_focus.addChar (evt.char);
                                  }


                                  --- In svg-developers@yahoogroups.com, Arvind Sareen
                                  <arvind_sareen@y...> wrote:
                                  > Hi Chris,
                                  >
                                  > Thanks for the information. Do u have sample code for
                                  > the rectangle which can have focus. If so, please
                                  > provide it.
                                  >
                                  > Regards
                                  >
                                  > Arvind
                                  > --- ctl271 <ctl271@y...> wrote:
                                  > > Hi Arvind,
                                  > >
                                  > > IIRC the keyboard event is received by whatever SVG
                                  > > Element has the
                                  > > mouse focus, and focus follows the mouse. So I
                                  > > don't think it will
                                  > > be possible to swtich the focus to the text box...
                                  > > (I'm sure someone
                                  > > will correct me if I'm wrong).
                                  > >
                                  > > Regardless of what event actually has focus, you
                                  > > might try
                                  > > registering an event listener on some top level SVG
                                  > > Element (like a
                                  > > background rectangle) and have it capture the key
                                  > > and send it to the
                                  > > textbox. Thus it would appear as though the textbox
                                  > > had focus...
                                  > > Characters could be sent to the textbox until the
                                  > > user clicked
                                  > > somewhere else in the interface... As the
                                  > > background is present in
                                  > > the entire application it wouldn't matter where the
                                  > > mouse was so long
                                  > > as it was over the application.
                                  > >
                                  > > cheers,
                                  > > Chris
                                  > >
                                  > > --- In svg-developers@yahoogroups.com, Arvind Sareen
                                  > >
                                  > > <arvind_sareen@y...> wrote:
                                  > > > Hi Francis,
                                  > > >
                                  > > > Please do but I don't need x and y co-ordinates
                                  > > > exactly. What i need is that when i click on a
                                  > > button
                                  > > > , the cursor should start blinking in the textbox
                                  > > and
                                  > > > focus should shift to that textbox.
                                  > > > With the help of the code provided by you , I was
                                  > > able
                                  > > > to place blinker in the textbox after i clicked on
                                  > > the
                                  > > > button , but it did not blink and moreover the
                                  > > focus
                                  > > > did not shift to that textbox , so that I could
                                  > > enter
                                  > > > the value in the textbox without keeping mouse
                                  > > over
                                  > > > the textbox.
                                  > > >
                                  > > > Regards
                                  > > >
                                  > > > Arvind
                                  > > >
                                  > > > --- Francis Hemsher <francishemsher@c...>
                                  > > > wrote:
                                  > > > > Arvind Wrote:
                                  > > > > --------------------------------
                                  > > > > Thanks for the code. I incorporated it in my
                                  > > > > application but found that it is not blinking
                                  > > and
                                  > > > > moreover the focus does not shift to that
                                  > > textbox.
                                  > > > > So
                                  > > > > I have to keep the mouse on the textbox to enter
                                  > > any
                                  > > > > character or number in it.
                                  > > > >
                                  > > > > Please let me know how best i can acheive it and
                                  > > if
                                  > > > > there is some sample code which does it . It
                                  > > will be
                                  > > > > of great help.
                                  > > > > ----------------------------------
                                  > > > >
                                  > > > > Hi Arvind,
                                  > > > > The method I've developed works like this:
                                  > > > >
                                  > > > > The user points/clicks at any place in the SVG
                                  > > > > drawing. This starts a
                                  > > > > text element with a tspan blinker. Then, via the
                                  > > > > keyboard, the user
                                  > > > > types into a tspan that was automatically placed
                                  > > > > before the blinker.
                                  > > > > As the user types in characters, that tspan
                                  > > responds
                                  > > > > dynamically,
                                  > > > > receiving the characters. The blinker, contained
                                  > > in
                                  > > > > its own tspan,
                                  > > > > meanwhile is moving 'in front' of the expanding
                                  > > > > character-filled
                                  > > > > tspan.
                                  > > > >
                                  > > > > If the user hits the Enter key, a new line is
                                  > > > > started directly below
                                  > > > > the first line (i.e. a new tspan), with the
                                  > > blinker
                                  > > > > sitting at the
                                  > > > > start of that line. To finish the line(s) and
                                  > > remove
                                  > > > > the blinker, the
                                  > > > > user, in my application, would select the Ctrl
                                  > > key.
                                  > > > >
                                  > > > > Now I suppose, if you have a textbox on your svg
                                  > > > > drawing, when the
                                  > > > > user clicks anywhere within the box, you would
                                  > > force
                                  > > > > the x,y
                                  > > > > coordinates for the text, and its tspans, to
                                  > > start
                                  > > > > relative to the
                                  > > > > box's x, y coordinates.
                                  > > > >
                                  > > > > If you want to go in this direction, I'll send
                                  > > this
                                  > > > > example to the
                                  > > > > list; if you don't mind waiting a day or two. I
                                  > > have
                                  > > > > to slice it from
                                  > > > > some files to create an the example.
                                  > > > >
                                  > > > > Let me know,
                                  > > > >
                                  > > > > Francis
                                  > > > >
                                  > > > >
                                  > > > >
                                  > > >
                                  > > >
                                  > > > __________________________________
                                  > > > Do you Yahoo!?
                                  > > > SBC Yahoo! DSL - Now only $29.95 per month!
                                  > > > http://sbc.yahoo.com
                                  > >
                                  > >
                                  >
                                  >
                                  > __________________________________
                                  > Do you Yahoo!?
                                  > SBC Yahoo! DSL - Now only $29.95 per month!
                                  > http://sbc.yahoo.com
                                • Arvind Sareen
                                  Hi Chris, Thanks for the code . I am trying to integrate it with my code and test it. Regards Arvind ... === message truncated ===
                                  Message 16 of 18 , Jul 14, 2003
                                  • 0 Attachment
                                    Hi Chris,

                                    Thanks for the code . I am trying to integrate it with
                                    my code and test it.

                                    Regards

                                    Arvind
                                    --- ctl271 <ctl271@...> wrote:
                                    > The only code I have is a little complicated.
                                    >
                                    > I've posted a snippet which creates two MouseTracker
                                    > objects and adds
                                    > them as EventListeners on the root element. I use
                                    > them to track the
                                    > current x and y coordinates of the mouse relative to
                                    > the current view
                                    > and to handle dragging frames etc... but you could
                                    > declare a
                                    > variable that stores a reference to the object which
                                    > has focus (say
                                    > this.cursor_focus), and set that variable on the
                                    > mousedown event.
                                    >
                                    > Then send your keypressed events to the element
                                    > referenced by
                                    > this.cursor_focus.
                                    >
                                    > Hope this helps, this is as much detail as I can
                                    > provide for now...
                                    > This fragment came from the CGUI source at
                                    > http://homepage.usask.ca/~ctl271/cgui. Looking
                                    > through it may help
                                    > you to understand my meaning...
                                    >
                                    > cheers,
                                    > Chris
                                    >
                                    > -----------
                                    >
                                    > var svgdoc = svgDocument;
                                    > var root = svgDocument.getDocumentElement();
                                    >
                                    > root.addEventListener("mousemove", new
                                    > MouseTracker
                                    > ("mousemove"),false);
                                    > root.addEventListener("mouseup", new
                                    > MouseTracker("mouseup"),
                                    > false);
                                    >
                                    > // create a MouseTracker object
                                    > // It may track mousemove or mousedown events
                                    > function MouseTracker (type) {
                                    > this.cursor_focus;
                                    > if (type == "mousemove") this.handleEvent =
                                    > MouseTracker.mouseMove;
                                    > else if (type == "mousedown") this.handleEvent =
                                    > MouseTracker.mouseDown;
                                    > }
                                    >
                                    > // method called when a mouseMove event is received
                                    > MouseTracker.mouseMove = function (evt) {
                                    > // Get the current x and y coordinate relative to
                                    > the current view
                                    > MouseTracker.x =
                                    > (evt.clientX-CGUI.root.currentTranslate.x)/
                                    > CGUI.root.currentScale;
                                    > MouseTracker.y =
                                    > (evt.clientY-CGUI.root.currentTranslate.y)/
                                    > CGUI.root.currentScale;
                                    > ...
                                    >
                                    > }
                                    >
                                    > // method called when a mousedown event is received
                                    > MouseTracker.mouseDown = function (evt) {
                                    > this.cursor_focus = evt.getTarget();
                                    > }
                                    >
                                    > // Note this is pure pseudo-code... I'm sure it
                                    > won't work as is, but
                                    > // hopefully you see what I'm suggesting.
                                    > MouseTracker.keyPressed (evt) {
                                    > this.cursor_focus.addChar (evt.char);
                                    > }
                                    >
                                    >
                                    > --- In svg-developers@yahoogroups.com, Arvind Sareen
                                    >
                                    > <arvind_sareen@y...> wrote:
                                    > > Hi Chris,
                                    > >
                                    > > Thanks for the information. Do u have sample code
                                    > for
                                    > > the rectangle which can have focus. If so, please
                                    > > provide it.
                                    > >
                                    > > Regards
                                    > >
                                    > > Arvind
                                    > > --- ctl271 <ctl271@y...> wrote:
                                    > > > Hi Arvind,
                                    > > >
                                    > > > IIRC the keyboard event is received by whatever
                                    > SVG
                                    > > > Element has the
                                    > > > mouse focus, and focus follows the mouse. So I
                                    > > > don't think it will
                                    > > > be possible to swtich the focus to the text
                                    > box...
                                    > > > (I'm sure someone
                                    > > > will correct me if I'm wrong).
                                    > > >
                                    > > > Regardless of what event actually has focus, you
                                    > > > might try
                                    > > > registering an event listener on some top level
                                    > SVG
                                    > > > Element (like a
                                    > > > background rectangle) and have it capture the
                                    > key
                                    > > > and send it to the
                                    > > > textbox. Thus it would appear as though the
                                    > textbox
                                    > > > had focus...
                                    > > > Characters could be sent to the textbox until
                                    > the
                                    > > > user clicked
                                    > > > somewhere else in the interface... As the
                                    > > > background is present in
                                    > > > the entire application it wouldn't matter where
                                    > the
                                    > > > mouse was so long
                                    > > > as it was over the application.
                                    > > >
                                    > > > cheers,
                                    > > > Chris
                                    > > >
                                    > > > --- In svg-developers@yahoogroups.com, Arvind
                                    > Sareen
                                    > > >
                                    > > > <arvind_sareen@y...> wrote:
                                    > > > > Hi Francis,
                                    > > > >
                                    > > > > Please do but I don't need x and y
                                    > co-ordinates
                                    > > > > exactly. What i need is that when i click on a
                                    > > > button
                                    > > > > , the cursor should start blinking in the
                                    > textbox
                                    > > > and
                                    > > > > focus should shift to that textbox.
                                    > > > > With the help of the code provided by you , I
                                    > was
                                    > > > able
                                    > > > > to place blinker in the textbox after i
                                    > clicked on
                                    > > > the
                                    > > > > button , but it did not blink and moreover the
                                    > > > focus
                                    > > > > did not shift to that textbox , so that I
                                    > could
                                    > > > enter
                                    > > > > the value in the textbox without keeping mouse
                                    > > > over
                                    > > > > the textbox.
                                    > > > >
                                    > > > > Regards
                                    > > > >
                                    > > > > Arvind
                                    > > > >
                                    > > > > --- Francis Hemsher <francishemsher@c...>
                                    > > > > wrote:
                                    > > > > > Arvind Wrote:
                                    > > > > > --------------------------------
                                    > > > > > Thanks for the code. I incorporated it in my
                                    > > > > > application but found that it is not
                                    > blinking
                                    > > > and
                                    > > > > > moreover the focus does not shift to that
                                    > > > textbox.
                                    > > > > > So
                                    > > > > > I have to keep the mouse on the textbox to
                                    > enter
                                    > > > any
                                    > > > > > character or number in it.
                                    > > > > >
                                    > > > > > Please let me know how best i can acheive it
                                    > and
                                    > > > if
                                    > > > > > there is some sample code which does it . It
                                    > > > will be
                                    > > > > > of great help.
                                    > > > > > ----------------------------------
                                    > > > > >
                                    > > > > > Hi Arvind,
                                    > > > > > The method I've developed works like this:
                                    > > > > >
                                    > > > > > The user points/clicks at any place in the
                                    > SVG
                                    > > > > > drawing. This starts a
                                    > > > > > text element with a tspan blinker. Then, via
                                    > the
                                    > > > > > keyboard, the user
                                    > > > > > types into a tspan that was automatically
                                    > placed
                                    > > > > > before the blinker.
                                    > > > > > As the user types in characters, that tspan
                                    > > > responds
                                    > > > > > dynamically,
                                    > > > > > receiving the characters. The blinker,
                                    > contained
                                    >
                                    === message truncated ===


                                    __________________________________
                                    Do you Yahoo!?
                                    SBC Yahoo! DSL - Now only $29.95 per month!
                                    http://sbc.yahoo.com
                                  • Francis Hemsher
                                    Hi Arvind, Earlier today I uploaded a file to the list that demonstrates typing text directly onto the svg drawing. It uses the blinker code I sent you a few
                                    Message 17 of 18 , Jul 15, 2003
                                    • 0 Attachment
                                      Hi Arvind,

                                      Earlier today I uploaded a file to the list that demonstrates typing
                                      text directly onto the svg drawing. It uses the blinker code I sent
                                      you a few days ago. My focus problem was when the user's cursor
                                      wanders outside the svg while they are using the keyboard. The
                                      keyboard lost focus on the svg. So I added a function that is fired
                                      when new text is being created. It works to keep keyboard focus on
                                      the SVG.

                                      function focusCursor()
                                      {
                                      if(addText!=null)
                                      docSVG.focus
                                      }

                                      onmouseover, onmouseout, onmousemove at the SVG drawing fires the
                                      function. It keeps focus about 95%, loses it sometimes when the
                                      blinker interval calls at same time the cursor is leaving the svg and
                                      heading into the HTML side of the fence.

                                      You can see this example at:
                                      http://groups.yahoo.com/group/svg-
                                      developers/files/xmlSVGrealtimeTEXT.zip

                                      Francis
                                    • Arvind Sareen
                                      Hi Francis Thanks for the code. I am trying to incorporate the code. Thanks for the help. Regards Arvind ... __________________________________ Do you Yahoo!?
                                      Message 18 of 18 , Jul 17, 2003
                                      • 0 Attachment
                                        Hi Francis

                                        Thanks for the code. I am trying to incorporate the
                                        code. Thanks for the help.

                                        Regards

                                        Arvind

                                        --- Francis Hemsher <francishemsher@...>
                                        wrote:
                                        > Hi Arvind,
                                        >
                                        > Earlier today I uploaded a file to the list that
                                        > demonstrates typing
                                        > text directly onto the svg drawing. It uses the
                                        > blinker code I sent
                                        > you a few days ago. My focus problem was when the
                                        > user's cursor
                                        > wanders outside the svg while they are using the
                                        > keyboard. The
                                        > keyboard lost focus on the svg. So I added a
                                        > function that is fired
                                        > when new text is being created. It works to keep
                                        > keyboard focus on
                                        > the SVG.
                                        >
                                        > function focusCursor()
                                        > {
                                        > if(addText!=null)
                                        > docSVG.focus
                                        > }
                                        >
                                        > onmouseover, onmouseout, onmousemove at the SVG
                                        > drawing fires the
                                        > function. It keeps focus about 95%, loses it
                                        > sometimes when the
                                        > blinker interval calls at same time the cursor is
                                        > leaving the svg and
                                        > heading into the HTML side of the fence.
                                        >
                                        > You can see this example at:
                                        > http://groups.yahoo.com/group/svg-
                                        > developers/files/xmlSVGrealtimeTEXT.zip
                                        >
                                        > Francis
                                        >
                                        >
                                        >
                                        >


                                        __________________________________
                                        Do you Yahoo!?
                                        SBC Yahoo! DSL - Now only $29.95 per month!
                                        http://sbc.yahoo.com
                                      Your message has been successfully submitted and would be delivered to recipients shortly.