From bca97ddc3ea401a2360a1404d090962f03607bba Mon Sep 17 00:00:00 2001 From: Vincent de Lachaux Date: Tue, 13 Aug 2024 12:04:40 +0200 Subject: [PATCH] bf subform --- UI/Project/Sources/Classes/subform.4dm | 40 +++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/UI/Project/Sources/Classes/subform.4dm b/UI/Project/Sources/Classes/subform.4dm index 9a54ee5..bd4563e 100644 --- a/UI/Project/Sources/Classes/subform.4dm +++ b/UI/Project/Sources/Classes/subform.4dm @@ -1,5 +1,4 @@ Class extends scrollable - property form : cs:C1710.form property parent : Object @@ -35,6 +34,14 @@ Class constructor($name : Text; $events : Object; $super : Object; $form : Objec This:C1470.isSubform:=True:C214 // MARK:Delegates 📦 + var $detailForm : Text:=String:C10(This:C1470.detailForm) + + If (Length:C16($detailForm)>0) + + $form:=$form || Try(JSON Parse:C1218(File:C1566("/SOURCES/Forms/"+$detailForm+"/form.4DForm").getText())) + + End if + This:C1470.form:=cs:C1710.form.new(This:C1470; $form) // === === === === === === === === === === === === === === === === === === === === === === === === === === @@ -54,6 +61,10 @@ Function set data($data) // Force an update to take account of changes This:C1470.refresh() +Function execute($formula : 4D:C1709.Function) + + This:C1470._execute($formula) + // MARK:-[Timer] // === === === === === === === === === === === === === === === === === === === === === === === === === === /// Launch the timer in the sub-form. @@ -111,17 +122,37 @@ Function getParentDimensions() : cs:C1710.dim // === === === === === === === === === === === === === === === === === === === === === === === === === === /// Returns the names of the forms associated with the subform. -Function getSubforms() +Function getSubforms() : Object var $detail; $list : Text var $ptr : Pointer OBJECT GET SUBFORM:C1139(*; This:C1470.name; $ptr; $detail; $list) - This:C1470.forms:={\ + return {\ detail: $detail; \ list: $list} + // <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== +Function get detailForm() : Text + + var $detail; $list : Text + var $ptr : Pointer + + OBJECT GET SUBFORM:C1139(*; This:C1470.name; $ptr; $detail; $list) + + return $detail + + // <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== <== +Function get listForm() : Text + + var $detail; $list : Text + var $ptr : Pointer + + OBJECT GET SUBFORM:C1139(*; This:C1470.name; $ptr; $detail; $list) + + return $list + // === === === === === === === === === === === === === === === === === === === === === === === === === === /// Sets the names of the forms associated with the subform. Function setSubform($detail : Text; $list : Text; $table : Pointer) : cs:C1710.subform @@ -217,4 +248,5 @@ Function _execute($formula : 4D:C1709.Function) Function _getWidget($widget : Text) : Text // Deal with the name of the form object or the name of an instance - return This:C1470.form[$widget].name || $widget \ No newline at end of file + return This:C1470.form[$widget].name || $widget + \ No newline at end of file