Skip to main content

VisListView

Namespace: PPJ.Runtime.Vis

Assembly: PPJ.Runtime.Vis.50 (5.0.0.0)

Displays icons or detail rows with Visual Toolchest list-view operations and SAL messages.

public class VisListView : ListView, ISalWindow

Example:

using (var list = new PPJ.Runtime.Vis.VisListView())
{
list.InsertItem(0, "First item", -1);
list.ViewList();
}

Constructors

Instance member VisListView()

Initializes the control, its SAL integration, and default components.

Properties

Instance member NamedProperties

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

Instance member RightToLeftLayout

Boolean: Gets or sets mirrored layout for the list view. (Default: False)

Until explicitly assigned, the getter uses the containing form setting when a form exists.

Methods

Instance member AddImage(hpicLarge, hpicSmall)

Adds a pair of pictures to the large and small image lists.

ParameterTypeDescription
hpicLargeSalNumberA valid nonzero large-picture handle.
hpicSmallSalNumberA valid nonzero small-picture handle.

Returns: SalNumber. The new large-image index, or -1 if either picture is missing or null.

Creates default image lists if necessary. The paired lists are expected to use matching indices.

Instance member Arrange(code)

Sets the list-view icon alignment.

ParameterTypeDescription
codeSalNumberA value corresponding to ListViewAlignment.

Returns: SalBoolean. True after assignment.

Instance member AssignColumns(saTitles, naAlignments, naWidths, nNumColumns)

Replaces all columns from parallel arrays.

ParameterTypeDescription
saTitlesSalArray<SalString>Column titles beginning at index zero.
naAlignmentsSalArray<SalNumber>HorizontalAlignment numeric values beginning at index zero.
naWidthsSalArray<SalNumber>Column widths in horizontal form units beginning at index zero.
nNumColumnsSalNumberThe number of entries to read from each array.

Returns: SalBoolean. True when all columns have been added.

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 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 DeleteAllItems()

Clears all items.

Returns: SalBoolean. Always true.

Instance member DeleteItem(nItem)

Removes an item at the specified index.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.

Returns: SalNumber. The remaining item count.

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 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 EnsureVisible(item, partialOK)

Scrolls the list view to display an existing item.

ParameterTypeDescription
itemSalNumberThe zero-based item index.
partialOKSalBooleanReserved for compatibility; ignored.

Returns: SalBoolean. True if the item exists; 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 FindItem(flags, itemText, itemStart)

Searches through the native list-view find-item message.

ParameterTypeDescription
flagsSalNumberThe LVFI search flags.
itemTextSalStringThe text used when LVFI_String is set.
itemStartSalNumberThe zero-based index after which searching starts; -1 starts at the first item.

Returns: SalNumber. The matching item index, or -1 when no match is found.

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.

Static member FromHandle(handle)

Resolves this control type from a native window handle.

ParameterTypeDescription
handleSalWindowHandleThe native control handle.

Returns: VisListView. The associated VisListView, or null when no managed control owns the handle.

A handle belonging to another control type causes an InvalidCastException.

Instance member GetAllSelectedItems(naSelections)

Replaces an array with the indices of all selected items.

ParameterTypeDescription
naSelectionsSalArray<SalNumber>The output array; reset and made dynamic before filling from index zero.

Returns: SalNumber. The resulting array length.

Instance member GetBkColor()

Reads the list-view background color.

Returns: SalNumber. The Win32 color value.

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 GetColumn(nColumn, sTitle, nAlignment, nWidth)

Reads a column's caption, alignment, and width.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.
sTitle by referenceSalStringReceives the caption.
nAlignment by referenceSalNumberReceives the HorizontalAlignment numeric value.
nWidth by referenceSalNumberReceives the width in horizontal form units.

Returns: SalBoolean. True for an existing column; otherwise false and the outputs are unchanged.

Instance member GetColumnAlignment(nColumn)

Reads a column's text alignment.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.

Returns: SalNumber. The HorizontalAlignment numeric value, or zero if the column is absent.

Instance member GetColumnTitle(nColumn)

Reads a column's caption.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.

Returns: SalString. The caption, or an empty string if the column is absent.

Instance member GetColumnWidth(nColumn)

Reads a column's width.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.

Returns: SalNumber. The width in horizontal form units, or zero if the column is absent.

Instance member GetControlType()

Gets the SAL window type of this control.

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

Instance member GetCountPerPage()

Gets the number of items that fit in a page of the native list view.

Returns: SalNumber. The native LVM_GETCOUNTPERPAGE result.

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 GetFocusItem()

Reads the item with keyboard focus.

Returns: SalNumber. Its index, or -1 if no item is focused.

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 GetImageCount()

Counts images in the small-image list.

Returns: SalNumber. The count, or zero if no small-image list exists.

Instance member GetItem(nItem, nSubItem, sItemText, nItemValue, nImage)

Reads a caption and the main item's value and image index.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nSubItemSalNumberZero or a negative value for the main item; a positive subitem index otherwise.
sItemText by referenceSalStringReceives the caption.
nItemValue by referenceSalNumberReceives the main item's Int32 Tag or zero; subitems return zero.
nImage by referenceSalNumberReceives the main image index; subitems return zero.

Returns: SalBoolean. True for an existing item or subitem; otherwise false with outputs unchanged.

Instance member GetItemCount()

Counts the items in the collection.

Returns: SalNumber. The item count.

Instance member GetItemPosition(item, position)

Gets the top-left corner of an item bounding rectangle.

ParameterTypeDescription
itemSalNumberThe zero-based item index.
positionVisPointReceives the client-area position in pixels; must not be null.

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

Instance member GetItemRect(nItem, rcItem, nCode)

Gets an item bounding rectangle.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
rcItemVisRectReceives the item bounds in client pixels; must not be null.
nCodeSalNumberReserved for compatibility; the full item bounds are always returned.

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

Instance member GetItemState(nItem, nMask)

Reads masked focus, selection, and state-image flags.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nMaskSalNumberThe LVIS_* bits to retain.

Returns: SalNumber. The masked state, or zero if the item is absent.

Instance member GetItemText(nItem, nSubItem)

Reads an item or subitem caption.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nSubItemSalNumberZero or negative for the main item; positive for a subitem.

Returns: SalString. The caption, or an empty string if the item is absent.

Instance member GetItemValue(nItem)

Gets the integer value stored in an item tag.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.

Returns: SalNumber. The integer tag value, or zero when the item or tag is missing.

A non-integer tag causes an InvalidCastException.

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(nItem, nFlags)

Finds the next native list-view item matching the specified state and direction.

ParameterTypeDescription
nItemSalNumberThe starting item index; -1 starts before the first item.
nFlagsSalNumberThe LVNI search flags.

Returns: SalNumber. The matching index, or -1 when no item matches.

Instance member GetOrigin(ptOrigin)

Gets the native list-view origin.

ParameterTypeDescription
ptOriginVisPointReceives the origin coordinates in pixels; must not be null.

Returns: SalBoolean. True when the native operation succeeds; otherwise, false.

The output is assigned even when the native operation fails.

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 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 GetSelectedCount()

Counts selected items.

Returns: SalNumber. The selected-item count.

Instance member GetSelectedItem()

Reads the first selected item.

Returns: SalNumber. Its zero-based index, or -1 if there is no selection.

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 GetSortColumn()

Reads the configured sort column.

Returns: SalNumber. The zero-based column index.

Instance member GetSortOrder()

Reads the compatibility sort order.

Returns: SalNumber. LVSORT_Descending for descending order; otherwise LVSORT_Ascending, including when sorting is disabled.

Instance member GetStringWidth(sCompare)

Measures text with the native list-view font.

ParameterTypeDescription
sCompareSalStringThe text to measure.

Returns: SalNumber. The measured width converted to horizontal form units.

Instance member GetStyle()

Gets the native list-view window-style flags.

Returns: SalNumber. The GWL_STYLE value.

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 GetTextBkColor()

Reads the list-view background color.

Returns: SalNumber. The Win32 color value.

Instance member GetTextColor()

Reads the list-view foreground color.

Returns: SalNumber. The Win32 color value.

Instance member GetTopIndex()

Gets the index of the top visible item where supported by the current view.

Returns: SalNumber. Zero in large-icon, small-icon, or tile view; otherwise, the top item index, or -1 when no top item exists.

Instance member GetViewRect(rcView)

Gets the rectangle enclosing the native list-view items.

ParameterTypeDescription
rcViewVisRectReceives the rectangle in pixels; must not be null.

Returns: SalBoolean. True when the native operation succeeds; otherwise, false.

The output is assigned even when the native operation fails.

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 HitTest(ptTest, flags)

Finds the native list-view item at a client-area point.

ParameterTypeDescription
ptTestVisPointThe client-area test point in pixels; must not be null.
flags by referenceSalNumberReceives the LVHT hit-test flags.

Returns: SalNumber. The item index, or -1 when no item is hit.

Instance member HitTest(x, y, flags)

Finds the native list-view item at a client-area point.

ParameterTypeDescription
xSalNumberThe horizontal client coordinate in pixels.
ySalNumberThe vertical client coordinate in pixels.
flags by referenceSalNumberReceives the LVHT hit-test flags.

Returns: SalNumber. The item index, or -1 when no item is hit.

Instance member InsertDetails(nItem, saText, nImage)

Inserts an item and its detail subitems.

ParameterTypeDescription
nItemSalNumberThe requested index, clamped to the range from zero through the current item count.
saTextSalArray<SalString>A zero-based text array; element zero is the item label and later elements are subitems.
nImageSalNumberThe image-list index.

Returns: SalNumber. The inserted item index.

Instance member InsertDetailsPic(nItem, saText, hpicLarge, hpicSmall)

Inserts a row of item and subitem captions and a newly added image pair.

ParameterTypeDescription
nItemSalNumberInsertion index, clamped to zero through the current item count.
saTextSalArray<SalString>Zero-based captions; element zero is the item caption and later elements are subitems.
hpicLargeSalNumberA valid large-picture handle.
hpicSmallSalNumberA valid small-picture handle.

Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.

Instance member InsertDetailsValue(nItem, saText, nItemValue, nImage)

Inserts a row of item and subitem captions with an application value.

ParameterTypeDescription
nItemSalNumberInsertion index, clamped to zero through the current item count.
saTextSalArray<SalString>Zero-based captions; element zero is the item caption and later elements are subitems.
nItemValueSalNumberThe application value, converted to Int32 and stored in Tag.
nImageSalNumberThe index in the image lists, or -1 for no picture.

Returns: SalNumber. The inserted index.

Instance member InsertDetailsValuePic(nItem, saText, nItemValue, hpicLarge, hpicSmall)

Inserts a row of item and subitem captions with an application value and a newly added image pair.

ParameterTypeDescription
nItemSalNumberInsertion index, clamped to zero through the current item count.
saTextSalArray<SalString>Zero-based captions; element zero is the item caption and later elements are subitems.
nItemValueSalNumberThe application value, converted to Int32 and stored in Tag.
hpicLargeSalNumberA valid large-picture handle.
hpicSmallSalNumberA valid small-picture handle.

Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.

Instance member InsertItem(nItem, sText, nImage)

Inserts a list-view item.

ParameterTypeDescription
nItemSalNumberThe requested index, clamped to the range from zero through the current item count.
sTextSalStringThe item label.
nImageSalNumberThe image-list index.

Returns: SalNumber. The inserted item index.

Instance member InsertItemPic(nItem, sText, hpicLarge, hpicSmall)

Inserts an item and a newly added image pair.

ParameterTypeDescription
nItemSalNumberInsertion index, clamped to zero through the current item count.
sTextSalStringThe item caption.
hpicLargeSalNumberA valid large-picture handle.
hpicSmallSalNumberA valid small-picture handle.

Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.

Instance member InsertItemValue(nItem, sText, nItemValue, nImage)

Inserts an item with an application value.

ParameterTypeDescription
nItemSalNumberInsertion index, clamped to zero through the current item count.
sTextSalStringThe item caption.
nItemValueSalNumberThe application value, converted to Int32 and stored in Tag.
nImageSalNumberThe index in the image lists, or -1 for no picture.

Returns: SalNumber. The inserted index.

Instance member InsertItemValuePic(nItem, sText, nItemValue, hpicLarge, hpicSmall)

Inserts an item with an application value and a newly added image pair.

ParameterTypeDescription
nItemSalNumberInsertion index, clamped to zero through the current item count.
sTextSalStringThe item caption.
nItemValueSalNumberThe application value, converted to Int32 and stored in Tag.
hpicLargeSalNumberA valid large-picture handle.
hpicSmallSalNumberA valid small-picture handle.

Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.

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 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 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 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 OnColumnClick(e)

Toggles sort direction, selects the clicked sort column, sorts, and raises the base event.

ParameterTypeDescription
eColumnClickEventArgsThe clicked column index.

Protected member OnHandleCreated(e)

Creates default image lists before raising the base handle-created event.

ParameterTypeDescription
eEventArgsThe handle-creation event data.

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 RemoveAllImages()

Clears both image lists, creating the lists if necessary.

Returns: SalBoolean. Always true.

Instance member RemoveImage(nIndex)

Removes an image at the same index in both image lists.

ParameterTypeDescription
nIndexSalNumberThe zero-based image index.

Returns: SalBoolean. True if both removals succeed; false on ArgumentOutOfRangeException.

The large-image removal is not rolled back if the small-image removal fails.

Instance member ReplaceImage(nIndex, hpicLarge, hpicSmall)

Replaces corresponding entries in the large and small image lists.

ParameterTypeDescription
nIndexSalNumberThe zero-based image index.
hpicLargeSalNumberThe large picture handle.
hpicSmallSalNumberThe small picture handle.

Returns: SalBoolean. True on success; false when neither picture resolves or an IndexOutOfRangeException occurs.

When only one picture resolves, its bitmap is used for both sizes.

Instance member Scroll(size)

Scrolls the native list view by the supplied displacement.

ParameterTypeDescription
sizeVisSizeThe horizontal and vertical displacement in pixels; must not be null.

Returns: SalBoolean. True when the native operation succeeds; otherwise, false.

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(nMsg, nMywParam, nMylParam)

Dispatches a SAL message to this control's children.

ParameterTypeDescription
nMsgSalNumberThe SAL or application-defined message code.
nMywParamSalNumberThe first message parameter.
nMylParamSalNumberThe second message parameter.

Returns: SalBoolean. The result of child-message dispatch; false if the parent is unavailable or disposed.

Instance member SetBkColor(nNewColor)

Sets the list-view background color.

ParameterTypeDescription
nNewColorSalNumberThe SAL color to apply.

Returns: SalBoolean. Always true.

Instance member SetColumn(nColumn, nMask, sTitle, nAlignment, nWidth)

Updates the column attributes selected by a mask.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.
nMaskSalNumberLVCF_Text, LVCF_Fmt, and LVCF_Width flags selecting the supplied values.
sTitleSalStringThe new caption.
nAlignmentSalNumberThe HorizontalAlignment numeric value.
nWidthSalNumberThe new width in horizontal form units.

Returns: SalBoolean. True when the column exists; otherwise false.

Instance member SetColumnAlignment(nColumn, nAlignment)

Sets a column's text alignment.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.
nAlignmentSalNumberThe HorizontalAlignment numeric value.

Returns: SalBoolean. True if the column exists and is updated; otherwise false.

Instance member SetColumnTitle(nColumn, sTitle)

Sets a column's caption.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.
sTitleSalStringThe new caption.

Returns: SalBoolean. True if the column exists and is updated; otherwise false.

Instance member SetColumnWidth(nColumn, nWidth)

Sets a column's width.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.
nWidthSalNumberThe new width in horizontal form units.

Returns: SalBoolean. True if the column exists and is updated; otherwise false.

Instance member SetContextMenu(sMenuName, nFlags)

Creates and assigns a context menu for this control.

ParameterTypeDescription
sMenuNameSalStringThe name used to resolve the menu type.
nFlagsSalNumberUse Sys.CM_TableCell to target the associated table column; other values target the control.

Returns: SalBoolean. True if the menu was created; false if the control or menu type is unavailable or menu creation fails.

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 SetFocusItem(nItem)

Gives keyboard focus to an item.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.

Returns: SalBoolean. True if the item exists; otherwise false.

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 SetItem(nItem, nSubItem, nMask, sItemText, nItemValue, nImage)

Updates selected item attributes.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nSubItemSalNumberZero or negative for the main item; positive for a subitem.
nMaskSalNumberLVIF_Text, LVIF_Image, and LVIF_Param flags selecting attributes to update.
sItemTextSalStringThe new caption.
nItemValueSalNumberThe new application value, converted to Int32.
nImageSalNumberThe new image-list index.

Returns: SalBoolean. True if the item or subitem exists; otherwise false.

Subitems support only text changes.

Instance member SetItemPosition(item, ptPosition)

Sets an icon item position through the native list view.

ParameterTypeDescription
itemSalNumberThe zero-based item index.
ptPositionVisPointThe requested position in pixels; each coordinate is packed into a 16-bit word.

Returns: SalBoolean. True when the native operation succeeds; otherwise, false.

Instance member SetItemState(nItem, nNewState, nStateMask)

Updates item state while suppressing generated SAM_Click notifications.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nNewStateSalNumberThe new LVIS state bits.
nStateMaskSalNumberThe state bits to change.

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

Supports focus, selection, state image, cut, and drop-highlight state.

Instance member SetItemText(nItem, nSubItem, sItemText)

Changes an item or subitem caption.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nSubItemSalNumberZero or negative for the main item; positive for a subitem.
sItemTextSalStringThe new caption.

Returns: SalBoolean. True if the item or subitem exists; otherwise false.

Instance member SetItemValue(nItem, nItemValue)

Stores an application value in an item's Tag.

ParameterTypeDescription
nItemSalNumberThe zero-based item index.
nItemValueSalNumberThe value converted to Int32.

Returns: SalBoolean. True if the item exists; 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 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 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 SetSortColumn(nColumn)

Selects the column for the next explicit sort.

ParameterTypeDescription
nColumnSalNumberThe zero-based column index.

Returns: SalBoolean. Always true.

Instance member SetSortOrder(nOrder)

Selects the ordering for the next explicit sort.

ParameterTypeDescription
nOrderSalNumberLVSORT_Ascending or LVSORT_Descending; other values disable ordering.

Returns: SalBoolean. Always true.

Instance member SetStyle(nStyle, fOn)

Enables or clears list-view styles and updates corresponding managed properties.

ParameterTypeDescription
nStyleSalNumberThe LVS style bits to change.
fOnSalBooleanTrue to set the bits; false to clear them.

Returns: SalNumber. The updated style value.

The return variable is modified during assignment, so the result is not the previous style.

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 SetTextBkColor(nNewColor)

Sets the list-view background color.

ParameterTypeDescription
nNewColorSalNumberThe SAL color to apply.

Returns: SalBoolean. Always true.

Instance member SetTextColor(nNewColor)

Sets the list-view foreground color.

ParameterTypeDescription
nNewColorSalNumberThe SAL color to apply.

Returns: SalBoolean. Always true.

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 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 SortItems()

Sorts once with the configured item sorter, then removes the sorter.

Returns: SalBoolean. True.

Subsequent insertions are not automatically sorted.

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 ViewDetails()

Switches the list view to details.

Returns: SalNumber. Always zero.

Instance member ViewLargeIcons()

Switches the list view to large icons.

Returns: SalNumber. Always zero.

Instance member ViewList()

Switches to list view.

Returns: SalNumber. Zero.

Instance member ViewSmallIcons()

Switches the list view to small icons.

Returns: SalNumber. Always zero.

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 list-view notifications and native messages through SAL while suppressing selection clicks during focus entry.

ParameterTypeDescription
m by referenceMessageThe native message and 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
ISalWindow