boundary_menu_pane.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. });
  11. }
  12. //Callback after UI is fully loaded and displayed.
  13. function OnReady(reload, preview) {
  14. PUI(()=>{
  15. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  16. //The 'pui' variable is valid in all functions of this document.
  17. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  18. });
  19. }
  20. function OnCloseForm() {
  21. }
  22. function OnException(err) {
  23. //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok);
  24. }
  25. //////////////////////////////////////////////////////////////////////////
  26. // Callback Functions.
  27. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7
  28. function OnGuass(){
  29. unit.form.mainfrm.menu(23);
  30. unit.form.mainfrm.OnChangePicture(3, 1);
  31. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: Blue;font-size:20px;">提供精确拾取及Brep面的生成,其中按快捷键L或l进行拾取实体或面的切换!</h4>');
  32. unit.form.mainfrm.OnCueline('提供精确拾取及Brep面的生成,其中按快捷键L或l进行拾取实体或面的切换!', 'blue');
  33. }
  34. function OnConstraint(){
  35. unit.form.mainfrm.menu(18);
  36. unit.form.mainfrm.OnChangePicture(3, 1);
  37. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: Blue;font-size:20px;">设置模型约束!</h4>');
  38. unit.form.mainfrm.OnCueline('设置模型约束!', 'blue');
  39. }
  40. function OnForce(){
  41. unit.form.mainfrm.menu(17);
  42. unit.form.mainfrm.OnChangePicture(3, 1);
  43. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: Blue;font-size:20px;">设置模型载荷!</h4>');
  44. unit.form.mainfrm.OnCueline('设置模型载荷!', 'blue');
  45. }
  46. function OnloadPeiDian(){
  47. unit.form.mainfrm.menu(5);
  48. unit.form.mainfrm.OnChangePicture(3, 1);
  49. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: Blue;font-size:20px;">设置均匀加密次数,网格尺寸大小!</h4>');
  50. unit.form.mainfrm.OnCueline('设置均匀加密次数,网格尺寸大小!', 'blue');
  51. }
  52. //The message corresponding callback executed by the docker pane.
  53. // when calling [side_pane].fireEvent(type,para) in the main form.
  54. function OnParentDockerMessage(type, para) {
  55. }
  56. //////////////////////////////////////////////////////////////////////////
  57. // Utils Functions.
  58. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  59. function onDragFile(filepath) {
  60. }
  61. function PUI(cb) {
  62. if(pui){cb();}
  63. }
  64. /*Usage of BLOCK_EVENT
  65. BLOCK_EVENT(()=>{
  66. ui.[name].[var] = ...;
  67. });
  68. */
  69. function BLOCK_EVENT(cb) {
  70. ui.block_event = true;
  71. cb();
  72. ui.block_event = false;
  73. }
  74. //////////////////////////////////////////////////////////////////////////
  75. // template codes for cw callback js.
  76. function CW_DeclareVariable(name, setter, getter) {
  77. if(typeof(__DeclareVariable) === 'function') {
  78. __DeclareVariable(name, setter, getter);
  79. }
  80. }
  81. function CW_DeclareOuterVariable(name) {
  82. if(typeof(__DeclareOuterVariable) === 'function') {
  83. __DeclareOuterVariable(name);
  84. }
  85. }