Find and Replace Component for 4D Write Pro

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Find and Replace Component for 4D Write Pro

4D Tech mailing list
I had the need to add find and replace to my 4D Write Pro areas. So I created a generic component. It easily shows and hides itself at the top of a Write Pro area and can resize itself automatically. You can download it and a demo at:

http://www.successware.net/downloads/4d-components/FindAndReplace.zip

It requires 4D v16R5. You are free to use and modify it in any way you wish. See the accompanying MIT license.

Hope this saves someone else some time and effort. :-)

----------
Jeff Grann
SuccessWare, Inc.

**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Find and Replace Component for 4D Write Pro

4D Tech mailing list
Hey Jeff,

Simple! Cool UI trick as well.

Works with v16R4 as well.

Thanks much,
John…



> I had the need to add find and replace to my 4D Write Pro areas. So I created a generic component. It easily shows and hides itself at the top of a Write Pro area and can resize itself automatically. You can download it and a demo at:
>
> http://www.successware.net/downloads/4d-components/FindAndReplace.zip
>
> It requires 4D v16R5. You are free to use and modify it in any way you wish. See the accompanying MIT license.

**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Find and Replace Component for 4D Write Pro

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Pat Bensky found a bug with the "replace all" in certain circumstances.  I posted a fix to the same link:

http://www.successware.net/downloads/4d-components/FindAndReplace.zip <http://www.successware.net/downloads/4d-components/FindAndReplace.zip>

Thanks Pat!

----------
Jeff Grann
SuccessWare, Inc.

> On Mar 7, 2018, at 10:46 AM, Jeff Grann <[hidden email]> wrote:
>
> I had the need to add find and replace to my 4D Write Pro areas. So I created a generic component. It easily shows and hides itself at the top of a Write Pro area and can resize itself automatically. You can download it and a demo at:
>
> http://www.successware.net/downloads/4d-components/FindAndReplace.zip <http://www.successware.net/downloads/4d-components/FindAndReplace.zip>
>
> It requires 4D v16R5. You are free to use and modify it in any way you wish. See the accompanying MIT license.
>
> Hope this saves someone else some time and effort. :-)
>
> ----------
> Jeff Grann
> SuccessWare, Inc.
>

**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Find and Replace Component for 4D Write Pro

4D Tech mailing list
In reply to this post by 4D Tech mailing list
On 8 Mar 2018, at 1:46 am, Jeff Grann via 4D_Tech <[hidden email]> wrote:
>
> I had the need to add find and replace to my 4D Write Pro areas. So I created a generic component. It easily shows and hides itself at the top of a Write Pro area and can resize itself automatically. You can download it and a demo at:
>
> http://www.successware.net/downloads/4d-components/FindAndReplace.zip

Very elegant piece of work, Jeff. Thanks for sharing!

J
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Flexible SVG ID Strategy

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Hi All,

{I sent this yesterday & and again earlier today and it never made it through?}

I am trying to create an interface built using SVG. The sag image will include many different kinds of complex objects. Bu complex I mean that each object is itself a complex object built by SVG and added into the main SVG image.

I want to be able to identify any part of an image I click on even if it’s part of a group. But I also want to be able to move the object around to different coords in the image.

I am using SVG_SET_ID (domSvg;”id_name...”) set each part of the objects ID. when I click on them I see the ID and this works great. BUT...

But when I move an object I want the entire object to move not just the part of it.

So wondering if anyone has decided on a strategy for managing SVG OD’s and how to best handle moving things around?

If this doesn’t make sense please ask questions.

BTW I am running in 4D v16 r6 and will be moving to v17.

Appreciate,
John…
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Flexible SVG ID Strategy

4D Tech mailing list
The easiest way I've found to move the objects in a group is to SVG_SET_TRANSFORM_TRANSLATE the group when the mouse is moving.  
Later if you UNGROUP, the translation needs to be spread out over the group's children so they don't jump to new locations.

You can use SVG_Get_root_reference in a loop to find the topmost group of the clicked object (the last one whose TYPE is not "svg").

Unless an ID needs to be meaningful, I've been letting the 4D SVG Engine set the ID (SVG_SET_OPTIONS), or setting the ID to GENERATE UUID.

Keith - CDI

> On Jun 5, 2018, at 3:22 PM, John J Foster via 4D_Tech <[hidden email]> wrote:
>
> Hi All,
>
> {I sent this yesterday & and again earlier today and it never made it through?}
>
> I am trying to create an interface built using SVG. The svg image will include many different kinds of complex objects. Bu complex I mean that each object is itself a complex object built by SVG and added into the main SVG image.
>
> I want to be able to identify any part of an image I click on even if it’s part of a group. But I also want to be able to move the object around to different coords in the image.
>
> I am using SVG_SET_ID (domSvg;”id_name...”) set each part of the objects ID. when I click on them I see the ID and this works great. BUT...
>
> But when I move an object I want the entire object to move not just the part of it.
>
> So wondering if anyone has decided on a strategy for managing SVG OD’s and how to best handle moving things around?
>
> If this doesn’t make sense please ask questions.
>
> BTW I am running in 4D v16 r6 and will be moving to v17.
>
> Appreciate,
> John…

**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Flexible SVG ID Strategy

4D Tech mailing list
In reply to this post by 4D Tech mailing list
SVG is XML, so you can have as many namespaces as you like.

in all of my SVG editors I define a private namespace,
which contains extended information such as group ID.

it also helps to store transform values (rotate, scale, translate)
as individual attributes in said namespace,
so much easier than to extract via regex or whatever each time.

https://github.com/miyako/4d-widget-svg-area-v3

https://github.com/miyako/4d-widget-svg-area-v2

> 2018/06/06 5:22、John J Foster via 4D_Tech <[hidden email]> のメール:
> So wondering if anyone has decided on a strategy for managing SVG OD’s and how to best handle moving things around?




**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Flexible SVG ID Strategy

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Hi John,


I understand there are cases where you might build an SVG interface using 4D commands instead of using javascript in a web area. But when you want to do drag and drop, that is probably the use case that will most benefit from using javascript. You can use a parent/child technique that works so well in js. Your IDs can just be auto assigned and can relate to the IDs of your associated 4D data.



Tom DeMeo
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Flexible SVG ID Strategy

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Hi Tom,

I have looked at a few but thought it might be work. But now I am not so sure. It is something I will building on for years so…

Which JS SVG library do you recommend?

I assume I’ll be able to:

Create template objects that can be reused and dynamically updated based upon the record they are associated wth?

Thus able to save and restore.

Able to click on any property and dynamically change it using some sort of property palette?

Speedy redraw?

Still lots to do so building a strong and flexible foundation paramount.

Thanks for the idea,
John…


>
> From: Tom DeMeo <[hidden email] <mailto:[hidden email]>>
> Subject: Re: Flexible SVG ID Strategy
> Date: June 6, 2018 at 1:14:39 PM PDT
> To: [hidden email] <mailto:[hidden email]>
>
>
> Hi John,
>
>
> I understand there are cases where you might build an SVG interface using 4D commands instead of using javascript in a web area. But when you want to do drag and drop, that is probably the use case that will most benefit from using javascript. You can use a parent/child technique that works so well in js. Your IDs can just be auto assigned and can relate to the IDs of your associated 4D data.
>
>
>
> Tom DeMeo
**********************************************************************
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:[hidden email]
**********************************************************************