mainfrm_pane.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ////////////////////////////////////////////////////////////////////////////
  2. // System Pre-define Functions
  3. // 95099372-ef3e-11ea-9c81-bf848405c62e
  4. //Callback of data preparation stage before UI is fully loaded.
  5. var dock_widget = false;
  6. function OnInitializeData(reload, preview) {
  7. if(preview) {return;}
  8. parent.setTimeout(()=>{
  9. OnInitDocker();
  10. }, 0);
  11. }
  12. function appendDockPane(sub_form, title, init_pos, allow_pos, features) {
  13. let dw = sub_form.CreateDock(title);
  14. if(features) {ui.docker.setFeatures(dw, features);}
  15. ui.docker.setAllowAreas(dw, allow_pos);
  16. ui.docker.dock(dw, init_pos);
  17. return dw;
  18. }
  19. function OnInitDocker() {
  20. dock_widget = appendDockPane(unit.form.side_pane, "功能区", 1, 1|2);
  21. ui.docker.show(dock_widget, true);
  22. }
  23. function installDockerCallback(apply_cb, next_cb, back_cb){
  24. ui.OnLeftSideApply = apply_cb;
  25. ui.OnLeftSideNext = next_cb;
  26. ui.OnLeftSideBack = back_cb;
  27. }
  28. //Callback after UI is fully loaded and displayed.
  29. function OnReady(reload, preview) {
  30. }
  31. function OnCloseForm() {
  32. }
  33. function OnException(err) {
  34. //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok);
  35. }
  36. //////////////////////////////////////////////////////////////////////////
  37. // Callback Functions.
  38. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7
  39. //The message corresponding callback executed by the main form
  40. // when calling pui.fireEvent(type,para) in the Docker subform.
  41. function OnChildDockerMessage(type, para){
  42. }
  43. //////////////////////////////////////////////////////////////////////////
  44. // Utils Functions.
  45. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  46. function onDragFile(filepath) {
  47. }
  48. /*Usage of BLOCK_EVENT
  49. BLOCK_EVENT(()=>{
  50. ui.[name].[var] = ...;
  51. });
  52. */
  53. function BLOCK_EVENT(cb) {
  54. ui.block_event = true;
  55. cb();
  56. ui.block_event = false;
  57. }