Graph2_pane.js 2.2 KB

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