Specify tab order for controls

Hi, I have a largish GUI with many controls on 8 tabs. Currently the tab order, https://doc.qt.io/archives/qt-4.8/designer-tab-order.html, of the controls seems to be determined by the order of creation in the recreation macro. Is that correct? Is it the only solution to reshuffle the controls in the recreation macro? Or will Igor break that on recreation the macro the next time?
Yes, the creation order is what determines tab order. And no, the recreation macro won't change the order- as controls are created, we make a list of controls in creation order. That same list is walked in order to generate the recreation macro. John Weeks WaveMetrics, Inc. support@wavemetrics.com

Bump.

How do I activate a notebook field that is embedded as a sub-panel? I have the equivalent of these two controls one after the other.

SetVariable svtitle,value=title, title=" ",proc=setvariables
NewNotebook/F=1/N=notefield/HOST=#/OPTS=(2)

I want to capture a return or tab key in the setvariables procedure and have either of those keystrokes jump to and activate the note field for immediate input.

Hmmm... subwindows aren't controls, so they aren't in the tab-key focus advance. In Igor 8 there is a new event sent to a structure-based control action proc, event code = -2, control lost keyboard focus. You might be able to monitor that event for the SetVariable and use SetActiveSubwindow to focus the notebook. But once the focus is in the notebook, I think that's where it will stay unless you click outside of it.

Event code -3 is control gained focus, but that won't help here :)

Ha! Got it!

I do this when the control that is activated is the title field.

strswitch(sva.ctrlName)
    // title - tab or return moves to and activates note field             
    case "tb0_title":
        SetActiveSubwindow #notefield
        break

OK. This is noted as "... mainly for use by recreation macros." But it works!

OK. This is noted as "... mainly for use by recreation macros." But it works!

Yep. So you found one of the cases that we consider probably rare where you actually need to force the issue. Our perspective on what situations are rare often don't reflect real user's experience, since we don't actually do science with Igor :)

Well, it is an edge case. I also have a panel hook function. Between my setvariable control, the SetActiveSubwindow command, and the PanelHook function, something is capturing the return or tab key leaving the setvariable control. Once the cursor skips from the title field to the subpanel window and activates the notebook window, all keyboard input dies. I have to type a TAB key to re-activate the input to the subwindow notebook. I've tried placing debug statements in key locations to see eventCodes and ... it just dies. No eventCode report from the variable or panel hook function until AFTER the TAB key.

I will try to set up a MWE to demonstrate the problem.

Here is a minimum working example.

* type "MakePanel()" on the command line

* type something in the title field and type a RETURN key
--> moves to note field but no keystroke works in the note field

* return to title field, clear it, type something, and type a TAB key
--> moves to note field and keystrokes work to enter text in note field

The note field will report when a return or an escape key are typed. The escape key moves back to the setvariable title field.

The hook is on the entire panel. I tried setting it only on the notefield. That did not work. Embedded notebooks cannot take hooks?

In reply to by jjweimer

I couldn't reproduce this. Text entry in the notebook subwindow following return key worked.
System Information:
IGORVERS:8.03
BUILD:32517

OS:Macintosh OS X
OSVERSION:10.13.6
LOCALE:US
IGORFILEVERSION:8.03B01

Window hooks cannot be attached to subwindows. But the winName member of the WMWinHookStruct should have the affected subwindow's name in it. DisplayHelpTopic "Window Hooks and Subwindows".

I should have noted, I am using Igor Pro 7. I have to wonder that something is happening when a return key to the setvariable field triggers both an eventCode for the return key and an eventCode for the "field is updated". The "field is updated" is handled, and the return key is lost (or visa-versa)? The tab key only sends the "field is updated" event.

I will look again at using the winName member as an improved approach to handle how actions are parsed with the panel hook.