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){