aardio 文档
com.hexEditor 库模块帮助文档
com 成员列表 #
com.hexEditor() #
返回对象:hexEditorObject
com.hexEditor(winform) #
创建十六进制编辑器
参数为窗口或控件对象
hexEditorObject 成员列表 #
hexEditorObject.accessData(callback) #
hexEditorObject.accessData( function(dataPtr,size){
/*获取当前编辑的数据指针,
dataPtr 为数据指针, size 为数据长度。
不可保存 dataPtr 指针并在回调函数外部使用 */
})
hexEditorObject.copy() #
复制选区
hexEditorObject.cut() #
剪切选区
hexEditorObject.deselect() #
取消选区
hexEditorObject.find #
查找并选中数据
hexEditorObject.find(模找模式串,开始位置) #
查找并选中数据。
参数 @1 支持模式匹配语法,
开始位置以字节计数
hexEditorObject.findNext(模找模式串) #
查找下一个并选中数据。
参数 @1 支持模式匹配语法,
hexEditorObject.getBuffer() #
获取修改后的数据
返回值为buffer类型字节数组,
返回值不会自动更新数据,必须调用getBuffer()函数才能得到最新的修改后的数据
hexEditorObject.getCaretPos() #
返回光标位置
hexEditorObject.getCodePage() #
返回代码页
hexEditorObject.getDataModified() #
数据是否已被用户修改
hexEditorObject.getFontHeight() #
返回字体大小
hexEditorObject.getSel() #
返回选区开始位置,结束位置
0 为无选区
hexEditorObject.getSelBuffer() #
获取选区数据,
如果选区非空返回 buffer 对象。
否则返回 null
hexEditorObject.getSelHex() #
如果选区非空,
返回选区数据的 16 进制编码文本。
可选用参数 @1 指定编码前缀,默认为 \x
hexEditorObject.load() #
加载文件,
参数 @1 指定文件路径,支持资源文件
hexEditorObject.onCaretPositionChanged #
import win.debounce;
hexEditorObject.onCaretPositionChanged = win.debounce(function(caretPos,selStart,selEnd){
/*光标或选区变更时触发此事件。
caretPos 为光标位置,selStart 为选区开始位置,
selEnd 为选区结束位置*/
});
hexEditorObject.paste() #
粘贴数据
hexEditorObject.replace #
替换当前选区数据
hexEditorObject.replace(数据) #
替换当前选区数据,
数据可以是字符串、buffer类型数据等
hexEditorObject.selectAll() #
全选
hexEditorObject.setAllowChangeSize() #
是否允许改变长度,默认值为false
hexEditorObject.setAppearance() #
0为扁平相式,1为2D边框
hexEditorObject.setBackColor() #
设置背景颜色,数值 color
hexEditorObject.setBuffer #
加载数据
hexEditorObject.setBuffer(数据,开始地址) #
数据可以是字符串、buffer类型数据等,
数据总是从开始显示,开始地址参数仅用于左侧栏显示地址的开始值
hexEditorObject.setCodePage() #
设置代码页,
默认值为 65001(UTF-8 编码),0 为系统 ANSI 编码
hexEditorObject.setColumns() #
显示的列数,设为0时根据控件宽度自动计算列数
hexEditorObject.setDigitsInAddress() #
设置地址栏显示的数位,默认为 4
hexEditorObject.setFontHeight() #
设置字体大小,默认为 14
hexEditorObject.setForeColor() #
设置文本颜色,数值 Text color
hexEditorObject.setSel #
设置选区
hexEditorObject.setSel(开始位置,结束位置) #
设置选区,
参数以字节为单位,1 表示第 1 个字节。
参数指定的位置超出长度或小于 1 时不执行任何操作
hexEditorObject.setShowAddress() #
设为 true 显示地址栏
hexEditorObject.setShowAscii() #
设为 true 显示 ASCII 字符
hexEditorObject.size() #
获取当前编辑的数据长度
Markdown 格式