Good article for beginners. However, in more complex interfaces this approach is no longer acceptable. The first thing that catches your eye:
for(int i=0; i<BUTTON_COLUMNS; i++) { for(int j=0; j<BUTTON_ROWS; j++) { ... ... ...I.e. a rigid table structure is sewn into the algorithm and this construction is found in almost all functions. Now let's imagine that the subwindow contains several graphic elements that are not related to the table in any way. For them we will have to describe their own positioning model, and this is not good. The positioning model should be one and universal, i.e. in this case, the "table" layout should be a special case of this model.
Good article for beginners. However, in more complex interfaces this approach is no longer acceptable. The first thing that catches your eye:
I.e. a rigid table structure is sewn into the algorithm and this construction is found in almost all functions. Now let's imagine that the subwindow contains several graphic elements that are not related to the table in any way. For them we will have to describe their own positioning model, and this is not good. The positioning model should be one and universal, i.e. in this case, the "table" layout should be a special case of this model.Yes, you are right. I'll try to come up with something more original next time. )
In this case, to get away from the special case, it is enough to use a one-dimensional array and one loop.
I don't understand why you should use OBJ_EDIT.
It would have been much more useful to "revive" the standard buttons from the library (so that they would also glow under the mouse).
I.e. it seems to be a useful article, but I don't understand why such a way was chosen.
ps: I envy the author's fruitfulness ;)
...
I'm used to using OBJ_EDIT already, as it is displayed during visualisation in the tester.
In this case, you could use any object for the example. It's a creative process, after all. )
- www.mql5.com
I don't understand why you should use OBJ_EDIT.
It would be much more useful to "revive" the standard buttons from the library (so that they also glow under the mouse).
I.e. it seems to be a useful article, but I don't understand why such a way was chosen.
ps: I envy the author's fruitfulness ;)
It would be much more useful to "animate" standard buttons from the library (so that they would also glow under the mouse).
- www.mql5.com
And buttons aren't really buttons at all).
And I wonder, is there any professional developer who would use the standard library of graphic elements in his products?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article MQL5 Cookbook: Indicator Subwindow Controls - Buttons has been published:
In this article, we will consider an example of developing a user interface with button controls. To convey the idea of interactivity to the user, buttons will change their colors when the cursor hovers over them. With the cursor being over a button, the button color will be slightly darkened, getting significantly darker when the button is clicked. Furthermore, we will add tooltips to each button, thus creating an intuitive interface.
The article will also cover some events: mouse move event, state of the left mouse button, left-click on an object and the event of modifying chart properties. We are going to create a button panel that will take up the entire space of the indicator subwindow. For illustrative purposes, the buttons will be arranged in three rows, with four buttons in each row.
Author: Anatoli Kazharski