Hello David,
Is it possible to create a plugin dll with a dialog box (in order a to do a filter)?
Could you explain us how to do ?
Best Regards
Franck
Plugin Dll with a dialog box
Moderator: DPlotAdmin
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Franck,
Sure, that's possible and isn't all that different from displaying a dialog box in any other DLL. You can get the source code for the Moving Average DLL from http://www.dplot.com/plugins/generate/m ... verage.zip.
The source includes an owner-draw list box that displays curve legends using the non-standard text formatting used in DPlot for subscripts, superscripts, etc.
The only real peculiarity here is what to do in the event that an action taken in the dialog procedure results in a condition that DPlot isn't prepared to handle. In particular: what should be done if as a result of selections made by the user in the dialog, you want to exceed the allowable number of curves or points for the arrays currently allocated? For all plugins you return the necessary values in the DPlot structure and a return value of PLUGIN_BADARRAYSIZE. DPlot resizes the arrays, then calls the plugin again. But at this point you usually don't want to display the dialog box again, you just want to proceed with the guts of the plugin. This plugin (and all others I distribute that include a dialog box) handles this by saving the dialog settings along with the last return code from the plugin to the registry. On entry that last return code is checked; if it is PLUGIN_BADARRAYSIZE then the plugin knows that the dialog should not be displayed again. On re-reading the above it all sounds like gibberish, but if you take a look at the source I think you'll see how it all works. Let me know if you have any questions.
Sure, that's possible and isn't all that different from displaying a dialog box in any other DLL. You can get the source code for the Moving Average DLL from http://www.dplot.com/plugins/generate/m ... verage.zip.
The source includes an owner-draw list box that displays curve legends using the non-standard text formatting used in DPlot for subscripts, superscripts, etc.
The only real peculiarity here is what to do in the event that an action taken in the dialog procedure results in a condition that DPlot isn't prepared to handle. In particular: what should be done if as a result of selections made by the user in the dialog, you want to exceed the allowable number of curves or points for the arrays currently allocated? For all plugins you return the necessary values in the DPlot structure and a return value of PLUGIN_BADARRAYSIZE. DPlot resizes the arrays, then calls the plugin again. But at this point you usually don't want to display the dialog box again, you just want to proceed with the guts of the plugin. This plugin (and all others I distribute that include a dialog box) handles this by saving the dialog settings along with the last return code from the plugin to the registry. On entry that last return code is checked; if it is PLUGIN_BADARRAYSIZE then the plugin knows that the dialog should not be displayed again. On re-reading the above it all sounds like gibberish, but if you take a look at the source I think you'll see how it all works. Let me know if you have any questions.
Visualize Your Data
support@dplot.com
support@dplot.com