StringListContainer

MLModule
genre Fields
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLBase
definition MLBase.def
see also XMarkerListContainer
keywords ListBase

Purpose

The module StringListContainer stores a list of strings as ml.StringList object and makes it available at its outStringList field. The contents of this string list can be displayed, edited and saved in a persistent state.

Usage

The StringListContainer controls either an internal ml.StringList object or an external object connected at the inStringList field. It allows to add, delete and modify entries in the StringList.

If an external StringList is connected, the StringListContainer acts as an inspector for the external object, i.e. it displays the contents of the external StringList and the internal list object is hidden.

If the inStringList field is unconnected, the internal list object is visible. If the inStringList field is connected to an object which is no StringList, all display and edit functions are disabled.

Details

A ml.StringList object contains a number of string list elements, each of which consists of a String and an Item ID. The item id of a string list element is unique within a list and is left unchanged even if list elements are inserted or deleted. The id can hence be used as a reference to a list element.

In addition to the string list elements, a ml.StringList contains a description of the last action performed on the list (see the description of the field Action below). This can be used by modules attached to a StringList object to synchronize themselves with operations performed on the list by some other module.

The StringList class is related to other list classes (e.g. ml.XMarkerList) in the sense that its properties (action) and the properties of string elements (string and id) are also part of other list objects and elements. In the context of other list classes, the string is typically used as a name property. As a consequence, the functionality of the StringListContainer module can also be found in other list container modules (e.g. XMarkerListContainer).

Interaction

The modules control panel offers the possibility to add empty or filled StringList items. To add filled items Add/Insert from Template has to be checked. In this case the value of the Template Item is used.

Furthermore the modification of existing items is possible. This can be done by selecting an item via the field Item Index and editing the field String. The new property value is passed to the list item when the focus leaves the edit control.

Windows

Default Panel

../../../Modules/ML/MLBase/mhelp/Images/Screenshots/StringListContainer._default.png

Input Fields

inStringList

name: inStringList, type: ListBase(MLBase), deprecated name: inputStringList

An external StringList object can be connected to this field.

Output Fields

outStringList

name: outStringList, type: StringList(MLBase), deprecated name: outputStringList

The StringList controlled by this module is presented at this output field.

Parameter Fields

Field Index

Action: String Enable: Bool Overflow Mode: Enum
Add: Trigger Id: Integer Owner: Bool
Add/Insert from Template: Bool Index: Integer Persistent: Bool
Clear Item: Trigger Insert: Trigger Select: Bool
Copy from Current Item: Trigger Item ID: Integer String (name): String
Copy to Current Item: Trigger Item Index: Integer String (newName): String
Current: Integer List Size: Integer Up to date: Bool
Delete all Items: Trigger List String: String Update: Trigger
Delete Item: Trigger Max. Size: Integer  

Visible Fields

List String

name: listString, type: String

Shows the contents of the list in the same format that is used for persistent storage.

The List String field is only active if the Enable checkbox next to it is checked. Since keeping the List String up to date may be expensive, it is best to disable this field if it is not needed. The List String field is updated automatically, but the Update button can be used to force an update.

List Size

name: numItems, type: Integer, persistent: no

Shows the current number of list items.

Item Index

name: index, type: Integer, default: 0

Shows the index of the current list item (counting from zero).

Persistent

name: persistent, type: Bool, default: FALSE

If checked, the contents of the list is stored and restored with the network.

Enable

name: listStringEnable, type: Bool, default: FALSE

If checked, the field List String shows the content of the StringList.

Owner

name: ownsList, type: Bool, persistent: no

Shows whether the module displays and controls the internal list object (checked) or an external object (unchecked).

Select

name: applySelect, type: Bool, default: FALSE

If checked, changing the Item Index results in a Select action on the list and other modules connected to this string list object are notified.

Item ID

name: id, type: Integer, persistent: no

Shows id property of the current item.

String (name)

name: name, type: String

Shows the string property of the current item.

String (newName)

name: newName, type: String

Sets the string in the template for a new item.

Action

name: actionClass, type: String, persistent: no

Shows the type of the last action performed on the list. Possible entries are:

  • ActNone: No action
  • ActUnknown: Unknown action
  • ActNew: New list generated
  • ActSelect: Changed the selection of the current list item. Deselect is represented by Index -1.
  • ActModify: Current list item modified
  • ActDelete: List item deleted, Index contains index formerly occupied by deleted item.
  • ActInsert: List item inserted.
  • ActInsertOvw: List item inserted, first or last item deleted due to maximum list size restriction. Index contains index of inserted item, Id contains id of deleted item. NOTE: In this case, Id and Index refer to different items!

Index

name: actionIndex, type: Integer, persistent: no

Shows the index of the item to which the last action refers. The value -1 means no item.

Id

name: actionId, type: Integer, persistent: no

Shows the id of the item to which the last action refers. The value -1 means no item.

Current

name: currentIndex, type: Integer, persistent: no

Shows the index of the currently selected item, or -1 if no item is selected.

Overflow Mode

name: overflowMode, type: Enum, default: None

Defines the behavior if the maximum size is reached and a new item is going to be inserted.

Values:

Title Name Description
None None List size is unrestricted.
Remove First RemoveFirst First list item is removed.
Remove Last RemoveLast Last list item is removed.
Remove All RemoveAll All list items are removed.
Remove New RemoveNew New item is deleted (not inserted).

Max. Size

name: maxSize, type: Integer, default: 0

Sets the maximum number of list items in conjunction with the Overflow Mode setting.

Delete Item

name: delete, type: Trigger

If pressed, the current item is deleted.

Delete all Items

name: deleteAll, type: Trigger

If pressed, all items are deleted.

Insert

name: insert, type: Trigger

If pressed, a new item is inserted at the current list position.

Add

name: add, type: Trigger

If pressed, a new item is appended at the end of the list.

Update

name: update, type: Trigger

If pressed, the module’s fields are updated to the state of an attached StringListContainer.

Add/Insert from Template

name: useInsertTemplate, type: Bool, default: FALSE

If checked, the added or inserted item is initialized with the values of the template fields.

Copy from Current Item

name: copyItemToTemplate, type: Trigger

If pressed, the properties of the current item are copied to the template fields.

Copy to Current Item

name: copyTemplateToItem, type: Trigger

If pressed, the properties of the template fields are copied to the current item.

Clear Item

name: clear, type: Trigger

If pressed, all property fields of the current item are cleared except of the Item ID.

Up to date

name: upToDate, type: Bool, persistent: no

Shows if the string item values are up to date. It is set to true after all string item values have been set.