Zum Inhalt

SelectItems (Opus Funktion)

Beschreibung

Zeigt eine Auswahltabelle wie beim Start der Software mit maximal 3 Textspalten. Die ersten 4 Argumente müssen dieselbe Grösse aufweisen und enthalten die ID sowie die Spaltentexte für die Auswahlmöglichkeiten.

Shows a modal selection dialog at the current mouse position and returns the IDs of the chosen entries. Two overloads are available: one supplies the display texts as three explicit columns, the other names a dataset whose standard texts are used.

Argumente

Name

Typ

Beschreibung

IDList

integer[]

IDs der einzelnen Auswahlmöglichkeiten

Strings1

string[]

Text 1. Spalte der Auswahlmöglichkeiten

Strings2

string[]

Text 2. Spalte der Auswahlmöglichkeiten

Strings3

string[]

Text 3. Spalte der Auswahlmöglichkeiten

SelectionCode

 

 

 

DatasetID

string

 

 

 

string

Eindeutige Beschreibung der Auswahl
name under which the dialog stores its size in the user profile (Settings\SSX\SelectionControls) and under which the column layout of its list is kept, so that the same code always shows the dialog the same way. It does not separate the remembered selection: the entries selected last time are preselected per overload for the lifetime of the process, no matter which SelectionCode is passed.

dataset ID whose standard texts are used for the entries instead of the three text arrays

MultiSelection

integer

(optional) Multiselect

0 = Nur eine Auswahl (Default)

1 = Multiselect möglich (Any value other than 0 enables multiple selection.)

SelectionType

integer

(optional)

0 = Auswahl ist Pflicht (Default)

1 = Mandatory, the Select button behaves as with 0 and cancelling the dialog is not possible, so the result always contains at least one entry;

2 = Kann auch ohne Auswahl geschlossen werden

governs the Select button and the Cancel possibility: 0 = Default, the Select button becomes active only once at least one entry is selected but the dialog can be cancelled (result is then empty); 1 = Mandatory, the Select button behaves as with 0 and cancelling the dialog is not possible, so the result always contains at least one entry; 2 = AllowEmpty, the Select button is always active, so the user can deliberately confirm an empty selection and the dialog can also be cancelled. Values below 0 or above 2 are clamped into that range.

Rückgabewert integer[]

ID(s) der ausgewählten Option(en). IDs of the items the user selected, in the order of the dialog. An empty array means that nothing was selected, either because the user cancelled the dialog or, with SelectionType 2, because the user confirmed an empty selection.

Beispiel

Li_IDs = [1,2,3];
Ls_Text1 = ["Alles neu und überschreiben",
"Neu und Text anpassen",
"Nur Neue erstellen"];
Ls_Text2 = ["Es werden neue Einträge erstellt und nicht mehr vorhandene gelöscht. (Nur vor Beginn des Semesters)",
"Es werden neue Einträge erstellt und auf bestehenden Einträgen wird der Text aktualisiert. Es wird nichts gelöscht.",
"Es werden nur neue Einträge erstellt. Bestehende werden nicht aktualisiert. Es wird nichts gelöscht. (Standard nach Semesterbeginn)"];
Ls_Text3 = ["","",""];
Ls_SelCode = "OverwriteMode";
Lo_SelectedMode = SelectItems(Li_IDs, Ls_Text1, Ls_Text2, Ls_Text3, Ls_SelCode);

Resultat:

Siehe auch