Re: NewEra 2.2 - Accelerators on child windows
Posted in 1997
This is a multi-part message in MIME format. --------------73F27B1BA26 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This is expected behavior, and if you reference "accelerator" in the NewEra Help you'll see it's published. I doubt if it will change; if it does a bunch of my code breaks. Attached is a white paper I wrote up on how to make window-aware accelerators. If anyone wants it in non-MS Word form, let me know. I have a windows class "wnStandard", and a menu class "mnHotKey" that help implement the procedure outlined in the paper. I'll share on request (no warranty, natch), but please read the doc first to see if you really want/need it. Be also aware of a bug in NewEra 3.10TC1: Function-key accelerators of any combination (F#, Alt+F#, Ctrl+F#, etc) simply don't work. I have a patch request in place, but no dates as yet (discovered at the start of the week; ref bug #82644) Windy in here today, isn't it? Ian Lucas wrote: > > 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 -- //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-843-6408 and do not necessarily //////////////// http://www.informix.com reflect those of my employer --------------73F27B1BA26 Content-Type: application/msword; name="hotkeys.doc" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="hotkeys.doc" 0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAgAAAAAA AAAAEAAADgAAAAEAAAD+////AAAAAAMAAAD///////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////9SAG8AbwB0ACAARQBuAHQAcgB5AAAAAAAAAAAA dwEAAJMCAAAIBwAAlgAAAMcBAACNAgAABwAAAAAAAAD//wAAFgAFAf//////////AQAAAAAJ AgAAAAAAwAAAAAAAAEYAAAAAoMM8tiwjvAFABz+ONyO8AQUAAADAAwAACAcAAFcAbwByAGQA RABvAGMAdQBtAGUAbgB0AAAARwAA0OYZZAJHACD3RgAAAEAA2GbVwiiA9780S1iBAAAAAH2S 978aAAIBAgAAAAMAAAD/////2IBBAAAAAACU9UYAlPVGAAAAQADYZtXCKID3vzRLWIEAAAAA FgAAANVGAAAAAAAAAQBDAG8AbQBwAE8AYgBqAAAA+dnQ+rsBAAAAAPHpYgABAAAAtOhiAN9V LlDx6WIAtOdiAAEAAAAAAAAAtOdiABIAAgH///////////////8AAAAA8eliACs+C1C052IA 8eliAAAAAAAAAAAAAAAAAAAAAAAAAAAAagAAACgAAAAFAFMAdQBtAG0AYQByAHkASQBuAGYA bwByAG0AYQB0AGkAbwBuAAAAIEZpbGUsIEM6XFByb2dyYW0gRmlsZXNcKAACAf////8EAAAA /////3Jvc29mdCBTaGFyZWQHAAAyAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAD4AQAAAMAAABAA AAD9///////////////+////BAAAAP//////////CQAAAP7///////////////////////// /v/////////+//////////////////////////////8XAAAAGAAAABkAAAAaAAAAGwAAABwA AAAdAAAAHgAAAB8AAAAgAAAAJAAAAP///////////////yUAAAAyAAAA//////////////// ////////////////////////////////////////////////MwAAADQAAAA1AAAANgAAADcA AAA4AAAAOQAAADoAAAA7AAAAPAAAAD0AAAA+AAAAPwAAAEAAAABBAAAAQgAAAEMAAABEAAAA TAAAAP////////////////////////////////////9NAAAACAAAAP////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// ////////////////////////////////UgBvAG8AdAAgAEUAbgB0AHIAeQAAAAAAAAAAAHcB AACTAgAACAcAAJYAAADHAQAAjQIAAAcAAAAAAAAA//8AABYABQH//////////wEAAAAACQIA AAAAAMAAAAAAAABGAAAAAKDDPLYsI7wBYKhGjjcjvAEFAAAAwAMAAAgHAABXAG8AcgBkAEQA bwBjAHUAbQBlAG4AdAAAAEcAANDmGWQCRwAg90YAAABAANhm1cIogPe/NEtYgQAAAAB9kve/ GgACAQIAAAADAAAA/////9iAQQAAAAAAlPVGAJT1RgAAAEAA2GbVwiiA9780S1iBAAAAAEYA AAD5fwAAAAAAAAEAQwBvAG0AcABPAGIAagAAAPnZ0Pq7AQAAAADx6WIAAQAAALToYgDfVS5Q 8eliALTnYgABAAAAAAAAALTnYgASAAIB////////////////AAAAAPHpYgArPgtQtOdiAPHp YgAAAAAAAAAAAAAAAAAAAAAAAAAAAGoAAAAoAAAABQBTAHUAbQBtAGEAcgB5AEkAbgBmAG8A cgBtAGEAdABpAG8AbgAAACBGaWxlLCBDOlxQcm9ncmFtIEZpbGVzXCgAAgH/////BAAAAP// //9yb3NvZnQgU2hhcmVkBwAAMgAAAAAAAAAAAAAAAAAAAAAAAAACAAAA+AEAAADAAAD///// /////xAAAAD9/////v///wQAAAAHAAAACgAAAP//////////CwAAAAwAAAANAAAADwAAAP7/ //8RAAAA/v///xIAAAATAAAAFAAAABUAAAAhAAAA//////////////////////////////// //////////////////////////8iAAAAIwAAACYAAAD//////////ycAAAAoAAAAKQAAACoA AAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAARQAAAP////////////////////////// //////////////////////////////////////////////////////////////////////// ///+////RwAAAEgAAABJAAAASgAAAEsAAABOAAAA//////////9PAAAAUAAAAFEAAABSAAAA UwAAAFQAAABVAAAAVgAAAFcAAABYAAAAWQAAAFoAAABbAAAAXAAAAF0AAABeAAAAXwAAAGAA AABhAAAAYgAAAGMAAABkAAAAZQAAAGYAAABnAAAAaAAAAGkAAABqAAAAawAAAAYAAAD///// //////////////////////////////////////////////////////////////////////// /////////////////////////////x4AAAAeAAAATWljcm9zb2Z0IFdvcmQgZm9yIFdpbmRv d3MgOTUAAABAAAAAAIDR8AgAAABAAAAAAAAAAAAAAABAAAAAAJ4WtiwjvAFAAAAAAKzSdzcj vAEDAAAABwAAAAMAAAC2CAAAAwAAAKkxAAADAAAAAAAAAAAAAAAAAAAA/v8AAAQAAgAAAAAA AAAAAAAAAAAAAAAAAQAAAALVzdWcLhsQk5cIACss+a4wAAAA4AAAAAgAAAABAAAASAAAAA8A AABQAAAABAAAAGwAAAAFAAAAdAAAAAYAAAB8AAAACwAAAIQAAAAQAAAAjAAAAAwAAACUAAAA AgAAAOQEAAAeAAAAEgAAAEluZm9ybWl4IFNvZnR3YXJlAEMAAwAAAACeAAADAAAAaQAAAAMA AAAZAAAACwAAAAAAAAALAAAAAAAAAAwQAAACAAAAHgAAADQAAABNYWtpbmcgYWNjZWxlcmF0 b3Iga2V5cyB3aW5kb3ctc3BlY2lmaWMgaW4gTmV3RXJhIDIAAwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA