Welcome! Log In Create A New Profile

Advanced

TAB and Shift-TAB on Window with TAB-control

Posted by Jimbo 
Jimbo
TAB and Shift-TAB on Window with TAB-control
October 22, 2008 09:25AM
Hi all,

I have an interesting WinDev 12 problem and maybe, someone knows a solution.

Test project: [www.syspredl.at]

On a window with a TAB-control I can TAB through all controls in correct sequence.

A - B - C - D - E - F - G -> A - B ... like a merry-go-round. Just fine. With a few lines of code in control G to go back to A

However, the shift-TAB key comb. should be able to go back in the exactly same way:

G - F - E - D - C - B - A -> G - F .. no way, a shift-TAB from F always defaults to A and does not go to E as intended.

Kind regards,
Guenter



Edited 3 time(s). Last edit at 10/22/2008 09:27AM by Jimbo.
Al
Re: TAB and Shift-TAB on Window with TAB-control
October 22, 2008 11:04AM
Hello Guenter

I got enough of it to work to find the answer ( I think)

Normal tracing will not work so you will need to put some STOP and info() messages to see exactly what is happening, but the solution is to put in tests for previousfield and nextfield() before running the tests for keypress() in the exit codes

When you trace back from F and activate tab1[2] the exit code for EditD is being run before editF is activated. To stop that you will need to test in the exit of EditD for previous field not being EDITF and so on. Have fun.

Exit of EditD
IF Upper(PreviousField()) <> "EDITF"
IF KeyPressed(kpShift) AND KeyPressed(VK_TAcool smiley THEN
Tab1 = 1
ReturnToCapture(Tab1[1].EditC)
END
END


I have struck this problem with exit codes running before and in some windows I have a "FirstRun" variable to stop the exit code in some controls from running as the window activates.

Regards
Al



Edited 2 time(s). Last edit at 10/22/2008 11:07AM by Al.
Jimbo
Re: TAB and Shift-TAB on Window with TAB-control
October 22, 2008 11:40AM
Thank you Al !

I think, it's a quite unexpected behaviour. ReturnToCapture(..) / SetFocus(..) / ScreenFirst(..) just work fine on a simple form or between windows - but not at all on a tab-control. Here, as we can see, ReturnToCapture(EditE) is ignored and focus is given to control A - instead of control E.

Since everything else is a bit too much coding for ~30 windows of that type with up to 15 tabs on each tab-control, in this project I settled for

IF keypressed(VK_TAcool smiley and keypressed(kpshift) then
  Tab1 = 2 
END

this would show Tab1[2] and give focus to its first control = D

Not exactly what I wanted, but good enough.

Kind regards,
Guenter

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: