SpinEdit looks like being disabled.

 

Hello everyone.

I am trying to create a SpinEdit in my EA code. Although it is shown on the chart but seems like it is disabled and the value cannot be changed.

Thanks for your help.

#include <Controls\SpinEdit.mqh>

CSpinEdit m_spin_edit;
  
int OnInit(void)
  {
   m_spin_edit.Create(ChartID(),"SpinEdit",0,180,100,270,140);
   m_spin_edit.MinValue(10);
   m_spin_edit.MaxValue(100);
   m_spin_edit.Value(50);   
   return(INIT_SUCCEEDED);
  }  

 

Maybe too old now, but here is the solution for everyone else, having this issue:

The SpinEdit Box is "disabled", because nothing listening for it events. You must check for events in the OnChartEvent() funktion.

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
{
        m_spin_edit.OnEvent(id,lparam,dparam,sparam);           //<-- this is the important part!
}

now you should be able to click it