sheet_common.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. /**
  2. * Created by Tony on 2017/4/28.
  3. */
  4. var sheetCommonObj = {
  5. // createSpread、initSheet 在一个Spread多个Sheet分别调用时的情况下使用。
  6. // buildSheet 在一个Spread、一个Sheet的情况下使用。
  7. createSpread: function(container, SheetCount){
  8. var me = this;
  9. var spreadBook = new GC.Spread.Sheets.Workbook(container, { sheetCount: SheetCount });
  10. spreadBook.options.allowCopyPasteExcelStyle = false;
  11. spreadBook.options.allowExtendPasteRange = true;
  12. spreadBook.options.tabStripVisible = false;
  13. //spreadBook.options.showHorizontalScrollbar = false;
  14. spreadBook.options.allowUserDragDrop = false;
  15. spreadBook.options.scrollbarMaxAlign = true;
  16. spreadBook.options.allowContextMenu = false;
  17. spreadBook.options.allowUndo = false;
  18. spreadBook.options.cutCopyIndicatorVisible = false;
  19. return spreadBook;
  20. },
  21. initSheet: function(sheet, setting, rowCount) {
  22. var me = this;
  23. var spreadNS = GC.Spread.Sheets;
  24. sheet.suspendPaint();
  25. sheet.suspendEvent();
  26. sheet.setRowCount(1, spreadNS.SheetArea.colHeader);
  27. sheet.setColumnCount(setting.header.length, spreadNS.SheetArea.viewport);
  28. sheet.options.colHeaderAutoTextIndex = 1;
  29. sheet.options.colHeaderAutoText = spreadNS.HeaderAutoText.numbers;
  30. sheet.options.protectionOptions = {
  31. allowResizeRows: true,
  32. allowResizeColumns: true
  33. };
  34. sheet.showRowOutline(false);
  35. sheet.options.allowCellOverflow = false;
  36. me.buildHeader(sheet, setting);
  37. if (rowCount > 0) sheet.setRowCount(rowCount);
  38. sheet.resumeEvent();
  39. sheet.resumePaint();
  40. },
  41. buildSheet: function(container, setting, rowCount) {
  42. var me = this;
  43. var spreadBook = new GC.Spread.Sheets.Workbook(container, { sheetCount: 1 });
  44. spreadBook.options.tabStripVisible = false;
  45. //spreadBook.options.showHorizontalScrollbar = false;
  46. spreadBook.options.scrollbarMaxAlign = true;
  47. spreadBook.options.allowCopyPasteExcelStyle = false;
  48. spreadBook.options.cutCopyIndicatorVisible = false;
  49. spreadBook.options.allowExtendPasteRange = true;
  50. spreadBook.options.allowUserDragDrop = false;
  51. spreadBook.options.allowUndo = false;
  52. spreadBook.options.allowContextMenu = false;
  53. var spreadNS = GC.Spread.Sheets;
  54. var sheet = spreadBook.getSheet(0);
  55. sheet.suspendPaint();
  56. sheet.suspendEvent();
  57. //Set rowHeader count and columnHeader count.
  58. sheet.setRowCount(1, spreadNS.SheetArea.colHeader);
  59. sheet.setColumnCount(setting.header.length, spreadNS.SheetArea.viewport);
  60. sheet.options.colHeaderAutoTextIndex = 1;
  61. sheet.options.colHeaderAutoText = spreadNS.HeaderAutoText.numbers;
  62. sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
  63. sheet.options.protectionOptions = {
  64. allowResizeRows: true,
  65. allowResizeColumns: true
  66. };
  67. sheet.showRowOutline(false);
  68. //setup column header
  69. me.buildHeader(sheet, setting);
  70. //setup cells
  71. if (rowCount > 0) sheet.setRowCount(rowCount);
  72. sheet.resumeEvent();
  73. sheet.resumePaint();
  74. return spreadBook;
  75. },
  76. buildHeader: function(sheet, setting){
  77. var me = this, ch = GC.Spread.Sheets.SheetArea.colHeader;
  78. for (var i = 0; i < setting.header.length; i++) {
  79. sheet.setValue(0, i, setting.header[i].headerName, ch);
  80. sheet.setColumnWidth(i, setting.header[i].headerWidth ? setting.header[i].headerWidth : 100);
  81. }
  82. if(setting.headerHeight) sheet.setRowHeight(0, setting.headerHeight, GC.Spread.Sheets.SheetArea.colHeader);
  83. },
  84. cleanData: function (sheet, setting, rowCount) {
  85. sheet.suspendPaint();
  86. sheet.suspendEvent();
  87. sheet.clear(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
  88. if (rowCount > 0) sheet.setRowCount(rowCount);
  89. sheet.resumeEvent();
  90. sheet.resumePaint();
  91. },
  92. cleanSheet: function(sheet, setting, rowCount) {
  93. sheet.suspendPaint();
  94. sheet.suspendEvent();
  95. sheet.clear(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
  96. if (rowCount > 0) sheet.setRowCount(rowCount);
  97. sheet.clearSelection();
  98. sheet.resumeEvent();
  99. sheet.resumePaint();
  100. },
  101. setAreaAlign: function(area, hAlign, vAlign){
  102. if (!(hAlign) || hAlign === "left") {
  103. area.hAlign(GC.Spread.Sheets.HorizontalAlign.left);
  104. } else if (hAlign === "right") {
  105. area.hAlign(GC.Spread.Sheets.HorizontalAlign.right);
  106. } else if (hAlign === "center") {
  107. area.hAlign(GC.Spread.Sheets.HorizontalAlign.center);
  108. } else {
  109. area.hAlign(GC.Spread.Sheets.HorizontalAlign.left);
  110. }
  111. if (!(vAlign) || vAlign === "center") {
  112. area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
  113. } else if (vAlign === "top") {
  114. area.vAlign(GC.Spread.Sheets.VerticalAlign.top);
  115. } else if (vAlign === "bottom") {
  116. area.vAlign(GC.Spread.Sheets.VerticalAlign.bottom);
  117. } else {
  118. area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
  119. }
  120. },
  121. showData: function(sheet, setting, data,distTypeTree) {
  122. var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
  123. sheet.suspendPaint();
  124. sheet.suspendEvent();
  125. //sheet.addRows(row, 1);
  126. sheet.clear(0, 0, sheet.getRowCount(), sheet.getColumnCount(), GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
  127. if(sheet.getRowCount()<data.length){
  128. data.length<30? sheet.setRowCount(30):sheet.setRowCount(data.length);
  129. }else if(sheet.getRowCount()==0){
  130. sheet.setRowCount(30);
  131. }
  132. for (var col = 0; col < setting.header.length; col++) {
  133. var hAlign = "left", vAlign = "center";
  134. if (setting.header[col].hAlign) {
  135. hAlign = setting.header[col].hAlign;
  136. } else if (setting.header[col].dataType !== "String"){
  137. hAlign = "right";
  138. }
  139. vAlign = setting.header[col].vAlign?setting.header[col].vAlign:vAlign;
  140. me.setAreaAlign(sheet.getRange(-1, col, -1, 1), hAlign, vAlign);
  141. if (setting.header[col].formatter) {
  142. sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
  143. }
  144. if(setting.header[col].cellType === "checkBox"||setting.header[col].cellType === "button"){//clear and reset
  145. var me = this, header = GC.Spread.Sheets.SheetArea.colHeader;
  146. sheet.deleteColumns(col,1);
  147. sheet.addColumns(col, 1);
  148. sheet.setValue(0, col, setting.header[col].headerName, header);
  149. sheet.setColumnWidth(col, setting.header[col].headerWidth?setting.header[col].headerWidth:100);
  150. }
  151. if(setting.header[col].visible === false){
  152. sheet.setColumnVisible(col,false);
  153. }
  154. sheet.getCell(0, col, GC.Spread.Sheets.SheetArea.colHeader).wordWrap(true);
  155. }
  156. for (var row = 0; row < data.length; row++) {
  157. //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
  158. this.showRowData(sheet,setting,row,data,distTypeTree);
  159. if(setting.getStyle && setting.getStyle(data[row])){
  160. sheet.setStyle(row, -1, setting.getStyle(data[row]));
  161. }
  162. }
  163. this.lockCells(sheet,setting);
  164. sheet.resumeEvent();
  165. sheet.resumePaint();
  166. //me.shieldAllCells(sheet);
  167. },
  168. showRowData:function (sheet,setting,row,data,distTypeTree=null) {
  169. let ch = GC.Spread.Sheets.SheetArea.viewport;
  170. for (var col = 0; col < setting.header.length; col++) {
  171. //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
  172. var val = data[row][setting.header[col].dataCode];
  173. if(val&&setting.header[col].dataType === "Number"){
  174. if(setting.header[col].hasOwnProperty('tofix')){
  175. val =scMathUtil.roundToString(val,setting.header[col].tofix);
  176. } else {
  177. val =val+'';
  178. }
  179. }
  180. if(val!=null&&setting.header[col].cellType === "checkBox"){
  181. this.setCheckBoxCell(row,col,sheet,val)
  182. }
  183. if(setting.header[col].cellType === "comboBox"){
  184. this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType);
  185. }
  186. if(setting.header[col].getText){
  187. val = setting.getText[setting.header[col].getText](data[row],val)
  188. }
  189. sheet.setValue(row, col, val, ch);
  190. }
  191. this.setRowStyle(row,sheet,data[row].bgColour);
  192. if(setting.autoFit==true){
  193. sheet.getRange(row, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).wordWrap(true);
  194. sheet.autoFitRow(row);
  195. }
  196. },
  197. setCheckBoxCell(row,col,sheet,val){
  198. var c = new GC.Spread.Sheets.CellTypes.CheckBox();
  199. c.isThreeState(false);
  200. sheet.setCellType(row, col,c,GC.Spread.Sheets.SheetArea.viewport);
  201. sheet.getCell(row, col).value(val);
  202. sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
  203. },
  204. setComboBox(row,col,sheet,options,editorValueType){
  205. //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
  206. let dynamicCombo = sheetCommonObj.getDynamicCombo(true);
  207. if(options){
  208. dynamicCombo.itemHeight(options.length).items(options);
  209. if(editorValueType==true){
  210. dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
  211. }
  212. }
  213. sheet.setCellType(row, col,dynamicCombo,GC.Spread.Sheets.SheetArea.viewport);
  214. },
  215. setRowStyle(row,sheet,bgColour) {
  216. if(bgColour){
  217. let style = new GC.Spread.Sheets.Style();
  218. style.backColor = bgColour;
  219. style.borderLeft = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  220. style.borderTop = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  221. style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  222. style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  223. sheet.setStyle(row, -1, style);
  224. }
  225. },
  226. analyzePasteData: function(setting, pastedInfo) {
  227. var rst = [], propId = pastedInfo.cellRange.col, preStrIdx = 0, itemObj = {};
  228. for (var i = 0; i < pastedInfo.pasteData.text.length; i++) {
  229. if (pastedInfo.pasteData.text[i] === "\n") {
  230. propId = pastedInfo.cellRange.col;
  231. preStrIdx = i + 1;
  232. rst.push(itemObj);
  233. if (i < pastedInfo.pasteData.text.length - 1) {
  234. itemObj = {};
  235. }
  236. } else if (pastedInfo.pasteData.text[i] === "\t" || pastedInfo.pasteData.text[i] === "\r") {
  237. if (setting.header[propId]) {
  238. itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx, i);
  239. }
  240. propId++;
  241. preStrIdx = i + 1;
  242. //if the last copied-cell were empty, should check whether the end of text
  243. if (i == pastedInfo.pasteData.text.length - 1 && setting.header[propId]) {
  244. itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
  245. rst.push(itemObj);
  246. }
  247. } else if (i == pastedInfo.pasteData.text.length - 1 && setting.header[propId]) {
  248. itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
  249. rst.push(itemObj);
  250. }
  251. }
  252. return rst;
  253. },
  254. combineRowData: function(sheet, setting, row) {
  255. var rst = {};
  256. for (var col = 0; col < setting.header.length; col++) {
  257. rst[setting.header[col].dataCode] = sheet.getValue(row, col);
  258. }
  259. return rst;
  260. },
  261. shieldAllCells: function(sheet) {
  262. sheet.options.isProtected = true;
  263. },
  264. unShieldAllCells: function(sheet) {
  265. sheet.options.isProtected = false;
  266. },
  267. unLockAllCells: function (sheet) {
  268. sheet.suspendPaint();
  269. sheet.suspendEvent();
  270. let defaultStyle = new GC.Spread.Sheets.Style();
  271. defaultStyle.locked = false;
  272. sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
  273. sheet.setStyle(-1, 0, defaultStyle);
  274. sheet.options.isProtected = false;
  275. sheet.resumePaint();
  276. sheet.resumeEvent();
  277. },
  278. lockAllCells: function (sheet) {
  279. sheet.suspendPaint();
  280. sheet.suspendEvent();
  281. let defaultStyle = new GC.Spread.Sheets.Style();
  282. defaultStyle.locked = true;
  283. sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
  284. for(let i = 0; i < sheet.getRowCount(); i++){
  285. sheet.setStyle(i, 0, defaultStyle);
  286. }
  287. sheet.options.isProtected = true;
  288. sheet.resumePaint();
  289. sheet.resumeEvent();
  290. },
  291. lockCells: function(sheet, setting){
  292. sheet.suspendPaint();
  293. sheet.suspendEvent();
  294. if (setting && setting.view.lockColumns && setting.view.lockColumns.length > 0) {
  295. sheet.options.isProtected = true;
  296. sheet.getRange(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport).locked(false);
  297. for (var i = 0; i < setting.view.lockColumns.length; i++) {
  298. sheet.getRange(-1,setting.view.lockColumns[i] , -1, 1, GC.Spread.Sheets.SheetArea.viewport).locked(true);
  299. }
  300. }
  301. sheet.resumePaint();
  302. sheet.resumeEvent();
  303. },
  304. setLockCol: function (sheet, col, isLocked) {
  305. sheet.suspendPaint();
  306. sheet.suspendEvent();
  307. for(let row = 0, len = sheet.getRowCount(); row < len; row++){
  308. sheet.getCell(row, col).locked(isLocked);
  309. }
  310. sheet.resumePaint();
  311. sheet.resumeEvent();
  312. },
  313. chkIfEmpty: function(rObj, setting) {
  314. var rst = true;
  315. if (rObj) {
  316. for (var i = 0; i < setting.header.length; i++) {
  317. if (rObj[setting.header[i].dataCode]) {
  318. rst = false;
  319. break;
  320. }
  321. }
  322. }
  323. return rst;
  324. },
  325. //add by zhong 2017-10-10
  326. //动态下拉框
  327. getDynamicCombo: function () {
  328. let ComboCellForActiveCell = function () { };
  329. ComboCellForActiveCell.prototype = new GC.Spread.Sheets.CellTypes.ComboBox();
  330. ComboCellForActiveCell.prototype.paintValue = function (ctx, value, x, y, w, h, style, options) {
  331. let sheet = options.sheet;
  332. if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
  333. GC.Spread.Sheets.CellTypes.ComboBox.prototype.paintValue.apply(this, arguments);
  334. } else {
  335. GC.Spread.Sheets.CellTypes.Base.prototype.paintValue.apply(this, arguments);
  336. }
  337. };
  338. ComboCellForActiveCell.prototype.getHitInfo = function (x, y, cellStyle, cellRect, options) {
  339. let sheet = options.sheet;
  340. if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
  341. return GC.Spread.Sheets.CellTypes.ComboBox.prototype.getHitInfo.apply(this, arguments);
  342. } else {
  343. return GC.Spread.Sheets.CellTypes.Base.prototype.getHitInfo.apply(this, arguments);
  344. }
  345. };
  346. return new ComboCellForActiveCell();
  347. },
  348. setDynamicCombo: function (sheet, beginRow, col, rowCount, items, itemsHeight, itemsType) {
  349. let me = this;
  350. sheet.suspendPaint();
  351. let combo = me.getDynamicCombo();
  352. if(itemsHeight) {
  353. combo.itemHeight(itemsHeight);
  354. combo._maxDropDownItems = itemsHeight + 5;
  355. }
  356. if(itemsType === 'value') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
  357. else if(itemsType === 'text') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
  358. else combo.items(items);
  359. for(let i = 0, len = rowCount; i < len; i++){
  360. sheet.getCell(beginRow + i, col).cellType(combo);
  361. }
  362. sheet.resumePaint();
  363. },
  364. setStaticCombo: function (sheet, beginRow, col, rowCount, items, itemsHeight, itemsType) {
  365. sheet.suspendPaint();
  366. let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
  367. for(let i = 0, len = rowCount; i < len; i++){
  368. if(itemsHeight) combo.itemHeight(itemsHeight);
  369. if(itemsType === 'value') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
  370. else if(itemsType === 'text') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
  371. else combo.items(items);
  372. sheet.getCell(beginRow + i, col).cellType(combo);
  373. }
  374. sheet.resumePaint();
  375. },
  376. //注册自定义回车键事件
  377. bindEnterKey: function (workBook, operation) {
  378. workBook.commandManager().register('myEnter', operation);
  379. workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.enter, false, false, false, false);
  380. workBook.commandManager().setShortcutKey('myEnter', GC.Spread.Commands.Key.enter, false, false, false, false);
  381. },
  382. //解决esc后触发了编辑结束的保存事件,显示与实际数据不同问题
  383. bindEscKey: function (workBook, sheets) {
  384. function isDef(v){
  385. return typeof v !== 'undefined' && v !== null;
  386. }
  387. workBook.commandManager().register('myEsc', function () {
  388. let activeSheet = workBook.getActiveSheet();
  389. let hasTheSheet = false;
  390. for(let sheetObj of sheets){
  391. let sheet = sheetObj.sheet;
  392. if(sheet === activeSheet){
  393. hasTheSheet = true;
  394. let editStarting = sheetObj.editStarting;
  395. let editEnded = sheetObj.editEnded;
  396. if(editStarting){
  397. sheet.unbind(GC.Spread.Sheets.Events.EditStarting);
  398. }
  399. if(editEnded){
  400. sheet.unbind(GC.Spread.Sheets.Events.EditEnded);
  401. }
  402. let row = sheet.getActiveRowIndex();
  403. let col = sheet.getActiveColumnIndex();
  404. let orgV = sheet.getValue(row, col);
  405. if(!isDef(orgV)){
  406. orgV = '';
  407. }
  408. if(sheet.isEditing()){
  409. sheet.endEdit();
  410. sheet.setValue(row, col, orgV);
  411. }
  412. if(editStarting){
  413. sheet.bind(GC.Spread.Sheets.Events.EditStarting, editStarting);
  414. }
  415. if(editEnded){
  416. sheet.bind(GC.Spread.Sheets.Events.EditEnded, editEnded);
  417. }
  418. }
  419. }
  420. //容错处理,以防没把所有工作簿的表格信息传入参数
  421. if(!hasTheSheet){
  422. if(activeSheet.isEditing()){
  423. activeSheet.endEdit();
  424. }
  425. }
  426. });
  427. workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.esc, false, false, false, false);
  428. workBook.commandManager().setShortcutKey('myEsc', GC.Spread.Commands.Key.esc, false, false, false, false);
  429. },
  430. //生成列字段与列号映射
  431. initColMapping: function (obj, headers) {
  432. //colToField 列下标与列字段映射
  433. //fieldToCol 列字段与列下标映射
  434. let colMapping = {colToField: {}, fieldToCol: {}};
  435. for(let header of headers){
  436. colMapping['colToField'][headers.indexOf(header)] = header.dataCode;
  437. colMapping['fieldToCol'][header.dataCode] = headers.indexOf(header);
  438. }
  439. console.log(colMapping);
  440. obj.colMapping = colMapping
  441. },
  442. //动态根据工作簿宽度和各列宽度比例设置宽度
  443. setColumnWidthByRate: function (workBookWidth, workBook, headers){
  444. if(workBook){
  445. const sheet = workBook.getActiveSheet();
  446. sheet.suspendEvent();
  447. sheet.suspendPaint();
  448. for(let col = 0; col < headers.length; col++){
  449. if(headers[col]['rateWidth'] !== undefined && headers[col]['rateWidth'] !== null && headers[col]['rateWidth'] !== ''){
  450. sheet.setColumnWidth(col, workBookWidth * headers[col]['rateWidth'], GC.Spread.Sheets.SheetArea.colHeader)
  451. }
  452. else {
  453. if(headers[col]['headerWidth'] !== undefined && headers[col]['headerWidth'] !== null && headers[col]['headerWidth'] !== ''){
  454. sheet.setColumnWidth(col, headers[col]['headerWidth'], GC.Spread.Sheets.SheetArea.colHeader)
  455. }
  456. }
  457. }
  458. sheet.resumeEvent();
  459. sheet.resumePaint();
  460. }
  461. },
  462. }