Navigation:  Reference > Form Objects >

TTASNavigator

Print this Topic Previous pageReturn to chapter overviewNext page

 

This is a special object that provides the user with a group of buttons that can be accessed by the user to scroll through the records in a file, delete a record, save a changed record or refresh a record from the file even after changes have been made.  Use the Navigator command to link this object to a file and key.  This is required before this command will have any effect.

 

PALETTE ICON & EXAMPLE

 

 

PROPERTIES

The following are the properties that apply to this object.  Some are defined in Common Properties and are linked to their appropriate page.

 

Appearance

 

Ctl3D

Cursor

FlatIf this is checked (set to .True.) the emphasis around the buttons is removed making the buttons look 'flatter.'   The default value is not checked.  This property can be modified at runtime.

 

Behavior

 

Enabled

TabOrder

TabStop

Visible

 

Hint

 

Hint

ParentShowHint

ShowHint

 

Misc

 

HelpContext

Name

PopupMenu

Tag

 

Other

 

AfterActionFocusWhen the user clicks on one of the Navigator buttons they could be on any object.  If you want to make sure they always return to a specific object after any action; record change, save, delete, cancel, etc., then the name of that object should be entered here.  To accomplish this you would click on the drop down arrow in the property entry box and choose an object from the list provided.  The object you want to set active must be on the screen form before it can be specified here.

Anchors

ClearRecOnSaveIf this is checked (set to .True.) and the user clicks on the save button then the record buffer will be cleared after the record is saved.  If it's not checked (set to .False.) then the record buffer will not be cleared.  This property can be modified during runtime.

 

ConfirmDeleteIf this is checked (set to .True.) the message entered in the ConfirmDeleteMsg property below will be displayed if the user clicks on the delete button.  If the user clicks the No button the record will not be deleted.  This property can be modified during runtime.  Also see the Delete event below for other options.

 

ConfirmDeleteMsgIf ConfirmDelete above is checked (set to .True.) then this is the message that will be displayed when the user clicks on the delete button.

 

ConfirmSaveIf this is checked (set to .True.) the message entered in the ConformSaveMsg property below will be displayed if the user clicks on the save button.  If the user clicks the No button the record will not be saved.  This property can be modified during runtime.  Also see the Save event below for other options.

 

ConfirmSaveMsgIf ConfirmSave above is checked (set to .True.) then this is the message that will be displayed when the user clicks on the delete button.

Constraints

HintsThis is a list of strings that will be displayed as the hints for the buttons.  They are in the same order as the buttons.  This property can be modified using the STRINGS() function.

ParentCtl3D

VisibleButtonsThis property determines which of the buttons will be displayed on the navigator bar.  To make the button visible check the appropriate property.  In design mode the navigator bar will change when you check or uncheck the appropriate button.

 

Position

 

Align

Height

Left

Top

Width

 

TAS Pro

 

AttachGridIf you have a TTASDataGrid on the form you can attach this TTASNavigator to that grid by entering the name of that grid here.  The easy way to do this is by clicking on the down arrow and choosing the appropriate grid.  The grid must be on the form before this will work.  If you utilize this option, and the grid is a WLISTF type, then you don't have to set the File Number or Key for this object (see Navigator command).  It will be done automatically by the grid.

 

       NOTE:  For an example of this see WTASDATAM.  The main form (WTASDATAM.DFM) has a TTASNavigator attached to the TTASDataGrid.

 

ClickBtnThis property doesn't show up in the Object Inspector during design mode since it's a write only property.  It cannot be read from.  The way to use it is to set the property equal to a value which represents one of the buttons displayed on the navigator bar.  This will have the same effect as if the user had clicked the button directly.  So, for example, if you want the Save button to be clicked at a certain point, perhaps after the user exits a field, you would include something like this:

 

                               '@navName.ClickBtn' = nbPost

 

       nbPost is a constant defined in CompilerConstants.txt and represents the Save button.

 

       What's the benefit of this?  You can have a single routine that handles the saves for the program and access it in two different ways, if the user clicks on the save (post) button or if they reach the end of the possible inputs.

 

       This property can also be updated using the command SET_OBJECT or the function SET_OBJ_PROP().

 

 

StdKeyTrapsIf this is checked (set to .True.) the user will be able to use the standard TAS fkeys to access records controlled by this TTASNavigator.  F5 - First record, F6 - Last record, F7 - Previous record, F8 - Next record, F3 - Clear record buffer, F4 - Delete record, F10 - Save record and F12 - Edit record.  If you have the ShowHint property above checked the program will add the Fx value to the end of the current hint for that button.  For example, if you have Delete record as the hint for delete then it will be displayed as Delete record (F4).

 

       NOTE:  This property cannot be changed during runtime.  It is setup when the form is loaded.

 

 

 

EVENTS

This object has events that are called depending on what the user does.  The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening.  An event looks to your program for a special label.  It is made up of the object Name, a period (.) and the Event name (listed below).  For example, the Change event below would be: ObjectName.Change:

 

AfterChangeThis event is called every time the user clicks the First, Next, Last or Prior button after the record is found.  This is different from the Change event that is called before the record is found.

 

CancelThis event is called when the user clicks the Cancel button.  If you use this event you must return .True. or .False. when you return (RET) from the routine.  If you return .True. the record buffer will be cleared.  If you return .False. the current record will remain.  If there are other files you wish to clear also you would use this event to do so in your program code.

 

ChangeThis event is called every time the user clicks the First, Next, Last or Prior button.  If you use this event you must return .True. or .False. when you return (RET) from the routine.  If you return .True. the appropriate record will be found and displayed.  If you return .False. the current record will remain.  If you want to call an event after the record is found see the AfterChange event above.

 

DeleteThis event is called every time the user clicks the Delete button.  If you use this event you must return .True. or .False. when you return (RET) from the routine.  If you return .True. the record will be deleted.  If you return .False. the current record will remain. NOTE:  If you have checked ConfirmDelete this event will be called only if the user answers Yes to that confirmation message first.

 

EditThis event is called every time the user clicks the Edit button.  If there is a record active and it can be locked, then the event routine will be called. NOTE:  Once in edit mode the edit button will be disabled (turn off) until the record is cleared or it is unlocked.

 

RefreshThis event is called when the user clicks the Refresh button.  If you use this event you must return .True. or .False. when you return (RET) from the routine.  If you return .True. the current record will be read fresh from disk and any changes will be lost.  If you return .False. the current record will remain.

 

SaveThis event is called every time the user clicks the Save button.  If you use this event you must return .True. or .False. when you return (RET) from the routine.  If you return .True. the record will be save.  If you return .False. the record will not be updated. NOTE:  If you have checked ConfirmSave this event will be called only if the user answers Yes to that confirmation message first.

 

 


Page url: http://www.cassoftware.com/tas/manual/ttasnavigator.htm