In 2017, 4D initiated a new program to share the source code of 4D internal components to 4D Partners.
Sharing the source code of 4D components lets you customize them and make them your own! With project databases and the ability to share an application’s source code via a source control system, we’ve converted our 4D internal components into project databases and pushed the source code to the 4D GitHub account. It’s open to everyone, all you need to take advantage of it is an account on Github. Why did we do this? To make your life easier by keeping track of changes and modifications to both code and forms.
The available Components:
- 4D Report
- 4D Labels
- 4D WritePro Interface
- 4D Progress
- 4D Widgets
- 4D SVG
We’ve added the “4d-component” topic to all of our components. If you share components on GitHub, feel free to add these topics to make them easy to find since Github topics help other people find and contribute to projects.
How to use
Want to use these components in your application but the look of the “4D WritePro interface” doesn’t match the style of your graphic charter, or a functionality that your business requires is missing? Instead of entirely writing a component from scratch, you can take inspiration from the 4D component and make your own component.
To do this, create a clone of the repository. Then, add code or modify the component’s interface according to your needs. Next, compile and rename the new component. Finally for deployment, place the newly compiled component in the “component” folder of your database.
You don’t need to worry about the evolution of the 4D components, we’ll provide them for each version of 4D so you can easily recognize the difference between the versions. This lets you decide if you want to incorporate any modifications into your component.
Now, it’s up to you!
Note: When using your own components based on 4D Labels and 4D Report, you must adapt and use your component’s methods. 4D commands (e.g. Print Labels) are reserved for internal 4D components.
Go further…
If you want to follow a step-by-step example on how to customize 4D components, you can watch this session by Angelo Caroprese at 4D Summit 2018.