Skip to content

Commit

Permalink
v20
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Jul 6, 2023
1 parent 111e395 commit 4ca9c6c
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 59 deletions.
Binary file added Build/4DPop Image Buddy.4dbase.zip
Binary file not shown.
Binary file modified Build/Components/4DPop Image Buddy.4dbase/4DPop Image Buddy.4DZ
Binary file not shown.
8 changes: 4 additions & 4 deletions Build/Components/4DPop Image Buddy.4dbase/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<key>CFBundleName</key>
<string>4DPop Image Buddy</string>
<key>CFBundleShortVersionString</key>
<string>20R2</string>
<string>20</string>
<key>CFBundleLongVersionString</key>
<string>20R2 (296)</string>
<string>20 (297)</string>
<key>NSHumanReadableCopyright</key>
<string>©vdl 2007-2023</string>
<key>CFBundleVersion</key>
<string>297</string>
<string>298</string>
<key>CSResourcesFileMapped</key>
<string></string>
<key>CFBundleGetInfoString</key>
<string>20R2</string>
<string>20</string>
<key>CFBundleDisplayName</key>
<string>4DPop Image Buddy</string>
</dict>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed Build/Components/4DPop Image Buddy.dmg
Binary file not shown.
8 changes: 4 additions & 4 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<key>CFBundleName</key>
<string>4DPop Image Buddy</string>
<key>CFBundleShortVersionString</key>
<string>20R2</string>
<string>20</string>
<key>CFBundleLongVersionString</key>
<string>20R2 (296)</string>
<string>20 (297)</string>
<key>NSHumanReadableCopyright</key>
<string>©vdl 2007-2023</string>
<key>CFBundleVersion</key>
<string>297</string>
<string>298</string>
<key>CSResourcesFileMapped</key>
<string></string>
<key>CFBundleGetInfoString</key>
<string>20R2</string>
<string>20</string>
<key>CFBundleDisplayName</key>
<string>4DPop Image Buddy</string>
</dict>
Expand Down
1 change: 0 additions & 1 deletion Project/Sources/Methods/browser.4dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//%attributes = {}
#DECLARE($data : Object)

BROWSER_HANDLER
112 changes: 63 additions & 49 deletions Project/Sources/Methods/onDrop.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,90 +3,104 @@
// Method : Pictures_Tool_Ondrop
// Created 14/02/08 by Vincent de Lachaux
// ----------------------------------------------------
// Description
//
// ----------------------------------------------------
#DECLARE($data : Object)

var $dest; $name; $src : Text
If (False:C215)
C_OBJECT:C1216(onDrop; $1)
End if

var $name; $pathname : Text
var $picture : Picture
var $dropPosition; $indx : Integer
var $pic : Picture
var $file : 4D:C1709.File
var $resources : 4D:C1709.Folder

$dest:=Get 4D folder:C485(Current resources folder:K5:16; *)
$resources:=Folder:C1567("/RESOURCES/"; *)
$indx:=1

// Get a path in the drag container
$src:=Get file from pasteboard:C976(1)
$pathname:=Get file from pasteboard:C976($indx)

Case of

//______________________________________________________
: (Length:C16($src)=0) // No path : try an image
: (Length:C16($pathname)=0) // No path : try an image

$dropPosition:=1

ARRAY TEXT:C222($signatures; 0x0000)
ARRAY TEXT:C222($nativeTypes; 0x0000)
GET PASTEBOARD DATA TYPE:C958($signatures; $nativeTypes)

If (Find in array:C230($signatures; "com.4d.private.picture.4dpicture")>0)
If (Find in array:C230($signatures; "com.4d.private.picture.4dpicture")=-1)

If (OK=1)

$name:=Get localized string:C991("NewImage")
$name:=Request:C163(Get localized string:C991("Name"); $name; Get localized string:C991("CommonCreate"))

If (OK=1)

End if
End if
BEEP:C151
return

Else
End if

$name:=Get localized string:C991("NewImage")
$name:=Request:C163(Get localized string:C991("Name"); $name+".png"; Get localized string:C991("CommonCreate"))

If (Bool:C1537(OK))

BEEP:C151
// TODO:Create the picture into the resources folder

End if

//______________________________________________________
Else

$indx:=1
$file:=File:C1566($pathname; fk platform path:K87:2)

ON ERR CALL:C155(Formula:C1597(No_Error).source)

Repeat

If (Test path name:C476($src)=Is a document:K24:1)
If (Not:C34($file.exists)) // It could be a folder

continue

ERROR:=0
ON ERR CALL:C155("No_Error")
READ PICTURE FILE:C678($src; $pic)
ON ERR CALL:C155("")
End if

ERROR:=0
READ PICTURE FILE:C678($file.platformPath; $picture)

Case of

//.....................................................
: (OK=0)

//.....................................................
: (ERROR#0)

ALERT:C41(".Error Nº "+String:C10(ERROR)+" reading file \""+$file.fullName+"\"")

//.....................................................
: (Picture size:C356($picture)=0)

//.....................................................
Else

$file.copyTo($resources; fk overwrite:K87:5)

//.....................................................
End case

$indx+=1
$pathname:=Get file from pasteboard:C976($indx)

If (Length:C16($pathname)=0)

Case of

//.....................................................
: (OK=0)

//.....................................................
: (ERROR#0)

ALERT:C41(".Error Nº "+String:C10(ERROR)+" reading file \""+doc_Txt_Path_Handler("get.name"; $src)+"\"")

//.....................................................
: (Picture size:C356($pic)=0)

//.....................................................
Else

COPY DOCUMENT:C541($src; $dest+doc_Txt_Path_Handler("get.name"; $src); *)

//.....................................................
End case
break

End if

$indx:=$indx+1
$src:=Get file from pasteboard:C976($indx)
$file:=File:C1566($pathname; fk platform path:K87:2)

Until ($src="")
Until ($pathname="")

ON ERR CALL:C155("")

//______________________________________________________
End case
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
![code-size](https://img.shields.io/github/languages/code-size/vdelachaux/4DPop-Image-Buddy.svg)
[![license](https://img.shields.io/github/license/vdelachaux/4DPop-Image-Buddy)](LICENSE)
[![release](https://img.shields.io/github/v/release/vdelachaux/4DPop-Image-Buddy?include_prereleases)](https://github.com/vdelachaux/4DPop-Image-Buddy/releases/latest)
[![Build](https://github.com/vdelachaux/4DPop-Image-Buddy/actions/workflows/build.yml/badge.svg)](https://github.com/vdelachaux/4DPop-Image-Buddy/actions/workflows/build.yml)

# 4DPop Image Buddy

Expand Down
Binary file modified Resources/InfoPlist.strings
Binary file not shown.
2 changes: 1 addition & 1 deletion lastbuild
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20R2
20

0 comments on commit 4ca9c6c

Please sign in to comment.