Help. FPW2.6 Changing browse field without moving

Help. FPW2.6 Changing browse field without moving

Post by Gordon Ang » Fri, 09 Sep 1994 21:20:51



I am trapping a downarrow key stroke in a browse field by using
'on key label dnarrow do xxx' activated in turn from the field's
'when' clause.
I use the procedure to revise selected fields in the current record
of the database (including the current field).
The problem is that after returning from the procedure 'xxx' all
fields have been obediently updated EXCEPT the field that the cursor
is in. The update to this field is deferred until the cursor is moved
off it.
HOW do I force the revised value to show in the highlighted (cursor)
field with out physically moving the cursor?

Gordon

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by leebe » Sat, 10 Sep 1994 01:45:11



> I am trapping a downarrow key stroke in a browse field by using
> 'on key label dnarrow do xxx' activated in turn from the field's
> 'when' clause.
> I use the procedure to revise selected fields in the current record
> of the database (including the current field).
> The problem is that after returning from the procedure 'xxx' all
> fields have been obediently updated EXCEPT the field that the cursor
> is in. The update to this field is deferred until the cursor is moved
> off it.
> HOW do I force the revised value to show in the highlighted (cursor)
> field with out physically moving the cursor?
> Gordon


Have you tried SHOW GET (VARREAD()) ?? I dunno if this'll work tho.

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by Gordon Ang » Sat, 10 Sep 1994 16:20:27



: > I am trapping a downarrow key stroke in a browse field by using
: > 'on key label dnarrow do xxx' activated in turn from the field's
: > 'when' clause.
: > I use the procedure to revise selected fields in the current record
: > of the database (including the current field).
: > The problem is that after returning from the procedure 'xxx' all
: > fields have been obediently updated EXCEPT the field that the cursor
: > is in. The update to this field is deferred until the cursor is moved
: > off it.
: > HOW do I force the revised value to show in the highlighted (cursor)
: > field with out physically moving the cursor?

: > Gordon

: Have you tried SHOW GET (VARREAD()) ?? I dunno if this'll work tho.

Thanks Leebert,  but this doesn't work. Neither does SHOW GET <fieldname>.

I could do it in a messy way by moving the cursor off the field and back
again  - but I can't work out how to move the cursor in a Browse screen
under programme control except by changing records (and this doesn't
work either - I suppose because the screen only updates when it becomes
visible again after the code has run and I have moved the record back
to its original place by this time!)

I guess there is a simple answer somewhere ....... !

Gordon

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by Brian Clever » Sun, 11 Sep 1994 16:42:18





>: > I am trapping a downarrow key stroke in a browse field by using
>: > 'on key label dnarrow do xxx' activated in turn from the field's
>: > 'when' clause.
>: > I use the procedure to revise selected fields in the current record
>: > of the database (including the current field).
>: > The problem is that after returning from the procedure 'xxx' all
>: > fields have been obediently updated EXCEPT the field that the cursor
>: > is in. The update to this field is deferred until the cursor is moved
>: > off it.
>: > HOW do I force the revised value to show in the highlighted (cursor)
>: > field with out physically moving the cursor?

>: > Gordon

>: Have you tried SHOW GET (VARREAD()) ?? I dunno if this'll work tho.

>Thanks Leebert,  but this doesn't work. Neither does SHOW GET <fieldname>.

>I could do it in a messy way by moving the cursor off the field and back
>again  - but I can't work out how to move the cursor in a Browse screen
>under programme control except by changing records (and this doesn't
>work either - I suppose because the screen only updates when it becomes
>visible again after the code has run and I have moved the record back
>to its original place by this time!)

>I guess there is a simple answer somewhere ....... !

>Gordon

Gordon,

I know this is moving the cursor, but how 'bout trying:
                keyboard '{TAB}'
                keyboard '{BACKTAB}'
before you return back to the browse.

The cursor movement should (?) be transparent to the user...

Good luck,

Brian Cleverly
Anzam Software
Sacramento  CA

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by leebe » Mon, 12 Sep 1994 00:46:44



> I could do it in a messy way by moving the cursor off the field and back
> again  - but I can't work out how to move the cursor in a Browse screen
> under programme control except by changing records (and this doesn't
> work either - I suppose because the screen only updates when it becomes
> visible again after the code has run and I have moved the record back
> to its original place by this time!)
> I guess there is a simple answer somewhere ....... !

Okay, there's a hard way to get the cursor off the field, and back on the
field again, and it involves using the WHEN statement to decide which
field to land on. What you have to do is

1. remember which field you want to land on: s_targ_fld
2. create a public logical var that says you are doing this: l_fld_skip
3. buffer TAB's using KEYBOARD tab

So after you do your WHEN routine and change the value of the field,
KEYBOARD '{TAB}' and set l_fld_skip = .T.

* Each browse field has in its WHEN routine:

IF s_targ_fld # VARREAD() AND l_fld_skip  && wrong field
  KEYBOARD '{TAB}'  && keep going round robin thru all the fields until
                    && you land on the right one
  RETURN .F. (won't allow FP to land on this field, goto next one
ELSE
  SET TYPEAHEAD TO 0
  CLEAR TYPEAHEAD
  SET TYPEAHEAD TO 128
  l_fld_skip = .T.
  s_targ_fld = ''
  RETURN .T.
ENDIF

It's a kludge, but the cursor will never show on the other fields until
the one you want returns a true in the WHEN routine. Of course, you could
try KEYBOARD '{TAB}' KEYBOARD '{SHIFT+TAB}' and achieve the same effect,
but perhaps a bit more noticable by the enduser.

If you send some sample code, I might be able to see what it is exactly
you are trying to do and come up with a better approach....

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by David Church » Tue, 13 Sep 1994 07:40:08



>HOW do I force the revised value to show in the highlighted (cursor)
>field with out physically moving the cursor?

 Have you tried SHOW WINDOW (WONTOP()) REFRESH? This refreshes the
whole browse display, including the field under the cursor.

--

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by Gordon Ang » Tue, 13 Sep 1994 20:15:52


Thanks David,

I had tried WONTOP() but it didn't work.  John Stevens identified the
problem - you must use the full Browse TITLE to differentiate it from
the underlying window.

Gordon.

 
 
 

Help. FPW2.6 Changing browse field without moving

Post by Gordon Ang » Tue, 13 Sep 1994 20:36:50


:.........

: Okay, there's a hard way to get the cursor off the field, and back on the
: field again, and it involves using the WHEN statement to decide which
: field to land on. What you have to do is

: 1. remember which field you want to land on: s_targ_fld
: 2. create a public logical var that says you are doing this: l_fld_skip
: 3. buffer TAB's using KEYBOARD tab

: So after you do your WHEN routine and change the value of the field,
: KEYBOARD '{TAB}' and set l_fld_skip = .T.

: * Each browse field has in its WHEN routine:

: IF s_targ_fld # VARREAD() AND l_fld_skip  && wrong field
:   KEYBOARD '{TAB}'  && keep going round robin thru all the fields until
:                     && you land on the right one
:   RETURN .F. (won't allow FP to land on this field, goto next one
: ELSE
:   SET TYPEAHEAD TO 0
:   CLEAR TYPEAHEAD
:   SET TYPEAHEAD TO 128
:   l_fld_skip = .T.
:   s_targ_fld = ''
:   RETURN .T.
: ENDIF

: It's a kludge, but the cursor will never show on the other fields until
: the one you want returns a true in the WHEN routine. Of course, you could
: try KEYBOARD '{TAB}' KEYBOARD '{SHIFT+TAB}' and achieve the same effect,
: but perhaps a bit more noticable by the enduser.

: If you send some sample code, I might be able to see what it is exactly
: you are trying to do and come up with a better approach....

That worked, thanks leebert, as did tab/backtab (thanks also to Brian).
Tab/Backtab was a lot more noticeable than cycling through the When
routines.
John Stephen identified the problem I was having in the SHOW WINDOW ....
REFRESH Statement, which was corrected by including the actual full
Browse TITLE in that statement - and this turned out to be the best
solution (although it does turn off the BG* highlite).
Many thanks to you all.
Gordon

 
 
 

1. Re(2): Help. FPW2.6 Changing browse field without moving

Gordon,
The trick is to use SHOW  WINDOW ( Wintitle) REFRESH.

Note however that Wintitle must be the Window Title NOT the Window Name,
(strange but true). This method seems to need a plain Jane title however.
SHOW WINDOW WONTOP() REFRESH should work but doesn't or is unreliable around
screen READS as WONTOP() is taken as being the Screen Window NOT the Browse
Window.

Good Luck !

-- Deep Thought User
       _/_/_/   _/_/_/_/       Generic user sig for a user of the
      _/    _/    _/          Deep Thought BBS, Auckland, New Zealand
     _/    _/    _/          A FirstClass(tm) Macintosh GUI BBS
    _/_/_/      _/          Internet: No e-mail address!

       This user may be contacted only via the public newsgroups.
       Please do not send E-mail via the author's return address.

2. Implicit conversion & truncating data

3. Changing a field without knowing which field to change

4. alternative select in list

5. Exiting browse without moving rec pointer

6. DTS in Job

7. FPW2.6 Editing field within browse

8. shape a disconnected recordset?

9. PLS help: Change field structure without loosing data?

10. Moving fields on report: FPW2.6

11. Moving to field in browse window

12. FPM Browse Field Titles can change?

13. The fields order changed in browse in 2.6