Aardio下的富文本编辑器

因为日常编辑需要使用到富文本,而aar下没有这种编辑器,于是就想到集成一个web的编辑器到库文件中,于是自己琢磨了一天,把ICE的IceEditor揉在一个库里(原编辑器https://iceui.cn/iceEditor/index)。简单演示效果如下所示:

使用代码较为简单:

import win.ui;
/*DSG{{*/
mainForm = win.form(text="iceEditor富文本编辑器";right=1296;bottom=756)
mainForm.add(
button={cls="button";text="打开富文本编辑器";left=1080;top=653;right=1277;bottom=711;db=1;dr=1;z=2};
custom={cls="custom";text="自定义控件";left=12;top=38;right=954;bottom=738;db=1;dl=1;dr=1;dt=1;edge=1;z=1};
richedit={cls="richedit";text="RichEdit";left=962;top=37;right=1280;bottom=640;db=1;dr=1;dt=1;edge=1;multiline=1;vscroll=1;z=3};
static={cls="static";text="html预览";left=19;top=14;right=329;bottom=42;transparent=1;z=4};
static2={cls="static";text="txt文本预览";left=986;top=6;right=1185;bottom=20;transparent=1;z=5}
)
/*}}*/

import web.view;
var wb = web.view(mainForm.custom);
wb.enableDefaultContextMenus(false) 
mainForm.button.oncommand = function(id,event){
    import yang.ice_editor;
    yang.ice_editor.start(mainForm.hwnd,function(html,text){
        /*回调函数对富文本进行处理*/
        wb.html = html;
        mainForm.richedit.text = text    ;
    },/*窗口标题*/"这是启动富文本的标题") 
}

mainForm.show();
return win.loopMessage();

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值