Home > Back-end >  Reprint: open an HTML version of the word, the WPS similar tools, and the stillness of the night
Reprint: open an HTML version of the word, the WPS similar tools, and the stillness of the night

Time:11-04

author: http://bbs.2ccc.com/topic.asp? Topicid=580946

A set of document typesetting function code, just submit the code to open source platform, based on HTML 5 Canvas, there is need to can see
https://gitee.com/HCView/HCView-H5
Or
https://github.com/59079096/HCView-H5
Or direct access to the sample web site, http://hcview.cn/, so in the name of the spirit of open source code without compression and server itself is too low, so first open will be slow, also please use the Google browser kernel can get the best results,

A little sigh with emotion:
This document typesetting software does have a few years, has been the way of open source, there are three versions, Delphi, c #, HTML 5, it's not wrong for you, is to use three sets of different language to realize the function of exactly the same, based on the QT c + + version is going to begin in the second half of the year, if you are interested in other versions of the layout code can access the link above (remove HCView - H5 can see other language code), the electronic medical records in medical industry in the system to use this code, with domestic top ten hospitals, there are also I have never heard of towns and townships, is also useful in the document management system,

I want to tell me about the H5 version, also be yourself from the desktop to the web a little output,
我不熟悉html和css,也没精力和时间学习,为实现几个语言的功能和代码维护方便,必需要有统一的方法和函数以及实现,所以在C#的版本中我自己实现了一个和Delphi里一样的Canvas来处理GDI层面的事情,在Html5版本中我也重点使用Html5的Canvas做UI处理,总共用了约1万行js代码封装实现了类似VCL的框架,所以你会看到Application.js,Control.js,Form.js,StdCtrls.js,Graphics.js等等和VCL体系类似的单元,我使用了ES6的面向对象的语法,由于js是弱类型的语言,我基于原生的js类型封装了一些delphi和C#下的常见类型,如TObject,TPoint,TRect,TList,TStream,TInt8,TInt16,TInt32等等(可到System.js里看到全部),也封装了TControl,TWinControl,TPanel,TButton,TLable,TEdit,TCombobox,TCheckBox,TPopupMenu,TScrollBar,TForm,TDialog等等有界面的控件(见Control.js,ExtCtrls.js,StdCtrls.js),以及TPersistent,TComponent,TTimer,TAnimate等等无界面的控件,为实现和鼠标键盘交互,把浏览器的页面事件监听后封装,实现了KeyDown,KeyPress,MouseDown,MouseMove,MouseUp等等事件,让这些和我喜欢的Delphi里使用时的方法一样,通过input元素实现了和输入法的交互产生了ime.js,因为有自成的体系,所以写了clipboard.js实现了自己的剪切板并能和浏览器交互,当然还有最重要的Application.js以及整个框架运行的环境Kernel.js,web程序有css来描述样式,我用一个theme.js来完成,现在它还不能和css交互,我有计划让它和css交互,我也想把这个框架用IDE或者拖拉控件的有设计期概念的机制来处理,所以在TComponent里预留了可视化设计时属性事件的机制,我不知道以后还有没有机会来把预留的这些功能来实现,因为目前我需要的东西都算是完成了,

At the completion of these functions in the process of the above, I read countless Delphi VCL system code, often plaint Delphi is so good, he is so "ignorance", especially when I see how Delphi Canva many times of the pen, brush, the font properties of the modified only when drawn through collection of addition and subtraction to deal with the update, I once thought that I didn't pass the exam for the use of the basic knowledge, more is lost it may be the last chance so carefully ZaMo Delphi source code,

I didn't study other js framework, I don't know I write this to have any meaning, while also constantly improve and reconstruction in the next few months, but at least it let me improve the design ability, and completed my H5 version of the target, if can be useful for everyone to contribute to the industry that is better,

CodePudding user response:

A good drop around, support ~ ~ ~
  • Related