npTray plugin

About this plugin

This plugin allow you to put one or more Tray Icons for your NeoBook publications. You can create more than one Tray Icon from the same publication. Every Tray Icon can be controlled separatelly and can have menus and submenus, balloon hints, etc.

The Tray Icons support Popup menus with items and subitems, you can conform complex Popup menus, including the use of optional images for every item and subitem. The plugin include events to notify you about Tray Icon, menu items and balloon hints clicks, etc.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npTrayCreate

Create a new instance of an Tray object. The result variable store the numeric ID of the new created Tray object instance. You need this ID on other plugins actions.

↑↑

npTrayDestroy

Destroy a previously created instanace of an Tray 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.

↑↑

npTrayDestroyAll

Destroy all previously created instances of Tray objects.

↑↑

npTrayOptions

Set some general options for the specified Tray object instance. This option are listed below:

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

↑↑

npTrayAddMenuItem

Add a new menu item for the specified Tray object instance. Note that the item ID must be unique. This item ID can be used later to discover what menu item is clicked, for example, or to add subitems to it. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npTrayAddMenuSubItem

Add a new menu subitem for the specified Tray object instance. Note that the item ID must be unique. This item ID can be used later to discover what menu item is clicked, for example, or to add subitems to it. On the other hand, you need to specify a parent item ID, which is the ID of a previously added menu item. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npTrayShowBalloon

Show a balloon hint in the specified Tray object instance. Choose the balloon type (determine the icon, for example), the title, text and duration for the balloon hint. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnTrayClick

Set a publication subroutine to be executed when the specified Tray object instance (icon) are clicked by the user. The Instance ID variable store the ID of the clicked Tray icon. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnTrayDblClick

Set a publication subroutine to be executed when the specified Tray object instance (icon) are double clicked by the user. The Instance ID variable store the ID of the clicked Tray icon. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnTrayBalloonClick

Set a publication subroutine to be executed when the specified Tray object instance (balloon hint) are clicked by the user. The Instance ID variable store the ID of the clicked Tray icon. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnTrayBalloonShow

Set a publication subroutine to be executed when the specified Tray object instance (balloon hint) are showed. The Instance ID variable store the ID of the clicked Tray icon. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnTrayBalloonHide

Set a publication subroutine to be executed when the specified Tray object instance (balloon hint) are hide. Note that if the user click the balloon hint this is hide but this event is not fired (but npOnTrayClick yes). The Instance ID variable store the ID of the clicked Tray icon. The result variable store "True" if everything is OK, or "False" if not. In this last case the [LastError] contain information about the error.

↑↑

npOnTrayMenuItemClick

Set a publication subroutine to be executed when the specified Tray object instance (menu item) are clicked by the user. The Instance ID variable store the ID of the clicked Tray icon. On the other hand, the Item ID variable store the ID of the item being clicked. 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.

↑↑