NewEra 2.2 - Accelerators on child windows
Posted in 1997
Topics: General Discussion
Has anyone encountered the problem (found a fix) of using accelerators on menu buttons on child windows ? It appears that the accelerator actually gets operated on in the parent window (assuming the same CTL-? and ALT-? mappings exist in both). In fact, if the parent menu option is off and the child is on - no action at all occurs when the child accelerator is invoked. Similarly, if the child menu button is off and the parent is on, the child program may crash (or other strange results) if the accelerator is invoked on the child. We have used the fudge of using the getWindow().getCtrlWithFocuas() function in the menu handler to assess which window the actual accelerator is coming from before performing the relevant function on the window. We also mimic the availability of the menu options in the parent when control moves to the child window to ensure that all options are available when required. We then switch control back to the parent options when a winFocusIn() event is detected on the parent. Unfortunately, this winFocusIn is only detected when a 'control' (of which a menu button is not one) is given focus on the window. This means that although clicking on the window background appears to give focus to the window, not until a control (or the TAB button) is accessed does focus actually move there. Has anyone encountered this or have any suggestions on a better approach ? Ian Lucas