From d2c7437fcd578f7b95b378d8c697790c35d97d36 Mon Sep 17 00:00:00 2001 From: Crimson Date: Sun, 16 Jun 2024 22:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=90=8E=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.aardio | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/main.aardio b/main.aardio index 44fd94e..3dd36d0 100644 --- a/main.aardio +++ b/main.aardio @@ -292,6 +292,9 @@ g_teMenus.setCommandFunc(0, 11, g_teMenus.showAbout); g_teMenus.setCommandFunc(1, 1, g_teMenus.showHelp); /*}}*/ +pre_searched_row = null; +pre_searched_col = null; + /*消息回调{{*/ g_flexcell.onCellChange = function(Row,Col){ if(!g_flexcell.isModified){ @@ -312,6 +315,16 @@ g_flexcell.onMouseUp = function(Button , Shift, x, y){ if(Button == 2){ g_flexcell.cell(g_flexcell.MouseRow,g_flexcell.MouseCol).Select(); } + if(pre_searched_row != null and pre_searched_col != null){ + g_flexcell.Cell(pre_searched_row, pre_searched_col).BackColor = 0xffffff; + } +} + +g_flexcell.onSelChange = function(FirstRow,FirstCol,LastRow,LastCol){ + /*** 在Selection选择范围改变时发生。参数:起始行,起始列,结束行,结束列 ***/ + var row1,col1=owner.toRelativeRow(FirstRow),owner.toRelativeCol(FirstCol); + var row2,col2=owner.toRelativeRow(LastRow),owner.toRelativeCol(LastCol); + console.log(row1, col1, row2, col2) } /*}}*/ @@ -327,8 +340,6 @@ var accelerator = win.ui.accelerator({ }; },mainForm ); -pre_searched_row = null; -pre_searched_col = null; research_flag = true; searchNextContent = function(data, firstRow, firstCol, lastRow, lastCol, isRangeSearch, selFirstRow, selFirstCol, str){ if(isRangeSearch){// 从一个范围开始搜索 @@ -400,6 +411,7 @@ searchNextContent = function(data, firstRow, firstCol, lastRow, lastCol, isRange } subscribe("search_prev",function(...){ + // TODO console.dump(...); } ) @@ -414,6 +426,9 @@ subscribe("search_next",function(...){ if(firstRow != lastRow or firstCol != lastCol){ isRangeSearch = true; } + if(pre_searched_row != null and pre_searched_col != null){ + g_flexcell.Cell(pre_searched_row, pre_searched_col).BackColor = 0xffffff; + } var row, col = searchNextContent(g_flexcell.getVlistData(), firstRow, firstCol, lastRow, lastCol, isRangeSearch, firstRow, firstCol, ...); //console.dump(row, col); if(row != null && col != null){