Channelui

ILxChannelUI

class ILxChannelUI

The item.channel command is used to show channels as controls in the UI. For full support the channels need to provide some way to tell the UI if the channel is enabled or when the some state changes. This is done by providing an ILxChannelUI interface on the item type/package object.

Public Functions

LxResult Enabled(LXtObjectID self, const char *channelName, LXtObjectID msg, LXtObjectID item, LXtObjectID chanRead)

The enable method works very much like a command enable function, and returns the same kinds of codes: LXe_CMD_DISABLED if disabled, LXe_OK for enabled and anything else for a failure code. The item type and channel name are provided as arguments, allowing the same object to handle multiple different channels. A disable message can be returned as part of the ILxMessageID. Note that, as with commands, the code stored in the ILxMessageID should also be returned by the enable function. The item argument may be NULL, or may be provided by the caller. The object can use this for for more specific enable tests. Note that it is valid for the item to be NULL, in which case a general test should be applied to item type itself.

LxResult DependencyCount(LXtObjectID self, const char *channelName, unsigned *count)

item.channel needs a way to know what other channels this channel might depend on for its enable state. The following methods are used to see if a recently changed channel is a dependency of this channel and thus control if this channel is enabled (i.e., available for user interaction) or not (i.e., “ghosted”). If the changed channel is a dependency, then this channel’s UI representation is told to update it’s “enabled” state with that returned by the Enabled() method. Note that the dependency mechanism only allows watching channels on the same item. This includes allowing packages to watch for changes to channels on other packages as long as both packages are on the same item. If you need more flexibility, you’ll need to implement your own notifier through the UIHints() method. The depItemType argument thus indicates a channel in different package on the item, or a supertype of the item itself.

LxResult DependencyByIndex(LXtObjectID self, const char *channelName, unsigned index, LXtItemType *depItemType, const char **depChannelName)
LxResult DependencyByIndexName(LXtObjectID self, const char *channelName, unsigned index, const char **depItemTypeName, const char **depChannelName)

This variation is more robust, taking an item type as a string instead of an integer code. This works well for packages, which do not support type codes. Clients only need to implement one of those, although DependencyByIndexName() is preferred.

LxResult ItemEnabled(LXtObjectID self, LXtObjectID msg, LXtObjectID item)

Entire items can also be disabled or enabled. When disabled, all controls related to item (such as channel controls in property forms) will be considered disabled, and the item will be marked as disabled in the Item List. The item argument is the specific item being tested.

LxResult ItemIcon(LXtObjectID self, LXtObjectID item, const char **icon)

An item can return a specific icon resource name based on some state, like an item tag. This isn’t updated too frequently, and thus should be a relatively static icon. If this returns a failure code or is not implemented, the icon found referenced in the Item Help configs is used. The resource name should not include any size suffix (ie: return “MyItemIcon”, not “MyItemIcon_20”).

LxResult UIHints(LXtObjectID self, const char *channelName, LXtObjectID hints)

A channel’s UI hints are automatically populated for it before being used for the UI. However, items further tweak these by implementing this method and setting the UI hints properties themselves.

LxResult UIValueHints(LXtObjectID self, const char *channelName, void **ppvObj)

Channels can similar return a specific UIValueHints object for their UI, and to provide a per-channel notifier list.

LxResult Cookie(LXtObjectID self, const char *channelName, const char *requestedFor, const char **cookie)

Each item/channel pair can have a cookie associated with it. This is primarily used to associate global data with the channel, which is often stored in the config. A common case is to provide a value preset popup for numeric channels. The cookie is optional. This method can return any failure code, such as LXe_NOTIMPL or LXe_NOTFOUND, if the channel does not have a cookie. A single channel may have multiple cookies for different purposes, and in fact may use the same cookie for multiple states. This allows the channel to support one global but not another. Which cookie the client wants is determined by the requestedFor argument.

ILxChannelUI1

class ILxChannelUI1

Public Functions

LxResult Enabled(LXtObjectID self, const char *channelName, LXtObjectID msg, LXtObjectID item, LXtObjectID chanRead)
LxResult DependencyCount(LXtObjectID self, const char *channelName, unsigned *count)
LxResult DependencyByIndex(LXtObjectID self, const char *channelName, unsigned index, LXtItemType *depItemType, const char **depChannelName)
LxResult ItemEnabled(LXtObjectID self, LXtObjectID msg, LXtObjectID item)
LxResult UIHints(LXtObjectID self, const char *channelName, LXtObjectID hints)
LxResult UIValueHints(LXtObjectID self, const char *channelName, void **ppvObj)
LxResult Cookie(LXtObjectID self, const char *channelName, const char *requestedFor, const char **cookie)

ILxChannelUIService

class ILxChannelUIService

The service interface provides some general methods for getting information about.

Public Functions

LxResult ScriptQuery(LXtObjectID self, void **ppvObj)
LxResult ItemTypeName(LXtObjectID self, LXtItemType typeID, unsigned useSuper, const char **name)

Given an item type, these returns the type’s username (not the internal name) and description, as defined in the ItemHelp configs. If useSuper is true, the supertye’s information will be used if no information can be found for the specific type.

LxResult ItemTypeDesc(LXtObjectID self, LXtItemType typeID, unsigned useSuper, const char **name)
LxResult ItemTypeIconText(LXtObjectID self, LXtItemType typeID, unsigned useSuper, char *buf, unsigned len)

This returns the name of the icon for this item type, optionally falling back to its supertype.

LxResult MeshMapUserName(LXtObjectID self, const char *name, unsigned addIcon, char *buf, unsigned len)

Get the username of a mesh map given its internal name. If addIcon is true, the icon will be encoded into the buffer as a rich text string.

LxResult ChannelUserName(LXtObjectID self, LXtObjectID item, unsigned channel, char *buf, unsigned len)

Get the username, description and toolitp of a channel given an item (not an item type) and the channel index.

LxResult ChannelDescription(LXtObjectID self, LXtObjectID item, unsigned channel, const char **desc)
LxResult ChannelToolTip(LXtObjectID self, LXtObjectID item, unsigned channel, const char **tip)
LxResult GetTypeIcon(LXtItemType typeID, unsigned useSuper, std::string &text)
LxResult GetMapUserName(const char *name, unsigned addIcon, std::string &text)
class Tmp_Sgs

User Class Only:

Public Functions

LxResult sgs_GetString(char *buf, unsigned int len)

Public Members

CLxLoc_ChannelUIService *srv
LXtItemType typeID
const char *mapName
unsigned useSuper
unsigned addIcon
bool isMap

ILxChannelUIService::Tmp_Sgs

class Tmp_Sgs

User Class Only:

Public Functions

LxResult sgs_GetString(char *buf, unsigned int len)

Public Members

CLxLoc_ChannelUIService *srv
LXtItemType typeID
const char *mapName
unsigned useSuper
unsigned addIcon
bool isMap