Download MetaTrader 5
To add comments, please log in or register
Do you have idle PCs? Connect them to MQL5 Cloud Network and earn money!
Amir Yacoby
1124
Amir Yacoby 2015.06.25 18:31 

Hi,

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

 

Thanks 

JD4
1101
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
1124
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();
   int sx=(ClientAreaWidth()-(INDENT_LEFT+INDENT_RIGHT+BUTTON_WIDTH))/3-CONTROLS_GAP_X;
//--- move and resize the "RadioGroup" element
   m_radio_group.Move(x,y);
   m_radio_group.Width(sx);
//--- move and resize the "CheckGroup" element
   x=ClientAreaLeft()+INDENT_LEFT+sx+CONTROLS_GAP_X;
   m_check_group.Move(x,y);
   m_check_group.Width(sx);
//--- move and resize the "ListView" element
   x=ClientAreaLeft()+ClientAreaWidth()-(sx+INDENT_RIGHT+BUTTON_WIDTH+CONTROLS_GAP_X);
   m_list_view.Move(x,y);
   m_list_view.Width(sx);
//--- succeed
   return(true);
  }

 

 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
1101
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