Announcement

Collapse
No announcement yet.

Left Mouse Button Double Click

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Left Mouse Button Double Click

    Hello, I'm sorry for my poor english.
    I am trying to program an EFS code that designs a button on the chart (i.e. a BUY button).
    Well, I need that the code senses the Left Button Mouse double click to start the BUY Routine.
    Please, can you explain to me with an example or a link ? Not the one in the EFS manual. It does not senses the click
    on a button but the x,y position on the chart.
    Thank you.
    Massimo Rizzi

  • #2
    Re: Left Mouse Button Double Click

    Hi maxmax68,

    check out my my fileShare here and the Buttons & Marking Chart folders therein for some examples. In addition, check out the EFS Database here and the help examples folder.

    There are many other references, like the EFS Knowledgebase and EFS Glossary (see the links below in my Signature and above in the Support Link). There are also a number of examples in the forum that can be found using the Forum Search tool.

    Originally posted by maxmax68
    Hello, I'm sorry for my poor english.
    I am trying to program an EFS code that designs a button on the chart (i.e. a BUY button).
    Well, I need that the code senses the Left Button Mouse double click to start the BUY Routine.
    Please, can you explain to me with an example or a link ? Not the one in the EFS manual. It does not senses the click
    on a button but the x,y position on the chart.
    Thank you.
    Massimo Rizzi

    Comment


    • #3
      Thank you Steve, very much!
      What I needed was the instruction:
      if (nButtonPressed == BUTTON_LEFTDBLCLK) etc...
      I was not able to find it in the EFS Glossary and Knowledgebase.

      Comment


      • #4
        Hi maxmax68,

        You are most welcome. There are several different techniques that may used that you should investigate further. For example, check out onLButtonDblClk and the other associated functions in the Glossary (or Knowledgebase).

        Comment


        • #5
          Hi,

          Just to finish up the thread, the attached efs (can be found in the afore mentioned FileShare Links) demonstrates the sequence of how the different onButtonClick event functions are called.

          What I found interesting when I wrote this is when you click a user drawn button that has an associated function associated with it, the sequence in which the built in functions are called in relationship to the user defined functions. This has tripped me up before when I have combined these functions and had some unexpected behavior.

          To show this more clearly, I just added the associated line numbers to the debugPrintln statements. I figured since this was helpful to me, it may be helpful to other forum members as well.

          edit - I added the file to the end of the post, this ensures the line numbers I put in the debugPrintln statements line up correctly

          PHP Code:
           /********************************************
          Provided By : Steve Hare © January 2009                      
          EFS Formula : Mouse Button Click Sequencing                    

          1/20/2009 ==> Originally puplished
          4/14/2009 ==> Added line numbers to debugPrintln Statements

          Notes:
          ->> This efs will show which button functions are called first and their relative sequencing.
          ->> this will output to the formula output pane.
          *************************************************/

          debugClear();
          function 
          preMain() {
           
          setPriceStudy(true);
           
          setStudyTitle("Mouse Button Click Sequencing");
           
          setShowCursorLabel(false);
          }

          var 
          bInit;
          function 
          main() {
           if(!
          bInit){
            
          drawButton();
            
          bInit=true;
           }
          }

          function 
          onLButtonDown(barIndexyValuexPixelyPixel) {
           
          debugPrintln("29: LeftDown: " "barIndex = "+barIndex", "+"yValue = "+yValue", "+"xPixel = "+xPixel", "+"yPixel = "+yPixel);
           
          updateClickInfo(barIndexyValuexPixelyPixel);
          }

          function 
          onLButtonUp(barIndexyValuexPixelyPixel) {
           
          debugPrintln("34: LeftUp: " "barIndex = "+barIndex", "+"yValue = "+yValue", "+"xPixel = "+xPixel", "+"yPixel = "+yPixel);
           
          updateClickInfo(barIndexyValuexPixelyPixel);
          }

          function 
          onRButtonDown(barIndexyValuexPixelyPixel) {
           
          debugPrintln("39: RightDown: " "barIndex = "+barIndex", "+"yValue = "+yValue", "+"xPixel = "+xPixel", "+"yPixel = "+yPixel);
           
          updateClickInfo(barIndexyValuexPixelyPixel);
          }

          function 
          onRButtonUp(barIndexyValuexPixelyPixel) {
           
          debugPrintln("44: RightUp: " "barIndex = "+barIndex", "+"yValue = "+yValue", "+"xPixel = "+xPixel", "+"yPixel = "+yPixel);
           
          updateClickInfo(barIndexyValuexPixelyPixel);
          }

          function 
          onLButtonDblClk(barIndexyValuexPixelyPixel) {
           
          debugPrintln("49: LeftDblClk: " "barIndex = "+barIndex", "+"yValue = "+yValue", "+"xPixel = "+xPixel", "+"yPixel = "+yPixel);
           
          updateDblClickInfo(barIndexyValuexPixelyPixel);
          }

          function 
          onRButtonDblClk(barIndexyValuexPixelyPixel) {
           
          debugPrintln("54: RightDblClk: " "barIndex = "+barIndex", "+"yValue = "+yValue", "+"xPixel = "+xPixel", "+"yPixel = "+yPixel);
           
          updateDblClickInfo(barIndexyValuexPixelyPixel);
          }

          function 
          updateClickInfo(barIndexyValuexPixelyPixel) {
           
          drawTextAbsolute(515"Clicked bar " barIndex " at " yValue.toFixed(2),
           
          Color.whiteColor.navyText.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLDnull14"ClickInfo");
          }

          function 
          updateDblClickInfo(barIndexyValuexPixelyPixel) {
           
          drawTextAbsolute(535"Double Clicked bar " barIndex " at " yValue.toFixed(2), 
           
          Color.whiteColor.navyText.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLDnull14"DblClickInfo");
          }



          //~ draws the clickable button
          function drawButton(){
           var 
          flg Text.RELATIVETOLEFT|Text.RELATIVETOTOPText.FRAME Text.ONTOP;//required
           
          drawTextPixel(480100"buttonClickTest" +" @URL=EFS:myButtonClicked"Color.whiteColor.redflg,"Comic Sans MS"20, -5);//required
          }


          function 
          myButtonClicked(nButtonPressed ){//section required 
           
          debugPrintln("78: myButtonClicked, nButtonPressed ==>> "+nButtonPressed);

          Attached Files

          Comment

          Working...
          X