Aside from processing events for a Plugin there needs to be a way to communicate back to the Plugins Dialog (Form) and the NPBuilder app.


This is done by a simple method of sending text to the control ID or requesting text back from the controls ID.

You can also send a numeric value to a control or request it back.


As mentioned in the previous topic, the Plugin header file has four defined routines for this:



You will notice that each routine has a parameter CID which is where you pass to NPBuilder the ID number ( or zero for Form ) of the control you want to communicate with.


For example if you have a BUTTON control with the ID of 100, to change the text of the control you would do the following



If you wanted to retrieve the controls current text you would do this:


If you had a control with ID of 100 which dealt with numbers rather than text you would use the following calls:


Some controls while they expect a text string, the text string may be a property string or possibly a string with a Macro language used in it.


For example Trackbar controls pass a property string to define the range of the Trackbar (ie. from 0 to 1000) and the current position of the Trackbar.


The Vector control expects a string which contains a Vector Macro description using the Vector Graphic Macro language.


For example a Vector control with ID 100 could have a macro string passed to it like this:



The OpenGL control works a little differently. When you send the control text you are sending a GLScript command to be executed immediately.

The GL Scripting language section in this document explains all of the GL (OpenGL) commands currently available.