Not changing value in CSpinEdit

 

Hi. Good time. I created a spin button with the following command, but the value does not change.

Also, I don't want to use it inside the panel. Can anyone help?

spin

#include <Controls\SpinEdit.mqh>

CSpinEdit clSpinEdit_NB; 

int OnInit()

  {

   clSpinEdit_NB.Create(0,"SpinEdit_NB",0,10,190,(10+60),(190+30));
   clSpinEdit_NB.MinValue(1);

   clSpinEdit_NB.MaxValue(20);
   clSpinEdit_NB.Value(10);  

  return(INIT_SUCCEEDED);

  }

void OnChartEvent(const int id,

                  const long &lparam,

                  const double &dparam,

                  const string &sparam)

{clSpinEdit_NB.OnEvent(id,lparam,dparam,sparam);          

}  
 
Check the example in the folder Indicators/Examples/Panels/SimplePanel
 
Samuel Manoel De Souza #:
Check the example in the folder Indicators/Examples/Panels/SimplePanel

I want the same as the photo I posted. They are in panel form. Do you know where the problem is?

 
Thierry Olivier #:

I want the same as the photo I posted. They are in panel form. Do you know where the problem is?

These controls are designed to work with CAppDialog, not alone.

 
Samuel Manoel De Souza #:

These controls are designed to work with CAppDialog, not alone.

CCheckBox works correctly. Are you sure there is no way?

 
Thierry Olivier #:

CCheckBox works correctly. Are you sure there is no way?

No it does not work correctly. It may visually check and uncheck, the method 'bool Checked(void)' may return correct value, but it doesn't mean that works correctly.

You can try, set the ids to the control after it is created, in OnInit, and maybe it will work, but the correct is use CAppDialog.

int OnInit()

  {

   clSpinEdit_NB.Create(0,"SpinEdit_NB",0,10,190,(10+60),(190+30));
   clSpinEdit_NB.MinValue(1);

   clSpinEdit_NB.MaxValue(20);
   clSpinEdit_NB.Value(10);  

   clSpinEdit_NB.Id(0);

  return(INIT_SUCCEEDED);

  }