Skip to main content
Version: 2023

SalTreeControl

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Web.49 (4.9.0.0)

TreeView implementation.

public class SalTreeControl : TreeView, ISalWindow, ISalControl

Constructors

Instance memberSalTreeControl()

Constructs a SalTreeControl object.

Properties

Instance memberLabel

Control: Returns/Sets the label associated with this control.

Instance memberNamedProperties

SalNamedProperties: Returns the collection of named properties.

Instance memberShowRoot

Boolean: Shows the root node.

Methods

Instance memberBringWindowToTop()

Brings a window to the top of all overlapping windows.

Returns: SalBoolean.

Instance memberCenterWindow()

Centers a window. If the window is a top-level window, it centers it on the desktop. If the window is a child window, it centers it on top of its parent.

Returns: SalBoolean.

Instance memberClear()

Clears the value from a data field, multi line field, or table window column.

Returns: SalBoolean.

Instance memberClearCursor(nType)

Clears a window's cursor.

ParameterTypeDescription
nTypeSalNumber

Returns: SalBoolean.

Instance memberCollapseItem(hItem)

Collapse a tree item. If the tree item handle is 0, then the top level tree items of the tree control are collapsed.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberDeleteItem(hItem)

Removes a tree item from a tree control. All child items of the tree item are also removed.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the item was deleted successfully.

Instance memberDemoteItem(hItem)

Moves a tree item so it becomes the child of its previous sibling. This function will fail if the tree item has no previous sibling.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberDestroyWindow()

Destroys a form window, a top-level table window, or a modeless dialog box created with SalCreateWindow.

Returns: SalBoolean.

Instance memberDisableWindow()

Disables keyboard and mouse input to a window. If the window contains text (for example, a push button), the text is grayed. If the window is a data field, it cannot receive the focus.

Returns: SalBoolean.

Instance memberDisableWindowAndLabel()

Disables keyboard and mouse input to a window and grays out its associated label. A label is the label control that immediately precedes the window in the outline. The label control must have a mnemonic. If the window contains text (for example, a push button), the text is grayed. If the window is a data field, it cannot receive the focus.

Returns: SalBoolean.

Instance memberEditItem(hItem)

Allows the user to edit the value of the tree item's label. SAM_Validate is sent to the tree control when the edit control loses focus with wParam indicating the handle to the tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if edit has been activated.

Instance memberEnableItem(hItem, bEnable)

Enables the tree item when bEnable is true, disables the tree item when bEnable is false.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bEnableSalBooleanSet to TRUE to enable the item. Set to FALSE to disable the item.

Returns: SalBoolean. previous state of the item before this function was called. TRUE if it was enabled, FALSE if it was disabled.

Instance memberEnableWindow()

Enables keyboard and mouse input to a window.

Returns: SalBoolean.

Instance memberEnableWindowAndLabel()

Enables keyboard and mouse input to a window and enables its associated label as well. A label is the label control that immediately precedes the window in the outline.

Returns: SalBoolean.

Instance memberExpandItem(hItem)

Expand a tree item. If the tree item handle is 0, then the top level tree items of the tree control are expanded.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberFindChild(windowName)

This function finds a child window of a given name in the specified window.

ParameterTypeDescription
windowNameSalString

Returns: SalWindowHandle.

Instance memberFindItemByData(hItem, nData)

Finds a tree item by its Object Data. Returns 0 if not found. Searches the child items of the tree item handle argument(hItem). If the handle is 0, searches the top level tree items.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
nDataSalNumberData of the item to find.

Returns: SalNumber. Handle of the tree item whose Data matches the nData parameter.

Instance memberFindItemByTitle(hItem, sTitle)

Finds a tree item by its object title. Returns 0 if not found. Searches the child items of the tree item handle argument. If the handle is 0, searches the top level tree items.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
sTitleSalStringTitle of the item to find.

Returns: SalNumber. Handle of the item whose title matches the sTitle parameter.

Instance memberFireWindowActions(msg, mywParam, mylParam)

Dispatches the specified message (Window Actions) directly to the control's WindowActions event handlers, without going through Windows message loop.

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalNumber.

Instance memberFormUnitsToPixels(formUnits, vertical)

Computes the number of pixels in the number of form units. Form units are a unit of measurement used by functions which move and position objects. Form units are computed using physical units (pixels) in conjunction with the window's font size.

ParameterTypeDescription
formUnitsSalNumber
verticalSalBoolean

Returns: SalNumber.

Instance memberGetClassName()

Return the name of a window's class as a string.

Returns: SalString.

Instance memberGetControlType()

Returns an object's type.

Returns: SalNumber.

Instance memberGetDataType()

Returns a data field's or table window column's data type.

Returns: SalNumber.

Instance memberGetFirstChild(typeMask)

Returns the handle of the first child window of the specified type. You can use this function to get the handles of MDI child windows.

ParameterTypeDescription
typeMaskSalNumber

Returns: SalWindowHandle.

Instance memberGetFirstItem(hItem)

Gets the first child tree item of the passed tree item handle. Returns 0 if not found. If the handle is 0, returns the first child of the tree control.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalNumber. Handle of the tree item.

Instance memberGetFont(name, size, enhancement)

ParameterTypeDescription
nameSalString&
sizeSalNumber&
enhancementSalNumber&

Returns: SalBoolean.

Instance memberGetItemCount(hItem)

Gets the number of child items. If the handle argument is 0, then number of first level child items is returned.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalNumber. Number of items.

Instance memberGetItemData(hItem)

Returns the numeric value assigned to the tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalNumber. Numeric value assigned to the tree item.

Instance memberGetItemParent(hItem)

Returns the handle of hItem's parent, or 0 if hItem is a top level child of the tree control.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalNumber. Handle of hItem's parent.

Instance memberGetItemText(hItem)

Returns the string title of the item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalString. String title of the item.

Instance memberGetItemTooltip(hItem)

Returns the current tooltip for the tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalString. Current tooltip for the tree item.

Instance memberGetLabel()

Retrieves the window handle of the label (label control) that is associated with the hWndTarget parameter. There must be a mnemonic in that label, and it must immediately precede hWndTarget in the outline, or this function will fail.

Returns: SalWindowHandle.

Instance memberGetLabelText(sText, nMaxLength)

ParameterTypeDescription
sTextSalString&
nMaxLengthSalNumber

Returns: SalNumber.

Instance memberGetLabelText(nMaxLength)

Retrieves the text of the label associated to a control. Important: The label control does not require a mnemonic for the functions listed above to operate.

ParameterTypeDescription
nMaxLengthSalNumber

Returns: SalString.

Instance memberGetLocation(x, y)

ParameterTypeDescription
xSalNumber&
ySalNumber&

Returns: SalBoolean.

Instance memberGetName(text)

ParameterTypeDescription
textSalString&

Returns: SalBoolean.

Instance memberGetName()

Gets the name of an object.

Returns: SalString.

Instance memberGetNextChild(typeMask)

Returns the handle of the next child window that matches a specified type.

ParameterTypeDescription
typeMaskSalNumber

Returns: SalWindowHandle.

Instance memberGetNextItem(hItem)

Gets the next sibling tree item of the passed tree item handle. Returns 0 if there are no more sibling tree items.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalNumber. Handle of the next tree item.

Instance memberGetParent()

Returns the handle of an object's parent window.

Returns: SalWindowHandle.

Instance memberGetPrevItem(hItem)

Gets the previous sibling tree item of the passed tree item handle. Returns 0 if there are no more sibling items.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalNumber. Handle of the previous tree item.

Instance memberGetProperty(name, value)

ParameterTypeDescription
nameSalString
valueSalString&

Returns: SalBoolean.

Instance memberGetProperty(name)

Gets the value of a named property.

ParameterTypeDescription
nameSalString

Returns: SalString.

Instance memberGetSelectedItem()

Returns the handle to the selected tree item, or 0 if no item is selected.

Returns: SalNumber. Handle to the selected tree item, or 0 if no item is selected.

Instance memberGetSize(width, height)

ParameterTypeDescription
widthSalNumber&
heightSalNumber&

Returns: SalBoolean.

Instance memberGetText(text, maxLen)

ParameterTypeDescription
textSalString&
maxLenSalNumber

Returns: SalNumber.

Instance memberGetText(maxLen)

Retrieves the text of a window.

ParameterTypeDescription
maxLenSalNumber

Returns: SalString.

Instance memberGetWindowColor(colorIndex)

Gets a window's color.

ParameterTypeDescription
colorIndexSalNumber

Returns: SalNumber.

Instance memberGetWindowState()

Returns a window's current state.

Returns: SalNumber.

Instance memberHideWindow()

Hides a window.

Returns: SalBoolean.

Instance memberHideWindowAndLabel()

Hides a window and its associated label.

Returns: SalBoolean.

Instance memberInsertItem(hItem, nIndex, sTitle)

Inserts a tree item into the tree control. The new item will be a child of hItem . If hItem is 0, the tree item is added as a top level child of the tree control. If nIndex is greater than or equal to the number of child items, or if nIndex is less than zero, the new item is appended.

ParameterTypeDescription
hItemSalNumberHandle of the tree item which will be the parent of the new item.
nIndexSalNumberIndex to insert (starting at zero).
sTitleSalStringTitle of the new item.

Returns: SalNumber. Handle of the newly created item.

Instance memberInvalidateWindow()

Causes a window to be repainted.

Returns: SalBoolean.

Instance memberIsDerivedFromClass(typeClass)

Determines whether a window is an instance of the specified class.

ParameterTypeDescription
typeClassType

Returns: SalBoolean.

Instance memberIsEnabled()

Determines whether a window is enabled for mouse and keyboard input.

Returns: SalBoolean.

Instance memberIsModified()

Returns the setting of the Field Edit Flag for a data field, multi line field, combo box, table window's context row cell, or picture.

Returns: SalBoolean.

Instance memberIsVisible()

Determines whether a window is currently visible.

Returns: SalBoolean.

Instance memberItemHasCheckBox(hItem)

Returns true if the tree item has a checkbox displayed.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the item has a checkbox displayed, FALSE if not.

Instance memberItemIsChecked(hItem)

Returns true if the item checkbox is checked. Returns false if the checkbox is not displayed.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the checkbox is checked. If the checkbox is not checked, or is not displayed, bIsChecked is FALSE.

Instance memberItemIsExpanded(hItem)

Returns whether the item is expanded.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the item is expanded, FALSE if not.

Instance memberItemIsSelected(hItem)

Returns whether the item is selected.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the item is selected, FALSE if not.

Instance memberItemsHaveCheckBoxes()

Returns true if the tree shows checkboxes next to the items.

Returns: SalBoolean. TRUE if the items have a checkbox displayed, FALSE if not.

Instance memberKillTimer(idEvent)

Destroys an object's system timer.

ParameterTypeDescription
idEventSalNumber

Returns: SalBoolean.

Instance memberMoveDownItem(hItem)

Moves a tree item downward. This functions fails if the tree item is the last child of its parent.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberMoveItem(hItem, hParentItem, nPosition)

Moves a tree node and all its sub-nodes to a new location in the tree control.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
hParentItemSalNumberHandle to the new parent tree item.
nPositionSalNumberPosition in the new parents list of children to place the new child (0-n).

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberMoveUpItem(hItem)

Moves a tree item upward . This functions fails if the tree item is the first child of its parent.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberMoveWindow(xOffset, yOffset)

Moves a window a given number of form units on the X and Y axes relative to its current position.

ParameterTypeDescription
xOffsetSalNumber
yOffsetSalNumber

Returns: SalBoolean.

Instance memberPixelsToFormUnits(numPixels, vertical)

Computes the number of form units based on the number of pixels. Form units are a unit of measurement used by functions that move and position objects. Form units are computed using physical units (pixels) in conjunction with a window's font sizes.

ParameterTypeDescription
numPixelsSalNumber
verticalSalBoolean

Returns: SalNumber.

Instance memberPostMessage(msg, mywParam, mylParam)

Posts the specified message to a window by adding nMsg to hWndReceiver's message queue.

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalBoolean.

Instance memberPromoteItem(hItem)

Moves a tree item so it becomes the sibling of its parent. This functions fails if the tree item has no grandparent.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberReset(bRemove)

Clears a tree control with the option to retain or destroy design-time nodes.

ParameterTypeDescription
bRemoveSalBooleanTRUE = Remove all nodes. FALSE = Remove nodes created dynamically; the tree goes back to the initial state.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it does not succeed.

Instance memberSendMessage(msg, mywParam, mylParam)

Sends the specified message to a window. SalSendMsg does not return until the processing for the message is complete.

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalNumber.

Instance memberSendMessageToChildren(msg, mywParam, mylParam)

Sends a message to all child items of a form window, dialog box, table window, or MDI window.

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalBoolean.

Instance memberSetContextMenu(sMenuName, nFlags)

Defines a named popup menu that displays automatically when a window receives SAM_ContextMenu.

ParameterTypeDescription
sMenuNameSalString
nFlagsSalNumber

Returns: SalBoolean.

Instance memberSetContextMenu(menuType, flags)

Defines a named popup menu that displays automatically when a window receives SAM_ContextMenu.

ParameterTypeDescription
menuTypeType
flagsSalNumber

Returns: SalBoolean.

Instance memberSetCursor(nResourceId, nType)

Sets a window's cursor.

ParameterTypeDescription
nResourceIdInt32
nTypeSalNumber

Returns: SalBoolean.

Instance memberSetCursor(sBlob, nType)

Sets a window's cursor from a string variable.

ParameterTypeDescription
sBlobSalString
nTypeSalNumber

Returns: SalBoolean.

Instance memberSetCursorFile(sFile, nType)

Sets an application-defined cursor for the specified window. Use this function to set the cursor from an image stored in a file.

ParameterTypeDescription
sFileSalString
nTypeSalNumber

Returns: SalBoolean.

Instance memberSetFocus()

Sets the focus to a specified window.

Returns: SalWindowHandle.

Instance memberSetFont(name, size, enhancement)

Sets a window's font, font size, and font enhancements.

ParameterTypeDescription
nameSalString
sizeSalNumber
enhancementSalNumber

Returns: SalBoolean.

Instance memberSetItemChecked(hItem, bChecked)

Sets or clears the checkbox. If the checkbox is not displayed, this function has no effect.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bCheckedSalBooleanTRUE to set the box as checked, FALSE to clear the checkbox.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemData(hItem, nValue)

Sets the numeric value of the tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
nValueSalNumberValue to set.

Returns: SalNumber. Value that was previously assigned to the tree item.

Instance memberSetItemEditable(hItem, bEditable)

Sets whether the tree item's label can be edited. If bEditable is true, the label can be edited.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bEditableSalBooleanWhether to enable or disable editing.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemFontEnh(hItem, nFontEnh)

Sets the font enhancement for a tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
nFontEnhSalNumberFont mask. Combine the following: FONT_EnhDefault, FONT_EnhNormal, FONT_EnhItalic, FONT_EnhUnderline, FONT_EnhBold.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemImage(hItem, bSelected, sImageFile)

Sets the image of a tree item. If the bSelected parameter is true, the selected image is set; otherwise the non-selected image is set.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bSelectedSalBooleanIf TRUE, use selected image. If FALSE, use non-selected image.
sImageFileSalStringFilename of the image.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemImageFromBinary(hItem, bSelected, nFormat, bPicture)

Sets the image of a tree item. If the bSelected parameter is true, the selected image is set; otherwise the non-selected image is set.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bSelectedSalBooleanIf TRUE, use selected image. If FALSE, use non-selected image.
nFormatSalNumberThe format of the picture contents: PIC_FormatBitmap, PIC_FormatIcon, PIC_FormatObject
bPictureSalBinaryThe image data to be assigned to the tree node.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemImageFromResource(hItem, bSelected, tResource)

Sets the image of a tree item. If the bSelected parameter is true, the selected image is set; otherwise the non-selected image is set.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bSelectedSalBooleanIf TRUE, use selected image. If FALSE, use non-selected image.
tResourceSalResourceResource object.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemText(hItem, sText)

Sets the title of the item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
sTextSalStringText to set as the title for this tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemTextColor(hItem, nColor)

Sets the text color of the tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
nColorSalNumberColor to set.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetItemTooltip(hItem, sTooltip)

Sets the tooltip for the tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
sTooltipSalStringTooltip text.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetLabelText(sText)

Sets the text of the associated label control.

ParameterTypeDescription
sTextSalString

Returns: SalBoolean.

Instance memberSetLocation(x, y)

Moves a window to a new position (x, y) on the X and Y axes.

ParameterTypeDescription
xSalNumber
ySalNumber

Returns: SalBoolean.

Instance memberSetModified(bSet)

Sets or clears the field edit flag for an editable data field, combo box, multi line text field, table window column, or picture.

ParameterTypeDescription
bSetSalBoolean

Returns: SalBoolean.

Instance memberSetProperty(name, value, length)

Sets the value of a named property.

ParameterTypeDescription
nameSalString
valueSalString
lengthSalNumber

Returns: SalBoolean.

Instance memberSetSelectedItem(hItem)

Selects a tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberSetSize(width, height)

Resizes a window.

ParameterTypeDescription
widthSalNumber
heightSalNumber

Returns: SalBoolean.

Instance memberSetText(text)

Sets the text of a window.

ParameterTypeDescription
textSalString

Returns: SalBoolean.

Instance memberSetTimer(idEvent, elapseMilliSec)

Creates a system timer for a given object. When a timer event occurs, sends SAM_Timer messages to the object in specified intervals. Timers are a limited global resource. Your application must check the value returned by SalTimerSet to verify that the timer was created.

ParameterTypeDescription
idEventSalNumber
elapseMilliSecSalNumber

Returns: SalBoolean.

Instance memberSetWindowColor(colorIndex, color)

Sets a window's color.

ParameterTypeDescription
colorIndexSalNumber
colorSalNumber

Returns: SalBoolean.

Instance memberShowItemCheckBox(hItem, bShow)

Shows or hides the checkbox for a tree item.

ParameterTypeDescription
hItemSalNumberHandle to the tree item.
bShowSalBooleanTRUE to show the checkbox, FALSE to hide it.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberShowItemsCheckBoxes(bShow)

Shows or hides the checkboxes for the tree control.

ParameterTypeDescription
bShowSalBooleanTRUE to show the checkboxes, FALSE to hide it.

Returns: SalBoolean. TRUE if the function succeeds and FALSE if it fails.

Instance memberShowWindow()

Makes a window visible.

Returns: SalBoolean.

Instance memberShowWindowAndLabel()

Makes a window and its associated label visible. A label is the label control that immediately precedes the window in the outline.

Returns: SalBoolean.

Instance memberTrackPopupMenu(menuName, flags, x, y)

Creates pop-up menus at runtime.

ParameterTypeDescription
menuNameSalString
flagsSalNumber
xSalNumber
ySalNumber

Returns: SalBoolean.

Instance memberTrackPopupMenu(menuType, flags, x, y)

Creates pop-up menus at runtime.

ParameterTypeDescription
menuTypeType
flagsSalNumber
xSalNumber
ySalNumber

Returns: SalBoolean.

Instance memberUpdateWindow()

Forces the update of a window.

Returns: SalBoolean.

Events

Instance memberWindowActions

WindowActionsEventHandler Window Actions

Implements

NameDescription
ISalControlAll SAL controls implement this interface.
ISalWindowAll Sal windows (Child windows, Forms, Dialogs and MDIs) implement this interface.