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 » U++ Library support » LineEdit, EditFields, DocEdit » EditField and the Enter Key[SOLVED]
EditField and the Enter Key[SOLVED] [message #3406] Tue, 23 May 2006 22:53 Go to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
How would I be able to handle the Return/Enter Key when someone presses it while typing in an EditField?




Justin

[Updated on: Fri, 26 May 2006 01:59]

Report message to a moderator

Re: EditField and the Enter Key [message #3412 is a reply to message #3406] Wed, 24 May 2006 11:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Justin wrote on Tue, 23 May 2006 16:53

How would I be able to handle the Return/Enter Key when someone presses it while typing in an EditField?




Justin



Well, EditField does not accept K_ENTER, so it gets passed up. Means you can handle it by overriding your top-level Ctrl's Key.

Mirek
Re: EditField and the Enter Key [message #3423 is a reply to message #3412] Wed, 24 May 2006 18:10 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
How do I do that? Embarassed Rolling Eyes
Re: EditField and the Enter Key [message #3427 is a reply to message #3423] Wed, 24 May 2006 18:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
class MyApp : public WithMyAppLayout<TopWindow> {
   virtual bool Key(dword key, int count);
.......
};

bool MyApp::Key(dword key, int count)
{
    if(key == K_ENTER) {
           ......
           return true; // key accepted
    }
    return TopWindow::Key(key, count);
}
Re: EditField and the Enter Key [message #3469 is a reply to message #3427] Fri, 26 May 2006 01:59 Go to previous message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Worked great. I had to check and see which control had focus for this to work properly, but everything worked out in the end. thanks




Justin
Previous Topic: Hide Passwords in EditField[SOLVED]
Next Topic: How to print the selected text in a LineEdit
Goto Forum:
  


Current Time: Wed Apr 17 01:29:16 CEST 2024

Total time taken to generate the page: 0.01295 seconds