void CAppDialog::ChartEvent(constint id,constlong &lparam,constdouble &dparam,conststring &sparam)
{
int mouse_x=(int)lparam;
int mouse_y=(int)dparam-m_subwin_Yoff;
//--- separate mouse events from othersswitch(id)
{
caseCHARTEVENT_CHART_CHANGE:
//--- assumed that the CHARTEVENT_CHART_CHANGE event can handle only the application dialogbreak;
caseCHARTEVENT_OBJECT_CLICK:
//--- we won't handle the CHARTEVENT_OBJECT_CLICK event, as we are working with the CHARTEVENT_MOUSE_MOVE eventsreturn;
caseCHARTEVENT_CUSTOM+ON_MOUSE_FOCUS_SET:
//--- the CHARTEVENT_CUSTOM + ON_MOUSE_FOCUS_SET eventif(CheckPointer(m_focused_wnd)!=POINTER_INVALID)
{
//--- if there is an element with focus, try to take its focus awayif(!m_focused_wnd.MouseFocusKill(lparam))
return;
}
m_focused_wnd=ControlFind(lparam);
return;
caseCHARTEVENT_CUSTOM+ON_BRING_TO_TOP:
m_top_wnd=ControlFind(lparam);
return;
caseCHARTEVENT_MOUSE_MOVE:
//--- the CHARTEVENT_MOUSE_MOVE eventif(CheckPointer(m_top_wnd)!=POINTER_INVALID)
{
//--- if a priority element already exists, pass control to itif(m_top_wnd.OnMouseEvent(mouse_x,mouse_y,(int)StringToInteger(sparam)))
{
//--- event handled
m_chart.Redraw();
return;
}
}
if(OnMouseEvent(mouse_x,mouse_y,(int)StringToInteger(sparam)))
m_chart.Redraw();
return;
default:
//--- call event processing and redraw chart if event handledif(OnEvent(id,lparam,dparam,sparam))
m_chart.Redraw();
return;
}
//--- if event was not handled, try to handle the CHARTEVENT_CHART_CHANGE eventif(id==CHARTEVENT_CHART_CHANGE)
{
//--- if subwindow number is not 0, and dialog subwindow has changed its number, then restartif(m_subwin!=0 && m_subwin!=ChartWindowFind())
{
long fiction=1;
OnAnotherApplicationClose(fiction,dparam,sparam);
}
//--- if subwindow height is less that dialog height, minimize application window (always)if(m_chart.HeightInPixels(m_subwin)<Height()+CONTROLS_BORDER_WIDTH)
{
m_button_minmax.Pressed(true);
Minimize();
m_chart.Redraw();
}
//--- if chart width is less that dialog width, and subwindow number is not 0, try to modify dialog widthif(m_chart.WidthInPixels()!=Width() && m_subwin!=0)
{
Width(m_chart.WidthInPixels());
m_chart.Redraw();
}
//--- get subwindow offset
SubwinOff();
return;
}
}
can i block it from my EA without removing it from the Dialog.mqh file?
my current solution is to block CHARTEVENT_CHART_CHANGE on OnChartEvent function, but i'm interested to see if there is any other
solutions
Price chart drawing. If false, drawing any price chart attributes is disabled and all chart border indents are eliminated, including time and price scales, quick navigation bar, Calendar event labels, trade labels, indicator and bar tooltips, indicator subwindows, volume histograms, etc. Scrolling the chart horizontally using the left mouse...
i'm including Dialog.mqh on my EA, but when my panel height exceed chart height it gets minimized.
it happens because of this in Dialog.mqh :
can i block it from my EA without removing it from the Dialog.mqh file?
my current solution is to block CHARTEVENT_CHART_CHANGE on OnChartEvent function, but i'm interested to see if there is any other solutions