Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying browse window title in FoxPro for Windows 2.6a 2

Status
Not open for further replies.

sdonaldson

Programmer
Jul 13, 2001
19
GB
I want to refresh the title of a browse window every time the user makes a change to particular column on any record.
To be more specific, the browse window shows stock items which the user selects for shipping. The user wants to see the total value of the items as they are selected.
I figured I could do this by adding a call to a function in the valid clause of the relevant browse field, and then including a MODIFY WINDOW ... TITLE command in the function. Although no error is being reported, this doesn't appear to work as the browse title never changes.
Am I missing something ?
Can this be done in 2.6a ?

Thanks in anticipation, Shaun Donaldson
System Corporation plc
 
Hi Shaun;

Are you sure that there isn't a TITLE clause already in your BROWSE WINDOW statement. (Just a hunch)!

Which leads to my next suggestion. Instead of doing a MODIFY WINDOW, why not put your new title in the BROWSE WINDOW statement?

Ed



Please let me know if the sugestion(s) I provide are helpful to you.
Sometimes your the windshield... Sometimes your the bug.

 
There isn't a way to set the title once the browse window is active (that I have ever been able to find), without reissuing the browse command maybe in the VALID code.
However, you can predefine the windw to hold the browse, and change it programmatically:

USE table1
DEFINE WINDOW brow_win;
FROM 10, 1 TO 20, 50;
TITLE table1.field1;
(rest of window definition...)

ACTIVATE WINDOW brow_win
BROWSE FIELDS field1 ;
:v = title_func();
:f,;
field2, ;
...rest of fields...,;
IN brow_win;

*... :v = validation proc
*... :f = forces validation to occur

RELEASE WINDOW brow_win
...
rest of code here
...



FUNCTION title_func
PRIVATE ret_val
STORE .F. TO ret_val

IF (validation code results in .T.)
MODIFY WINDOW brow_win TITLE table1.field1
ret_val = .T.
ENDIF
RETURN ret_val

Try this out. It works pretty good.
Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top