wait_pane.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ////////////////////////////////////////////////////////////////////////////
  2. // System Pre-define Functions
  3. // 95099372-ef3e-11ea-9c81-bf848405c62e
  4. //Callback of data preparation stage before UI is fully loaded.
  5. function OnInitializeData(reload, preview) {
  6. PUI(()=>{
  7. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  8. //The 'pui' variable is valid in all functions of this document.
  9. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  10. process.on('message', (m) => {
  11. if (m.type == 'wait_cueline') {
  12. ui.cueline.value = '<span style="color:#111111">' + m.info + '</span>';
  13. }
  14. });
  15. });
  16. }
  17. //Callback after UI is fully loaded and displayed.
  18. function OnReady(reload, preview) {
  19. PUI(()=>{
  20. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  21. //The 'pui' variable is valid in all functions of this document.
  22. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  23. });
  24. }
  25. function OnCloseForm() {
  26. }
  27. function OnException(err) {
  28. //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok);
  29. }
  30. //////////////////////////////////////////////////////////////////////////
  31. // Callback Functions.
  32. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7
  33. //The message corresponding callback executed by the docker pane.
  34. // when calling [side_pane].fireEvent(type,para) in the main form.
  35. function OnParentDockerMessage(type, para) {
  36. }
  37. //////////////////////////////////////////////////////////////////////////
  38. // Utils Functions.
  39. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  40. function onDragFile(filepath) {
  41. }
  42. function PUI(cb) {
  43. if(pui){cb();}
  44. }
  45. /*Usage of BLOCK_EVENT
  46. BLOCK_EVENT(()=>{
  47. ui.[name].[var] = ...;
  48. });
  49. */
  50. function BLOCK_EVENT(cb) {
  51. ui.block_event = true;
  52. cb();
  53. ui.block_event = false;
  54. }
  55. //////////////////////////////////////////////////////////////////////////
  56. // template codes for cw callback js.
  57. function CW_DeclareVariable(name, setter, getter) {
  58. if(typeof(__DeclareVariable) === 'function') {
  59. __DeclareVariable(name, setter, getter);
  60. }
  61. }
  62. function CW_DeclareOuterVariable(name) {
  63. if(typeof(__DeclareOuterVariable) === 'function') {
  64. __DeclareOuterVariable(name);
  65. }
  66. }