Here are some handy tricks for implementing window titles similar to those of the User environment. In the output form, this will give you a window title like "TableName: 10 of 12", and in the input form the title will change to "Entry for TableName".
First, create a generic method to create the title for the output form:
Project Method: OutputWindowTitle
$pTable:=Current form table
$0:=Table name($pTable)+": "+string(Records in selection($pTable->))+" of "+string(Records in table($pTable->))
---
Then create a generic method to create the title for the input form:
` Project Method: InputWindowTitle
$0:="Entry for "+Table name(Current form table))
---
In the On Load form event of the output form's form method, use the following line of code:
SET WINDOW TITLE(OutputWindowTitle)
This sets the title of the window when it is first opened. (You could have also called the OutputWindowTitle function as the title parameter of the "Open window" command. By setting the window title in the On Load form event, your code will be able to update the title of a window opened with the new 4D 6.5 "Open form window" command, which does not include a window title parameter.)
When the user double-clicks on a record in the output form, that record will be displayed in the input form. To change the window title, in the On Load form event of the input form's form method, use the following line of code:
SET WINDOW TITLE(InputWindowTitle)
When the user closes the input form and returns to the output form, you want the window title to change back. The appropriate place to do this would be in the On Close Detail form event of the output form's form method. But if you had exited the input form by clicking an automatic action Delete Record button, you'll find that the "Records in selection" and "Records in table" functions don't properly factor the deleted record into their counts. So how can you update the window title with the proper record count?
The solution is to place this line of code in the On Close Detail form event of the output form's form method:
CALL PROCESS(Current process)
Then in the On Outside Call form event of the output form's form method, set the window title:
SET WINDOW TITLE(OutputWindowTitle)
You should also add this line of code at the end of any Project Method or Object Method that adds new records to the current selection.