TabEditor/dlg/searchForm.aardio
2024-06-17 23:41:57 +08:00

70 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import win.ui;
/*DSG{{*/
var winform = win.form(text="查找";right=418;bottom=135;bgcolor=16777215;exmode="none";max=false;min=false;mode="popup")
winform.add(
btnSearchNext={cls="button";text="查找下一个(F)";left=218;top=83;right=306;bottom=113;db=1;dl=1;font=LOGFONT(name='微软雅黑');z=1};
btnSearchPrev={cls="button";text="查找下上个(V)";left=119;top=83;right=207;bottom=113;db=1;dl=1;font=LOGFONT(name='微软雅黑');z=2};
button={cls="button";text="关闭";left=327;top=82;right=386;bottom=112;db=1;dl=1;font=LOGFONT(name='微软雅黑');z=4};
checkbox={cls="checkbox";text="单元格匹配";left=16;top=86;right=108;bottom=113;bgcolor=16777215;checked=1;font=LOGFONT(h=-14);z=6};
editSearchInput={cls="combobox";left=81;top=28;right=392;bottom=54;db=1;dl=1;edge=1;font=LOGFONT(name='微软雅黑');items={};mode="dropdown";z=3};
static={cls="static";text="查找内容:";left=12;top=29;right=72;bottom=55;align="right";bgcolor=16777215;center=1;db=1;dl=1;font=LOGFONT(name='微软雅黑');transparent=1;z=5}
)
/*}}*/
/*
窗口会自动检测默认的对话框快捷键,
默认Enter会触发onOk事件ESC键会触发onCancel事件
可选如下自定义检测对话框快捷键函数 winform.isDialogMessage
*/
winform.isDialogMessage = function(hwnd,msg){
if( msg.message == 0x100/*_WM_KEYDOWN*/){
if( msg.wParam == 0xD/*_VK_RETURN*/ ){
//return true;//告诉消息处理函数这是一个快捷键,阻止按键消息继续分发
}
if( msg.wParam == 0x1B/*_VK_ESC*/ ){
//return true;//告诉消息处理函数这是一个快捷键,阻止按键消息继续分发
}
}
//检测并响应默认快捷键
return win.isDialogMessage(hwnd,msg);
}
winform.onCancel = function(){
winform.show(false);
}
pushSearchNext = function(){
publish("search_next", winform.editSearchInput.text, winform.checkbox.checked);
}
winform.onOk = function(){
pushSearchNext();
}
winform.btnSearchPrev.oncommand = function(id,event){
publish("search_prev", winform.editSearchInput.text);
}
winform.btnSearchNext.oncommand = function(id,event){
pushSearchNext();
}
winform.button.oncommand = function(id,event){
winform.show(false);
}
winform.btnSearchPrev.disabled = true;
winform.editSearchInput.setFocus();
winform.onClose = function(hwnd,message,wParam,lParam){
winform.show(false);
return false;//禁止关闭
}
winform.show(false);
win.loopMessage();
return winform;