Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Action on exit from an EditString field
Action on exit from an EditString field [message #45107] Wed, 02 September 2015 10:30 Go to next message
Giorgio is currently offline  Giorgio
Messages: 194
Registered: August 2015
Experienced Member
Hi there,
I need to execute an action when I exit from an EditString field. I found in the forum something, but - you know - I am a noob and need some further explanation. So, I wrote this message http://www.ultimatepp.org/forums/index.php?t=msg&th=4559 &goto=45067&#msg_45067 on a thread related to my question. To date I had no response, maybe because is a really dumb question. Could someone give me a hint?
Regards,
Giorgio
Re: Action on exit from an EditString field [message #45108 is a reply to message #45107] Wed, 02 September 2015 15:46 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 299
Registered: November 2008
Experienced Member
Hello, Giorgio.

Giorgio wrote on Wed, 02 September 2015 08:30
I need to execute an action when I exit from an EditString field.

According to the mentioned topic, you could override LostFocus virtual function or just use proposed C++ template(s), e.g.:
// Create an object of EditString with WithLostFocus template
WithLostFocus<EditString> text;
// Assign some function to WhenLostFocus callback
text.WhenLostFocus = callback1(PromptOK, "LostFocus");

The more complete example follows:
Toggle example

[Updated on: Wed, 02 September 2015 16:01]

Report message to a moderator

Re: Action on exit from an EditString field [message #45112 is a reply to message #45108] Thu, 03 September 2015 12:21 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 194
Registered: August 2015
Experienced Member
Hi Ghost,
thank you for your reply. Your example was indeed detailed and I got it working. I also got to extend a window on my own application. The only problem is that I can reproduce the example when I build the window layout by myself, but I do not know how to add it to a window designed with the designer. I tried to add it using the "user class" function, but it throws an error when compiling. I tried also to use the instruction Add but I do not see the control in the window.
Regards,
Giorgio

--- Edit ---
Well, I did it, it was not so difficult Embarassed

[Updated on: Thu, 03 September 2015 12:52]

Report message to a moderator

Previous Topic: Defining composite primary key
Next Topic: Encrypting password in .ini file with aes
Goto Forum:
  


Current Time: Thu May 28 00:25:51 CEST 2020

Total time taken to generate the page: 0.01870 seconds