How to get value form an edit graphical object. I am only getting the value for Spin edit.

 

How can i get and use the value form edit to do certain task in graphical panel?

I am using this thread.

Documentation on MQL5: Standard Library / Panels and Dialogs
Documentation on MQL5: Standard Library / Panels and Dialogs
  • www.mql5.com
Panels and Dialogs - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Also which event handler should we use for check boxes? i am using sparam but it only works for buttons.
 
Here you can find a lot of working examples incl. the event handling: https://www.mql5.com/en/search#!keyword=panel
 
Carl Schreiber #:
Here you can find a lot of working examples incl. the event handling: https://www.mql5.com/en/search#!keyword=panel

Thnks for your reply but i didnt found any articles on how to get and use data from CEdit Edit button on control panel inputed by the user?

 
Abhishek Yadav:

How can i get and use the value form edit to do certain task in graphical panel?

I am using this thread.

input string StopLoss="";
int OnInit()
  {
//---
   if(!ObjectCreate(ChartID(),"Editable",OBJ_EDIT,0,0,0))
     {
      Print(__FUNCTION__,
            ": failed to create \"Edit\" object! Error code = ",GetLastError());
      return(false);
     }
//--- set object coordinates
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_XDISTANCE,0);
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_YDISTANCE,50);
//--- set object size
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_XSIZE,66);
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_YSIZE,22);
//--- set the text
   ObjectSetString(ChartID(),"Editable",OBJPROP_TEXT,StopLoss);
//--- set text font
   ObjectSetString(ChartID(),"Editable",OBJPROP_FONT,"Trebuchet-MS");
//--- set font size
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_FONTSIZE,12);
//--- set the type of text alignment in the object
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_ALIGN,ALIGN_LEFT);
//--- enable (true) or cancel (false) read-only mode
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_READONLY, false);
//--- set the chart's corner, relative to which object coordinates are defined
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_CORNER,CORNER_LEFT_UPPER);
//--- set text color
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_COLOR,Black);
//--- set background color
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_BGCOLOR,SkyBlue);
//--- set border color
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_BORDER_COLOR,Blue);
//--- display in the foreground (false) or background (true)
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_BACK,false);
//--- enable (true) or disable (false) the mode of moving the label by mouse
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_SELECTABLE,false);
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_SELECTED,false);
//--- hide (true) or display (false) graphical object name in the object list
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_HIDDEN,true);
//--- set the priority for receiving the event of a mouse click in the chart
   ObjectSetInteger(ChartID(),"Editable",OBJPROP_ZORDER,0);
//--- successful execution
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
ObjectDelete(ChartID(),"Editable");
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
string txt=NULL;
   if(ObjectGetString(ChartID(), "Editable",OBJPROP_TEXT,0,txt))
      Alert(txt);
/*
CHANGE THE STOPLOSS AND SEE IF THE ALERT HERE GIVES YOU THE NEW VALUE. 
Hope you can follow now.
*/
  }