A task with buttons ! - page 6

 
Dmitry Fedoseev:

Four pages trying to ask one question:

Where does it all go? In the ontic by tick function, or in the ontimer, or where? Where do you callObjectGetInteger() to know ifa button is pressed?

What difference does it make ? It doesn't matter in any ...
 
Dmitry Fedoseev:
Once you reach 50, there will be no pushback, because this pushing has already been recorded in the array.
You have pressed the "hare" button, you press the "wolf" button in your array of 2 pressed buttons ... How do you release the "hare" button?
 
Vladimir Pastushak:
You have pressed "hare" button, you press "wolf" button in your array of 2 pressed buttons ... How do you release the "hare" button ???

Find out in the saved state array the state of all buttons. Unclick the one that was pressed before and save the state of the one that is pressed now. ;)

Example:

MQL5 Recipes - Controls in Indicator Subwindow - Buttons >>>

 
Vladimir Pastushak:
You have the "hare" button pressed, you press the "wolf" button in your array of 2 pressed buttons ... How do you push the "hare" button?
One way ObectSetInteger()
 
Dmitry Fedoseev:
One way obectSetInteger()

Again, the code reaches the "hare" button, applies obectSetInteger() and pushes the other buttons, including the "wolf" button that was pressed last.

I tend to think that to understand the essence of the problem it is necessary to write the code and see what exactly the problem is. Otherwise, not understanding the essence of the problem will not help.

This thread was created in the hope to get an answer from those who have already encountered a similar problem...

 
Anatoli Kazharski:

Find out in the saved state array the state of all buttons. Unclick the one that was pressed before and save the state of the one that is pressed now. ;)

Example:

MQL5 Recipes - Controls in Indicator Subwindow - Buttons >>>

In this article it is defined with OnChartEvent, it won't work in the tester... I need solution without using OnChartEvent
 
Vladimir Pastushak:

Again, the code reaches the "hare" button, applies obectSetInteger() and pushes the other buttons, including the "wolf" button which was pressed last.

I tend to think that to understand the essence of the problem it is necessary to write code and see what exactly the problem is. Otherwise, not understanding the essence of the problem will not help.

The topic was created in the hope of getting an answer from those who have already encountered a similar problem...

Why face the problem if the problem is solved easily and without problems in one or two or three?
 
It's probably time to attach the test code. This will make experimenting easier.
 
Vladimir Pastushak:
In this article the definition goes with OnChartEvent in the tester won't work that way... You need a solution without using OnChartEvent
You just answered yourself that it doesn't matter where it all runs. Actually it really doesn't make any difference.
 
Vladimir Pastushak:
In this article the definition goes with OnChartEvent in the tester won't work that way... Need a solution without using OnChartEvent
It doesn't matter where. The basic principle is the same. You can see an example of saving button states there.