OnSetZOrder missing instructions in WndObj.mqh

 

Greetings,


I did some testing with .ZOrder method in AppDialog, and I found out that no matter where I put the Button.ZOrder call, it does not set the ZOrder of the object actually, so I looked that part up in WndObj.mqh, and i saw that the

virtual bool      OnSetZOrder(void)                { return(true); }

is actually empty. I've added the missing part like this:

virtual bool      OnSetZOrder(void)                { ObjectSetInteger(m_chart_id, m_name, OBJPROP_ZORDER, m_zorder); return(true); }

so when I call the method it sets the ZOrder properly, but this might not be the way it should have been solved. I wanted to add an override specifier to my actual code without tampering the base code, but with this:

virtual bool OnSetZOrder() override
{
   ObjectSetInteger(m_chart_id, m_name, OBJPROP_ZORDER, m_zorder);
   return(true);
}

the compiler threwn a 'method is declared with override specifier but does not override any base class method' and a 'm_zorder - undeclared identifier' error at me.

How could I override the method properly?