Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 14:36:10 +0000



Post From: Marketdelta-like background mouse cursor.

[2013-07-03 16:11:53]
marcovth - Posts: 61
Hello ...

A freebee ... it's code for a Marketdelta-like background mouse cursor.
It uses the ACS_TOOL7 button, but you can change that.

Just load the study for the main price GraphRegion, and duplicate the study (load a second+) for other GraphRegions.

Enjoy.


#include "sierrachart.h"
SCDLLName("MousePointer")
SCSFExport scsf_ChangeTimeFrame(SCStudyGraphRef sc){
  SCSubgraphRef background = sc.Subgraph[0];
  if (sc.SetDefaults){
    sc.GraphName = "MousePointer";
    background.Name = "background";
    background.PrimaryColor = RGB(80,80,80);
    background.DrawStyle = DRAWSTYLE_BACKGROUND;
    sc.DrawZeros = false;
    sc.FreeDLL = 0;
    sc.AutoLoop = 1;
    sc.GraphRegion = 0;
    sc.ScaleRangeType = SCALE_INDEPENDENT;
    return;
  }

  int i=sc.Index;
  background[i]=0;
  sc.ReceiveMousePointerEvents= true;
  int& MenuID7 = sc.PersistVars->i1;
  
  if (sc.UpdateStartIndex == 0){
    sc.SetACSToolToolTip(7,"Mouse");
    sc.SetACSToolButtonText(7, "Mouse");
    if (MenuID7 <= 0) MenuID7 = sc.AddACSChartShortcutMenuItem(sc.ChartNumber, "Mouse");
  }

  if (sc.LastCallToFunction){
    sc.RemoveACSChartShortcutMenuItem(sc.ChartNumber, MenuID7);
  }

  if (sc.MenuEventID != 0){
    if (sc.MenuEventID == SC_ACS_TOOL7){
      if (sc.MouseEventType == SC_MOUSE_MOVE){
        for (int m = 0; m < sc.ArraySize-1; m++){
          background[m]=0;
        }
        background[sc.ActiveToolIndex]=sc.Close[sc.ActiveToolIndex];
}
}
}
}