When I clear a window the Cursor stays in the second field of the window. I would like to place it back in the first field, which is invisible BTW so the user will not think of S+Tab. How do I do this? I haven't even been able to determine whether this is an event or a property.
![]()
Is there such a thing as an AREV to OI translation dictionary? ie If you did this in AREV, check out this in OI.
Still wobbly but making progress,
Roy
Roy,
Setting FOCUS is a property, i.e. Set_Property(@Window:".EDITLINE", "FOCUS", 1). However, I don't recall off the top of my head if that will work for invisible controls. I don't see why not, but I just don't recall ever doing that.
There are a few articles in the Knowledgebase that discuss the general approach that developers have used to convert their applications from AREV to OI. They are all pretty old and I don't believe they were comprehensive. Truthfully, the best resource is this discussion site or a direct link to those who have and continue to do this type of work all the time.
Don,
However, I don't recall off the top of my head if that will work for invisible controls. I don't see why not, but I just don't recall ever doing that.
I just tried it and it seems you can. I set the focus to an invisible edit line from a button script. (Pressing tab afterwards brings focus to a visible control, and it's not possible to tab or back-tab back to the invisible one. Of course.)
- Oystein -
Roy - Btw - cursor position is not the right word. Rather focus. Or if you think of that blinking bar signifying the current position: I think it's called the caret. - Oystein -
Thanks all. Gotta go to work now, but will try this evening.
Roy
That worked just like you said it would, thanks!
While testing that code I encountered another odd behavior. The mouse pointer disappears when it moves over the window. At first I thought it was 'under' the window, but I noticed the Min/Max/Close labels display when the pointer was in their neighborhood. What have I done to make this happen? My script is included below.
TIA * 1K,
Roy
PS Fiels 1, invisible, is a barcode entry field and the script takes it apart and stuffs the other fields.
Declare Subroutine Msg
*Msg("I'm here!|LOSTFOCUS, Script")
BARCODE=Get_Property(@WINDOW:".BARCODE","TEXT")
If Len(BARCODE) then
C_NO =Field(BARCODE,'/',1)B_NO =Field(BARCODE,'/',2)W_REC=Xlate('BW_File',C_NO,'','X')REMOVED_DATE=W_RECIf Len(REMOVED_DATE) ThenMsg('This was removed from stock on ':Oconv(REMOVED_DATE,'D'):'.','','','')rv=Set_Property(@Window:".BARCODE", "FOCUS", 1)rv=Set_Property(@Window:".BARCODE", "DEFPROP", '')RETURN 0End ElseW_INFO=W_REC:' ':W_REC:' ':W_RECrv=Set_Property(@Window:".C_NO", "DEFPROP", C_NO)rv=Set_Property(@Window:".B_NO", "DEFPROP", B_NO)rv=Set_Property(@Window:".W_INFO", "DEFPROP", W_INFO)EndEnd
rv=Set_Property(@Window:".BARCODE", "FOCUS", 1)
RETURN 1
This window is giving me fits. All my buttons have stopped working: Clear, Save, & Exit. I added the SetProperty(FOCUS) to the Clear first as a script and it stopped clearing. When I took it off it did not start working again.
What in the world of multi-values is going on?
Roy
Ignore the following, I cried 'Wolf' too quickly. FOCUS is trikier than I thought.
![]()
RgD
False alarm, sorry for all the racket. The following situation only happened on one test of the window. Sheesh!
RgD
Hi Roy,
Well it looks like you solved your own problems. Therefore, let me offer you some advice on your returns. It is cleaner to only have one master return and use a variable to designate whether you want the return to be a 1 or 0.
FWIW,