Returns True if the widget and all its children accept to be closed or to lose the focus
Source position: msegui.pas line 2270
public function twidget.canclose( |
const newfocus: twidget = Nil |
):Boolean; virtual; |
Returns True if the widget and all its children accept to be closed or to lose the focus. For a data edit with oe_closequery, a value being edited is checked and stored (as if Enter was pressed), and the result is False if it is invalid. Call it before saving, so that the value being typed is not lost, e.g.:
if container.canclose(nil) then begin query.applyupdates; transaction.commit; end;
See also canparentclose, which checks the focused widget first.