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 » U++ Library : Other (not classified elsewhere) » SOLVED how to intercept the ENTER key
SOLVED how to intercept the ENTER key [message #18858] Wed, 29 October 2008 11:35 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I have a class (window) AdvancedBrowser in which there are two classes bp1 and bp2. Both bp1 and bp2 contains a column list called slist.
The problem: when I press the ENTER key in the columnlist I would like to distinguish between the two in order to peform the appropriate action.
I've overrided the Key() method below. Unfortunetely after I've clicked in both slist the key pressure return always the slist in bp1.
Is there a way to understand from where the key RETURN is pressed?

Thanks,
Luigi

bool AdvancedBrowser::Key(dword key, int count)
{   if(key == K_ENTER) {
           if (bp1.slist.IsCursor()) Exclamation("key bp1"); 
           else if (bp2.slist.IsCursor()) Exclamation("key p2");
 	   return true; 
    }
    return TopWindow::Key(key, count);
}

[Updated on: Wed, 29 October 2008 19:01]

Report message to a moderator

SOLVED Re: how to intercept the ENTER key [message #18868 is a reply to message #18858] Wed, 29 October 2008 18:53 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
forlano wrote on Wed, 29 October 2008 11:35

Hello,

I have a class (window) AdvancedBrowser in which there are two classes bp1 and bp2. Both bp1 and bp2 contains a column list called slist.
The problem: when I press the ENTER key in the columnlist I would like to distinguish between the two in order to peform the appropriate action.
I've overrided the Key() method below. Unfortunetely after I've clicked in both slist the key pressure return always the slist in bp1.
Is there a way to understand from where the key RETURN is pressed?

Thanks,
Luigi

bool AdvancedBrowser::Key(dword key, int count)
{   if(key == K_ENTER) {
           if (bp1.slist.IsCursor()) Exclamation("key bp1"); 
           else if (bp2.slist.IsCursor()) Exclamation("key p2");
 	   return true; 
    }
    return TopWindow::Key(key, count);
}



Solved.
It was necessary to remove with .KillCursor() the selection of the other columnlist.
Luigi

[Updated on: Wed, 29 October 2008 19:01]

Report message to a moderator

Previous Topic: Missing methods in Win32 version of GLCtrl
Next Topic: X11 DnD cursor issue
Goto Forum:
  


Current Time: Sat Apr 20 05:35:40 CEST 2024

Total time taken to generate the page: 0.04782 seconds