npPops plugin

About this plugin

This NeoBook plugin allows you to create one or more Popup Menu objects in order to be shows when you need in whatever part of your publication. You can add the items and subitems that you wanted and these can have associated Bitmap images.

You can prepare a Popup Menu with a couple of actions and various Popup Menu in the same publication. The appropiate subroutine are executed when a Menu item is clicked and you can get information about what Popup Menu and item are selected by the user.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npPopsCreate

Create a new instance of an Pops object. The result variable store a numeric ID which you can use in other plugin actions to work with the appropiate Pops object instance.

↑↑

npPopsDestroy

Destroy a previously created instanace of an Pops object. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsDestroyAll

Destroy all previously created instances of Pops objects.

↑↑

npPopsAddMenuItem

Add a new menu item for the specified Pops object instance. The Menu Item ID is a numeric value which you can use later in order to identify the item when it's clicked by the user (see npOnPopsMenuItemClick). Also this numeric ID is required if you want to add submenu items to the item (see npPopsAddMenuSubItem). If you want to set this as a separator item set their text as "-" without quotes.

The Bitmap is optional and determine the item width and height. Note that all the images (if you use it) need to be of the same size. Also note that the plugin take the top left pixel of the Bitmap to use as the background color mask. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsAddMenuSubItem

Add a new menu subitem for the specified Pops object instance. The Menu Item ID is a numeric value which you can use later in order to identify the item when it's clicked by the user (see npOnPopsMenuItemClick). Also this numeric ID is required if you want to add submenu items to the item. If you want to set this as a separator item set their text as "-" without quotes.

The Bitmap is optional and determine the item width and height. Note that all the images (if you use it) need to be of the same size. Also note that the plugin take the top left pixel of the Bitmap to use as the background color mask. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsCheckMenuItem

Check or uncheck an item of the specified Pops object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsIsItemChecked

Find if an item of the specified Pops object instance is checked or not. The result variable store "True" if the specified item is checked, or "False" when not.

↑↑

npPopsEnableMenuItem

Enable or disable an item of the specified Pops object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsIsItemEnabled

Find if an item of the specified Pops object instance is enabled or not. The result variable store "True" if the specified item is enabled, or "False" when not.

↑↑

npPopsHideMenuItem

Hide or show an item of the specified Pops object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsIsItemHidden

Find if an item of the specified Pops object instance is hidden or not. The result variable store "True" if the specified item is hidden, or "False" when not.

↑↑

npPopsShowMenu

Show the Popup Menu of the specified Pops object instance at the specified position. The Y and X positions are relative to the screen. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsShowMenuEx

Show the Popup Menu of the specified Pops object instance at the cursor position. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npPopsMenuColors

Set the menu colors of the specified Pops object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npOnPopsMenuItemClick

Set a publication subroutine to be executed when the specified Pops object instance (menu item) are clicked by the user. The Instance ID variable store the Pops object ID which fired the event, so you can share the same subroutine to be used not only by more than one menu items, but also to use with various Pops objects instances.

The Menu item ID variable store the menu item ID which you determine when add menu items and subitems using npPopsAddMenuItem and npPopsAddMenuSubItem. In this way you can know exactly what item is clicked by the user.

The result variable store "True" if everything is OK, or "False" if an error occur. In this last case the [LastError] variable 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.

↑↑