Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

Most components that present a user interface, have an item in the navigation tree that presents a panel when the item is clicked. 

Adding a tree item

When you are ready to create your user interface, the first thing that you typically do is add an item to the navigation tree. 

NavItemHelpers in the sdk provides a much more convenient way of managing navigation items. However the examples in this section use the full low level APIs.

When creating your framework you have to wait until the ComponentUIAPI interface has been registered. Your component will get a COMPONENT_NOTIFY_NEWINTERFACE message with a UUID of UIFRAMEWORK_INTERFACE_UUID when the host component framework is ready to be used.

In the example above we have set treeItem.lParam to NULL. However this is a free form field and you may wish to set this to some object which is then used to process your events in a more object oriented fashion. e.g.

 

Getting notified of activation and deactivation

The pInterface member above points to an interface that will be called to handle events relating to your inserted item. The most common of these are NI_EVENT_ACTIVATE an NI_EVENT_DEACTIVATE which are called when the user selects your item in the tree and when they click away to another item. 

Creating a custom panel

When the WMC needs you to create the window relating to your navigation tree item then it calls the NavigationItemUIInterface interface function NavItemCreateWindow. In this function you need to return the HWND associated with your window.

When the WMC disconnects from a WinGate Engine, the entire window hierarchy is destroyed and all GUI components are unloaded. However, If you need to close your window under your control you can do so at any appropriate time such as in your component's Stop() function or when it receives a COMPONENT_NOTIFY_PREDISCONNECT message in it's Notify callback.

 

 

  • No labels