Field-Map Scripting

4.1.1.2.10 InputFromCheckListTab

InputFromCheckListTab function


Prototype:

function InputFromCheckListTab (const caption, msg: string;

tab : TFieldMapTableScriptWrapper;

FormatString, FormattedAtts, TaggedAtt, ValAtt : string) : TVariantListWrapper;


Description:

The InputFromCheckListTab function displays a dialog allowing the user to choose from a number of listed options. Each item of the list is preceded by a check box. The listed options come from a table. The dialog has a caption specified by the caption parameter, contains the text specified by the msg parameter, check boxes with labels for every option, "OK" and "Cancel" buttons.

Syntax:

variable := InputFromCheckListTab (Caption, Msg, Tab, FormatString, FormattedAtts, TaggedAtt, ValAtt);


Part

Description


variable

A variable declared as TVariantListWrapper


Caption

A string parameter which specifies the caption of the dialog box.


Msg

A string parameter which specifies the message displayed in the dialog box.


Tab

A table of TTableWrapper type


FormatString

A variable declared as string; a format string for the formatted attributes


FormattedAtts

A column from the tab that defines labels for the checkboxes


TaggedAtt

A column from the tab that defines if an option is checked or not


ValAtt

A column from the tab that defines the values for the checkboxes




Return value:

List of selected options as a variant list




Note: This function is available since version X7.



Example:

var
  tab:TTableWrapper;
  vlist :TVariantListWrapper;

begin
    //create  list  of species on particular plot
    tab:= Project.GetQueryResult(format('SELECT DISTINCT Species,Value1,1 as checked FROM Trees INNER JOIN qSpecies ON Trees.Species = qSpecies.ID WHERE IDPlots=%d',[Trees.ValueAsInteger['IDPlots']]));


    vlist := InputFromCheckListTab( 'Select species','List of species',
                                    tab,
                                    '%s','Value1',
                                    'checked',
                                    'Species');

    if vlist<>nil then 
    try
      // do something
    finally
      vlist.Free;
    end
    else exit;

end.



See also:

InputInteger; InputIntegerWithCounter; InputFloat; InputString; InputText; InputOption; InputOptionWithStartingValue; InputFromList;InputFromListWithStartingValue; InputFromCheckListTab; InputFromListTab