GuiEditorExplorerTree.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. function GuiEditorExplorerTree::onAdd(%this)
  2. {
  3. %this.endRadioSilence();
  4. }
  5. function GuiEditorExplorerTree::startRadioSilence(%this)
  6. {
  7. %this.removeAllListeners();
  8. }
  9. function GuiEditorExplorerTree::endRadioSilence(%this)
  10. {
  11. %this.addListener(GuiEditor.brain);
  12. %this.addListener(GuiEditor.inspectorWindow);
  13. }
  14. function GuiEditorExplorerTree::onSelect(%this, %index, %text, %item)
  15. {
  16. if(%this.getSelCount() == 1)
  17. {
  18. %this.postEvent("ClearInspectAll");
  19. %this.postEvent("AlsoInspect", %item);
  20. }
  21. else
  22. {
  23. %this.postEvent("AlsoInspect", %item);
  24. }
  25. }
  26. function GuiEditorExplorerTree::onUnselect(%this, %index, %text, %item)
  27. {
  28. %this.postEvent("ClearInspect", %item);
  29. }
  30. function GuiEditorExplorerTree::onUnselectAll(%this)
  31. {
  32. %this.postEvent("ClearInspectAll");
  33. }
  34. function GuiEditorExplorerTree::onDeleteKey(%this, %index, %text, %item)
  35. {
  36. %this.postEvent("ObjectRemoved", %item);
  37. }
  38. function GuiEditorExplorerTree::onPostApply(%this, %obj)
  39. {
  40. %index = %this.findItemID(%obj.getId());
  41. if(%index > -1)
  42. {
  43. %this.refreshItemText(%index);
  44. }
  45. }
  46. function GuiEditorExplorerTree::onGetObjectText(%this, %obj)
  47. {
  48. if(%obj == GuiEditor.rootGui)
  49. {
  50. return "Canvas Simulation";
  51. }
  52. return "";
  53. }