Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

keeping tabs in a canvas (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: one window or two?
Next thread: Transparent Icons in ToolbarItems?


keeping tabs in a canvas   -   Joe Cabrera
  Re: keeping tabs in a canvas   -   Steve Garman
  Re: keeping tabs in a canvas   -   Joe Cabrera
   Re: keeping tabs in a canvas   -   Steve Garman
    Re: keeping tabs in a canvas   -   Terry Ford

keeping tabs in a canvas
Date: 05.02.06 01:34 (Sat, 4 Feb 2006 19:34:41 -0500)
From: Joe Cabrera
I have a canvas that I need to accept tabs. It's a crossword grid
where you can use the tab key to go to the next box in the grid. If I
tab from within my canvas, other items in that window (like my push
buttons) get selected instead. If I'm in my grid, I want to stay in
there.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: keeping tabs in a canvas
Date: 05.02.06 01:47 (Sun, 5 Feb 2006 00:47:22 +0000)
From: Steve Garman
In a message regarding keeping tabs in a canvas dated Sat, 4 Feb 2006
19:34:41 -0500, Joe Cabrera said that ...

> I have a canvas that I need to accept tabs. It's a crossword grid
> where you can use the tab key to go to the next box in the grid. If I
> tab from within my canvas, other items in that window (like my push
> buttons) get selected instead. If I'm in my grid, I want to stay in
> there.

Check the "Accept Tabs" property of the Canvas so the KeyDown event will
fire.

Return True from the KeyDown Event so the focus doesn't move to the next
control. Something like

if asc (key) = 9 Then
speak "next column"
Return True
end if

Re: keeping tabs in a canvas
Date: 05.02.06 20:43 (Sun, 5 Feb 2006 14:43:30 -0500)
From: Joe Cabrera
Steve Garman said:

> > I have a canvas that I need to accept tabs. It's a crossword grid
>> where you can use the tab key to go to the next box in the grid. If I >
>> tab from within my canvas, other items in that window (like my push >
>> buttons) get selected instead. If I'm in my grid, I want to stay in >
>> there.
>
>Check the "Accept Tabs" property of the Canvas so the KeyDown event >will
>fire.
>
>Return True from the KeyDown Event so the focus doesn't move to the >next
>control. Something like
>
> if asc (key) = 9 Then
> speak "next column"
> Return True
> end if

Awesome, thanks! I assume this works even if the code checks for a
tab plus a shift key press at the same time?

BTW, I've been using "key = Chr (9)" for my tab press check. Is that
a kosher way to do it in my code, rather that your way above? I also
do similarly when checking for space key tabs [Chr (32)] or an arrow
key press [Keyboard.AsyncKeyDown (126) for the up arrow].

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: keeping tabs in a canvas
Date: 05.02.06 21:17 (Sun, 5 Feb 2006 20:17:21 +0000)
From: Steve Garman
In a message regarding Re: keeping tabs in a canvas dated Sun, 5 Feb 2006
14:43:30 -0500, Joe Cabrera said that ...

> BTW, I've been using "key = Chr (9)" for my tab press check. Is that
> a kosher way to do it in my code, rather that your way above?

Yes it's the same thing.

However, if your checking for multiple keys, it's a little more efficient
to use something like:

Select Case Asc(key)

and then compare against integers. It's only one function call.

Re: keeping tabs in a canvas
Date: 05.02.06 21:47 (Sun, 05 Feb 2006 12:47:22 -0800)
From: Terry Ford

On 5-Feb-06, at 12:17 PM, Steve Garman wrote:

> In a message regarding Re: keeping tabs in a canvas dated Sun, 5
> Feb 2006
> 14:43:30 -0500, Joe Cabrera said that ...
>
>> BTW, I've been using "key = Chr (9)" for my tab press check. Is that
>> a kosher way to do it in my code, rather that your way above?
>
> Yes it's the same thing.
>
> However, if your checking for multiple keys, it's a little more
> efficient
> to use something like:
>
> Select Case Asc(key)
>
> and then compare against integers. It's only one function call.

But where did 3d come into the picture?

> if asc (key) = 9 Then
> speak "next column"
> Return True
> end if

Was it the list itself that generated it as it wasn't in the original.

Terry

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>