User Tools

Site Tools


DzScriptTab

A sub-component of DzScriptPane that allows authoring/viewing each script.

More...

Inherits :

Enumerations

Methods

DAZ Script
BooleanappendText ( String text )
BooleanbeginEdit ()
voidcenterCursor ()
voidclear ()
voidclearRedoStack ()
BooleanclearSelection ()
voidclearUndoRedoStacks ()
voidclearUndoStack ()
BooleancopySelection ()
BooleancutSelection ()
BooleandeleteSelection ()
BooleanfinishEdit ()
BooleanfoldLine ( Number line )
NumbergetCursorAnchor ()
NumbergetCursorColumnNumber ()
NumbergetCursorLineNumber ()
NumbergetCursorPosition ()
StringgetFilename ()
StringgetFilepath ()
StringgetLineText ( Number line )
StringgetSelectedText ()
StringgetText ()
StringgetType ()
DzVersiongetVersion ()
BooleangotoLine ( Number line )
Booleanindent ( Number levels=1 )
BooleaninsertText ( String text )
BooleanisCursorAtEnd ()
BooleanisCursorAtLineEnd ()
BooleanisCursorAtLineStart ()
BooleanisCursorAtStart ()
BooleanisEncrypted ()
BooleanisLineFoldable ( Number line )
BooleanisLineFolded ( Number line )
BooleanisModified ()
voidmarkText ( String text, Number caseSense=0 )
BooleanmoveCursorPosition ( CursorMoveOperation operation, Boolean keepAnchor=false, Number iterations=1 )
BooleanneedsSave ()
BooleanneedsSaveAs ()
NumbernumAvailableRedoSteps ()
NumbernumAvailableUndoSteps ()
NumbernumCharacters ()
NumbernumLines ()
BooleanpasteAtCursor ()
voidredo ()
BooleanreloadScript ()
BooleansaveEncryptedScript ()
BooleansaveScript ()
BooleansaveScriptAs ()
BooleanselectAllText ()
voidsetCursorPosition ( Number pos, Boolean keepAnchor=false )
voidsetCursorPosition ( Number line, Number column, Boolean keepAnchor=false )
BooleansetLineText ( Number line, String text )
BooleansetText ( String text )
BooleansetType ( String type )
BooleansetVersion ( DzVersion version )
BooleansetVersionBuild ( Number build )
BooleansetVersionMajor ( Number major )
BooleansetVersionMinor ( Number minor )
BooleansetVersionRevision ( Number revision )
BooleantoggleFold ( Number line )
voidundo ()
BooleanunfoldLine ( Number line )
Booleanunindent ( Number levels=1 )
voidupdateSidebar ()

Signals

voidblockCountChanged ( Number count )
voidcopyAvailable ( Boolean yesNo )
voidcursorPositionChanged ()
voidmodificationChanged ( Boolean state )
voidnameChanged ()
voidredoAvailable ( Boolean yesNo )
voidselectionChanged ()
voidtextChanged ()
voidtypeChanged ()
voidundoAvailable ( Boolean yesNo )
voidupdateRequest ( Rect rect, Number dy )
voidversionChanged ()

Detailed Description

Provides a widget that is used to display and edit a DAZ Script document.

Since:

  • 4.11.0.132

Enumerations


: CursorMoveOperation

Since:

  • 4.11.0.138
  • NoChange - Keep the cursor where it is.
  • Start - Move to the start of the document.
  • Up - Move up one line.
  • StartOfLine - Move to the start of the current line.
  • StartOfWord - Move to the start of the current word.
  • PreviousLine - Move to the start of the previous line.
  • PreviousCharacter - Move to the previous character.
  • PreviousWord - Move to the beginning of the previous word.
  • Left - Move left one character.
  • WordLeft - Move left one word.
  • End - Move to the end of the document.
  • Down - Move down one line.
  • EndOfWord - Move to the end of the current word.
  • EndOfLine - Move to the end of the current line.
  • NextLine - Move to the beginning of the next line.
  • NextCharacter - Move to the next character.
  • NextWord - Move to the next word.
  • Right - Move right one character.
  • WordRight - Move right one word.

Methods


Boolean : appendText( String text )

Appends text to the end of the script.

Parameter(s):

  • text - The text to append.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : beginEdit()

Starts a block of editing operations as a single operation from an undo/redo perspective.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

void : centerCursor()

Scrolls the document in order to center the cursor vertically.


void : clear()

Deletes all of in the document.

Attention:

  • The undo/redo stack is cleared.

void : clearRedoStack()

Clears the redo stack.

Since:

  • 4.11.0.143

Boolean : clearSelection()

Clears the current selection by setting the anchor to the cursor position; does not delete the text of the selection.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

void : clearUndoRedoStacks()

Clears the undo and redo stacks.

Since:

  • 4.11.0.143

void : clearUndoStack()

Clears the undo stack.

Since:

  • 4.11.0.143

Boolean : copySelection()

Copies the selected text to the clipboard.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : cutSelection()

Copies the selected text to the clipboard and deletes it from the script.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : deleteSelection()

If there is no text selected in the script, deletes the character at the current cursor position, otherwise deletes the selected text.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : finishEdit()

Finishes a block of editing operations as a single operation from an undo/redo perspective.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : foldLine( Number line )

Causes a foldable line to be folded (collapsed).

Parameter(s):

  • line - The number of the line to fold.

Return Value:

  • true if the script is not encrypted, otherwise false.

Number : getCursorAnchor()

Return Value:

  • The (0-based) absolute position of the anchor; this is the same as getPosition() unless there is a selection in which case getPosition() marks the end of the selection and this marks the starting position; the cursor is positioned between characters.

Since:

  • 4.11.0.137

Number : getCursorColumnNumber()

Return Value:

  • The (0-based) relative position of the cursor within the line; the cursor is positioned between characters on the line.

Since:

  • 4.11.0.137

Number : getCursorLineNumber()

Return Value:

  • The (1-based) relative position of the line within the script that the cursor is in.

Since:

  • 4.11.0.137

Number : getCursorPosition()

Return Value:

  • The (0-based) absolute position of the cursor within the script; the cursor is positioned between characters.

Since:

  • 4.11.0.137

String : getFilename()

Return Value:

  • The short name of the script.

String : getFilepath()

Return Value:

  • The full path to the script.

String : getLineText( Number line )

Return Value:

  • The text of the (1-based) line specified (if not encrypted), otherwise an empty string.

Since:

  • 4.11.0.141

String : getSelectedText()

Return Value:

  • The selected text of the script (if not encrypted), otherwise an empty string.

Since:

  • 4.11.0.137

String : getText()

Return Value:

  • The text of the script (if not encrypted), otherwise an empty string.

Since:

  • 4.11.0.137

String : getType()

Return Value:

  • The type of the script.

DzVersion : getVersion()

Return Value:

  • The version of the script.

Boolean : gotoLine( Number line )

Moves the cursor to the given line number.

Parameter(s):

  • line - The number of the line to move the cursor to.

Return Value:

  • true if the script is not encrypted and the line number specified is within the range of lines in the script, otherwise false.

Boolean : indent( Number levels=1 )

Indents the selected line(s) by the specified amount.

Parameter(s):

  • levels - The number of indentions to apply.

Return Value:

  • true if the script is not encrypted and the operation was successful, otherwise false.

Since:

  • 4.11.0.137

Boolean : insertText( String text )

Inserts text at the current cursor position.

Parameter(s):

  • text - The text to insert.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : isCursorAtEnd()

Return Value:

  • true if the cursor is at the end of the document, otherwise false.

Since:

  • 4.11.0.138

Boolean : isCursorAtLineEnd()

Return Value:

  • true if the cursor is at the end of the line, otherwise false.

Since:

  • 4.11.0.138

Boolean : isCursorAtLineStart()

Return Value:

  • true if the cursor is at the start of the line, otherwise false.

Since:

  • 4.11.0.138

Boolean : isCursorAtStart()

Return Value:

  • true if the cursor is at the start of the document, otherwise false.

Since:

  • 4.11.0.138

Boolean : isEncrypted()

Return Value:

  • true if the script is encrypted, otherwise false.

Since:

  • 4.11.0.142

Boolean : isLineFoldable( Number line )

Parameter(s):

  • line - The line number to check.

Return Value:

  • true if the script is not encrypted and line is foldable (collapsable), otherwise false.

Boolean : isLineFolded( Number line )

Parameter(s):

  • line - The line number to check.

Return Value:

  • true if the script is not encrypted and line is folded (collapsed), otherwise false.

Boolean : isModified()

Return Value:

  • true if the script is in a modified state, otherwise false.

Since:

  • 4.11.0.143

void : markText( String text, Number caseSense=0 )

Highlights occurances of specified text within the body of the script.

Parameter(s):

  • text - The text to “mark”.
  • caseSense - If 0, case insensitive. If 1, case sensitive.

Boolean : moveCursorPosition( CursorMoveOperation operation, Boolean keepAnchor=false, Number iterations=1 )

Moves the cursor by performing the specified operation a given number of times; the cursor is positioned between characters.

Parameter(s):

  • operation - The operation to perform on the cursor.
  • keepAnchor - If true, the current position of the cursor is kept as the anchor (the start of a selection). If false, the anchor is set to the same position.
  • iterations - The number of times to perform the operation.

Return Value:

  • true if all operations were completed successfully; otherwise false.

Since:

  • 4.11.0.138

Boolean : needsSave()

Return Value:

  • true if the contents of this tab has not been saved, the contents of this tab has been modified since the script was last saved, the version number of this tab does not match the version number last saved for the script, the script type of this tab does not match the script type last saved for the script, otherwise false.

Since:

  • 4.11.0.137

Boolean : needsSaveAs()

Return Value:

  • true if the contents of this tab has not been saved (e.g., started from an empty/new script, or was converted from an earlier deprecated format), otherwise false.

Since:

  • 4.11.0.137

Number : numAvailableRedoSteps()

Return Value:

  • The number of available redo steps.

Since:

  • 4.11.0.143

Number : numAvailableUndoSteps()

Return Value:

  • The number of available undo steps.

Since:

  • 4.11.0.143

Number : numCharacters()

Return Value:

  • The number of characters in the script if not encrypted, otherwise -1.

Since:

  • 4.11.0.143

Number : numLines()

Return Value:

  • The number of lines in the script if not encrypted, otherwise -1.

Since:

  • 4.11.0.137

Boolean : pasteAtCursor()

Pastes the text from the clipboard into the script at the current cursor position.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

void : redo()

Redoes the last operation. If there is no operation to redo, nothing happens.


Boolean : reloadScript()

Causes the script to be reloaded from disk.

Return Value:

  • true if a file was reloaded, otherwise false.

See Also:

Since:

  • 4.11.0.141

Boolean : saveEncryptedScript()

Prompts the user to save the script to an encrypted file.

Return Value:

  • true if a file was saved, otherwise false.

See Also:

Since:

  • 4.11.0.141

Boolean : saveScript()

Saves the contents of this tab to file, prompting as needed.

Return Value:

  • true if a file was saved, otherwise false.

See Also:

Since:

  • 4.11.0.141

Boolean : saveScriptAs()

Prompts the user to save the script.

Return Value:

  • true if a file was saved, otherwise false.

See Also:

Since:

  • 4.11.0.141

Boolean : selectAllText()

Selects all text in the script.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

void : setCursorPosition( Number pos, Boolean keepAnchor=false )

Moves the cursor to the absolute position in the script specified by pos; the cursor is positioned between characters.

Parameter(s):

  • pos - The absolute position to move the cursor to.
  • keepAnchor - If true, the text between the current position and the new position is selected. If false, no text is selected.

void : setCursorPosition( Number line, Number column, Boolean keepAnchor=false )

Moves the cursor to the position specified in the script; the cursor is positioned between characters.

Parameter(s):

  • line - The (1-based) line number to move the cursor to.
  • column - The (0-based) column number to move the cursor to.
  • keepAnchor - If true, the text between the current position and the new position is selected. If false, no text is selected.

Since:

  • 4.11.0.141

Boolean : setLineText( Number line, String text )

Sets the text of the specified line in the script.

Parameter(s):

  • line - The (1-based) line number to set the text of.
  • text - The text to set.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.142

Boolean : setText( String text )

Sets the text of the script.

Parameter(s):

  • text - The text to set.

Return Value:

  • true if the script is not encrypted, otherwise false.

Since:

  • 4.11.0.137

Boolean : setType( String type )

Sets the type of the script.

Parameter(s):

  • type - The type to set.

Return Value:

  • true if the script is not encrypted and the type is different, otherwise false.

Since:

  • 4.11.0.130

Boolean : setVersion( DzVersion version )

Sets the version for the script.

Parameter(s):

  • version - The version to set.

Return Value:

  • true if the script is not encrypted and the version is different, otherwise false.

Since:

  • 4.11.0.138

Boolean : setVersionBuild( Number build )

Sets the build number of the version for the script.

Parameter(s):

  • build - The build number to set.

Return Value:

  • true if the script is not encrypted and the build number is different, otherwise false.

Boolean : setVersionMajor( Number major )

Sets the major number of the version for the script.

Parameter(s):

  • major - The major number to set.

Return Value:

  • true if the script is not encrypted and the major number is different, otherwise false.

Boolean : setVersionMinor( Number minor )

Sets the minor number of the version for the script.

Parameter(s):

  • minor - The minor number to set.

Return Value:

  • true if the script is not encrypted and the minor number is different, otherwise false.

Boolean : setVersionRevision( Number revision )

Sets the revision number of the version for the script.

Parameter(s):

  • revision - The revision number to set.

Return Value:

  • true if the script is not encrypted and the revision number is different, otherwise false.

Boolean : toggleFold( Number line )

Toggles the folded/unfolded (collapsed/expanded) state of a foldable line.

Parameter(s):

  • line - The number of the line to toggle the folded state.

Return Value:

  • true if the script is not encrypted, otherwise false.

void : undo()

Undoes the last operation. If there is no operation to undo, nothing happens.


Boolean : unfoldLine( Number line )

Causes a foldable line to be unfolded (expanded).

Parameter(s):

  • line - The number of the line to unfold.

Return Value:

  • true if the script is not encrypted, otherwise false.

Boolean : unindent( Number levels=1 )

Unindent the selected line(s) by the specified amount.

Parameter(s):

  • levels - The number of unindentions to apply.

Return Value:

  • true if the script is not encrypted and the operation was successful, otherwise false.

Since:

  • 4.11.0.137

void : updateSidebar()

Forces the sidebar (the area on the left of the script that displays line numbers and folding points) to be updated.

Signals


void : blockCountChanged( Number count )

Signature:“blockCountChanged(int)”

Emitted when the block count (number of lines) has changed.

Parameter(s):

  • count - The new count.

void : copyAvailable( Boolean yesNo )

Signature:“copyAvailable(bool)”

Emitted when text is selected or de-selected.

Parameter(s):

  • yesNo - The state of whether or not text is selected.

void : cursorPositionChanged()

Signature:“cursorPositionChanged()”

Emitted when the position of the text cursor has changed.


void : modificationChanged( Boolean state )

Signature:“modificationChanged(bool)”

Emitted when the content of the document changes in a way that affects the modification state.

Parameter(s):

  • state - The state of whether or not the document has been modified.

void : nameChanged()

Signature:“nameChanged()”

Emitted when the name of the script has changed.


void : redoAvailable( Boolean yesNo )

Signature:“redoAvailable(bool)”

Emitted when redo operations become available/un-available.

Parameter(s):

  • yesNo - The state of whether or not redo operations are available.

void : selectionChanged()

Signature:“selectionChanged()”

Emitted when text selection has changed.


void : textChanged()

Signature:“textChanged()”

Emitted when the text of the document has changed.


void : typeChanged()

Signature:“typeChanged()”

Emitted when the type of the script has changed.


void : undoAvailable( Boolean yesNo )

Signature:“undoAvailable(bool)”

Emitted when undo operations become available/un-available.

Parameter(s):

  • yesNo - The state of whether or not undo operations are available.

void : updateRequest( Rect rect, Number dy )

Signature:“updateRequest(const QRect&,int)”

Emitted when the document needs an update of the specified area.

Parameter(s):

  • rect - The area requesting an update. If the text is scrolled, this will cover the entire document viewport.
  • dy - If the text is scrolled vertically, the amount of pixels the viewport was scrolled.

void : versionChanged()

Signature:“versionChanged()”

Emitted when the version of the script has changed.