You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-16Lines changed: 23 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -168,10 +168,9 @@ You can enhance `4DPop` with [your own components](#how-to), and you are also ab
168
168
* One or more components from the collection
169
169
***Don't forget** to open your database structure settings dialog and go to the `Security` page to enable, if necessary, the `Execute the "On host database event" method of the component` option.
All the components in the 4DPop collection are compatible with the project's dependency manager.
173
+
All the components in the 4DPop collection are compatible with the [Project dependencies](https://developer.4d.com/docs/Project/components#monitoring-project-dependencies) feature. So you can simply integrate one or components into your project by selecting `Design` > `Project dependencies` and adding `vdelachaux/4DPop{-name}` as the repository address in the dedicated dialog box. **This way, you can benefit from updates over time**.
175
174
176
175
You can download a pre-configured `dependencies.json` file for the complete collection [**here**](./dependencies.json) and place it in the `Sources` folder of your project.
177
176
@@ -256,39 +255,44 @@ The manifest describes the elements of the component that will be available via
256
255
| `name` | The name that will be displayed below the button | ① | Mandatory
257
256
| `media` | File name of the image used for the button. |⑦| If omitted a default picture is used
258
257
| `handler` | The name of the ‘entry point’ method for your component. <br>I suggest that this name starts with an underscore (`_`) to avoid it interfering with the type ahead, as it is shared. | ② | Mandatory
259
-
| `default` | The name of the method to be executed when the user clicks on the strip's button | ③ ④ ⑤| Optional if `tools`is defined
258
+
| `default` | The name of the method to be executed when the user clicks on the strip's button | ③⑤| Optional if `tools`is defined
260
259
| `tools` | Collection of [tool objects](#tool) that will be displayed as a linked menu | ④ ⑥
261
-
| `popup` | To force the display of a linked menu indicator even if there is only one tool | ④
262
-
|`ondrop` | The name of the method to be executed at the time of a drop on the button | ③
263
-
| `initproc` | The name of the method to be executed when the component is loaded | ③
264
-
| `helptip` | Text of help tip associated with button
260
+
| `popup` | To force the display of a linked menu indicator even if there is only one tool | ⑤
261
+
|`ondrop` | The name of the method to be executed at the time of a drop on the button | ③
262
+
| `initproc`| The name of the method to be executed when the component is loaded | ③
263
+
| `helptip` | Text of help tip associated with button | ①
265
264
266
265
### <aname="tool">tool object</a>
267
266
268
267
| Attributes ||||
269
268
|------------|----|:----:|----|
270
-
| `name` | Name of the tool as it will appear in the menu associated with the button | ① ④ | Mandatory if there are several `tool`<br>• pass "-" to display a separator line
269
+
| `name` | Name of the tool as it will appear in the menu | ① ④ ⑧| Mandatory if there is more than one `tool`
271
270
| `method` | The name of the method to run when the item is selected | ③ | Mandatory
272
-
----
271
+
272
+
<hr>
273
+
273
274
> ① The `name` & `helptip` attributes accepts the syntax ‘ :xliff:resname’, so the string must be defined in the component's xliff files, and the string displayed will be localized.
274
275
275
-
> ② You must check the `Shared by component and host project` property. The method code must be:
276
+
> ② The method code must be:
276
277
277
278
```4d
278
279
#DECLARE() : 4D.Function
279
-
>return Formula(Formula from string($1))
280
+
return Formula(Formula from string($1))
280
281
```
282
+
> ⚠️ Don't forget to enable the `Shared by component and host project` property for this method.
281
283
282
284
> ③ The methods called receive an object as a parameter (for future use). If you plan to compile the component, this parameter must be declared explicitly `#DECLARE($data: Object)` in all the methods of the component called. It is not necessary to declare the method as shared.
283
285
284
-
> ④ If there is only one `tool`, the method is executed as soon as the button is clicked. If there are several `tool`, a menu arrow linked with the button is displayed and a menu listing the available tools is provided for the user.
286
+
> ④ If there is only one `tool`, the method is executed as soon as the button is clicked. If there are several `tools`, a menu arrow linked to the button is displayed and a menu, listing the available tools, is displayed when the user clicks on the arrow or performs a long click.
285
287
286
-
> ⑤ The component method may be responsible for constructing and displaying the menu. In this case, set the `default` attribute to the name of the method whose code displays the menu and processes the user's choice. For the menu arrow to be displayed on your tool's button, you need to specify ‘True’ in the `popup` attribute.
288
+
> ⑤ The component method may be responsible for building and displaying the menu. In this case, set the `default` attribute to the name of the method whose code displays the menu and processes the user's choice. This method will be called when the user clicks on the button or the arrow. For the menu arrow to be displayed on your tool's button, you need to specify “True” in the `popup` attribute.
289
+
290
+
> ⑥ If more than one tool is defined and the `default` attribute is set, a single click launches the `default` method and a long click or click on the arrow displays the tool menu. If there is no `default` attribute, the menu is always displayed.
287
291
288
-
> ⑥ In case of the default attribute is defined, a simple clic launches the `default` method and a long click or an on arrow click display the tools' menu.
289
-
>
290
292
> ⑦ You must provide an image of 512x512 pixels, 4DPop builds the various icons needed to display in the strip, the settings or the About dialog.
291
293
294
+
> ⑧ Put “-” to display a separator line
295
+
292
296
# <aname="topic">Topic 4DPop</a>
293
297
294
298
If you develop a [component compatible with 4DPop](#how-to), it is strongly recommended to add the "4DPop" [topic](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/classifying-your-repository-with-topics) to be referenced in the [list of 4DPop compatible components](https://github.com/topics/4dpop).
@@ -301,3 +305,6 @@ Found the issue? Go on and join its discussion thread.
301
305
Not found? Go on and <ahref="https://github.com/vdelachaux/4DPop/issues/new"target="_blank">create one</a>.
302
306
303
307
I strongly recommend that you create a [clone of this repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) and do a [pull-request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for your improvements and bug fixes.
0 commit comments