lanch a script by click-event (or other user-actions)

Back to topics list To post a new topic, please log in or register
avatar
7
sgnifus 2015.10.26 02:14
 
(Please, some patience because I just started in MQL.)
On the chart I put an OBJ_BITMAP_LABEL, which has two states: on and off. When I click the image changes (img1 in img2 or img2 in img1), and so on.
But the key-thing for me is: how to launch a script when I click?
I searched the internet but I found nothing.
Thank Guys

Francis

 

 

avatar
Moderator
3418
GumRai 2015.10.26 04:27 #
 
   if(sparam=="Reset Button" && ObjectGetInteger(0,"Reset Button",OBJPROP_STATE)==true)
     {
      if(ReSet())
      ObjectSetInteger(0,"Reset Button",OBJPROP_STATE,false);
     }

Here's an example of what I do in OnChartEvent (Object Clicked) with a button object.

The function ReSet()  returns a bool when complete and so the button is un-clicked automatically. 

Back to topics list  

To add comments, please log in or register