Navigation: ABC Library Reference > EditDropListClass > EditDropListClass Methods >====== TakeNewSelection (process EVENT:NewSelection events:EditDropList Class) ====== | |
TakeNewSelection( field ), VIRTUAL
TakeNewSelection | Processes the EVENT:NewSelection event. |
field | A numeric constant, variable, EQUATE, or expression containing the control number of the control that generated the EVENT:NewSelection event. |
The TakeNewSelection method processes the EVENT:NewSelection event for the EditDropListClass object.
Implementation:
The TakeEvent method calls the TakeNewSelection method. If the EditDropListClass object's LIST generated the new selection event, then the TakeNewSelection method does the field assignments specified by the AddUpdateField method or clears the target fields if there is no valid selection.
Example:
EditDropListClass.TakeEvent PROCEDURE(UNSIGNED E)
CODE
CASE E
OF EVENT:Accepted
IF SELF.ListIsDown
SELF.ListIsDown = False
SELF.NewSelected = False
IF SELF.AlertedKeyEvent
SELF.AlertedKeyEvent = False
RETURN EditAction:None
ELSE
IF KEYCODE()=MouseLeft
RETURN EditAction:Forward
ELSE
RETURN EditAction:None
END
END
ELSE
IF SELF.NewSelected
SELF.NewSelected = False
RETURN EditAction:None
ELSE
RETURN EditAction:Forward
END
END
RETURN EditAction:Forward
OF EVENT:NewSelection
SELF.NewSelected = True
SELF.TakeNewSelection()
RETURN EditAction:None
OF EVENT:DroppingDown
SELF.ListIsDown = True
RETURN PARENT.TakeEvent(E)
OF EVENT:PreAlertKey
RETURN PARENT.TakeEvent(E)
OF EVENT:AlertKey
CASE KEYCODE()
OF EnterKey
RETURN EditAction:Complete
OF EscKey
RETURN EditAction:Cancel
OF TabKey
OROF ShiftTab
SELF.AlertedKeyEvent = True
RETURN PARENT.TakeEvent(E)
END
END
SELF.AlertedKeyEvent = False
SELF.ListIsDown = False
SELF.NewSelected = False
RETURN PARENT.TakeEvent(E)