Notify_Select_State - RadioGroup
Sent to notify the group that the current radio item has changed
Type: Event
Parameters
| Parameter | Type | Description |
|---|---|---|
| NewId | Integer | The number of the new current item |
| OldId | Integer | The number of the old item |
Syntax
Procedure Notify_Select_State Integer NewId Integer OldId
Description
The Notify_Select_State event is sent to notify the group that the current radio item has changed. It is passed the number of the new current item and the number of the old item. By default, this does nothing, and is intended for augmentation. It should never be sent. Note that the passed radio item numbers may be converted to object IDs with the Radio_Object message.
You may use this message to change the states of other objects. A common use of this message is to shadow other objects based on the condition of the constituents of the radio group.
Sample
This sample shows how to augment Notify_Select_State to dynamically enable and disable different Form controls depending on which radio object is selected by the user.
Object oNotifySelectStateSampleView is a dbView
Set Border_Style to Border_Thick
Set Location to 1 1
Set Size to 78 300
Object oTypeOfIdRadioGroup is a RadioGroup
Set Size to 39 89
Set Location to 7 14
Set Label to "Type of Id Presented:"
Object oRadio1 is a Radio
Set Label to "Driver's License"
Set Size to 10 67
Set Location to 10 5
End_Object
Object oRadio2 is a Radio
Set Label to "Passport"
Set Size to 10 44
Set Location to 25 5
End_Object
Procedure Notify_Select_State Integer NewId Integer OldId
Forward Send Notify_Select_State NewId OldId
// if oRadio1 is selected, enable driver's license number form
// and disable passport number form
If (NewId = 0) begin
Set Enabled_State of oDLNForm to True
Set Enabled_State of oPassportNumberForm to False
End
// if oRadio2 is selected, enable passport number form
// and disable driver's license number form
Else If (NewId = 1) begin
Set Enabled_State of oDLNForm to False
Set Enabled_State of oPassportNumberForm to True
End
End_Procedure
End_Object
Object oDLNForm is a Form
Set Label to "Driver's License Number:"
Set Size to 13 85
Set Location to 12 195
Set Label_Col_Offset to 0
Set Label_Justification_Mode to jMode_Right
End_Object
Object oPassportNumberForm is a Form
Set Label to "Passport Number:"
Set Size to 13 85
Set Location to 29 195
Set Label_Col_Offset to 0
Set Label_Justification_Mode to jMode_Right
End_Object
End_Object