Compare commits

..

No commits in common. "main" and "v0.10" have entirely different histories.
main ... v0.10

4 changed files with 95 additions and 79 deletions

View File

@ -5,9 +5,6 @@
<p align="center"> <p align="center">
一个制表符分隔的文本数据编辑工具 一个制表符分隔的文本数据编辑工具
</p> </p>
<p align="center" style="color:red;"><strong>使用 FlexCell 控件,请支持正版:<a href="https://www.grid2000.com/cn/index.html">https://www.grid2000.com/cn/index.html</a></strong></p>
TabEditor++仅适用于特定场景,小众应用。 TabEditor++仅适用于特定场景,小众应用。
## 📃 功能 ## 📃 功能

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="TabEditor++" libEmbed="true" icon="res\app.ico" ui="win" output="TabEditor++.exe" CompanyName="" FileDescription="TabEditor++" LegalCopyright="Copyright (C) iioio.com 2024" ProductName="TabEditor++" InternalName="TabEditor++" FileVersion="0.0.0.11" ProductVersion="0.0.0.11" publishDir="/dist/" dstrip="true" local="false" ignored="false"> <project ver="10" name="TabEditor++" libEmbed="true" icon="res\app.ico" ui="win" output="TabEditor++.exe" CompanyName="" FileDescription="TabEditor++" LegalCopyright="Copyright (C) iioio.com 2024" ProductName="TabEditor++" InternalName="TabEditor++" FileVersion="0.0.0.9" ProductVersion="0.0.0.9" publishDir="/dist/" dstrip="true" local="false" ignored="false">
<file name="main.aardio" path="main.aardio" comment="main.aardio"/> <file name="main.aardio" path="main.aardio" comment="main.aardio"/>
<folder name="资源文件" path="res" embed="true" local="false" ignored="false"> <folder name="资源文件" path="res" embed="true" local="false" ignored="false">
<file name="app.ico" path="res\app.ico" comment="res\app.ico"/> <file name="app.ico" path="res\app.ico" comment="res\app.ico"/>

View File

@ -264,53 +264,86 @@ class TeMenu{
}; };
this.init(); this.init();
}; };
getSid = function(side, idx) {
var std = {};
if (side == 0) {
std.sd = "plus_left";
std.n = #this.toolbars_left;
} else {
std.sd = "plus_right";
std.n = #this.toolbars_right;
}
if (idx > 0 && idx <= std.n) {
std.ctrl = winform[std.sd ++ idx];
return std;
}
return;
}
setCommandFunc = function(side, idx, func){ setCommandFunc = function(side, idx, func){
var std = this.getSid(side, idx); select(side) {
if (std) { case 0 {
std.ctrl.oncommand = func(std.ctrl); if (idx > 0 and idx <= #this.toolbars_left) {
} else { var ctrl = winform['plus_left'+idx];
return; winform['plus_left'+idx].oncommand = func(ctrl);
}
else {
return false;
} }
} }
case 1 {
if (idx > 0 and idx <= #this.toolbars_right) {
var ctrl = winform['plus_right'+idx];
winform['plus_right'+idx].oncommand = func(ctrl);
}
else {
return false;
}
}
else {
return false;
}
}
};
setRightClickFunc = function(side, idx, func){ setRightClickFunc = function(side, idx, func){
var std = this.getSid(side, idx); select(side) {
if (std) { case 0 {
std.ctrl.wndproc = function(hwnd, message, wParam, lParam) { if (idx > 0 and idx <= #this.toolbars_left) {
var ctrl = winform['plus_left'+idx];
winform['plus_left'+idx].wndproc = function(hwnd,message,wParam,lParam){
if (message == 0x205/*_WM_RBUTTONUP*/) { if (message == 0x205/*_WM_RBUTTONUP*/) {
func(std.ctrl); func(ctrl);
} }
} }
} else { }
return; else {
return false;
}
}
case 1 {
if (idx > 0 and idx <= #this.toolbars_right) {
var ctrl = winform['plus_right'+idx];
winform['plus_right'+idx].wndproc = function(hwnd,message,wParam,lParam){
if (message == 0x205/*_WM_RBUTTONUP*/) {
func(ctrl);
}
}
}
else {
return false;
}
}
else {
return false;
}
} }
} }
disabled = function(side, idx, status){ disabled = function(side, idx, status){
var std = this.getSid(side, idx); select(side) {
if (std) { case 0 {
std.ctrl.disabled = status; if (idx > 0 and idx <= #this.toolbars_left) {
} else { winform['plus_left'+idx].disabled = status;
return; }
else {
return false;
} }
} }
case 1 {
if (idx > 0 and idx <= #this.toolbars_right) {
winform['plus_right'+idx].disabled = status;
}
else {
return false;
}
}
else {
return false;
}
}
};
} }

View File

@ -10,10 +10,11 @@ import flexcell;
import teUtils; import teUtils;
import teMenu; import teMenu;
/*DSG{{*/ /*DSG{{*/
var mainForm = win.form(text="TabEditor++";right=1399;bottom=799;bgcolor=16777215) var mainForm = win.form(text="TabEditor++";right=1399;bottom=799;bgcolor=16777215;)
mainForm.add( mainForm.add(
custom={cls="custom";text="自定义控件";left=0;top=36;right=1400;bottom=800;ah=1;aw=1;bgcolor=12639424;db=1;dl=1;dr=1;dt=1;z=2}; custom={cls="custom";text="自定义控件";left=0;top=36;right=1400;bottom=800;ah=1;aw=1;bgcolor=12639424;db=1;dl=1;dr=1;dt=1;z=2;};
plus={cls="plus";left=0;top=0;right=1400;bottom=36;bgcolor=16777215;border={left=1;top=1;right=1;color=-6250332};clipBk=false;clipch=1;dl=1;dr=1;dt=1;font=LOGFONT(h=-18);forecolor=16777215;notify=1;repeat="stretch";z=1} plus={cls="plus";left=0;top=0;right=1400;bottom=36;bgcolor=16777215;border={left=1;top=1;right=1;color=-6250332;};clipBk=false;clipch=1;dl=1;dr=1;dt=1;font=LOGFONT(h=-18);forecolor=16777215;notify=1;repeat="stretch";z=1;};
) )
/*}}*/ /*}}*/
@ -25,7 +26,6 @@ mainForm.release = function(){
collectgarbage("collect"); collectgarbage("collect");
} }
var frmChild = mainForm.loadForm("\dlg\searchForm.aardio"); var frmChild = mainForm.loadForm("\dlg\searchForm.aardio");
var g_mainform_text_default = mainForm.text;
//菜单控件初始化 //菜单控件初始化
g_teMenus = teMenu.TeMenu(mainForm.plus); g_teMenus = teMenu.TeMenu(mainForm.plus);
@ -81,7 +81,6 @@ g_teMenus.openFile = function(ctrl){
return function(){ return function(){
var t = teUtils.getTxtTableData(); var t = teUtils.getTxtTableData();
if(t){ if(t){
mainForm.text = g_mainform_text_default;
mainForm.text += "[ " + teUtils.getCurFilePath() + " ]"; mainForm.text += "[ " + teUtils.getCurFilePath() + " ]";
g_teMenus.newFile(); g_teMenus.newFile();
mainForm.g_flexcell.AutoRedraw = false; mainForm.g_flexcell.AutoRedraw = false;
@ -94,7 +93,6 @@ g_teMenus.openFile = function(ctrl){
mainForm.g_flexcell.Refresh(); mainForm.g_flexcell.Refresh();
collectgarbage("collect"); collectgarbage("collect");
collectgarbage("collect"); collectgarbage("collect");
showModifyStyle();
} }
} }
} }
@ -378,6 +376,19 @@ mainForm.g_flexcell.onSelChange = function(FirstRow,FirstCol,LastRow,LastCol){
} }
/*}}*/ /*}}*/
//搜索窗口
var openSearchForm = function(){
frmChild.show();
frmChild.editSearchInput.setFocus();
}
var accelerator = win.ui.accelerator({
{
ctrl = true; vkey = 'F'#;
oncommand = function() openSearchForm();
};
},mainForm );
research_flag = true; research_flag = true;
searchNextContent = function(data, firstRow, firstCol, lastRow, lastCol, isRangeSearch, selFirstRow, selFirstCol, searchContent, isCaseSensitive, isCellMatching){ searchNextContent = function(data, firstRow, firstCol, lastRow, lastCol, isRangeSearch, selFirstRow, selFirstCol, searchContent, isCaseSensitive, isCellMatching){
if(isRangeSearch){// 从一个范围开始搜索 if(isRangeSearch){// 从一个范围开始搜索
@ -523,31 +534,6 @@ subscribe("search_next",function(...){
curSelection.release(); curSelection.release();
} ) } )
//搜索窗口
var openSearchForm = function(){
frmChild.show();
frmChild.editSearchInput.setFocus();
}
var accelerator = win.ui.accelerator({
{
ctrl = true; vkey = 'F'#;
oncommand = function() openSearchForm();
};
{
ctrl = true; vkey = 'S'#;
oncommand = function(){
var curRow = mainForm.g_flexcell.ActiveCell().Row;
var curCol = mainForm.g_flexcell.ActiveCell().Col;
mainForm.g_flexcell.Cell(curRow, curCol).SetFocus(); // 不加这个,光标处于的单元格内容不会被保存----规避方案
teUtils.saveTxtTableData(mainForm.g_flexcell.getVlistData());
showUnmodifyStyle();
};
};
},mainForm );
import win.ui.minmax; import win.ui.minmax;
win.ui.minmax(mainForm,860,400); win.ui.minmax(mainForm,860,400);