diff --git a/Project/Sources/Forms/WP_Palette_Backgrounds/ObjectMethods/xbtn_Apply.4dm b/Project/Sources/Forms/WP_Palette_Backgrounds/ObjectMethods/xbtn_Apply.4dm index be7ad27e..2ce10903 100644 --- a/Project/Sources/Forms/WP_Palette_Backgrounds/ObjectMethods/xbtn_Apply.4dm +++ b/Project/Sources/Forms/WP_Palette_Backgrounds/ObjectMethods/xbtn_Apply.4dm @@ -13,6 +13,7 @@ If ($oCurrent#Null:C1517) Else - ALERT:C41("not available yet ffor this target") + BEEP:C151 + //ALERT("Not available yet for this target") End if \ No newline at end of file diff --git a/Project/Sources/Forms/WP_Palette_Backgrounds/form.4DForm b/Project/Sources/Forms/WP_Palette_Backgrounds/form.4DForm index fb314919..1be6dc1b 100644 --- a/Project/Sources/Forms/WP_Palette_Backgrounds/form.4DForm +++ b/Project/Sources/Forms/WP_Palette_Backgrounds/form.4DForm @@ -751,5 +751,5 @@ "version": "1", "kind": "form" }, - "geometryStamp": 1595 + "geometryStamp": 1603 } \ No newline at end of file diff --git a/Project/Sources/Methods/WP_CopyPasteMenu.4dm b/Project/Sources/Methods/WP_CopyPasteMenu.4dm index f7136916..f14d69fc 100644 --- a/Project/Sources/Methods/WP_CopyPasteMenu.4dm +++ b/Project/Sources/Methods/WP_CopyPasteMenu.4dm @@ -45,15 +45,6 @@ Else $hasPasteMenu2:=False:C215 End if -//If ($context="FrameBackground") -//$oSettings2:=(OBJECT Get pointer(Object named;"oSettings2"))-> -//If (Not(OB Is empty($oSettings2))) -//$hasPasteMenu2:=True -//Else -//$hasPasteMenu2:=False -//End if -//End if - // get the RANGE according to context ---------------------------------------------------------------------------------------------- Case of @@ -123,7 +114,7 @@ Case of : ($context="Background") APPEND MENU ITEM:C411($menu; Get localized string:C991("CopyBackground")) - SET MENU ITEM PARAMETER:C1004($menu; -1; "Copy1") + SET MENU ITEM PARAMETER:C1004($menu; -1; "CopyBackground") // If ($hasPasteMenu1) APPEND MENU ITEM:C411($menu; "(-") @@ -131,11 +122,13 @@ Case of If ($hasPasteMenu1) APPEND MENU ITEM:C411($menu; Get localized string:C991("PasteBackground")) - SET MENU ITEM PARAMETER:C1004($menu; -1; "Paste1") + SET MENU ITEM PARAMETER:C1004($menu; -1; "PasteBackground") // + End if End case + // call the menu ------------------------------------------------------------------------------------------------------------------------------ $Parameter:=Dynamic pop up menu:C1006($menu) RELEASE MENU:C978($menu) @@ -313,6 +306,11 @@ Case of : ($context="Background") + $oCurrent:=Form:C1466.selection // 2023/09/05 RL + If (Not:C34(Undefined:C82($oCurrent.container))) + $oCurrent:=$oCurrent.container + End if + CLEAR VARIABLE:C89(oSettings1) // numeric values @@ -335,6 +333,8 @@ Case of ARRAY TEXT:C222($_attributes; 0) APPEND TO ARRAY:C911($_attributes; wk background width:K81:27) APPEND TO ARRAY:C911($_attributes; wk background height:K81:28) + APPEND TO ARRAY:C911($_attributes; wk background image url:K81:220) // + $n:=Size of array:C274($_attributes) For ($i; 1; $n) WP GET ATTRIBUTES:C1345($oCurrent; $_attributes{$i}; $textValue) @@ -344,9 +344,6 @@ Case of End for oSettings1:=oSettings1 - // +++ - (OBJECT Get pointer:C1124(Object named:K67:5; "bgndPictPreviewCopy"))->:=(OBJECT Get pointer:C1124(Object named:K67:5; "bgndPictPreview"))-> - End case @@ -360,6 +357,20 @@ Case of Case of : ($Parameter="Paste1") $oSettings:=oSettings1 + + : ($Parameter="PasteBackground") // + + $oSettings:=oSettings1 + + $oCurrent:=Form:C1466.selection // 2023/09/05 RL + If (Not:C34(Undefined:C82($oCurrent.container))) + $oCurrent:=$oCurrent.container + Else + If ($oCurrent.type=wk type character:K81:296) + $oCurrent:=WP Paragraph range:C1346(Form:C1466.selection) + End if + End if + : ($Parameter="Paste2") $oSettings:=oSettings2 End case @@ -421,14 +432,6 @@ Case of End for End if - If ($context="Background") - - //$ptrPreview:=(OBJECT Get pointer(Object named;"bgndPictPreview")) - $ptrPreviewCopy:=(OBJECT Get pointer:C1124(Object named:K67:5; "bgndPictPreviewCopy")) - //$ptrPreview->:=$ptrPreviewCopy-> - WP_SetBackgroundPicture($oCurrent; $ptrPreviewCopy->) - - End if SET TIMER:C645(-1) diff --git a/Project/Sources/Methods/WP_GetBackgroundSize.4dm b/Project/Sources/Methods/WP_GetBackgroundSize.4dm index d2773d1a..5e772d8e 100644 --- a/Project/Sources/Methods/WP_GetBackgroundSize.4dm +++ b/Project/Sources/Methods/WP_GetBackgroundSize.4dm @@ -22,30 +22,39 @@ If (Not:C34(OB Is empty:C1297($range))) $refUnit:=oForm.verticalSizeUnits End if - If ($size="auto") | ($size="cover") | ($size="contain") - - OBJECT SET VALUE:C1742($refValue; 0) - $refUnit.index:=$refUnit.css.indexOf($size) - $refUnit.memoUnit:="" - - Else // ex 50%, 10mm, 2.5cm, 5in or 120pt - - $n:=Length:C16($size) - For ($i; 1; $n) - $char:=$size[[$i]] - If (($char>="0") & ($char<="9")) | ($char=".") - $sizeVal:=$sizeVal+$char - Else - $sizeUnit:=Substring:C12($size; $i) - $i:=$n - End if - End for + + // NOT multiple units + If ($size#"") - OBJECT SET VALUE:C1742($refValue; Num:C11($sizeVal; ".")) - $refUnit.index:=$refUnit.css.indexOf($sizeUnit) - $refUnit.memoUnit:=$refUnit.css[$refUnit.index] // "%","mm","cm","in" or "pt" + // + If ($size="auto") | ($size="cover") | ($size="contain") + OBJECT SET VALUE:C1742($refValue; 0) + $refUnit.index:=$refUnit.css.indexOf($size) + $refUnit.memoUnit:="" + Else // ex 50%, 10mm, 2.5cm, 5in or 120pt + + $n:=Length:C16($size) + For ($i; 1; $n) + $char:=$size[[$i]] + If (($char>="0") & ($char<="9")) | ($char=".") + $sizeVal:=$sizeVal+$char + Else + $sizeUnit:=Substring:C12($size; $i) + $i:=$n + End if + End for + + OBJECT SET VALUE:C1742($refValue; Num:C11($sizeVal; ".")) + $refUnit.index:=$refUnit.css.indexOf($sizeUnit) + $refUnit.memoUnit:=$refUnit.css[$refUnit.index] // "%","mm","cm","in" or "pt" + + End if + // + Else + // multiple units… do nothing. End if + // End for