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
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 :)
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.
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.
June 26, 2018 at 01:20 pm - Permalink
June 26, 2018 at 02:29 pm - Permalink
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.
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.
November 13, 2018 at 03:15 pm - Permalink
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 :)
November 13, 2018 at 05:15 pm - Permalink
Ha! Got it!
I do this when the control that is activated is the title field.
// 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!
November 13, 2018 at 06:19 pm - Permalink
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 :)
November 14, 2018 at 09:05 am - Permalink
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.
November 14, 2018 at 05:32 pm - Permalink
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?
November 15, 2018 at 08:22 pm - Permalink
In reply to Here is a minimum working… 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
November 16, 2018 at 08:30 am - Permalink
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".
November 16, 2018 at 09:53 am - Permalink
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.
November 16, 2018 at 12:29 pm - Permalink