Discussion of article "Custom Graphical Controls. Part 3. Forms" - page 2

 
Urain:

I did everything right.

Given the possibilities of ME is quite convenient, Japanese minimalism in the era of total kitsch, everything is there, nothing superfluous.

Those who want to loop through objects can implement a postfix shell where they can write whatever they want.


Nikolay, do you think that in MQL5 this looks neat and according to the possibilities?


         void OnHideEvent(){
            // 7. Calling the Hide() method for all form controls
            m_hm.Hide(); 
            m_vm1.Hide(); 
            m_vm2.Hide(); 
            m_vm3.Hide();             
            m_fr1.Hide();
            m_fr2.Hide();               
            m_ib.Hide();
            m_sib.Hide();
            m_dib.Hide();
            m_cb.Hide();  
            m_chb.Hide();  
            m_rg1.Hide();  
            m_rg2.Hide();  
            m_lms1.Hide();
            m_lms2.Hide();
            m_but.Hide();
         }

        void OnWindowChangeEvent(int aSubWindow){
            // 8. Вызов метода SetSubWindow() для всех элементов управления формы. Номер подокна находится в аргументе aSubWindow.
            m_hm.SetSubWindow(aSubWindow);
            m_vm1.SetSubWindow(aSubWindow);
            m_vm2.SetSubWindow(aSubWindow);
            m_vm3.SetSubWindow(aSubWindow); 
            m_fr1.SetSubWindow(aSubWindow);
            m_fr2.SetSubWindow(aSubWindow);            
            m_ib.SetSubWindow(aSubWindow);
            m_sib.SetSubWindow(aSubWindow);
            m_dib.SetSubWindow(aSubWindow);
            m_cb.SetSubWindow(aSubWindow);
            m_chb.SetSubWindow(aSubWindow);
            m_rg1.SetSubWindow(aSubWindow);
            m_rg2.SetSubWindow(aSubWindow);
            m_lms1.SetSubWindow(aSubWindow);
            m_lms2.SetSubWindow(aSubWindow);
            m_but.SetSubWindow(aSubWindow);
            
         }

 
sergeev:

Nikolay, do you think that this looks neat and according to the possibilities in MQL5?

No, the Japanese are against it. It should be exactly three lines.
 
sergeev:

Nikolay, do you think that in MQL5 this looks neat and according to the possibilities?

If you don't have enough time to type, use a template.

You should not be too fond of realising all the possibilities, we are writing codes, not creating pictures out of letters.

I don't see any problems.

 
it's just an opinion. I'm more of a code painting kind of guy. Aesthete. :)
 
sergeev:

it's just an opinion. I'm more of a code painting kind of guy. Aesthete. :)

In fact, Integer gives API with a level of abstraction a bit lower than you wanted.

Well, refine it for yourself, put it in the codebase and maybe your API will be more popular.

 
papaklass:

You shouldn't have backed down.

because there's also professional ethics. Integer's a pro and doesn't need to be taught.

But if the doctor says morgue, then morgue it is.

 
Urain:

In fact, Integer gives API with a level of abstraction a little lower than you wanted.

Well, refine it to your liking, put it in the codebase and maybe your API will be more popular.

A library in which every class will have the same set of methods, half of which will be invalid, is unlikely to become popular.

 
papaklass:

You shouldn't have backed down. You are absolutely right. A person who positions himself as a cool, professional programmer is obliged to write correct and beautiful code. Beginners will have something to learn from.

Mr sergeev, having fallen into some fundamental and positional misconception, suggests something like combining variables like bool, int, double, string, etc. in one array.

But you, Mr papaklass, as a true troll, hear a noise but do not know where it is.

Документация по MQL5: Основы языка / Типы данных / Целые типы / Тип bool
Документация по MQL5: Основы языка / Типы данных / Целые типы / Тип bool
  • www.mql5.com
Основы языка / Типы данных / Целые типы / Тип bool - Документация по MQL5
 
Integer:

Mr sergeev, ... , proposes something like combining in one array variables like bool, int, double, string, etc.

...

This is possible in principle, but

such universalisation leads to overconsumption of resources in the final implementation. Graphics is heavy on resources as it is.

And for this price you buy only a more abstracted class, by the way, it is not a fact that it will be more understandable in use.

But it is a fact that the more complex the implementation is, the more buggy it is.

 
Urain:

And for this price you buy only a more abstracted class, by the way, it is not fact that it will be more understandable in use.

Imho, you are wrong. Dmitry is wrong too, Alex is wrong too :) . (Everyone is wrong! )))) )

Again, imho, Dmitry chose the best option in terms of labour to write/use.

Writing something simpler to use (not to understand!) would be much more difficult.

This website uses cookies. Learn more about our Cookies Policy.