🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2619

Re: moving the input focus

#2619
From: Chris Marriott
Date: Fri, 08 Jan 1993 19:15
40 lines
2332 bytes
In article <1851@bdrc.bdrc.bd.com> jcl@bdrc.bd.com writes:

>Hi there!
>
>I just finished rewriting Petzold's COLORS2 program in Programming Windows
>3.1 in the style of his HEXCALC example in the same book.  Basically,
>my main window is a dialog box with three scrollbar controls and a
>static area upon which I paint the current color as defined by the
>scrollbar positions.  Now in his book, Petzold states that by including
>the WS_TABSTOP windows style for your dialog controls, Windows automatically
>will handle switching the input focus upon receiving a tab or shift-tab
>from the keyboard.  Well, it doesn't work.  Tab and shift-tab are ignored
>in my program.  If I take out the WS_TABSTOP style, then the keyboard
>interface for the scrollbars disappears (e.g. PgUp and PgDown don't work),
>so the WS_TABSTOP is doing something.
>
>How do I fix this problem?  In HEXCALC, Petzold takes about keeping the
>buttons from getting the input focus. My scrollbars can get the focus
>when clicked upon, they just can't give it up without a mouse click on
>another scrollbar.
>
>Any help would be appreciated.
>
>john
>-- 
>John C. Lusth, Becton Dickinson Research Center, RTP, NC, USA  jcl@bdrc.bd.com
>

Have you got an "IsDlgMessage" line in your main message loop?  This is the
function which gives you the tab-moving-between-controls behaviour.

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------
 
Technical Details
Message-ID: <726520538snz@chrism.demon.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
References: <1851@bdrc.bdrc.bd.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
Subject: Re: moving the input focus 
Distribution: world
References: <1851@bdrc.bdrc.bd.com>
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Lines: 40
Date: Fri, 8 Jan 1993 19:15:38 +0000
Message-ID: <726520538snz@chrism.demon.co.uk>
Sender: usenet@demon.co.uk