Unit 'MUIClass.List' Package
[Overview][Types][Classes][Index] [#MUIClass]

TMUIList.NextSelected

Iterate through the selected entries of a list.

Declaration

Source position: MUIClass.List.pas line 96

public procedure TMUIList.NextSelected(

  var Pos: Integer

);

Arguments

Pos

  

A longword that will hold the number of the returned entry. Must be set to MUIV_List_NextSelected_Start at start of iteration. Is set to MUIV_List_NextSelected_End when iteration is finished.

Description

This method steps through the contents of a (multi select) list and returns every entry that is currently selected. When no entry is selected but an entry is active, only the active entry will be returned.

This behaviour will result in not returning the active entry when you have some other selected entries somewhere in your list. Since the active entry just acts as some kind of cursor mark, this seems to be the only sensible possibility to handle multi selection together with keyboard control.

Example:

Pos := MUIV_List_NextSelected_Start; // Start Value
repeat
  List.NextSelected(Pos); // Get next Entry
  if Pos = MUIV_List_NextSelected_End then // Check for End of List
    Break;
  Entry := List.GetEntry(Pos);
  // do something with your Entry
until False;

Documentation generated on: 2024-05-29