This is mainly an issue for discussion with @ThistleSifter.
I feel pretty strongly about all the following as usability features.
- All dialogs should be modeless.
- All scripts should nevertheless support JW Lua unless using features from the PDK Framework that are not available in JW Lua. In JW Lua they must be modal and the rest of these items do not apply. However for modal dialogs, there may be a requirement that a selected region exist when modeless dialogs probably do not have the same requirement.
- All dialogs should remember their previous values and position. (Already implemented.)
- Use of the modifier keys when the script is first called should cause the OK button to close the dialog. Otherwise not. If the user cancels out, it is as if the dialog were never called.
- Use of the modifier keys after the script is first called should skip the dialog altogether and use the last settings from the dialog.
- Use of the modifier keys when closing the dialog sets
RetainLuaState to false so that the script can start fresh. (Already implemented.)
To clarify point 4: it allows two modes for using the script. One basically sets the value you want the first time and then you never have to see the dialog again. The other mode leaves the dialog open on the desktop at all times for easy access. Point 4 allows for instant removal of the dialog the first time after the values are set.
To implement these, I am finding that I always need a block of code something like this:
functiondo_my_plugin()
localkeys_on_invoke=finenv.QueryInvokedModifierKeysand (finenv.QueryInvokedModifierKeys(finale.CMDMODKEY_ALT) orfinenv.QueryInvokedModifierKeys(finale.CMDMODKEY_SHIFT))
ifkeys_on_invokeandglobal_dialogthenglobal_dialog:on_ok()
returnendifnotglobal_dialogthenglobal_dialog=create_dialog_box()
endiffinenv.IsRGPLuathenifglobal_dialog.OkButtonCanClosethen-- OkButtonCanClose will be nil before 0.56 and true (the default) afterglobal_dialog.OkButtonCanClose=keys_on_invokeendifglobal_dialog:ShowModeless() thenfinenv.RetainLuaState=trueendelseiffinenv.Region():IsEmpty() thenfinenv.UI():AlertInfo("Please select a music region before running this script.", "Selection Required")
returnendglobal_dialog:ExecuteModal(nil)
endendIs there a sensible way to move this code into FCXCustomLuaWindow so that all we have to do is this?
functiondo_my_plugin()
ifnotglobal_dialogthenglobal_dialog=create_dialog_box()
endglobal_dialog:ShowFunction() -- this could be ShowModeless if it makes sense to put it there. Otherwise some new function name.end
This is mainly an issue for discussion with @ThistleSifter.
I feel pretty strongly about all the following as usability features.
RetainLuaStatetofalseso that the script can start fresh. (Already implemented.)To clarify point 4: it allows two modes for using the script. One basically sets the value you want the first time and then you never have to see the dialog again. The other mode leaves the dialog open on the desktop at all times for easy access. Point 4 allows for instant removal of the dialog the first time after the values are set.
To implement these, I am finding that I always need a block of code something like this:
Is there a sensible way to move this code into
FCXCustomLuaWindowso that all we have to do is this?