Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 20:40:24 +0000



Post From: is it possible to hide/show all studies with a single mouse-click?

[2023-10-29 22:45:12]
Tony - Posts: 519
This is a very goofy solution, I tested on my chart, it works:

Press the "q" key will hide all the studies on the chart, and
press the "q" key again will unhide all the studies.
so on and so forth, just like a light switch.

You will just have to load this tiny custom study to all of
your charts

Mouse click is also doable, since we have access to values
of X and Y coordinates in a chart with ACSIL, but I think key
board is much faster.
  
if you don't like letter "q", go to this web site to find out the
value of what ever key/letter you like to use, i.e. 27 for "Esc"


#include "sierrachart.h"

SCDLLName("KeyToHide")

SCSFExport scsf_KeyToHide(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    sc.GraphName = "Key To Hide";
    sc.GraphRegion = 0;
    sc.AutoLoop = 1;
    sc.UpdateAlways = 1;
    sc.ReceiveCharacterEvents = 1;    
    return;
  }
  

  if (sc.CharacterEventCode==113) "q"uick hide
    sc.HideStudy = !sc.HideStudy;
    
  if (sc.HideStudy) { // chage to a bigger value if you have 100+ studies
    for (int MyStudyIDs {0}; MyStudyIDs<100; MyStudyIDs++)
      sc.SetStudyVisibilityState(MyStudyIDs, 0);
  }
  else {
        for (int MyStudyIDs {0}; MyStudyIDs<100; MyStudyIDs++)
      sc.SetStudyVisibilityState(MyStudyIDs, 1);
  }
  
  
}

Unfortunately, there is no ACSIL function or variable to hide/show drawings,
unless for drawings drawn by sc.UseTool(), you can pretty much do whatever
you want.
Date Time Of Last Edit: 2023-10-29 23:19:56