Skip to main content

SalTreeControl

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Runtime.50 (5.0.0.0)

Presents a hierarchy of nodes with SAL window actions and tree-control operations.

public class SalTreeControl : TreeView, ISalWindow, ISalControl

Example:

void AddControl(System.Windows.Forms.Control parent)
{
var control = new PPJ.Runtime.Windows.SalTreeControl();
control.Name = "SalTreeControl";
parent.Controls.Add(control);
}

Constructors

Instance member SalTreeControl()

Initializes a SAL tree with node label editing and node tooltips enabled.

Properties

Instance member Label

Control: Gets or sets the label associated with this control through the SAL window implementation.

Instance member NamedProperties

SalNamedProperties: Gets the SAL named-property collection associated with this control.

Instance member ShowRoot

Boolean: Gets or sets whether a synthetic root bearing the control name contains the top-level items.

Changing the setting moves existing nodes into or out of the synthetic root.

Methods

Instance member BringWindowToTop()

Brings this control to the front, or activates it when it is a top-level or MDI form.

Returns: SalBoolean. True if the translated control exists; otherwise, false.

Instance member CenterWindow()

Centers this window within its parent or, for a top-level form, its owner or screen working area.

Returns: SalBoolean. True when the translated control exists; otherwise, false.

A top-level form is constrained to the selected screen working area. A control without a parent is unchanged unless it is a top-level form.

Instance member Clear()

Clears the value or selection appropriate to this control type.

Returns: SalBoolean. False for an unavailable control or a form; otherwise, true.

Editable controls and labels have their text cleared; check boxes are unchecked; list selections are cleared. A date/time picker is set to the current date and time. Unrecognized control types are unchanged.

Instance member ClearCursor(type)

Restores the default cursor for a role, using the I-beam for TextBox subclasses.

ParameterTypeDescription
typeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.

Instance member CollapseItem(hItem)

Requests collapse of a node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when the item resolves and collapse is requested; otherwise, false.

Instance member DeleteItem(hItem)

Removes a node and its subtree.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when a resolved node is removed; otherwise, false.

Instance member DemoteItem(hItem)

Attempts to append a node to the parent collection of its previous sibling.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. False when the node, previous sibling, or parent is absent; true if insertion completes.

This implementation does not make the node a child of its previous sibling and does not detach it before adding it.

Instance member DestroyWindow()

Closes this window when it is a form, or disposes the control.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

A true result reports that the close or disposal request was made; a form can apply its own closing behavior.

Instance member DisableWindow()

Disables input to this control, or clears editability for a table column.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member DisableWindowAndLabel()

Disables input to this control and disables its associated label.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member EditItem(hItem)

Requests label editing for a node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when the item resolves and editing is requested; false when unresolved.

The tree must permit label editing, and BeforeLabelEdit can cancel the request.

Instance member EnableItem(hItem, enable)

Represents unsupported per-item enabling and disabling.

ParameterTypeDescription
hItemSalNumberThe item handle; not used.
enableSalBooleanThe requested state; not used.

Returns: SalBoolean. No value is returned.

Throws:

Instance member EnableWindow()

Enables input to this control, or enables editing for a table column.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

For text-box controls, this operation also clears the read-only setting.

Native disabled styles are also cleared. When needed, tab navigation is restored except for unchecked radio buttons.

Instance member EnableWindowAndLabel()

Enables input to this control and enables its associated label.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member ExpandItem(hItem)

Requests expansion of a node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when the item resolves and expansion is requested; otherwise, false.

Instance member FindChild(windowName)

Searches this window for a child control by name.

ParameterTypeDescription
windowNameSalStringThe child control name to locate.

Returns: SalWindowHandle. The matching child handle, or a null SAL handle if no child is found.

Instance member FindItemByData(item, data)

Searches descendant SAL tree items depth-first for an associated numeric value.

ParameterTypeDescription
itemSalNumberThe parent handle, or zero for the logical root.
dataSalNumberThe value to match.

Returns: SalNumber. The first matching handle, or a null SAL number when no match is found.

Subtrees rooted at ordinary non-SAL TreeNode instances are not searched.

Instance member FindItemByTitle(hItem, title)

Searches descendants depth-first for an exact caption match.

ParameterTypeDescription
hItemSalNumberThe parent handle, or zero for the logical root; the parent itself is not tested.
titleSalStringThe case-sensitive caption to find.

Returns: SalNumber. The first matching handle, or a null SAL number when no match is found.

Instance member FireWindowActions(msg, mywParam, mylParam)

Invokes this control's SAL action handlers directly and returns their result.

ParameterTypeDescription
msgSalNumberThe action message code.
mywParamSalNumberThe first action parameter.
mylParamSalNumberThe second action parameter.

Returns: SalNumber. The result stored in the dispatched action arguments.

Instance member FormUnitsToPixels(formUnits, vertical)

Converts a length in form units to pixels using this control's form metrics.

ParameterTypeDescription
formUnitsSalNumberThe length in form units.
verticalSalBooleanTrue for a vertical measurement; false for a horizontal measurement.

Returns: SalNumber. The converted pixel length.

Instance member GetClassName()

Gets the translated application class name associated with this control.

Returns: SalString. The class name, an empty string for a runtime-defined class, or a null SAL string for an unresolved or native control.

Forms use their base type; nested table-window types are walked upward to a non-nested type.

Instance member GetControlType()

Gets the SAL window type of this control.

Returns: SalNumber. The SAL Sys.TYPE_* code for the translated control.

Instance member GetDataType()

Gets the SAL data type represented by this control.

Returns: SalNumber. The SAL data-type code, or zero if the translated control does not implement the SAL value contract.

Instance member GetFirstChild(typeMask)

Finds the first child matching a SAL window-type mask.

ParameterTypeDescription
typeMaskSalNumberThe SAL window types to include; zero matches no controls.

Returns: SalWindowHandle. The first matching child handle, or a null SAL handle when none matches.

Ordinary controls use tab order; table columns use their creation order, and MDI forms use their child-form collection.

Instance member GetFirstItem(hItem)

Gets the first immediate child of an item.

ParameterTypeDescription
hItemSalNumberThe parent handle, or zero for the logical root.

Returns: SalNumber. The child handle, or zero when no child is available.

Instance member GetFont(name, size, enhancement)

Reads the control font's family, point size, and style flags.

ParameterTypeDescription
name by referenceSalStringReceives the font family name.
size by referenceSalNumberReceives the size in points.
enhancement by referenceSalNumberReceives the combined Sys.FONT_Enh* style flags.

Returns: SalBoolean. True if a font was available; otherwise, false.

Instance member GetItemCount(hItem)

Counts immediate children of an item.

ParameterTypeDescription
hItemSalNumberThe parent handle, or zero for the logical root.

Returns: SalNumber. The child count, or zero for an unresolved item.

Instance member GetItemData(hItem)

Gets the numeric value associated with a SAL tree item.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalNumber. The item value, or a null SAL number when the item is unavailable or is not a SalTreeItem.

Instance member GetItemParent(hItem)

Gets the parent node handle.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalNumber. The parent handle, or zero for an unresolved or top-level node.

Instance member GetItemText(hItem)

Gets the caption of a node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalString. The caption, or a null string for an unresolved item.

Instance member GetItemTooltip(hItem)

Gets the tooltip text of a node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalString. The tooltip, or a null string for an unresolved item.

Instance member GetLabel()

Gets the label associated with this control.

Returns: SalWindowHandle. The associated label handle, or a null SAL handle if no label can be found.

Instance member GetLabelText(text, maxLength)

Copies the associated label text to a supplied variable.

ParameterTypeDescription
text by referenceSalStringReceives the label text when it can be read.
maxLengthSalNumberThe maximum number of leading characters to copy.

Returns: SalNumber. The number of characters copied, or zero if no label text is available.

Instance member GetLabelText(maxLength)

Gets this control's associated label text.

ParameterTypeDescription
maxLengthSalNumberThe maximum number of leading characters to return.

Returns: SalString. The label text limited to the requested length, or an empty string if no label exists.

Instance member GetLocation(x, y)

Reads this control's location in form units.

ParameterTypeDescription
x by referenceSalNumberReceives the horizontal location.
y by referenceSalNumberReceives the vertical location.

Returns: SalBoolean. Always true; an unresolved control produces zero coordinates.

Instance member GetName(text)

Copies this control's name to the supplied variable.

ParameterTypeDescription
text by referenceSalStringReceives the control name when the operation succeeds.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member GetName()

Gets this control's name.

Returns: SalString. The control name, or an empty string if the control cannot be resolved.

Instance member GetNextChild(typeMask)

Finds the next sibling matching a SAL window-type mask.

ParameterTypeDescription
typeMaskSalNumberThe SAL window types to include; zero matches no controls.

Returns: SalWindowHandle. The next matching control handle, or a null SAL handle when none matches.

Instance member GetNextItem(hItem)

Gets the next sibling node handle.

ParameterTypeDescription
hItemSalNumberThe current item handle.

Returns: SalNumber. The next sibling handle, or zero when unavailable.

Instance member GetParent()

Gets the SAL parent form, owner, or table container for this control.

Returns: SalWindowHandle. The parent window handle, or a null SAL handle if no parent can be resolved.

Instance member GetPrevItem(hItem)

Gets the previous sibling node handle.

ParameterTypeDescription
hItemSalNumberThe current item handle.

Returns: SalNumber. The previous sibling handle, or zero when unavailable.

Instance member GetProperty(name, value)

Reads a SAL named property into a supplied variable.

ParameterTypeDescription
nameSalStringThe property name.
value by referenceSalStringReceives the value only when the property is found.

Returns: SalBoolean. True if a non-null property value was found; otherwise, false.

Instance member GetProperty(name)

Gets the value of a SAL named property.

ParameterTypeDescription
nameSalStringThe property name.

Returns: SalString. The property value, or a SAL null string if the value is unavailable.

Instance member GetSelectedItem()

Gets the selected node handle.

Returns: SalNumber. The native node handle, or zero when no node is selected.

Instance member GetSize(width, height)

Reads this control's size in form units.

ParameterTypeDescription
width by referenceSalNumberReceives the width.
height by referenceSalNumberReceives the height.

Returns: SalBoolean. Always true; an unresolved control produces a zero size.

Instance member GetText(text, maxLen)

Copies this control's displayed text or long-string value to a SAL string.

ParameterTypeDescription
text by referenceSalStringReceives the retrieved text.
maxLenSalNumberThe maximum character count for ordinary text; ignored for a Sys.DT_LongString value.

Returns: SalNumber. The number of characters copied, or zero when no text is available.

Instance member GetText(maxLen)

Gets this control's displayed text or long-string value.

ParameterTypeDescription
maxLenSalNumberThe maximum character count for ordinary text; ignored for a Sys.DT_LongString value.

Returns: SalString. The retrieved text, or an empty string if the control cannot be resolved.

Instance member GetWindowColor(colorIndex)

Reads a window or cell color as a Win32 color value.

ParameterTypeDescription
colorIndexSalNumberThe Sys.COLOR_Index* color component to read.

Returns: SalNumber. The color encoded as a Win32 color value, or zero if the control is unavailable.

Transparent colors are reported as Sys.COLOR_None. Table-column window colors use the system window colors; cell colors use the column settings.

Instance member GetWindowState()

Gets the visibility and form-state classification of this window.

Returns: SalNumber. A Sys.Window_* state code; visible non-form controls report Sys.Window_Normal.

Instance member HideWindow()

Hides this control or table column.

Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.

Instance member HideWindowAndLabel()

Hides this control and its associated label.

Returns: SalBoolean. The control's visibility before the operation, or false if it cannot be resolved.

Instance member InsertItem(hItem, index, title)

Inserts a dynamic SAL tree item into the requested parent collection.

ParameterTypeDescription
hItemSalNumberThe parent handle; zero or an unresolved handle inserts into the physical top-level collection.
indexSalNumberThe insertion index, or -1 to append.
titleSalStringThe node caption.

Returns: SalNumber. The inserted native node handle.

Instance member InvalidateWindow()

Invalidates this control and its child controls for repainting.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member IsDerivedFromClass(typeClass)

Tests this control's runtime type against an application base type.

ParameterTypeDescription
typeClassTypeThe type to test, including the framework's emulated inheritance relationships.

Returns: SalBoolean. True if the runtime type derives from the requested type; otherwise, false.

Instance member IsEnabled()

Determines whether this control accepts input.

Returns: SalBoolean. The enabled state, or the editable flag for a table column; false if the control cannot be resolved.

Instance member IsModified()

Reads this control's SAL modification flag.

Returns: SalBoolean. True if the control reports a modified value; otherwise, false.

Instance member IsVisible()

Determines whether this control is visible.

Returns: SalBoolean. The visible state, or the visibility flag for a table column; false if the control cannot be resolved.

Instance member ItemHasCheckBox(hItem)

Represents an unsupported per-item checkbox query; use ItemsHaveCheckBoxes instead.

ParameterTypeDescription
hItemSalNumberThe item handle; not used.

Returns: SalBoolean. No value is returned.

Throws:

Instance member ItemIsChecked(hItem)

Checks the node check state.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when checked; false for an unchecked or unresolved node.

Instance member ItemIsExpanded(hItem)

Checks whether the node is expanded.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when expanded; false for a collapsed or unresolved node.

Instance member ItemIsSelected(hItem)

Compares the resolved item with the selected node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when both references match, including when neither an item nor a selection resolves; otherwise, false.

Instance member ItemsHaveCheckBoxes()

Gets the tree-wide checkbox setting.

Returns: SalBoolean. True when node checkboxes are enabled; otherwise, false.

Instance member KillTimer(idEvent)

Stops the native window timer with the specified identifier.

ParameterTypeDescription
idEventSalNumberThe timer identifier to remove.

Returns: SalBoolean. The native timer-removal result, or false if the control cannot be resolved.

Instance member MoveDownItem(hItem)

Moves a node one position later in its parent collection.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True after moving; false for an unresolved, top-level, or last sibling node.

Instance member MoveItem(hItem, parentItem, position)

Inserts an existing node into the requested parent collection.

ParameterTypeDescription
hItemSalNumberThe node handle.
parentItemSalNumberThe destination parent handle.
positionSalNumberThe destination child index.

Returns: SalBoolean. False when either node fails to resolve; true if insertion completes.

The implementation does not detach the node before insertion; native TreeNodeCollection restrictions apply.

Instance member MoveUpItem(hItem)

Moves a node one position earlier in its parent collection.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True after moving; false for an unresolved, top-level, or first sibling node.

Instance member MoveWindow(xOffset, yOffset)

Moves this control by an offset expressed in form units.

ParameterTypeDescription
xOffsetSalNumberThe horizontal offset to add to the current position.
yOffsetSalNumberThe vertical offset to add to the current position.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Protected member OnAfterCollapse(e)

Sends SAM_ItemCollapsed with the node handle before raising the base event.

ParameterTypeDescription
eTreeViewEventArgsThe collapsed node and action.

Protected member OnAfterExpand(e)

Sends SAM_ItemExpanded with the node handle before raising the base event.

ParameterTypeDescription
eTreeViewEventArgsThe expanded node and action.

Protected member OnAfterSelect(e)

Updates the modified flag from the selection action and sends SAM_ItemSelected after the base event.

ParameterTypeDescription
eTreeViewEventArgsThe selected node and selection cause.

Protected member OnBeforeLabelEdit(e)

Cancels editing unless the node is an editable SalTreeItem, then raises the base event.

ParameterTypeDescription
eNodeLabelEditEventArgsThe node and cancellation state.

Protected member OnDoubleClick(e)

Raises the base event and sends SAM_DoubleClick with client cursor coordinates.

ParameterTypeDescription
eEventArgsThe event data.

Protected member OnNodeMouseClick(e)

Sends SAM_ItemClicked with the clicked node handle before raising the base event.

ParameterTypeDescription
eTreeNodeMouseClickEventArgsThe clicked node and mouse information.

Instance member PixelsToFormUnits(numPixels, vertical)

Converts a pixel length to form units using this control's form metrics.

ParameterTypeDescription
numPixelsSalNumberThe pixel length to convert.
verticalSalBooleanTrue for a vertical measurement; false for a horizontal measurement.

Returns: SalNumber. The converted length in form units.

Instance member PostMessage(msg, mywParam, mylParam)

Posts a native Windows message to this control for asynchronous processing.

ParameterTypeDescription
msgSalNumberThe Windows or SAL message code.
mywParamSalNumberThe first message parameter.
mylParamSalNumberThe second message parameter.

Returns: SalBoolean. True if the native message was posted; false for an unavailable or disposed control, or if posting fails.

Instance member PromoteItem(hItem)

Attempts to append an existing node to its current parent collection.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. False for an unresolved or parentless item; true if insertion completes.

This implementation does not move the node to its grandparent and does not detach it before adding it.

Instance member Reset(remove)

Clears all logical root children or removes only dynamic children at that level.

ParameterTypeDescription
removeSalBooleanTrue to clear all root children; false to remove immediate dynamic items and ordinary non-SAL nodes.

Returns: SalBoolean. Always true after removal.

The optional synthetic root is retained. Dynamic removal does not recurse into retained static items.

Instance member SendMessage(msg, mywParam, mylParam)

Sends a native Windows message to this control synchronously.

ParameterTypeDescription
msgSalNumberThe Windows or SAL message code.
mywParamSalNumberThe first message parameter.
mylParamSalNumberThe second message parameter.

Returns: SalNumber. The native message result, or zero when the control is unavailable or disposed.

Instance member SendMessageToChildren(msg, mywParam, mylParam)

Sends a message to this control's child windows and eligible descendants.

ParameterTypeDescription
msgSalNumberThe Windows or SAL message code.
mywParamSalNumberThe first message parameter.
mylParamSalNumberThe second message parameter.

Returns: SalBoolean. True after dispatching; false when the parent is unavailable or disposed.

Traversal does not descend into embedded forms or user controls. Close and destroy messages for ordinary child controls are routed to their action handlers instead of their native window procedures.

Instance member SetContextMenu(menuName, flags)

Creates and assigns a context menu for this control.

ParameterTypeDescription
menuNameSalStringThe menu type name to resolve.
flagsSalNumberUse Sys.CM_TableCell to assign the table's cell-editor menu; otherwise, assign the control's context menu.

Returns: SalBoolean. True if a control and menu type resolve and the menu is created; otherwise, false.

When called during a SAL context-menu action, the created menu is also shown at the current mouse position.

Instance member SetContextMenu(menuType, flags)

Creates and assigns a context menu for this control.

ParameterTypeDescription
menuTypeTypeThe menu type to instantiate.
flagsSalNumberUse Sys.CM_TableCell to assign the table's cell-editor menu; otherwise, assign the control's context menu.

Returns: SalBoolean. True if a control and menu type resolve and the menu is created; otherwise, false.

When called during a SAL context-menu action, the created menu is also shown at the current mouse position.

Instance member SetCursor(resource, type)

Loads a cursor resource and assigns it to the requested role.

ParameterTypeDescription
resourceSalResourceCursorThe cursor resource to load.
typeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.

Instance member SetCursor(resourceId, type)

Assigns a system cursor or a cursor identified by its native handle to the requested role.

ParameterTypeDescription
resourceIdInt32A Sys.CURSOR_* identifier, or a native cursor handle represented as an integer.
typeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.

Instance member SetCursor(blob, type)

Loads a cursor from binary data and assigns it to the requested role.

ParameterTypeDescription
blobSalStringThe cursor file data stored in a SAL binary string.
typeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.

Instance member SetCursorFile(file, type)

Loads a cursor file and assigns it to the requested role.

ParameterTypeDescription
fileSalStringThe cursor file path.
typeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.

Instance member SetFocus()

Moves keyboard focus to this control, deferring the change when SAL validation is in progress.

Returns: SalWindowHandle. The previously focused managed control as a SAL handle, or a null handle if the target is unavailable, a table column, an ActiveX host, disabled, or hidden.

Instance member SetFont(name, size, enhancement)

Creates and assigns a font to this control.

ParameterTypeDescription
nameSalStringThe font family name.
sizeSalNumberThe font size in points.
enhancementSalNumberThe combined Sys.FONT_Enh* style flags.

Returns: SalBoolean. True if the font was created and assigned; otherwise, false.

Instance member SetItemChecked(hItem, isChecked)

Assigns the node checked state.

ParameterTypeDescription
hItemSalNumberThe item handle.
isCheckedSalBooleanThe desired checked state.

Returns: SalBoolean. True when the item resolves; otherwise, false.

Instance member SetItemData(hItem, value)

Replaces the numeric value stored in a SAL tree item.

ParameterTypeDescription
hItemSalNumberThe item handle.
valueSalNumberThe new value.

Returns: SalNumber. The previous value, or a null SAL value when the node is not a resolved SalTreeItem.

Instance member SetItemEditable(hItem, editable)

Sets whether label editing is allowed for a SAL tree item.

ParameterTypeDescription
hItemSalNumberThe item handle.
editableSalBooleanThe desired editing permission.

Returns: SalBoolean. True for a resolved SalTreeItem; otherwise, false.

Instance member SetItemFontEnh(hItem, fontEnh)

Creates a node font using the tree font family and size with the requested enhancements.

ParameterTypeDescription
hItemSalNumberThe item handle.
fontEnhSalNumberThe SAL font enhancement flags.

Returns: SalBoolean. True when the node resolves; otherwise, false.

Instance member SetItemImage(hItem, selected, imageFile)

Loads a node image from a file or removes the existing image-list entry.

ParameterTypeDescription
hItemSalNumberThe item handle.
selectedSalBooleanTrue to change the selected image; false for the normal image.
imageFileSalStringThe image file path, or an empty value to remove the image.

Returns: SalBoolean. False for an unresolved node or nonexistent nonempty file; true when the image operation completes.

Instance member SetItemImageFromBinary(hItem, selected, format, picture)

Decodes binary image data for a node or removes its image-list entry when decoding yields no image.

ParameterTypeDescription
hItemSalNumberThe item handle.
selectedSalBooleanTrue for the selected image; false for the normal image.
formatSalNumberThe Sys.PIC_Format* decoding format.
pictureSalBinaryThe encoded picture bytes.

Returns: SalBoolean. True when the node resolves and the operation completes; otherwise, false.

Invalid image data can raise decoder exceptions.

Instance member SetItemImageFromResource(hItem, selected, resource)

Assigns a resource image to a node or removes the existing image-list entry when no image is supplied.

ParameterTypeDescription
hItemSalNumberThe item handle.
selectedSalBooleanTrue for the selected image; false for the normal image.
resourceSalResourceThe image resource, or null to remove the image.

Returns: SalBoolean. True when the node resolves and the operation completes; otherwise, false.

Instance member SetItemText(hItem, text)

Assigns the node caption.

ParameterTypeDescription
hItemSalNumberThe item handle.
textSalStringThe new caption.

Returns: SalBoolean. True when the node resolves; otherwise, false.

Instance member SetItemTextColor(hItem, color)

Assigns the node foreground color using a SAL color value.

ParameterTypeDescription
hItemSalNumberThe item handle.
colorSalNumberThe SAL color to translate.

Returns: SalBoolean. True when the node resolves; otherwise, false.

Instance member SetItemTooltip(hItem, tooltip)

Assigns the node tooltip text.

ParameterTypeDescription
hItemSalNumberThe item handle.
tooltipSalStringThe new tooltip text.

Returns: SalBoolean. True when the node resolves; otherwise, false.

Instance member SetLabelText(text)

Assigns the text of this control's associated label.

ParameterTypeDescription
textSalStringThe label text to display.

Returns: SalBoolean. True if an associated label was found and updated; otherwise, false.

Instance member SetLocation(x, y)

Sets this control's location in form units.

ParameterTypeDescription
xSalNumberThe new horizontal coordinate.
ySalNumberThe new vertical coordinate.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

For forms, this also selects manual startup positioning.

Instance member SetModified(set)

Sets this control's SAL modification flag.

ParameterTypeDescription
setSalBooleanTrue to mark the value modified; false to clear the flag.

Returns: SalBoolean. True if the translated control supports SAL values; otherwise, false.

For editable SAL controls, this also clears the validation flag.

Instance member SetProperty(name, value, length)

Assigns a SAL named property after limiting the value's length.

ParameterTypeDescription
nameSalStringThe property name.
valueSalStringThe value to assign.
lengthSalNumberThe number of leading characters to retain.

Returns: SalBoolean. True if the translated control implements the SAL window contract; otherwise, false.

Instance member SetSelectedItem(hItem)

Selects a resolved tree node.

ParameterTypeDescription
hItemSalNumberThe item handle.

Returns: SalBoolean. True when the item resolves and selection is assigned; otherwise, false.

Instance member SetSize(width, height)

Sets this control's dimensions in form units.

ParameterTypeDescription
widthSalNumberThe new width.
heightSalNumberThe new height.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member SetText(text)

Assigns the control's displayed text.

ParameterTypeDescription
textSalStringThe text to assign.

Returns: SalBoolean. True if the translated control exists and assignment completes; otherwise, false.

An empty string is passed as null when assigning combo-box text.

Instance member SetTimer(idEvent, elapseMilliSec)

Creates or updates a native window timer for this control.

ParameterTypeDescription
idEventSalNumberThe timer identifier.
elapseMilliSecSalNumberThe requested interval in milliseconds.

Returns: SalBoolean. True if the native timer was created; otherwise, false.

Instance member SetWindowColor(colorIndex, color)

Assigns a SAL window, table-cell, text, or transparent-image color.

ParameterTypeDescription
colorIndexSalNumberThe Sys.COLOR_Index* component to update.
colorSalNumberThe SAL color value.

Returns: SalBoolean. True for a recognized color index and resolved control, even when the component does not apply to that control; otherwise, false.

Cell colors apply to table columns; window colors apply to other controls. Transparent colors require the SAL picture-control contract.

Instance member ShowItemCheckBox(hItem, bShow)

Represents unsupported per-item checkbox visibility; use ShowItemsCheckBoxes instead.

ParameterTypeDescription
hItemSalNumberThe item handle; not used.
bShowSalBooleanThe requested visibility; not used.

Returns: SalBoolean. No value is returned.

Throws:

Instance member ShowItemsCheckBoxes(show)

Sets checkbox visibility for the entire tree.

ParameterTypeDescription
showSalBooleanTrue to show node checkboxes; false to hide them.

Returns: SalBoolean. Always true after assignment.

Instance member ShowWindow()

Shows this control or table column.

Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.

Instance member ShowWindowAndLabel()

Shows this control and its associated label.

Returns: SalBoolean. The control's visibility before the operation, or false if it cannot be resolved.

Instance member TrackPopupMenu(menuName, flags, x, y)

Creates and displays a temporary popup menu at screen coordinates.

ParameterTypeDescription
menuNameSalStringThe menu type name to resolve.
flagsSalNumberSAL TPM_* alignment and cursor-position flags; center alignment and TPM_ContextMenu are unsupported.
xSalNumberThe screen X coordinate, unless TPM_CursorX selects the cursor position.
ySalNumberThe screen Y coordinate, unless TPM_CursorY selects the cursor position.

Returns: SalBoolean. True after the popup is shown; false when the target or menu cannot be resolved.

The previous context menu is restored after display and the temporary menu is queued for disposal.

Instance member TrackPopupMenu(menuType, flags, x, y)

Creates and displays a temporary popup menu at screen coordinates.

ParameterTypeDescription
menuTypeTypeThe menu type to instantiate.
flagsSalNumberSAL TPM_* alignment and cursor-position flags; center alignment and TPM_ContextMenu are unsupported.
xSalNumberThe screen X coordinate, unless TPM_CursorX selects the cursor position.
ySalNumberThe screen Y coordinate, unless TPM_CursorY selects the cursor position.

Returns: SalBoolean. True after the popup is shown; false when the target or menu cannot be resolved.

The previous context menu is restored after display and the temporary menu is queued for disposal.

Instance member UpdateWindow()

Requests an update of this control.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member WinHelp(file, command, numData, strData)

Invokes the legacy Windows Help API for this control.

ParameterTypeDescription
fileSalStringThe help file path.
commandSalNumberThe Sys.HELP_* command.
numDataSalNumberThe numeric topic or index for HELP_Context and HELP_SetIndex.
strDataSalStringThe lookup text for HELP_Key.

Returns: SalBoolean. The native help result, or false for an empty file name.

Protected member WndProc(m)

Routes the native window message through the SAL window implementation.

ParameterTypeDescription
m by referenceMessageThe message to process, including its mutable result.

Instance member Yield()

Dispatches one pending message for this window, or processes application messages when no window handle exists.

Message dispatch can reenter application code.

Events

Instance member MessageActions

SalMessageHandler Provides the legacy SAL message-handler event.

Use WindowActions for new handlers.

Instance member WindowActions

WindowActionsEventHandler Occurs when this control dispatches a SAL or custom window action.

Implements

NameDescription
ISalControlProvides access to a SAL control's typed value, associated label, and modification state.
ISalWindowExposes SAL message dispatch and runtime metadata for child controls, forms, dialogs, and MDI windows.