User Tools

Site Tools


DzFileFilter

Encapsulates one or more file filters to be chosen from in a file dialogs.

More...

Inherits :

Constructors

DAZ Script
DzFileFilter ()
DzFileFilter ( String description, Array extensions )
DzFileFilter ( String description, String extension )

Methods

DAZ Script
voidaddExtension ( String extension )
voidaddExtensions ( Array extensions )
NumbergetDefaultFilter ()
StringgetExtension ( Number filterIdx, Number extensionIdx )
StringgetFilterDescription ( Number filterIdx )
NumbergetNumExtensions ( Number filterIdx )
NumbergetNumFilters ()
voidnewFilter ( String description )
voidsetDefaultFilter ( Number filterIdx )

Detailed Description

For each group of files that you want to make available to the user, create a new filter with the newFilter() call, then add one or more file extensions to be accepted by the filter.

Constructors


DzFileFilter()

Default Constructor.


DzFileFilter( String description, Array extensions )

Creates a new file filter and adds a filter with the given description and extensions.

Parameter(s):

  • description - The description of the filter.
  • extensions - The list of extensions for the filter.

DzFileFilter( String description, String extension )

Creates a new file filter and adds a filter with the given description and extension.

Parameter(s):

  • description - The description of the filter.
  • extension - The extension for the filter.

Methods


void : addExtension( String extension )

Adds a file extension to the current filter.

Parameter(s):

  • extension - A file extension that this filter will open/save e.g. “duf”

void : addExtensions( Array extensions )

Adds file extensions to the current filter.

Parameter(s):

  • extensions - A list of file extensions that this filter will open/save

Number : getDefaultFilter()

Return Value:

  • The default filter index, returns -1 if no default is set.

String : getExtension( Number filterIdx, Number extensionIdx )

Parameter(s):

  • filterIdx - The index of the filter to return an extension for.
  • extensionIdx - The index of the extension to return.

Return Value:

  • The extension of the filter at the given index.

String : getFilterDescription( Number filterIdx )

Parameter(s):

  • filterIdx - The index of the filter to return a description for.

Return Value:

  • The description of the filter at the given index.

Number : getNumExtensions( Number filterIdx )

Parameter(s):

  • filterIdx - The index of the filter to get the number of extensions for.

Return Value:

  • The number of extensions in the filter at the given index.

Number : getNumFilters()

Return Value:

  • The number of filters.

void : newFilter( String description )

Starts a new filter with the given description.

Parameter(s):

  • description - The description of files this filter will open/save e.g. “DAZ Studio files”

void : setDefaultFilter( Number filterIdx )

Sets the default filter index - by default this is 0.

Parameter(s):

  • filterIdx - The index of the filter to become the default - if the index is invalid the default is not changed.