Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NewEra 2.2 - Accelerators on child windows

1 view
Skip to first unread message

Ian Lucas

unread,
Oct 23, 1997, 3:00:00 AM10/23/97
to

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 Pimple

unread,
Oct 23, 1997, 3:00:00 AM10/23/97
to

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?

--
//////////////// =======================================================
////////// // Dennis J. Pimple Informix Software, Inc.
////// / /// Principal Consultant 5299 DTC Blvd Suite 740
///// // //// den...@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"

<encoded_portion_removed>
KCkNTEVUIG1lbnVOYW1lID0gdGhpc01JLm4=
--------------73F27B1BA26--


Dennis Pimple

unread,
Oct 24, 1997, 3:00:00 AM10/24/97
to

This is a multi-part message in MIME format.

--------------53B233DA2F38


Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I posted the wrong document in my prior mail. The one posted was for
NewEra 2.0; and there are several features in 3.x that make things
simpler (or maybe I just got smarter). Attached is the real document.

Dennis Pimple wrote:
>
> 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.
>
>

> 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.
> >

//////////////// =======================================================


////////// // Dennis J. Pimple Informix Software, Inc.
////// / /// Principal Consultant 5299 DTC Blvd Suite 740
///// // //// den...@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

--------------53B233DA2F38
Content-Type: application/msword; name="Hot Keys In NewEra 3_0.doc"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="Hot Keys In NewEra 3_0.doc"

<encoded_portion_removed>
/////w==
--------------53B233DA2F38--


David C. Harrison

unread,
Oct 24, 1997, 3:00:00 AM10/24/97
to Ciaran Kelly

Ciaran Kelly wrote:

[snip]

> 1. David C. Harrison and his excellent New Era Windows Toolkit. As far
> as I know, his dchWindow class will post focus events when the window
> actually gets focus from Windows. I have however not tested this
> myself. You can download a trial version of the NEWT library from his
> website www.dch.co.uk

Gosh! Thanks for the advert 8) But, erm, how can I put this? You got the
URL wrong 8(

The NewEra Windows Toolkit is at:

http://www.dchsoftware.co.uk/download.htm

It's still in Beta, but the full version ships November 1.

Cheers,

-- David.
_________________________________________________________
David C. Harrison
Managing Director
DCH Software Ltd.
Tel : +44 (0)1276 450031
Fax : +44 (0)1276 450039
Mobile : 0966 476727
Email : d...@dchsoftware.co.uk
Web: http://www.dchsoftware.co.uk

0 new messages