🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9120

Re: Windows spacebar hotkey

#9120
From: Andrue Cope [TeamB]
Date: Tue, 03 Aug 2004 12:49
69 lines
3581 bytes
Chris Croughton wrote:

> Hmm, it won't let me give the focus to an invisible component, it pops
> up an error box telling me so.

Sounds like you are ignorning my earlier advice and setting "Visible"
to false. Don't. Leave "Visible" set to true and put the component
underneath another one (Right click, Control.., Send to back). It'll
still be visible as far as Windows is concerned but the user won't be
able to see it because it's covered up.

> Personally, I'd rather have a progress bar which is accurate
> (it's amazing how many aren't accurate).

You're right that most are pretty bad and it's another pet hate of
mine. A progress bar should give the user an idea of how long before
they can give the next command. Most of the time this is the point at
which the process stops but it doesn't have to be. Just so long as it
gives me a good idea when to put my book down and reach for the
keyboard :)

> If I have a
> button (and the one I clicked to start the operation will do as well
> as any), force everything else to give it the focus, and use the
> OnKeyDown event of that

Yeah but then we're back to losing [Space] activation on a button plus
users can see the focus border around the button and might wonder
what's going on.

> TEdit boxes seem to interpret keys themselves, though, to do their own
> editing.  Or can that be stopped?

/That's/ why I've set the form's Keypreview to true (knew there was a
reason <g>). By setting that it gets first dibs on keypresses..but only
grabs them when the TEdit has the focus:

void __fastcall TfrmViewer::FormKeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
  if( MyVariables.MyViewerFocusedF )
  {
    bool updateF=ViewerSupport_FormKeyDown( Key, Shift,
                                            MyVariables,
                                            sbBlockView );

    if( updateF )
    {
      setNewBlockPosition( MyVariables.MyCurrentBlockNumber );

      Key='\0';
    }
  }
}

If the viewer doesn't have the focus the function does nothing and the
keypress gets handed on to someone else to deal with.

Ah..it's all coming back to me now :)

> I know a number of sysadmins who
> don't understand how I get SCSI to work without sacrificing a goat
> <g>...

Or Windows networking, or RS232 connections :)
-- 
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <410f89ed@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4107b926$1@newsgroups.borland.com> <4107c851@newsgroups.borland.com> <slrncgg2ei.f6p.chris@ccserver.keris.net> <4108b254$1@newsgroups.borland.com> <slrncghsd7.7ug.chris@ccserver.keris.net> <4108fd87$1@newsgroups.borland.com> <slrncgkkn7.9lp.chris@ccserver.keris.net> <410a6de9@newsgroups.borland.com> <slrncguooa.nl5.chris@ccserver.keris.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,af0a7a309a9df709
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrue Cope [TeamB]" <no.spam@spammy.com>
Subject: Re: Windows spacebar hotkey
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4107b926$1@newsgroups.borland.com> <4107c851@newsgroups.borland.com> <slrncgg2ei.f6p.chris@ccserver.keris.net> <4108b254$1@newsgroups.borland.com> <slrncghsd7.7ug.chris@ccserver.keris.net> <4108fd87$1@newsgroups.borland.com> <slrncgkkn7.9lp.chris@ccserver.keris.net> <410a6de9@newsgroups.borland.com> <slrncguooa.nl5.chris@ccserver.keris.net>
User-Agent: XanaNews/1.16.3.1
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <410f89ed@newsgroups.borland.com>
Date: 3 Aug 2004 05:49:49 -0700
X-Trace: newsgroups.borland.com 1091537389 217.207.223.34 (3 Aug 2004 05:49:49 -0700)
Lines: 69
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail