TOPIC: EditorControl and Tabs, Tab order in general !
#1849
EditorControl and Tabs, Tab order in general ! 7 Months ago
I want one program to work basically only with keyboard and for that I use "arrow keys" and "return key" to move from one field to another, the problem comes when I have an EditorControl because there is no way to go out of it with the keyboard, actually it accepts the "tab key" so even with tab isn't possible to go out of it.

I did a small modification to EditorControl:

Code:


KEYDOWN(wParam)
{
if wParam is VK.F6
{
...
else if wParam is VK.TAB and not KeyPressed?(VK.CONTROL)
.FocusNext()
else
return 'callsuper'
return 0
}



And in Control I have:

Code:


moveFocus(previous)
{
hwnd = first = GetNextDlgTabItem(.Window.Hwnd, .Hwnd, previous)
while .readonly(hwnd)
{
hwnd = GetNextDlgTabItem(.Window.Hwnd, .Hwnd, previous)
if hwnd is first
break
}
SetFocus(hwnd)
}

FocusNext()
{
.moveFocus(false)
}
FocusPrev()
{
.moveFocus(true)
}



Now I can go out of an EditorControl with "tab key", of course now the editor control doesn't accept "tabs" as before (we can still use CTRL-TAB to have tabs on it), but the problem is that the code above doesn't eat the "tab key" and every time we pass through EditorControl a new "TAB" is added to it.

Has anyone done anything related to this and can share it ?

Another issue is with "tab order" ther is a way to alter the tab order to be different from layout order ?

Well I googled a bit an added this function to Control:

Code:


TabOrderAfter(afterThis)
{
SetWindowPos(.Hwnd, afterThis.Hwnd, 0, 0, 0, 0,
SWP.NOMOVE | SWP.NOSIZE | SWP.NOACTIVATE)
}

 
 
Last Edit: 2010/01/21 19:19 By mingodad.
 
#1857
Re:EditorControl and Tabs, Tab order in general ! 7 Months ago
You should be able to override GetDialogCode (I think that's the right name) - if you search for that, you'll see how some of the other controls use it. And you can look at the MSDN documentation.

We have not done much with overriding the tab order. If you use Vert and Horz they will affect the tab order (because they affect the order of creation of the controls which is what currently determines the tab order)
 
 
andrew