4 Replies Latest reply on Jun 26, 2009 7:48 AM by rtalton

    Click Event

    Louder6Pounder

      Hi,

       

      Probably a simple question, how do you define the click duration?  Got an image i'm panning on mouse down but i want to zoom in on a click.  Do i have to set a timer or is there a simple way which i have over looked?

       

      Cheers

        • 1. Re: Click Event
          John Hall Level 4

          Could you be a little more specific? If you're successfully dragging an image, you obviously have a sense of how to program with events. Are you running into a specific issue that won't work if you  click the image before or after dragging?

          • 2. Re: Click Event
            rtalton Level 4

            Click events do not have a duration. I think you may be wanting to differentiate between a mouse down (for dragging) and a  click (mouse down/mouse up). If so, listen for the mouse up event, and then apply some logic to do your zoom there, if the user is not panning.

            • 3. Re: Click Event
              Louder6Pounder Level 1

              Ok, i'm using the mouse down event to set a bool to true.  The program checks this value and if its true it pans the image when the user moves the mouse.  on mouse up i set the bool to false.  but now i want to make it so as well as that if the user does a a quick single click i.e not holding the mouse button down, it zooms in.  I have added an event on mouse click, but this fires no matter how long the mouse is held down.  So if a user clicks and holds the mouse to pan when they let go it zooms in. 

               

              I wondered if there is a simple way of doing this or would i have to user a timer or something to measure how long they have held the mouse down? ....actually i've just thought, i should check where the mouse is moved, if its moved sinze mouse up then don't zoom.  Ok i think i have answered this myself.  Cheers anyway. 

              • 4. Re: Click Event
                rtalton Level 4

                The mouse up & mouse click should not be firing until you release the mouse button.

                What are you clicking on, an Image Control?