User input in a plugin?

Beta releases, announcements and anything else that doesn't fit below. Please read the <B>Welcome</B> topic.

Moderator: DPlotAdmin

Post Reply
pomalle
Posts: 8
Joined: Wed Feb 18, 2009 10:02 am

User input in a plugin?

Post by pomalle »

Hi,

I would like to write a Dplot "generate" plugin that queries the user for three numerical values. It would seem that this is potentially possible but would require the DLL to spawn a window with controls such as buttons and input fields and all that. Has anyone ever done this? If so, is there an example out there? Or is there an easier way?

Thanks!
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Several of the generate plugins distributed with DPlot display dialog boxes and take user input. The "Moving Average" plugin is probably the simplest. If you'd like I'll be happy to post the source where you can get it.
Visualize Your Data
support@dplot.com
pomalle
Posts: 8
Joined: Wed Feb 18, 2009 10:02 am

Post by pomalle »

Thanks! I found the moving average plugin source code in another post. It intimidated me :) Maybe I'll give it a try.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I'll be happy to help if you have a hard time with this. For old-timers using archaic programming languages as I do there really isn't anything magic about it. But if you're accustomed to, for example, VB then the dialog procedure may look like spaghetti.

Other than that, the only real gotcha is explained in the post you've already found: returning with an error due to insufficient array sizes, whereupon DPlot will adjust the arrays and call your plugin again. At that point (in most cases) you wouldn't want to again display your dialog box. The solution is a little convoluted but works.

Again, don't hesitate to ask if you have problems. I'll be happy to help if I can.
Visualize Your Data
support@dplot.com
Post Reply