marcocir 2 Posted May 6, 2021 (edited) Hi all. I wonder if there is a way to get a request of input in Python, showing as a VCL InputQuery box in Delphi but *without* the ugly standard title and text "Query from Python" and "Enter Text"..? Or an alternative path to route a request of input from python to Delphi? Any help is appreciated, thanks. Marco Edited May 6, 2021 by marcocir Share this post Link to post
FranzB 0 Posted May 6, 2021 are you asking to modify the input dialog or are yos asking to get data from Delphi to Python or the opposite way ? Share this post Link to post
marcocir 2 Posted May 6, 2021 Yes Franz, I'm asking on how to modify the generic text (title and caption of the edit) in the VCL input dialog that Dephi puts in front of my users when Pithon code executes a INPUT command. It should be so much better to not have that completely generic dialog, to use (it's seems strange to me the actual behavior of P4D in that functionality) Thanks Share this post Link to post
pyscripter 689 Posted May 6, 2021 function TPythonGUIInputOutput.ReceiveData : AnsiString; Var S : string; begin if Assigned( FOnReceiveData ) then Result := inherited ReceiveData else begin InputQuery( 'Query from Python', 'Enter text', S); Result := AnsiString(S); end; end; You can handle the OnReceiveData event and respond in whatever way you like. Share this post Link to post
David Heffernan 2345 Posted May 8, 2021 On 5/7/2021 at 12:59 AM, pyscripter said: function TPythonGUIInputOutput.ReceiveData : AnsiString; Var S : string; begin if Assigned( FOnReceiveData ) then Result := inherited ReceiveData else begin InputQuery( 'Query from Python', 'Enter text', S); Result := AnsiString(S); end; end; You can handle the OnReceiveData event and respond in whatever way you like. How would you handle non ANSI input? Share this post Link to post
pyscripter 689 Posted May 8, 2021 1 hour ago, David Heffernan said: How would you handle non ANSI input? There is a corresponding event OnReceiveUniData. Which is used is based on IO.UnicodeIO, which by default is true. 1 Share this post Link to post
marcocir 2 Posted May 13, 2021 On 5/7/2021 at 1:59 AM, pyscripter said: function TPythonGUIInputOutput.ReceiveData : AnsiString; Var S : string; begin if Assigned( FOnReceiveData ) then Result := inherited ReceiveData else begin InputQuery( 'Query from Python', 'Enter text', S); Result := AnsiString(S); end; end; You can handle the OnReceiveData event and respond in whatever way you like. Perfect, thank you! (and also thanks for P4D, finally I'm learning another language 😉 ) Share this post Link to post