scriptEditorDlg.ed.gui 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. //--- OBJECT WRITE BEGIN ---
  2. %guiContent = new GuiControl(ScriptEditorDlg,EditorGuiGroup) {
  3. isContainer = "1";
  4. Profile = "ToolsGuiDefaultProfile";
  5. HorizSizing = "width";
  6. VertSizing = "height";
  7. position = "0 0";
  8. Extent = "1024 768";
  9. MinExtent = "8 2";
  10. canSave = "1";
  11. Visible = "1";
  12. tooltipprofile = "ToolsGuiToolTipProfile";
  13. hovertime = "1000";
  14. canSaveDynamicFields = "0";
  15. new GuiWindowCtrl() {
  16. resizeWidth = "0";
  17. resizeHeight = "0";
  18. canMove = "1";
  19. canClose = "1";
  20. canMinimize = "1";
  21. canMaximize = "1";
  22. minSize = "50 50";
  23. closeCommand = "ScriptEditorDlg.close();";
  24. EdgeSnap = "1";
  25. text = "Text Pad";
  26. Margin = "0 0 0 0";
  27. Padding = "0 0 0 0";
  28. AnchorTop = "1";
  29. AnchorBottom = "0";
  30. AnchorLeft = "1";
  31. AnchorRight = "0";
  32. isContainer = "1";
  33. Profile = "ToolsGuiWindowProfile";
  34. HorizSizing = "center";
  35. VertSizing = "center";
  36. position = "176 120";
  37. Extent = "656 464";
  38. MinExtent = "8 8";
  39. canSave = "1";
  40. Visible = "1";
  41. Command = "ScriptEditorDlg.close();";
  42. Accelerator = "escape";
  43. tooltipprofile = "ToolsGuiToolTipProfile";
  44. hovertime = "1000";
  45. canSaveDynamicFields = "0";
  46. new GuiControl() {
  47. isContainer = "1";
  48. Profile = "ToolsGuiDefaultProfile";
  49. HorizSizing = "width";
  50. VertSizing = "height";
  51. position = "8 24";
  52. Extent = "640 392";
  53. MinExtent = "8 2";
  54. canSave = "1";
  55. Visible = "1";
  56. tooltipprofile = "ToolsGuiToolTipProfile";
  57. hovertime = "1000";
  58. canSaveDynamicFields = "0";
  59. new GuiControl() {
  60. isContainer = "1";
  61. Profile = "ToolsGuiDefaultProfile";
  62. HorizSizing = "width";
  63. VertSizing = "height";
  64. position = "8 7";
  65. Extent = "627 380";
  66. MinExtent = "8 2";
  67. canSave = "1";
  68. Visible = "1";
  69. tooltipprofile = "ToolsGuiToolTipProfile";
  70. hovertime = "1000";
  71. canSaveDynamicFields = "0";
  72. new GuiScrollCtrl() {
  73. willFirstRespond = "0";
  74. hScrollBar = "dynamic";
  75. vScrollBar = "dynamic";
  76. lockHorizScroll = "0";
  77. lockVertScroll = "0";
  78. constantThumbHeight = "0";
  79. childMargin = "1 1";
  80. mouseWheelScrollSpeed = "-1";
  81. Margin = "0 0 0 0";
  82. Padding = "0 0 0 0";
  83. AnchorTop = "1";
  84. AnchorBottom = "0";
  85. AnchorLeft = "1";
  86. AnchorRight = "0";
  87. isContainer = "1";
  88. Profile = "ToolsGuiScrollProfile";
  89. HorizSizing = "width";
  90. VertSizing = "height";
  91. position = "0 0";
  92. Extent = "627 380";
  93. MinExtent = "8 2";
  94. canSave = "1";
  95. Visible = "1";
  96. tooltipprofile = "ToolsGuiToolTipProfile";
  97. hovertime = "1000";
  98. canSaveDynamicFields = "0";
  99. new GuiMLTextEditCtrl() {
  100. lineSpacing = "2";
  101. allowColorChars = "0";
  102. maxChars = "-1";
  103. useURLMouseCursor = "0";
  104. isContainer = "0";
  105. Profile = "ToolsGuiTextPadProfile";
  106. HorizSizing = "width";
  107. VertSizing = "height";
  108. position = "2 2";
  109. Extent = "623 380";
  110. MinExtent = "8 2";
  111. canSave = "1";
  112. Visible = "1";
  113. tooltipprofile = "ToolsGuiToolTipProfile";
  114. hovertime = "1000";
  115. internalName = "TextPad";
  116. canSaveDynamicFields = "0";
  117. };
  118. };
  119. };
  120. };
  121. new GuiIconButtonCtrl() {
  122. buttonMargin = "4 4";
  123. iconBitmap = "tools/gui/images/iconCancel.png";
  124. iconLocation = "Left";
  125. sizeIconToButton = "0";
  126. makeIconSquare = "0";
  127. textLocation = "Center";
  128. textMargin = "4";
  129. autoSize = "0";
  130. text = "Cancel";
  131. groupNum = "-1";
  132. buttonType = "PushButton";
  133. useMouseEvents = "0";
  134. isContainer = "0";
  135. Profile = "ToolsGuiButtonProfile";
  136. HorizSizing = "left";
  137. VertSizing = "top";
  138. position = "460 424";
  139. Extent = "80 25";
  140. MinExtent = "8 2";
  141. canSave = "1";
  142. Visible = "1";
  143. Command = "ScriptEditorDlg.close();";
  144. tooltipprofile = "ToolsGuiToolTipProfile";
  145. hovertime = "1000";
  146. canSaveDynamicFields = "0";
  147. };
  148. new GuiIconButtonCtrl() {
  149. buttonMargin = "4 4";
  150. iconBitmap = "tools/gui/images/iconAccept.png";
  151. iconLocation = "Left";
  152. sizeIconToButton = "0";
  153. makeIconSquare = "0";
  154. textLocation = "Center";
  155. textMargin = "4";
  156. autoSize = "0";
  157. text = "Ok";
  158. groupNum = "-1";
  159. buttonType = "PushButton";
  160. useMouseEvents = "0";
  161. isContainer = "0";
  162. Profile = "ToolsGuiButtonProfile";
  163. HorizSizing = "left";
  164. VertSizing = "top";
  165. position = "560 424";
  166. Extent = "80 25";
  167. MinExtent = "8 2";
  168. canSave = "1";
  169. Visible = "1";
  170. Command = "_TextPadOnOk();";
  171. tooltipprofile = "ToolsGuiToolTipProfile";
  172. hovertime = "1000";
  173. canSaveDynamicFields = "0";
  174. };
  175. };
  176. };
  177. //--- OBJECT WRITE END ---
  178. function TextPad(%text, %callback, %root)
  179. {
  180. ScriptEditorDlg-->textpad.setText(%text);
  181. ScriptEditorDlg.callback = %callback;
  182. if(!isObject(%root))
  183. %root = Canvas;
  184. %root.pushDialog(ScriptEditorDlg);
  185. }
  186. function _TextPadOnOk()
  187. {
  188. if(ScriptEditorDlg.callback !$= "")
  189. {
  190. %text = ScriptEditorDlg-->textpad.getText();
  191. %command = ScriptEditorDlg.callback @ "( %text );";
  192. eval(%command);
  193. }
  194. ScriptEditorDlg.callback = "";
  195. ScriptEditorDlg.getRoot().popDialog(ScriptEditorDlg);
  196. }
  197. function ScriptEditorDlg::close(%this)
  198. {
  199. %this.getRoot().popDialog(%this);
  200. }