scriptEditorDlg.ed.gui 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. //--- OBJECT WRITE BEGIN ---
  2. $guiContent = new GuiControl(ScriptEditorDlg,EditorGuiGroup) {
  3. position = "0 0";
  4. extent = "1024 768";
  5. minExtent = "8 2";
  6. horizSizing = "width";
  7. vertSizing = "height";
  8. profile = "ToolsGuiDefaultNonModalProfile";
  9. visible = "1";
  10. active = "1";
  11. tooltipProfile = "ToolsGuiToolTipProfile";
  12. hovertime = "1000";
  13. isContainer = "1";
  14. canSave = "1";
  15. canSaveDynamicFields = "1";
  16. new GuiWindowCtrl() {
  17. text = "Text Pad";
  18. resizeWidth = "0";
  19. resizeHeight = "0";
  20. canMove = "1";
  21. canClose = "1";
  22. canMinimize = "1";
  23. canMaximize = "1";
  24. canCollapse = "0";
  25. closeCommand = "ScriptEditorDlg.close();";
  26. edgeSnap = "1";
  27. margin = "0 0 0 0";
  28. padding = "0 0 0 0";
  29. anchorTop = "1";
  30. anchorBottom = "0";
  31. anchorLeft = "1";
  32. anchorRight = "0";
  33. position = "219 162";
  34. extent = "524 373";
  35. minExtent = "8 8";
  36. horizSizing = "center";
  37. vertSizing = "center";
  38. profile = "ToolsGuiWindowProfile";
  39. visible = "1";
  40. active = "1";
  41. command = "ScriptEditorDlg.close();";
  42. accelerator = "escape";
  43. tooltipProfile = "ToolsGuiToolTipProfile";
  44. hovertime = "1000";
  45. isContainer = "1";
  46. canSave = "1";
  47. canSaveDynamicFields = "0";
  48. new GuiControl() {
  49. position = "8 24";
  50. extent = "508 291";
  51. minExtent = "8 2";
  52. horizSizing = "width";
  53. vertSizing = "height";
  54. profile = "ToolsGuiDefaultProfile";
  55. visible = "1";
  56. active = "1";
  57. tooltipProfile = "ToolsGuiToolTipProfile";
  58. hovertime = "1000";
  59. isContainer = "1";
  60. canSave = "1";
  61. canSaveDynamicFields = "0";
  62. new GuiControl() {
  63. position = "1 7";
  64. extent = "507 286";
  65. minExtent = "8 2";
  66. horizSizing = "width";
  67. vertSizing = "height";
  68. profile = "ToolsGuiDefaultProfile";
  69. visible = "1";
  70. active = "1";
  71. tooltipProfile = "ToolsGuiToolTipProfile";
  72. hovertime = "1000";
  73. isContainer = "1";
  74. canSave = "1";
  75. canSaveDynamicFields = "0";
  76. new GuiScrollCtrl() {
  77. willFirstRespond = "0";
  78. hScrollBar = "dynamic";
  79. vScrollBar = "dynamic";
  80. lockHorizScroll = "0";
  81. lockVertScroll = "0";
  82. constantThumbHeight = "0";
  83. childMargin = "1 1";
  84. mouseWheelScrollSpeed = "-1";
  85. margin = "0 0 0 0";
  86. padding = "0 0 0 0";
  87. anchorTop = "1";
  88. anchorBottom = "0";
  89. anchorLeft = "1";
  90. anchorRight = "0";
  91. position = "0 0";
  92. extent = "507 286";
  93. minExtent = "8 2";
  94. horizSizing = "width";
  95. vertSizing = "height";
  96. profile = "ToolsGuiScrollProfile";
  97. visible = "1";
  98. active = "1";
  99. tooltipProfile = "ToolsGuiToolTipProfile";
  100. hovertime = "1000";
  101. isContainer = "1";
  102. canSave = "1";
  103. canSaveDynamicFields = "0";
  104. new GuiMLTextEditCtrl() {
  105. lineSpacing = "2";
  106. allowColorChars = "0";
  107. maxChars = "-1";
  108. useURLMouseCursor = "0";
  109. position = "2 2";
  110. extent = "505 286";
  111. minExtent = "8 2";
  112. horizSizing = "width";
  113. vertSizing = "height";
  114. profile = "ToolsGuiTextPadProfile";
  115. visible = "1";
  116. active = "1";
  117. tooltipProfile = "ToolsGuiToolTipProfile";
  118. hovertime = "1000";
  119. isContainer = "0";
  120. internalName = "TextPad";
  121. canSave = "1";
  122. canSaveDynamicFields = "0";
  123. };
  124. };
  125. };
  126. };
  127. new GuiIconButtonCtrl() {
  128. buttonMargin = "4 4";
  129. BitmapAsset = "ToolsModule:iconCancel_image";
  130. iconLocation = "Left";
  131. sizeIconToButton = "0";
  132. makeIconSquare = "0";
  133. textLocation = "Center";
  134. textMargin = "4";
  135. autoSize = "0";
  136. text = "Cancel";
  137. groupNum = "-1";
  138. buttonType = "PushButton";
  139. useMouseEvents = "0";
  140. position = "335 334";
  141. extent = "80 25";
  142. minExtent = "8 2";
  143. horizSizing = "left";
  144. vertSizing = "top";
  145. profile = "ToolsGuiButtonProfile";
  146. visible = "1";
  147. active = "1";
  148. command = "ScriptEditorDlg.close();";
  149. tooltipProfile = "ToolsGuiToolTipProfile";
  150. hovertime = "1000";
  151. isContainer = "0";
  152. canSave = "1";
  153. canSaveDynamicFields = "0";
  154. };
  155. new GuiIconButtonCtrl() {
  156. buttonMargin = "4 4";
  157. BitmapAsset = "ToolsModule:iconAccept_image";
  158. iconLocation = "Left";
  159. sizeIconToButton = "0";
  160. makeIconSquare = "0";
  161. textLocation = "Center";
  162. textMargin = "4";
  163. autoSize = "0";
  164. text = "Ok";
  165. groupNum = "-1";
  166. buttonType = "PushButton";
  167. useMouseEvents = "0";
  168. position = "436 334";
  169. extent = "80 25";
  170. minExtent = "8 2";
  171. horizSizing = "left";
  172. vertSizing = "top";
  173. profile = "ToolsGuiButtonProfile";
  174. visible = "1";
  175. active = "1";
  176. command = "_TextPadOnOk();";
  177. tooltipProfile = "ToolsGuiToolTipProfile";
  178. hovertime = "1000";
  179. isContainer = "0";
  180. canSave = "1";
  181. canSaveDynamicFields = "0";
  182. };
  183. };
  184. };
  185. //--- OBJECT WRITE END ---
  186. function TextPad(%text, %callback, %root)
  187. {
  188. ScriptEditorDlg-->textpad.setText(%text);
  189. ScriptEditorDlg.callback = %callback;
  190. if(!isObject(%root))
  191. %root = Canvas;
  192. %root.pushDialog(ScriptEditorDlg);
  193. }
  194. function _TextPadOnOk()
  195. {
  196. if(ScriptEditorDlg.callback !$= "")
  197. {
  198. %text = ScriptEditorDlg-->textpad.getText();
  199. %command = ScriptEditorDlg.callback @ "(\"" @ expandEscape(%text) @ "\");";
  200. eval(%command);
  201. }
  202. ScriptEditorDlg.callback = "";
  203. ScriptEditorDlg.getRoot().popDialog(ScriptEditorDlg);
  204. }
  205. function ScriptEditorDlg::close(%this)
  206. {
  207. %this.getRoot().popDialog(%this);
  208. }