delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/29/03:35:09

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ALLEGRO: Problems with keyboard shortcut to edit box
Date: Sat, 21 Jun 1997 19:11:56 +0100
Organization: None
Distribution: world
Message-ID: <3UtOxIAslBrzEwaQ@talula.demon.co.uk>
References: <866802647 DOT 0513395 DOT 0 AT acecoin DOT demon DOT co DOT uk>
<33AACBC2 DOT 168F AT seanet DOT com>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 38
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Alan M. Doerhoefer writes:
>Nick wrote:
>> when you press TAB (or an arrow key). Ideally, TAB would make move_focus
>> offer the focus to the next object defined in the dialog.

That's certainly one possibility: it would give the programmer a lot
more flexibilty in the TAB focus ordering, and I suspect most people
already have their dialogs layed out in a sensible top-to-bottom format.
It's an easy change to make: does anyone have any objections to me doing
this? The only disadvantage I can see is that programs without nice
sorted object lists will suffer from erratic tab key movement, while the
current system works ok, even if not 100% perfectly, on almost any set
of objects...

>I found that originally, before I made my change to the move_focus
>routine, the tab key and the left and right arrow keys would indeed jump
>to random objects in my dialog. But at least for me, in this instance,

Really? They ought not to do that :-) The test is done by comparing the
position (actually the centre) of each object, and finding the most
suitable one for the desired direction of movement (biased to find a
good compromise between distant objects in the exact direction and
closer ones on a slight diagonal). This seems to work for most dialogs,
but obviously there will be some cases where it breaks down: given a
strange jumbled up set of locations, it's not always easy to figure out
which one is to the 'right' or 'left' of another!

>defined in my dialog. I think it depends on the order you put them in
>your dialog array definition. 

Nope, the order of the objects is totally irrelevant. Arrow key movement
is done using the screen positions of the objcts, not their placement
within the dialog array. 


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019