STx 3.9 Documentation

Up

BXMLDoc Member Functions

Previous

DETACHGLOBALITEM item ; unlock

Next

EXTRACTATTRIBUTELIST ref ; tag ; table ; attr1 ; ... ; attrN

DialogSelectElement

Extracts a sub-document using the function ExtractSubDoc and displays the sub-document tree in a dialog where the user can select one or more elements (depending on selmode). Depending on outmode, either the position/s or the internal reference/s of the selected element/s is/are returned. If outmode is set to POSITION the user must cleanup the positions when the element processing is finished.

Usage:

inst DialogSelectElement title ; selmode ; outmode ; tag1 ; sub1 ; tagX ; subX ; …

Parameters:

title

The dialog window caption.

selmode

The selection mode {SINGLE|MULTIMPLE}.

outmode

The output mode {POSITION|IREF}

tagX, subX

The tag name and subtree scan flag, are passed to function ExtractSubDoc. Note that

Result:

An empty string for error/cancel or one of the values listed in the table below:

selmode

outmode

result

SINGLE

POSITION

position string of selected element

SINGLE

IREF

internal reference of selected element

MULTIPLE

POSITION

simple table containing position strings of selected elements

MULTIPLE

IREF

simple table containing internal references of selected elements

Examples:

The following code displays a dialog with all audio files and sets in the current DataSet and retrieves the audio set information for the file chosen by the user (if any).

#pos := $BDataSet DialogSelectElement title ; single ; position ; Set ; 1 ; AFile ; 0

if '$#pos' != '' then

readstr '$($BDataSet GetASetInfo $#pos soundfile)' #sf';'#setId';'#srate';'#ch';'#fPath

if '$#fPath' != '' #file := $#fPath

if '$#sRate' != '' #sr := $#srate

#iref := $($BDataSet FormatIRef $#pos)

#result := '$#file ; $#sr ; $#iref ; $#ch'

end

© 2009 The Austrian Academy of Sciences Acoustics Research Institute