Download MetaTrader 5

Resizing a dialog

To add comments, please log in or register
Do you know that MQL5 is an object-oriented language?
Amir Yacoby
Amir Yacoby 2015.06.25 18:31 


Anybody knows why the examples of indicator or expert given for instance in <Indicators/Examples/SimplePanel> show a panel but can not resize it?



JD4 2015.06.27 05:53  
Probably because the examples are there for proof of concept, and do not have a lot of functionality they might be capable of if more work was put into them.  More capabilities means more coding, and they are probably trying to make the most productive use of their time by covering more topics than going into larger detail level with one thing.
Amir Yacoby
Amir Yacoby 2015.06.27 14:57  

 You're probably wrong because the code has the OnResize method:

//| Handler of resizing                                              |
bool CPlanPanelDialog::OnResize(void)
//--- call method of parent class
   if(!CAppDialog::OnResize()) return(false);
//--- coordinates
   int x=ClientAreaLeft()+INDENT_LEFT;
   int y=m_radio_group.Top();
//--- move and resize the "RadioGroup" element
//--- move and resize the "CheckGroup" element
//--- move and resize the "ListView" element
//--- succeed


 The problem is that this method does not get executed when you try to change the panel size with the mouse. 
Is it supposed to get executed when the mouse change the panel size as with any other windows system window?

 It doesnt seem that mt4 creates an event when you change the panel size, or I miss something.  

JD4 2015.06.27 17:48  
I was working on reading and responding to (some) posts at the time, and didn't take a look at the code for the example you said.  I do not have experience with MQL4, so I cannot say for sure, but I do know in Java, they have what are called event handlers for different things, such as window resizing, mouse events, and so on.  It has been so long since my Java class, so I do not remember exactly how to code it, but there is an event handler named OnMouseEvent or MouseEvent or something like that.  How that works is the listener is a part of the code within the program, similar in concept to the OnResize method you are talking about, and is supposed to get called automatically when the event (or events) that part of code is supposed to be listening for and when it sees the event happen, it is supposed to automatically (like you are saying) execute the required code.  How to fix that within MQL, IDK, sorry to say.  Working on trying to learn MQL right now, and hoping my Java knowledge will help me out, as both languages are based on C++.
To add comments, please log in or register