simViewDlg.ed.gui 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. //--- OBJECT WRITE BEGIN ---
  2. $guiContent = new GuiControl(simViewDlg, EditorGuiGroup) {
  3. canSaveDynamicFields = "0";
  4. Profile = "ToolsGuiDefaultProfile";
  5. HorizSizing = "right";
  6. VertSizing = "bottom";
  7. position = "0 0";
  8. Extent = "800 600";
  9. MinExtent = "8 8";
  10. canSave = "1";
  11. Visible = "1";
  12. hovertime = "1000";
  13. new GuiWindowCtrl() {
  14. canSaveDynamicFields = "0";
  15. Profile = "ToolsGuiWindowProfile";
  16. HorizSizing = "center";
  17. VertSizing = "center";
  18. position = "70 43";
  19. Extent = "685 489";
  20. MinExtent = "602 440";
  21. canSave = "1";
  22. Visible = "1";
  23. hovertime = "1000";
  24. text = "Torque SimView";
  25. maxLength = "1024";
  26. resizeWidth = "1";
  27. resizeHeight = "1";
  28. canMove = "1";
  29. canClose = "1";
  30. canMinimize = "1";
  31. canMaximize = "1";
  32. minSize = "50 50";
  33. closeCommand = "Canvas.popDialog(simViewDlg);";
  34. new GuiScrollCtrl() {
  35. canSaveDynamicFields = "0";
  36. Profile = "ToolsGuiScrollProfile";
  37. HorizSizing = "width";
  38. VertSizing = "height";
  39. position = "10 28";
  40. Extent = "255 448";
  41. MinExtent = "8 8";
  42. canSave = "1";
  43. Visible = "1";
  44. hovertime = "1000";
  45. willFirstRespond = "1";
  46. hScrollBar = "dynamic";
  47. vScrollBar = "alwaysOn";
  48. lockHorizScroll = "false";
  49. lockVertScroll = "false";
  50. constantThumbHeight = "0";
  51. childMargin = "0 0";
  52. new GuiTreeViewCtrl(InspectTreeView) {
  53. canSaveDynamicFields = "0";
  54. Profile = "ToolsGuiTreeViewProfile";
  55. HorizSizing = "right";
  56. VertSizing = "bottom";
  57. position = "2 2";
  58. Extent = "212 21";
  59. MinExtent = "8 8";
  60. canSave = "1";
  61. Visible = "1";
  62. hovertime = "1000";
  63. tabSize = "16";
  64. textOffset = "2";
  65. fullRowSelect = "0";
  66. itemHeight = "21";
  67. destroyTreeOnSleep = "1";
  68. MouseDragging = "1";
  69. MultipleSelections = "1";
  70. DeleteObjectAllowed = "1";
  71. DragToItemAllowed = "1";
  72. };
  73. };
  74. new GuiScrollCtrl() {
  75. canSaveDynamicFields = "0";
  76. Profile = "ToolsGuiScrollProfile";
  77. HorizSizing = "left";
  78. VertSizing = "height";
  79. position = "272 96";
  80. Extent = "404 380";
  81. MinExtent = "8 8";
  82. canSave = "1";
  83. Visible = "1";
  84. hovertime = "1000";
  85. willFirstRespond = "1";
  86. hScrollBar = "alwaysOff";
  87. vScrollBar = "alwaysOn";
  88. lockHorizScroll = "true";
  89. lockVertScroll = "false";
  90. constantThumbHeight = "0";
  91. childMargin = "0 0";
  92. new GuiInspector(InspectFields) {
  93. StackingType = "Vertical";
  94. HorizStacking = "Left to Right";
  95. VertStacking = "Top to Bottom";
  96. Padding = "1";
  97. canSaveDynamicFields = "0";
  98. Profile = "ToolsGuiTransparentProfile";
  99. HorizSizing = "width";
  100. VertSizing = "bottom";
  101. position = "2 2";
  102. Extent = "382 8";
  103. MinExtent = "8 8";
  104. canSave = "1";
  105. Visible = "1";
  106. hovertime = "1000";
  107. };
  108. };
  109. new GuiControl() {
  110. canSaveDynamicFields = "0";
  111. Profile = "ToolsGuiButtonProfile";
  112. HorizSizing = "left";
  113. VertSizing = "bottom";
  114. position = "272 28";
  115. Extent = "403 61";
  116. MinExtent = "8 2";
  117. canSave = "1";
  118. Visible = "1";
  119. hovertime = "1000";
  120. new GuiTextEditCtrl(InspectObjectName) {
  121. canSaveDynamicFields = "0";
  122. Profile = "ToolsGuiTextEditProfile";
  123. HorizSizing = "right";
  124. VertSizing = "bottom";
  125. position = "121 8";
  126. Extent = "195 18";
  127. MinExtent = "8 8";
  128. canSave = "1";
  129. Visible = "1";
  130. hovertime = "1000";
  131. maxLength = "1024";
  132. historySize = "0";
  133. password = "0";
  134. tabComplete = "0";
  135. sinkAllKeyEvents = "0";
  136. password = "0";
  137. passwordMask = "*";
  138. };
  139. new GuiTextCtrl() {
  140. canSaveDynamicFields = "0";
  141. Profile = "EditorTextHLRight";
  142. HorizSizing = "right";
  143. VertSizing = "bottom";
  144. VertSizing = "bottom";
  145. Extent = "44 18";
  146. MinExtent = "8 8";
  147. canSave = "1";
  148. Visible = "1";
  149. hovertime = "1000";
  150. text = "Sim ID:";
  151. maxLength = "1024";
  152. };
  153. new GuiTextCtrl() {
  154. canSaveDynamicFields = "0";
  155. Profile = "EditorTextHLRight";
  156. HorizSizing = "right";
  157. VertSizing = "bottom";
  158. HorizSizing = "right";
  159. Extent = "106 18";
  160. MinExtent = "8 8";
  161. canSave = "1";
  162. Visible = "1";
  163. hovertime = "1000";
  164. text = "Internal Name:";
  165. maxLength = "1024";
  166. };
  167. new GuiTextEditCtrl(InspectObjectInternalName) {
  168. canSaveDynamicFields = "0";
  169. Profile = "ToolsGuiTextEditProfile";
  170. HorizSizing = "right";
  171. VertSizing = "bottom";
  172. Extent = "93 18";
  173. MinExtent = "8 8";
  174. canSave = "1";
  175. Visible = "1";
  176. hovertime = "1000";
  177. maxLength = "1024";
  178. historySize = "0";
  179. password = "0";
  180. tabComplete = "0";
  181. sinkAllKeyEvents = "0";
  182. password = "0";
  183. passwordMask = "*";
  184. canSaveDynamicFields = "0";
  185. };
  186. new GuiTextCtrl() {
  187. Profile = "EditorTextHLBoldRight";
  188. HorizSizing = "right";
  189. VertSizing = "bottom";
  190. HorizSizing = "right";
  191. Extent = "106 18";
  192. MinExtent = "8 8";
  193. canSave = "1";
  194. Visible = "1";
  195. hovertime = "1000";
  196. text = "Selected Object:";
  197. maxLength = "1024";
  198. };
  199. new GuiIconButtonCtrl() {
  200. canSaveDynamicFields = "0";
  201. Profile = "ToolsGuiButtonProfile";
  202. HorizSizing = "right";
  203. VertSizing = "bottom";
  204. Extent = "76 22";
  205. MinExtent = "8 2";
  206. canSave = "1";
  207. Visible = "1";
  208. Command = "InspectApply();";
  209. hovertime = "1000";
  210. text = "Refresh";
  211. groupNum = "-1";
  212. buttonType = "PushButton";
  213. bitmapAsset = "ToolsModule:iconRefresh_image";
  214. sizeIconToButton = "0";
  215. textLocation = "Right";
  216. textMargin = "4";
  217. buttonMargin = "4 4";
  218. };
  219. new GuiTextCtrl(InspectObjectSimID) {
  220. canSaveDynamicFields = "0";
  221. Profile = "EditorTextHLBoldCenter";
  222. HorizSizing = "right";
  223. VertSizing = "bottom";
  224. HorizSizing = "right";
  225. Extent = "51 18";
  226. MinExtent = "8 8";
  227. canSave = "1";
  228. Visible = "1";
  229. hovertime = "1000";
  230. text = "0";
  231. maxLength = "1024";
  232. };
  233. new GuiIconButtonCtrl() {
  234. canSaveDynamicFields = "0";
  235. Profile = "ToolsGuiButtonProfile";
  236. HorizSizing = "right";
  237. VertSizing = "bottom";
  238. Extent = "76 22";
  239. MinExtent = "8 2";
  240. canSave = "1";
  241. Visible = "1";
  242. Command = "InspectDelete();";
  243. hovertime = "1000";
  244. text = "Delete";
  245. groupNum = "-1";
  246. buttonType = "PushButton";
  247. bitmapAsset = "ToolsModule:iconDelete_image";
  248. sizeIconToButton = "0";
  249. textLocation = "Right";
  250. textMargin = "4";
  251. buttonMargin = "4 4";
  252. };
  253. };
  254. };
  255. };
  256. //--- OBJECT WRITE END ---
  257. function Inspect(%obj)
  258. {
  259. // Don't inspect the root group.
  260. if( %obj == -1 )
  261. return;
  262. InspectFields.inspect(%obj);
  263. // Update selected object properties
  264. InspectObjectName.setValue(%obj.getName());
  265. InspectObjectInternalName.setValue( %obj.getInternalName() );
  266. InspectObjectSimID.setValue( %obj.getId() );
  267. // Store Object Reference
  268. InspectObjectName.refObj = %obj;
  269. }
  270. function InspectApply()
  271. {
  272. %obj = InspectObjectName.refObj;
  273. if( !isObject( %obj ) )
  274. return;
  275. // Update name and internal name
  276. %obj.setName( InspectObjectName.getValue() );
  277. %obj.setInternalName( InspectObjectInternalName.getValue() );
  278. // Update inspected object information.
  279. InspectFields.inspect( %obj );
  280. }
  281. function InspectDelete()
  282. {
  283. %obj = InspectObjectName.refObj;
  284. if( !isObject( %obj ) )
  285. return;
  286. %obj.delete();
  287. // Update inspected object information.
  288. InspectFields.inspect( 0 );
  289. // Update selected object properties
  290. InspectObjectName.setValue("");
  291. InspectObjectInternalName.setValue( "" );
  292. InspectObjectSimID.setValue( 0 );
  293. }
  294. function InspectTreeView::onSelect(%this, %obj)
  295. {
  296. Inspect(%obj);
  297. }
  298. function Tree(%obj)
  299. {
  300. Canvas.popDialog("simViewDlg");
  301. Canvas.pushDialog("simViewDlg", 20);
  302. InspectTreeView.open(%obj);
  303. }
  304. // MM: Added Dynamic group toggle support.
  305. function GuiInspector::toggleDynamicGroupScript(%this, %obj)
  306. {
  307. %this.toggleDynamicGroupExpand();
  308. %this.inspect(%obj);
  309. }
  310. // MM: Added group toggle support.
  311. function GuiInspector::toggleGroupScript(%this, %obj, %fieldName)
  312. {
  313. %this.toggleGroupExpand(%obj, %fieldName);
  314. %this.inspect(%obj);
  315. }
  316. // MM: Set All Group State support.
  317. function GuiInspector::setAllGroupStateScript(%this, %obj, %groupState)
  318. {
  319. %this.setAllGroupState(%groupState);
  320. %this.inspect(%obj);
  321. }
  322. function SimViewTreeFilter::onReturn(%this)
  323. {
  324. %text = %this.getText();
  325. if( %text $= "" )
  326. %this.reset();
  327. else
  328. InspectTreeView.setFilterText( %text );
  329. }