1. up arrow and down arrow
Derek, thanks for the help. The 'beep' is now gone. However, I need a way to
get windows to ignore uparrow and dnarrow after I've finished my thing. It
still does it's window's thing with the arrows when i'm done. Is there a way
to get win to leave it alone? You've said that returnValue() doesen't work
for onKeyDown. Do we have another alternative?
...george
2. Re: up arrow and down arrow
Thanks Derek,
I'm using the up and dn arrows to advance / backup editText fields
(don't cringe too much) rather than what windows does (the same as left and
right arrows). What windows does after I'm through with setFocus() is to
move the arrow to an interior part (where it would have been on the previous
field usually) of the editText field where I've setFocus(). Difficult to
explain, hopefully you can follow.
...george
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: up arrow and down arrow
> >
> Hi George,
>
> > From: George Walters <gwalters at sc.rr.com>
> > To: EUforum <EUforum at topica.com>
> > Reply-To: EUforum at topica.com
> > Subject: up arrow and down arrow
> > Date: 23/08/2001 8:17:46 AM
> >
> >
> > Derek, thanks for the help. The 'beep' is
> > now gone. However, I need a way to
> > get windows to ignore uparrow and dnarrow
> > after I've finished my thing. It
> > still does it's window's thing with the
> > arrows when i'm done. Is there a way
> > to get win to leave it alone? You've said
> > that returnValue() doesen't work
> > for onKeyDown. Do we have another
> > alternative?
> >
>
> I've tried to do this sometime back but couldn't work out how. Maybe I'll
> have another look at the problem.
>
> Anyhow, what exactly is the "window's thing" that the up/down arrow keys
do?
> As far as I know only MleText, RichEdit, and lists use the up/down arrow
> keys and it makes sense for these controls. Is there something I've
missed?
> What are you trying to do with these keys? There may be another way to
skin
> this particular cat.
>
> -----
> Derek
>
>
> confidential information intended solely for the use of the individual or
> entity to whom they are addressed. If you are not the intended recipient
of
> this message you are hereby notified that any use, dissemination,
> distribution or reproduction of this message is prohibited. If you have
> received this message in error please notify the sender immediately. Any
> views expressed in this message are those of the individual sender and may
> not necessarily reflect the views of Global Technology Australasia
Limited.
>
> >
> >
>
>
3. Re: up arrow and down arrow
> From: George Walters <gwalters at sc.rr.com>
> To: EUforum <EUforum at topica.com>
> Reply-To: EUforum at topica.com
> Subject: Re: up arrow and down arrow
> Date: 23/08/2001 9:21:58 AM
>
>
> Thanks Derek,
>
> I'm using the up and dn arrows to
> advance / backup editText fields
> (don't cringe too much) rather than what
> windows does (the same as left and
> right arrows). What windows does after I'm
> through with setFocus() is to
> move the arrow to an interior part (where
> it would have been on the previous
> field usually) of the editText field where
> I've setFocus(). Difficult to
> explain, hopefully you can follow.
>
Just an idea, but try this ...
setFocus(nextFld)
setIndex(nextFld, 0)
this should tell windows where to place the cursor in the field you are
going to. The zero just means place it at the start of the field, but you
can decide otherwise if you like.
--------
Derek
confidential information intended solely for the use of the individual or
entity to whom they are addressed. If you are not the intended recipient of
this message you are hereby notified that any use, dissemination,
distribution or reproduction of this message is prohibited. If you have
received this message in error please notify the sender immediately. Any
views expressed in this message are those of the individual sender and may
not necessarily reflect the views of Global Technology Australasia Limited.
4. Re: up arrow and down arrow
Thanks Derek,
Nice Idea but windows apparently ignores it. I even tried to set the current
field index to zero on a lostfocus event before the field is left.
procedure lostFocusProcess()
setIndex(getSelf(),0)
end procedure
onLostFocus[Screen] = routine_id("processLostFocus")
onKeyPress[Screen] = routine_id("keyPressProcessB")
onKeyDown[Screen] = routine_id("keyPressProcessA")
Windows 'remembers' where the cursor location was at the field (i.e. use
your mouse and click it to the middle of a field) and if you return it
places the cursor at that location (+- 1 based on up or down arrow being
used) and ignores the setIndex().
...george
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, August 22, 2001 10:11 PM
Subject: Re: up arrow and down arrow
>
> > From: George Walters <gwalters at sc.rr.com>
> > To: EUforum <EUforum at topica.com>
> > Reply-To: EUforum at topica.com
> > Subject: Re: up arrow and down arrow
> > Date: 23/08/2001 9:21:58 AM
> >
> >
> > Thanks Derek,
> >
> > I'm using the up and dn arrows to
> > advance / backup editText fields
> > (don't cringe too much) rather than what
> > windows does (the same as left and
> > right arrows). What windows does after I'm
> > through with setFocus() is to
> > move the arrow to an interior part (where
> > it would have been on the previous
> > field usually) of the editText field where
> > I've setFocus(). Difficult to
> > explain, hopefully you can follow.
> >
>
> Just an idea, but try this ...
>
> setFocus(nextFld)
> setIndex(nextFld, 0)
>
> this should tell windows where to place the cursor in the field you are
> going to. The zero just means place it at the start of the field, but you
> can decide otherwise if you like.
>
> --------
> Derek
>
>
> confidential information intended solely for the use of the individual or
> entity to whom they are addressed. If you are not the intended recipient
of
> this message you are hereby notified that any use, dissemination,
> distribution or reproduction of this message is prohibited. If you have
> received this message in error please notify the sender immediately. Any
> views expressed in this message are those of the individual sender and may
> not necessarily reflect the views of Global Technology Australasia
Limited.
>
>
>
>
>
5. Re: up arrow and down arrow
here is some code that seems to do the job.
-------------------------
include win32lib.ew
without warning
constant
win = create(Window,"Up Down test", 0, 0, 0, 400, 400, 0),
SB = create(StatusBar, "", win, 0, 0, 0, 0, 0),
fld1 = create(EditText, "", win, 5, 5, 200, 20, 0),
fld2 = create(EditText, "", win, 5, 35, 200, 20, 0),
fld3 = create(EditText, "", win, 5, 65, 200, 20, 0),
tabseq = {fld1, fld2, fld3}
-- Used to remember where I was when the fld lost focus.
sequence fldposn
fldposn = {0, 0, 0}
procedure focus(integer self, integer event, sequence params)
integer w
w = find(self, tabseq)
if w = 0 then
return
end if
if event = w32HGotFocus then
setIndex(self, fldposn[w])
else
fldposn[w] = getIndex(self)
end if
end procedure
procedure movefocus(integer id, integer incr)
integer w
w = find(id, tabseq)
if w = 0 then
return
end if
w += incr
if w > length(tabseq) then
w = 1
elsif w < 1 then
w = length(tabseq)
end if
setFocus(tabseq[w])
end procedure
procedure keydown(integer self, integer event, sequence params)
integer incr
if params[1] = VK_DOWN then
incr = 1
elsif params[1] = VK_UP then
incr = -1
else
return
end if
movefocus(self, incr)
end procedure
setHandler(tabseq, w32HKeyDown, routine_id("keydown"))
setHandler(tabseq, {w32HGotFocus,w32HLostFocus}, routine_id("focus"))
WinMain(win, Normal)
---------------------
Derek
----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, August 23, 2001 7:56 PM
Subject: Re: up arrow and down arrow
>
> Thanks Derek,
>
> Nice Idea but windows apparently ignores it. I even tried to set the
current
> field index to zero on a lostfocus event before the field is left.
>
> procedure lostFocusProcess()
> setIndex(getSelf(),0)
> end procedure
>
> onLostFocus[Screen] = routine_id("processLostFocus")
> onKeyPress[Screen] = routine_id("keyPressProcessB")
> onKeyDown[Screen] = routine_id("keyPressProcessA")
>
> Windows 'remembers' where the cursor location was at the field (i.e. use
> your mouse and click it to the middle of a field) and if you return it
> places the cursor at that location (+- 1 based on up or down arrow being
> used) and ignores the setIndex().
>
> ...george
>
> ----- Original Message -----
> From: "Derek Parnell" <ddparnell at bigpond.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Wednesday, August 22, 2001 10:11 PM
> Subject: Re: up arrow and down arrow
>
>
> >
> > > From: George Walters <gwalters at sc.rr.com>
> > > To: EUforum <EUforum at topica.com>
> > > Reply-To: EUforum at topica.com
> > > Subject: Re: up arrow and down arrow
> > > Date: 23/08/2001 9:21:58 AM
> > >
> > >
> > > Thanks Derek,
> > >
> > > I'm using the up and dn arrows to
> > > advance / backup editText fields
> > > (don't cringe too much) rather than what
> > > windows does (the same as left and
> > > right arrows). What windows does after I'm
> > > through with setFocus() is to
> > > move the arrow to an interior part (where
> > > it would have been on the previous
> > > field usually) of the editText field where
> > > I've setFocus(). Difficult to
> > > explain, hopefully you can follow.
> > >
> >
> > Just an idea, but try this ...
> >
> > setFocus(nextFld)
> > setIndex(nextFld, 0)
> >
> > this should tell windows where to place the cursor in the field you are
> > going to. The zero just means place it at the start of the field, but
you
> > can decide otherwise if you like.
> >
> > --------
> > Derek
> >
> >
> > confidential information intended solely for the use of the individual
or
> > entity to whom they are addressed. If you are not the intended recipient
> of
> > this message you are hereby notified that any use, dissemination,
> > distribution or reproduction of this message is prohibited. If you have
> > received this message in error please notify the sender immediately. Any
> > views expressed in this message are those of the individual sender and
may
> > not necessarily reflect the views of Global Technology Australasia
> Limited.
> >
> >
> >
> >
> >
>
>
>
>
>
6. Re: up arrow and down arrow
Thanks Derek, I'll try to understand it and give it a try..
...george
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: up arrow and down arrow
>
> here is some code that seems to do the job.
>
>
> -------------------------
> include win32lib.ew
> without warning
>
> constant
> win = create(Window,"Up Down test", 0, 0, 0, 400, 400, 0),
> SB = create(StatusBar, "", win, 0, 0, 0, 0, 0),
> fld1 = create(EditText, "", win, 5, 5, 200, 20, 0),
> fld2 = create(EditText, "", win, 5, 35, 200, 20, 0),
> fld3 = create(EditText, "", win, 5, 65, 200, 20, 0),
> tabseq = {fld1, fld2, fld3}
>
> -- Used to remember where I was when the fld lost focus.
> sequence fldposn
> fldposn = {0, 0, 0}
>
> procedure focus(integer self, integer event, sequence params)
> integer w
>
> w = find(self, tabseq)
> if w = 0 then
> return
> end if
>
> if event = w32HGotFocus then
> setIndex(self, fldposn[w])
> else
> fldposn[w] = getIndex(self)
> end if
>
> end procedure
>
> procedure movefocus(integer id, integer incr)
> integer w
>
> w = find(id, tabseq)
> if w = 0 then
> return
> end if
>
> w += incr
> if w > length(tabseq) then
> w = 1
> elsif w < 1 then
> w = length(tabseq)
> end if
>
> setFocus(tabseq[w])
> end procedure
>
> procedure keydown(integer self, integer event, sequence params)
> integer incr
>
> if params[1] = VK_DOWN then
> incr = 1
> elsif params[1] = VK_UP then
> incr = -1
> else
> return
> end if
>
> movefocus(self, incr)
>
> end procedure
>
> setHandler(tabseq, w32HKeyDown, routine_id("keydown"))
> setHandler(tabseq, {w32HGotFocus,w32HLostFocus}, routine_id("focus"))
>
> WinMain(win, Normal)
>
> ---------------------
> Derek
> ----- Original Message -----
> From: "George Walters" <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Thursday, August 23, 2001 7:56 PM
> Subject: Re: up arrow and down arrow
>
>
> >
> > Thanks Derek,
> >
> > Nice Idea but windows apparently ignores it. I even tried to set the
> current
> > field index to zero on a lostfocus event before the field is left.
> >
> > procedure lostFocusProcess()
> > setIndex(getSelf(),0)
> > end procedure
> >
> > onLostFocus[Screen] = routine_id("processLostFocus")
> > onKeyPress[Screen] = routine_id("keyPressProcessB")
> > onKeyDown[Screen] = routine_id("keyPressProcessA")
> >
> > Windows 'remembers' where the cursor location was at the field (i.e. use
> > your mouse and click it to the middle of a field) and if you return it
> > places the cursor at that location (+- 1 based on up or down arrow being
<snip>
> > > going to. The zero just means place it at the start of the field, but
> you
> > > can decide otherwise if you like.
> > >
> > > --------
> > > Derek
> > >
> > >
> > > confidential information intended solely for the use of the individual
> or
> > > entity to whom they are addressed. If you are not the intended
recipient
> > of
> > > this message you are hereby notified that any use, dissemination,
> > > distribution or reproduction of this message is prohibited. If you
have
> > > received this message in error please notify the sender immediately.
Any
> > > views expressed in this message are those of the individual sender and
> may
> > > not necessarily reflect the views of Global Technology Australasia
> > Limited.
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>
>