npArea plugin

About this plugin

This plugin allow you to use skinable image areas which can be clicked by the user. Define area regions using a Bitmap colored image (every color on the image are taken as area regions) and other optional pictures to the diferent area region states.

You can attach to host rectangles one or more Areas objects, and customize every one with their own images and options. Also you can set and get certain properties of every area region. And of course be notified when the user click on an specific area region.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npAreaCreate

Create a new instance of an Area object and attach it to a NeoBook rectangle object. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npAreaDestroy

Destroy a previously Area object instance and deattach from their NeoBook rectangle. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npAreaDestroyAll

Destroy all previously Area objects instances and deattach from their NeoBook rectangles.

↑↑

npAreaSetRegion

Set specific properties for an area region of an Area object instance. You need to specify the host rectangle in which the Area object is attached, and the Color (in NeoBook format, like "0,0,255") of the area region that you want to set their properties. You can set this area region properties:

(*) Imagine an area with four regions (like in the plugin samples). If you set two region with the same group, for example, "1", then this area regions act in an "exclusive" mode, so when you click on one area region, this is shown "down", and the other "up" and viceversa.

The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npAreaGetRegion

Get specific properties for an area region of an Area object instance. Specify variables to get the values of the specified area region. The available values are the same that is defined on the npAreaSetRegion action. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npAreaImages

Set the images options of an Area object instance. The only needed image is the "Area" image. All others are optionals. Below you can see the list of possible images for the Area object instance.

Note that the Area image support only Bitmap (BMP) images. Other pictures options support BMP, JPG, PNG, GIF and TIFF images. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npAreaOptions

Set the general options of an Area object instance. Below you can see the diferent options and values for the Area object instance.

The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnAreaClick

Set a publication subroutine to be executed when an area region of the specified Area object instance are clicked. The Rectangle variable store the rectangle name in which the object is attached and that fired the event. The Color variable store the area region color. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑