Josh,

Well, I am not sure... but... I noticed one thing... and Joe mentioned this a bit
earlier in this thread.

When an event passes through all the handlers, without being 'handled' it
causes a Beep. At least, on Windows it causes a Beep.

I placed two Editfields on my window. One with the logic for the Y/N and one that was just there as an extra control to be in the tab group. That was just
so I could test the navigation (earlier).

I noticed that if I tabbed/clicked into that editfield, then hit Enter, I got a Beep
(on Windows, not on the Mac).

So, I surmise, that only means that none of the handlers handled the event of
pressing the Enter and causes, as Joe Mentions, a Beep.

I did not make an array of editfields, but you could add some sort of
statement, like 'Speak "In editfield X keydown handler"' and pop it in
and see if the handler you EXPECT to get called, is being called.
Put it in ALL the editfields and see what happens. Maybe a different
Editfield is grabbing the event. Or some other control all together.
Do you have a Default button somewhere? Maybe it is grabbing it?

Joe, is there a catch all event handler somewhere in the App class?
How can one catch those 'unhandled' events?

I have not tried the remote debugging, maybe that would work to trace things thourhg if you have a PC close to your Mac, etc. (As Joe also mentioned...)

-Scott


On Apr 18, 2006, at 1:45 PM, Joshua Demori wrote:

Scott,

You truly are a gentleman. I tried your code out in a new project and yes it works. I place only your code in my editfield and it only beeps at me when I try to hit enter.
So heres what really goes on in my code blow by blow.
1.) In an editfield.lostfocus event it does the following and only the following. (note it is a indexed array of editfields)

        if Index = IN_NOTE Then  // this is the last editfield in my form
                display_correctEntry.Visible = True
                input_correctEntry.Visible = True
                input_correctEntry.Text = "N"
                input_correctEntry.SelStart = 0
input_correctEntry.SelLength = 1 // I could replace this with selectAll being that its available...
                input_correctEntry.SetFocus()
         End If


2.) the focus is now in a single indexed or solo editfield
it has only code in its keydown event no other place in this field has code
        which I took my code out and replaced yours Scott.
        
so I lose focus in an array of editfields whose index is IN_NOTE
this then runs code which displays a static text called display_correctEntry and editfield input_correctEntry

I then hit enter and all I get are beeps. please what else could cause the problem. RB is compiling or doing something wrong. My goal is not just to complain no but to help others because this could be a serious error. Please understand that.
And yes the ilogic is that this logic is simple and should work.

Again sorry to all those who I have insulted. I will do better from now on not to do that. My apologies.

Josh

P.S. In this again there is no outside code that could cause a problem.

Try something like this:

  // Let them type in Y/N/navigate/delete/tab
if asc(Key) = 8 or asc(Key) = 28 or asc(Key) = 29 or asc(Key) = 9 or Uppercase(Key) = "Y" or Uppercase(Key) = "N" then return FALSE

  // Otherwise check for action
  if asc(Key) = 13 and me.Text <> "" then
if Uppercase(me.Text) = "Y" then 'Note: String comparisons of this type should NOT be case sensitive
      // Do 'Yes' stuff
      Speak "Yes!"
    else
      // Do 'No' Stuff (If it ain't 'Y', then it must be 'N'!)
      Speak "No"
    end if
  end if

// If we get here, then they have not entered an allowable Key, or they are finished, no problem // so we return TRUE to ignore any other keys, or to simply stop further processing of the event
  Return TRUE


That logic is, well, perhaps a bit simpler, to me at least. :-)

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


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

Reply via email to