Announcement

Collapse
No announcement yet.

Command button

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

  • Command button

    1) Any way to implement a command button? I know there are mouse events for up/down/click, but there is not much control with that...(?) 2) Maybe place a circle on the graph and any way to know when you have ckicked inside the circle? 3) In the indicator pane, do the mouse events work there? Thanks. Ken

  • #2
    Hi Ken,

    Yes there are several. I'll reference you to my File Share, there are several examples in the button folder. When you click on the chart (regardless of there being a button) these functions are called (if contained in your efs)
    PHP Code:
    function onLButtonDown(barIndex,yValue,x,y){
    }
    function 
    onLButtonUp(barIndex,yValue,x,y){
    }
    function 
    onRButtonDown(barIndex,yValue,x,y){
    }
    function 
    onRButtonUp(barIndex,yValue,x,y){
    }
    function 
    onLButtonDblClk(barIndex,yValue,x,y){
    }
    function 
    onRButtonDblClk(barIndex,yValue,x,y){ // not functional

    To get a button to work, you will have to draw the button with a string component added to the draw command. For example,
    PHP Code:
    drawTextPixelxxyynButtonTitle +" @URL=EFS:functionName"forcolorbackcolorflg,"Comic Sans MS"20, -5);//required 
    Specifically, the " @URL=EFS:functionName" part of the drawTextPixel command is the pointer to the function that will be called when you click the button. As I indicated above, the respective button event function will be called as well if it exists in your efs.

    Peruse through the FileShare folder I referred you to, I believe it will help. There are other links in my signature block below, you may find those useful as well.

    Comment


    • #3
      What kind of command button are you looking for. Buttons and mouse clicks can be set to execute almost any event, process, series or other EFS feature.

      I've developed many complex efs scripts. Some for equity allocation across numerous charts, some for master control programs, others for watching multiple intervals of the same symbol and passing control across numerous charts for auto-trading.

      What is it exactly you want to accomplish? Maybe I can help you sort it all out.
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        Initially to define the start and end of the data series input to the indicator. I could use parms for this, but wanted it to be faster so I could experiment with different settings. So I would have a buttton to "Clear", "Start" to expect next click to be the start, "End", "Compute", etc. Later on want to draw arcs from those points - will have to review my trig functions.

        Comment


        • #5
          sure, that is no problem. What you have to do is setup a process with the buttons, then store the clicked locations, re-initiate your indicators or arcs based on the information you derive from the clicks, then draw whatever you want. This is easy.

          If you need help beyond what I'm stating here, just let me know.
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Thanks Brad and Steve.
            Is this documented anywhere?
            ===========================================
            Specifically, the " @URL=EFS:functionName" part of the drawTextPixel command is the pointer to the function that will be called when you click the button.
            ===========================================
            I downloaded your samples of buttons and trendline-build-on-double-clicks - that is very helpful. I'm impressed - you have effectively turned a text box into a drop-down list!

            Comment


            • #7
              Hi Ken,

              Good to hear you liked the examples, I uploaded these to help answer questions on the subject, and appreciate your comments. As you have ascertained from the efs's, drop down lists and other handy functionality is readily achievable.

              I looked for a description of this (" @URL=EFS:functionName") functionality and was able to find a number of posts. This was the search term I used *URL=EFS*, try this (or variants like *draw* AND *URL* AND *EFS*) and start looking at the oldest threads first. You will see a number of different questions and answers on the subject. FWIW, the forum information constitutes the majority of what I know on the subject.

              I was unable to find formal documentation of the functionality. There may be some reference material other than that in the forum, but I couldn't locate it on this day.


              Originally posted by kenz987
              Thanks Brad and Steve.
              Is this documented anywhere?
              ===========================================
              Specifically, the " @URL=EFS:functionName" part of the drawTextPixel command is the pointer to the function that will be called when you click the button.
              ===========================================
              I downloaded your samples of buttons and trendline-build-on-double-clicks - that is very helpful. I'm impressed - you have effectively turned a text box into a drop-down list!

              Comment

              Working...
              X