Announcement

Collapse
No announcement yet.

control-mouse click

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

  • control-mouse click

    Currently I am using onLButtonDown to select two bars on the chart from which to perform calculations, then onLButtonDblClk to reset the selection. However, if I want to scroll back or forward on the chart - done by holding down the left mouse button and dragging - this is interpretted by my efs code as a bar selection.

    Is there anyway to use a combination of keys like control-mouse in my efs code to make the bar selections ?

    Thanks !
    Jennifer

  • #2
    Hello Jennifer,

    There are two solution to this problem. One is to use the Ctrl+Left Arrow and Ctrl+Right Arrow keys to scroll the chart.

    From the EFS side, there isn't any Ctrl+Mouse click options. What I would recommend is to add a button to your chart using drawTextRelative() that switches a global Boolean flag to true (or false) when clicked. This flag would then be used in a conditional statement that looks for a value of true before allowing you bar selection code from executing. When you've completed your bar selections, you would then click this button to turn the flag to false, which will then allow you to scroll the chart normally with the mouse.

    To attach the button to an EFS function add "@URL=EFS:functionName" to the end of the text string for the text parameter of drawTextRelative().

    The code for the switching function might look like below.

    PHP Code:
    var bSwitch false;

    function 
    mySwitch() {
        
    // bSwitch is a global var
        
    if (bSwitch == false) {
            
    // turn bar selection on
            
    bSwitch true;
        } else if (
    bSwitch == true) {
            
    // turn bar selection off
            
    bSwitch false;
        }
        return;

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X