Errors, bugs, questions - page 3007

 
A question has arisen: how do I know when a graph is highlighted and visible?
 
Artyom Trishkin:
I have a question: how do I know if the graph is highlighted and visible?

Is

  • CHART_IS_MAXIMIZED - graph window expanded
  • CHART_IS_MINIMIZED - graph window minimized

not suitable?

 
Artyom Trishkin:
A question has arisen: how do I know when a graph is highlighted and visible?

This?

void OnTick(void)
{
  // if(ChartGetInteger(0, CHART_BRING_TO_TOP)) return; // Окно не активно - выход

   if(ChartGetInteger(0, CHART_BRING_TO_TOP)) {
      // Выполняется код, если окно активно
      Print("Active: ",Period());
   }
}
 
Vitaly Muzichenko:

This?

I've tried it before. Always returned false. I.e., as I understood it - it's a function we give a "pulse" to the chart to make it active, and then again false returns the property. But I'll double-check again.

 
Alexey Viktorov:

Is

  • CHART_IS_MAXIMIZED - graph window expanded
  • CHART_IS_MINIMIZED - graph window minimized

doesn't it fit?

Collapsed/expanded. Both flags can be false. In case both are not collapsed and unfolded, but in windowed mode. And, yes, that's not it. I need to know programmatically which graph I'm looking at and working with at the moment.

 
Artyom Trishkin:

Collapsed/uncollapsed. Both flags can be false. In case both are not collapsed and unfolded, but in windowed mode. And, yes, that's not it. I need to know programmatically which graph I'm looking at and working with at the moment.

And to check it?

/********************Script program start function*******************/
void OnStart()
 {
  long currChart = 0;
  int i = 0, limit = 100;
  while(i < limit)
   {
    currChart = ChartNext(currChart);
    if(currChart < 0)
      break;
      Print(i, " ", ChartSymbol(currChart)," ", EnumToString(ChartPeriod(currChart)), " ID = ", currChart, " ", (bool)ChartGetInteger(currChart, CHART_IS_MAXIMIZED));
    i++;
   }
 }/******************************************************************/

Result


 
Vitaly Muzichenko:

This?

Showing a graph on top of all other graphs

bool w/o

This is a write-only property.

 
Alexey Viktorov:

Show chart on top of all other charts

bool w/o

This is a write-only property.

No words :)

Alexey Viktorov:

And to check?

Result


 
Vitaly Muzichenko:

No words :)

Well, that's an "ouch." I trusted the documentation so much that I didn't bother to check it.

 
Alexey Viktorov:

And to check?

Result


Make graphs in window mode

Reason: