mql5 ObjectGetString(): buggy or not? (video attached) OBJ_EDIT / OBJPROP_TEXT
Where is the indicator file?
You forgot to poll an element when you stopped editing:
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if(id==CHARTEVENT_OBJECT_CLICK && sparam=="Input_Text") { ObjectGetString(0,"Input_Text",OBJPROP_TEXT,0,string_value); Print("2 String Value : ",string_value); } else if(id==CHARTEVENT_OBJECT_ENDEDIT) { ObjectGetString(0,"Input_Text",OBJPROP_TEXT,0,string_value); Print("The text in the Edit field of the object with name ",sparam," has been changed"); Print("3 String Value : ",string_value); } }
Fernando Carreiro #:
The code that the OP has posted and attached as a file "_input_box.mq5" is the the indicator in question. Is that what you are asking?
Thanks very much Vladimir!!!!
I love you :-)))))))))
Hi everyone!
For some reason, if I input a string in a box on the Chart using "ObjectCreate(chart_ID,name,OBJ_EDIT,sub_window,0,0))"and retrieve it in a global variable named "string_value" with "ObjectGetString(0, "Input_Text",OBJPROP_TEXT,0,string_value)"
it only saves it with a delay, while on the contrary, I would like my input to be taken into account as soon as
the "Enter" key on the keyboard is pressed, after the input.
I have spent hours trying to understand why, I have not found a solution and God knows how
I am persistent. I have searched the forums and Google with no luck.
If you can help me, I would be grateful... This is a bug, isn't it?
I have attached a video (in the zip file) - latest MetaEditor 5 build 3270).