Re: 4D Write to 4D Write Pro, Moving and using templates (Was: WR Count equivalent in 4D Write Pro)

2018-06-12 Thread JOHN BAUGHMAN via 4D_Tech
Step 1 should have read "Using WR Count and WR GET PICTURE IN PAGE INFO"


> On Jun 12, 2018, at 11:41 AM, JOHN BAUGHMAN  wrote:
> 
> 1. In 4D Write store the position and dimensions of each anchored picture 
> place holder into a c_object.
>   Using WR Count and WR SELECT PICTURE IN PAGE
> 


John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

4D Write to 4D Write Pro, Moving and using templates (Was: WR Count equivalent in 4D Write Pro)

2018-06-12 Thread JOHN BAUGHMAN via 4D_Tech
If anyone was following the original thread, the underlying problem was how to 
address Anchored Picture place holders when converting a 4D Write template to 
4D Write Pro. Beyond that, how to populate the place holder pictures when the 
4D Write Pro template is used.

My last post left this problem as undoable in anything prior to v17. I have 
since figured out a way to do it in v16 and thought I would post my solution if 
anyone is in fact interested.

Moving the Template from 4D Write to 4D Write Pro…

1. In 4D Write store the position and dimensions of each anchored 
picture place holder into a c_object.
Using WR Count and WR SELECT PICTURE IN PAGE

2. Copy the 4D Write area to an off screen area and delete all the 
anchored picture placeholders.

3. Convert the off screen area to 4D Write Pro.

4. Using the c_object created in step 1 recreate in the new 4D Write 
Pro are all the anchored picture place holders with WP Add Picture.
Store the picture reference returned by WP Add Picture in the 
c_object created in step 1.

Saving the 4D Write Pro template

1. Store the c_object in the template record.

2. Using the picture references stored in the c_object, delete all the 
anchored picture place holders

3. Save the record

Opening the template in the Template table.

1, Using the saved c_object, recreate all the anchored picture place 
holders with WP Add Picture.
Update the picture references in the c_object with the newly 
created anchored pictures references as returned by WP Add Picture

Adding a 4D Write Pro template in a 4D Write Pro document for a patient in the 
patient table.

1. Using the saved c_object recreate all the anchored picture place 
holders with WP Add Picture.
Update the picture references in the c_object with the newly 
created anchored pictures references as returned by WP Add Picture

2, Using the picture references in the c_object, populate the place 
holder pictures with the photos from the patient record.

Hope this helps anyone struggling with a similar situation.

John



John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

> On Jun 10, 2018, at 9:06 PM, JOHN BAUGHMAN  wrote:
> 
> 
> 
>> On Jun 10, 2018, at 8:37 PM, Keisuke Miyako via 4D_Tech 
>> <4d_tech@lists.4d.com > wrote:
>> 
>> I must say it would be difficult to manipulate an existing anchored image 
>> without Get elements or Get element by id (v17).
> 
> 
> You assumed correctly in that these are anchored pictures. I have discovered 
> as you have pointed out that the reference returned by Add picture is 
> destroyed when the record is unloaded. I think you have confirmed for me that 
> there is no way currently to use picture place holders in a 4D Write Pro 
> template as I did in 4D Write.
> 
> I will give this a bit more thought, but I am about to give up on this part 
> of my attempt to upgrade my client to v16. Since it is way to early to deploy 
> v17, I will have to tell them they will have to wait until we upgrade to v17 
> to move any of their photo templates to Pro or create any new ones. Of course 
> this prevents me from moving them to 64 bit until then as well.
> 
> BTW, another thing I cannot find is any way to provide a means for end users 
> to insert 4D expressions as they can in 4D Write. I could write a dialog for 
> this, but it already exists in 4D so why not provide the same functionality 
> out of the box?
> 
> John
> 
> 
> 
> John Baughman
> 1331 Auwaiku Street
> Kailua, Hawaii  96734
> (808) 262-0328
> john...@hawaii.rr.com 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-11 Thread JOHN BAUGHMAN via 4D_Tech
Of course that works. Thanks. I was getting tired and cranky last night.

> On Jun 10, 2018, at 10:36 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I suppose you could use EDIT FORMULA, for a start...
> 
>> 2018/06/11 16:06、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> 
>> BTW, another thing I cannot find is any way to provide a means for end users 
>> to insert 4D expressions as they can in 4D Write. I could write a dialog for 
>> this, but it already exists in 4D so why not provide the same functionality 
>> out of the box?
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-11 Thread Keisuke Miyako via 4D_Tech
I suppose you could use EDIT FORMULA, for a start...

> 2018/06/11 16:06、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> のメール:
>
> BTW, another thing I cannot find is any way to provide a means for end users 
> to insert 4D expressions as they can in 4D Write. I could write a dialog for 
> this, but it already exists in 4D so why not provide the same functionality 
> out of the box?




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-11 Thread JOHN BAUGHMAN via 4D_Tech


> On Jun 10, 2018, at 8:37 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I must say it would be difficult to manipulate an existing anchored image 
> without Get elements or Get element by id (v17).


You assumed correctly in that these are anchored pictures. I have discovered as 
you have pointed out that the reference returned by Add picture is destroyed 
when the record is unloaded. I think you have confirmed for me that there is no 
way currently to use picture place holders in a 4D Write Pro template as I did 
in 4D Write.

I will give this a bit more thought, but I am about to give up on this part of 
my attempt to upgrade my client to v16. Since it is way to early to deploy v17, 
I will have to tell them they will have to wait until we upgrade to v17 to move 
any of their photo templates to Pro or create any new ones. Of course this 
prevents me from moving them to 64 bit until then as well.

BTW, another thing I cannot find is any way to provide a means for end users to 
insert 4D expressions as they can in 4D Write. I could write a dialog for this, 
but it already exists in 4D so why not provide the same functionality out of 
the box?

John



John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-10 Thread Keisuke Miyako via 4D_Tech
WP SET A. expects different kind of "range", depending on the attribute type.

for example,

// a regular range to specify where to insert the image
$range:=WP Create range($wp_l;wk end text;wk end text)

// insert the image in range
WP INSERT PICTURE($range;$data;wk append)

// the URL is a property of the regular range
WP SET ATTRIBUTES($range;wk link url;"...")

// the size is a property applies to the "picture" reference, not the range
$insertedImage:=WP Create picture range($range)
WP SET ATTRIBUTES($insertedImage;wk width;"...pt")

now, in your case, you are counting on "wk image"
to changes the data for an image that already exists in the document.

so you keep the picture reference returned from Add picture
but you can't just store for later use,
because it is not a static JSON structure,
it is a reference to an instance of 4D Write Pro
which is destroyed when you unload the form.

if this is an inline picture,
maybe you can construct a regular range (Create range) based on start/end,
then a picture range (Create picture range=Get pictures).

but it sounds like this is an anchored picture (because you mention Add 
picture),
which is not bound to any position in text.

(if it is not an anchored picture, it would make more sense to use INSERT 
PICTURE as shown above)

since it is not possible to converted an inline imaged to anchored,

http://doc.4d.com/4Dv16R6/4D/16-R6/4D-Write-Pro-Attributes.300-3605889.en.html

and only inline images can be an ST expression,
it seems anchored images are pretty much static.

I must say it would be difficult to manipulate an existing anchored image 
without Get elements or Get element by id (v17).

http://doc.4d.com/4Dv16R6/4D/16-R6/Handling-pictures.200-3624743.en.html

2018/06/11 12:18、JOHN BAUGHMAN via 4D_Tech 
<4d_tech@lists.4d.com> のメール:
how can I use WP SET ATTRIBUTES



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-10 Thread JOHN BAUGHMAN via 4D_Tech
Ahhh…. V17. I am working in v16R6.

Given a 4D Write Pro Template with a bunch of pictures that are in essence 
place holders to be filled when the template is used, how can I use WP SET 
ATTRIBUTES tp assign pictures from the database when the template is used…

WP SET ATTRIBUTES(picture1Ref;wk image;[Patient]photo1)

Maybe there is another way to assign the pictures?

I have not yet tried using the template, but I tried saving the references 
returned from WP Add picture() in the template record then using the saved 
reference to change the picture after saving and reopening the record. That did 
not work. If it doesn’t work between template loads it’s certainly not going to 
work when the template is used in a different table ([Letters]). So I think I 
need a way to create or access each picture’s reference object when the 
template is loaded.

This may be further complicated if the pro template was created with 4D Write. 
After converting the templates how do I reference the pictures? 


Thanks,

John




> On Jun 10, 2018, at 2:28 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> c.f.
> 
> http://doc.4d.com/4Dv17/4D/17/WP-Get-elements.301-3703212.en.html
> 
> a whacky alternative would be:
> 
> WP EXPORT DOCUMENT + wk web page complete and parse the XHTML (or count the 
> number of attachments)
> 
> working directly with XHTML is also quite useful to setup a preconfigured 
> document with non-default settings.
> you can then pass the XHTML to WP New.
> 
>> 2018/06/11 9:12、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> I cannot find WP Get element.
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-10 Thread Keisuke Miyako via 4D_Tech
c.f.

http://doc.4d.com/4Dv17/4D/17/WP-Get-elements.301-3703212.en.html

a whacky alternative would be:

WP EXPORT DOCUMENT + wk web page complete and parse the XHTML (or count the 
number of attachments)

working directly with XHTML is also quite useful to setup a preconfigured 
document with non-default settings.
you can then pass the XHTML to WP New.

> 2018/06/11 9:12、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> のメール:
> I cannot find WP Get element.



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-10 Thread JOHN BAUGHMAN via 4D_Tech


> On Jun 10, 2018, at 12:53 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> WP Get element <--- returns a collection

I cannot find WP Get element. 

Thanks.

John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WR Count equivalent in 4D Write Pro

2018-06-10 Thread Keisuke Miyako via 4D_Tech
if you want to bulk-update all pictures in a range, use

WP Create picture range (was WP Get pictures) <--- returns a class of object 
suitable for GET/SET ATTRIBUTES

if you want to access each pictures in a range or document, use

WP Get element <--- returns a collection



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

WR Count equivalent in 4D Write Pro

2018-06-10 Thread JOHN BAUGHMAN via 4D_Tech
I need to determine programmatically how many pictures a user has placed in a 
page’s background. In 4D Write I used WR Count(myWRArea;13).

Can't find a way in 4D Write Pro to count the number of pictures in the page, 
in background or otherwise.

Thanks,

John




John Baughman
1331 Auwaiku Street
Kailua, Hawaii  96734
(808) 262-0328
john...@hawaii.rr.com

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**