Dialog takes always close event
I've checked the event
ON_EVENT(ON_CLICK,m_button_close,OnClickButtonClose)
defined in Include\Controls\Dialog.mqh but it seems to work correctly: it closes the Dialog when the bitmap "close" receives a click.
I think it should be:
Then the code example must be correct as follows:
void CGui::OnClickButton1() { if (!dialog.IsVisible()) { dialog.Visible(true); } else { CreateDialog(); CreateButton2(); } }
Can someone confirm (that is a bug in the Library)?
This issue is very similar to this one https://www.mql5.com/en/forum/376645, except that there the Dialog(s) are created at the beginning and immediately set to Hide(), while I would like to create the Dialog only on request.
Is that the only approach or am I missing something in my code?
Apparently, the only correct way is to create the Dialog and all its objects and then control their visibility.
Hi,
the minimal example shown here is an AppDialog with a Button which should create a separate Dialog with a second Button.
The problem is that clicking on any area of the Dialog (except the caption) set the Dialog to be Visible(false).
I've checked the event
ON_EVENT(ON_CLICK,m_button_close,OnClickButtonClose)
defined in Include\Controls\Dialog.mqh but it seems to work correctly: it closes the Dialog when the bitmap "close" receives a click.
This issue is very similar to this one https://www.mql5.com/en/forum/376645, except that there the Dialog(s) are created at the beginning and immediately set to Hide(), while I would like to create the Dialog only on request.
Is that the only approach or am I missing something in my code?