void | attributesToggleChanged ( Boolean onOff ) |
void | findReplaceToggleChanged ( Boolean onOff ) |
This pane provides users with an Integrated Development Environment (IDE) that is specifically tailored to the development of DAZ Script for use in Daz Studio. It includes several standard features expected in a modern IDE, such as line numbering, syntax highlighting, and code folding. In addition to these core features, the pane allows users to execute a script directly within Daz Studio while the script is being developed, making testing/debugging easier.
The Script IDE pane is accessible within the UI via the Window > Panes (Tabs) menu. Triggering the “Script IDE” action will toggle visibility of the pane. As is the case for any pane in the application, this pane can float (be undocked) in its own pane group or be docked with other panes, as desired.
The Script IDE pane is accessible through the scripting API using DzPaneMgr::findPane().
MenuBar and Menus
A menubar, with menus and actions that pertain specifically to the IDE, is located at the top of the pane. Many of the actions found here provide access to basic file operations, such as opening, closing, and saving scripts or basic editing operations, such as copy, paste and find/replace. Also found here are actions that provides access to attributes of the script, such as API version and type, as well as preferences that provide control over look, feel and formatting.
Script Tabs
Multiple script documents can be open within the Script IDE pane at the same time. Script tabs provide access to the individual script documents. Each tab displays the shortname of the file that the script document was loaded from. If the script document was not loaded from a file, the script tab displays “Untitled” for its name.
Output Window
At the bottom of the pane is an output window that displays error and warning messages when there is an issue with a script that has been executed from within the Script IDE pane. These messages can be helpful for narrowing down the cause of a failure in the script.
Also displayed within this window are the results of calls made to Global::print() and Global::debug().
Extending the Script IDE
Edit Menu
The Edit menu, specifically, has the ability to be extended by placing scripts that use the DzScriptTab API to access and/or manipulate the contents of an open script document within specific directories that are known to the application:
The folder/file structure that resides within these specific directories is reflected within the middle portion of the Edit menu. Where an adjacent and corresponding PNG exists for a given script within this structure, that PNG will be used for the script action's icon. In the case of relative path collisions.
Events
There are three specific events that occur in the Script IDE that you have the ability to directly extend the functionality of:
These three events are extended by placing a corresponding script, which use the DzScriptTab API to access and/or manipulate the contents of the invoking script document, within the <application_home>/resources/Script IDE/ directory:
Transient Variables
When extending the Script IDE pane, the scripts described above provide transient global variables that provide convenient access to key objects:
Encryption
It is important to understand that while the ability to open and execute encrypted scripts from within the Script IDE pane is provided, the contents of any such script cannot be accessed directly from within the Script IDE pane; placeholder text indicating that the contents of the script is encrypted will be displayed instead. The DzScript object that holds the contents of any loaded script and the DzScriptTab that displays the contents of a script are separate distinct objects.
Causes all open scripts to be closed; prompting the user to save changes as needed.
Return Value:
true
if all scripts were closed, otherwise false
.See Also:
Boolean : closeAllScriptsExceptCurrent()
Causes all open scripts except the current one to be closed; prompting the user to save changes as needed.
Return Value:
true
if all scripts except this one were closed, otherwise false
.See Also:
Since:
Boolean : closeScript()
Causes the active script to be closed; prompting the user to save changes as needed.
Return Value:
true
if the file was closed, otherwise false
.Boolean : copySelection()
Copies the selected text in the active script to the clipboard.
Return Value:
true
if the script is not encrypted, otherwise false
.DzScriptTab : currentScriptTab()
Return Value:
Number : currentScriptTabIndex()
Return Value:
Boolean : cutSelection()
Copies the selected text in the active script to the clipboard and deletes it from the document.
Return Value:
true
if the script is not encrypted, otherwise false
.If there is no text selected in the active 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
.Executes the active script.
Return Value:
true
if the script executed successfully, otherwise false
.Finds the first/last occurrence of the “Find” text from the Find/Replace frame and if the “Find” text is not found, displays a message to the user.
Return Value:
true
if the search found a match, otherwise false
.Finds the next occurrence of the “Find” text (based on the current cursor position) from the Find/Replace frame and if the “Find” text is not found, displays a message to the user.
Return Value:
true
if the search found a match, otherwise false
.Boolean : findPrevious()
Finds the previous occurrence of the “Find” text (based on the current cursor position) from the Find/Replace frame and if the “Find” text is not found, displays a message to the user.
Return Value:
true
if the search found a match, otherwise false
.String : getFindText()
Return Value:
Return Value:
Since:
String : getReplaceText()
Return Value:
DzScriptTab : getScriptTab( Number index )
Parameter(s):
Return Value:
Since:
Boolean : gotoLine( Number line=-1 )
Moves the cursor to the given line number.
Parameter(s):
Return Value:
true
if the cursor could be moved to the line number specified, otherwise false
.Boolean : indent( Number levels=1 )
Indents the selected line(s) by the specified amount.
Parameter(s):
Return Value:
true
if the script is not encrypted and the operation was successful, otherwise false
.Number : indexOf( DzScriptTab scriptTab )
Parameter(s):
Return Value:
scriptTab
.Number : indexOfFile( String filename )
Parameter(s):
Return Value:
Since:
Boolean : isFileOpen( String filename )
Return Value:
true
if the specified file is open, otherwise false
.Since:
Boolean : isFindMatchCaseChecked()
Return Value:
true
if the Case Sensitive option in the Find/Replace frame is checked, otherwise false
.Boolean : isFindRegExpChecked()
Return Value:
true
if the “Regular Expression” option in the Find/Replace frame is checked, otherwise false
.See Also:
Boolean : isFindWholeWordsChecked()
Return Value:
true
if the “Whole Words Only” option in the Find/Replace frame is checked, otherwise false
.Return Value:
true
if the contents of any script has not been saved, the contents of any script has been modified since it was last saved, the version number of any script does not match the version number last saved, the type of any script does not match the type last saved, otherwise false
.void : newScript()
Creates a new empty script.
void : openFile( String filename )
Opens a script at the specified path in a new tab.
Parameter(s):
Attention:
filename
is already open, that tab will become the 'current' tab.See Also:
Boolean : openScript()
Prompts the user to open a script.
Return Value:
true
if a file was opened, otherwise false
.See Also:
Boolean : pasteAtCursor()
Pastes the text from the clipboard into the active script, at the current cursor position.
Return Value:
true
if the script is not encrypted, otherwise false
.void : refreshEditMenu()
Causes the Edit menu for the pane to be rebuilt.
Attention:
See Also:
Since:
Boolean : reloadScript()
Causes the active script to be reloaded from disk.
Return Value:
true
if a file was reloaded, otherwise false
.See Also:
Boolean : replaceAll()
Replaces all occurrences of the “Find” text with the “Replace” text and notifies the user with the number of replacements made.
Return Value:
true
if the operation was successful, otherwise false
.Boolean : replaceNext()
Replaces the selected text with the “Replace” text if it matches the “Find” text of the Find/Replace frame. If there is no selection or the text does not match the “Find” text, a findNext() operation is performed.
Return Value:
true
if the selected text matches the “Find” text and the replace was successful, otherwise false
.Replaces the selected text with the “Replace” text if it matches the “Find” text of the Find/Replace frame. If there is no selection or the text does not match the “Find” text, a findPrevious() operation is performed.
Return Value:
true
if the selected text matches the “Find” text and the replace was successful, otherwise false
.Boolean : saveEncryptedScript()
Prompts the user to save the active script to an encrypted file.
Return Value:
true
if the script is not encrypted and a file was saved, otherwise false
.See Also:
Boolean : saveFile( String filename )
Saves the contents of the active script to the specified path.
Parameter(s):
Return Value:
true
if the script is not encrypted and the operation is successful, otherwise false
.Boolean : saveScript()
Saves the contents of the active script to file, prompting as needed.
Return Value:
true
if the script is not encrypted and a file was saved, otherwise false
.See Also:
Boolean : saveScriptAs()
Prompts the user to save the active script.
Return Value:
true
if the script is not encrypted and a file was saved, otherwise false
.See Also:
Selects all text in the active script.
Return Value:
true
if the script is not encrypted, otherwise false
.void : setCurrentScriptTab( Number index )
Sets the current script tab in the pane.
Parameter(s):
void : setFindMatchCaseChecked( Boolean yesNo )
Sets whether or not the “Case Sensitive” option in the Find/Replace frame is checked.
Parameter(s):
true
, the “Case Sensitive” option in the Find/Replace frame is checked.void : setFindRegExpChecked( Boolean yesNo )
Sets whether or not the “Regular Expression” option in the Find/Replace frame is checked.
Parameter(s):
true
, the “Regular Expression” option in the Find/Replace frame is checked.See Also:
void : setFindText( String text )
Sets the “Find” text in the Find/Replace frame.
Parameter(s):
void : setFindWholeWordsChecked( Boolean yesNo )
Sets whether or not the “Whole Words Only” option in the Find/Replace frame is checked.
Parameter(s):
true
, the “Whole Words Only” option in the Find/Replace frame is checked.void : setReplaceText( String text )
Sets the “Replace” text in the Find/Replace frame.
Parameter(s):
void : showAttributesFrame( Boolean onOff )
Sets whether or not the Attributes frame is visible.
Parameter(s):
true
, the Attributes frame will be made visible. If false
, the Attributes frame will be hidden.void : showFindReplaceFrame( Boolean onOff )
Sets whether or not in the Find/Replace frame is visible.
Parameter(s):
true
, the Find/Replace frame will be made visible. If false
, the Find/Replace frame will be hidden.Shows the preferences dialog for the pane.
Return Value:
true
if the dialog is accepted, otherwise false
.Boolean : unindent( Number levels=1 )
Unindent the selected line(s) by the specified amount.
Parameter(s):
Return Value:
true
if the script is not encrypted and the operation was successful, otherwise false
.void : attributesToggleChanged( Boolean onOff )
Signature:“attributesToggleChanged(bool)”
Emitted when the option to show/hide the attributes panel has changed.
Parameter(s):
void : findReplaceToggleChanged( Boolean onOff )
Signature:“findReplaceToggleChanged(bool)”
Emitted when the option to show/hide the find/replace panel has changed.
Parameter(s):