PDA

View Full Version : force focus in a ctlstring



.:Xk-Liber:.
09-16-2004, 07:22 AM
Hi again ! :o
Does someone know how to force the focus in a ctlstring ? :confused:

I have an interface with several things and particularly a ctlstring in order to do a search, and a ctllisbox to show results.

So I do the search, typin' [Enter] key will launch the search and it puts the focus on the first result - the first line indeed - in the ctllistbox, if there is some result of course.
After that I wanna use my keybord typing [TAB] key ( => key value : 9 in reqkeyboard function) to put the focus in the ctlstring in order to do another search (instead of click with the mouse to do it => I just wanna use the keybord too, for more easy manipulations :D ).

Do you know how could I do it? :)

Thanks for answers ;)

faulknermano
09-16-2004, 07:25 AM
will Shift + TAB work?

.:Xk-Liber:.
09-16-2004, 07:32 AM
Aaah an answer :D

faulknermano, The One who already answered my in the past :) (my only "friend" in this forum ? ;) lol, just kidin' for other guys :p )

So, in fact, Shift+Tab doesn't work.
(But shift key value is : 4193 :p ).

I just wanna put the focus out of the ctllisbox ... (I've tried to give a value to the ctlstring when Tab is typed but it doesn't allowed me to have the focus on it).
It's just an option, to do it well ;) but if it's not possible, it's not essential for the plug.

faulknermano
09-16-2004, 07:51 AM
here's a hack: decide which key will determine focus (e.g. TAB key). then reqabort() and call up the panel again. be sure the values that are refreshed are current, of course.




...
reqkeyboard: key
{
if(key == 9) // TAB
{
reqabort();
options(); // assuming you are writing a master class

}

.:Xk-Liber:.
09-16-2004, 08:01 AM
Thanks, it a good idea.

In fact I'm writtin' 2 plugs which do the same thing.
One for the Modeler (so it's a "main") and another for the Layout which is a "generic".

I will try it for the Layout. ;)