How to repositionate a button after chart resizing

To add comments, please log in or register
Jose Luis Lominchar
747
Jose Luis Lominchar  

I want to ask you the proper way to get a object (in example a Button) repositionate after changing the size of the chart.

Thanks

paul selvan
626
paul selvan  

did you try ObjectMove() to repositionate after chart event 

void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam){
        //...
        ObjectMove(...      
}
Jose Luis Lominchar
747
Jose Luis Lominchar  

This work for me:


void OnChartEvent(const int id,

                  const long &lparam,

                  const double &dparam,

                  const string &sparam) {

   if (id == CHARTEVENT_CHART_CHANGE) {                 
      int width = ChartGetInteger(0, CHART_WIDTH_IN_PIXELS, 0);
      int nuevaPos = width - 70;
      ObjectSetInteger(0, InpName, OBJPROP_XDISTANCE, nuevaPos);
      ChartRedraw();
   }
     
}
To add comments, please log in or register