|
![]() |
![]() |
Developers know how painful the creation/management of dialogs can be using an OS API -- for either MacOS or Windows.
4D Plug-in API gives Plug-in developers the ability to use a dialog created with the 4D Form Editor. The dialog can use any 4D object and can have object and form methods. Changing the state of an object, its color, its visibility, etc. is done through the 4D Language, a language much easier than a native Language. The API lets the Plug-in get the value of any variable used in the dialog at any time. It can set the values of objects, move them, etc. within its own C/C++ code, even if it is probably much easier to write this within the form itself using the 4D Language.
Beyond this facility to create a dialog, an other advantage is that by doing dialogs this way, the Plug-in developer can take advantage of the 4D virtual platform interface. The dialogs will always look nice on each platform.
4D Dialogs within a plug-in can be called anywhere from plug-in code, but a more usual usage is probably from External Areas, in the Advanced Properties dialog, or at Runtime for setting preferences or properties of an area.
To open and manage a dialog from a plug-in, the developer has to follow those 3 steps :
- Create and open the dialog (
PA_NewDialog
,
PA_OpenDialog
)
|
|
- Then, in a loop, call
PA_ModalDialog
, until the user cancels or validates the dialog. The Plug-in can interact with the user from the 4D Dialog itself, or by using some of this API's routines (
PA_Dial4DSetLong
,
PA_Dial4DGetDate
)
|
|
- Finally, the plug-in closes the dialog (
PA_CloseDialog
).
|
Sample use