52ky 发表于 2021-6-24 12:47:00

TELook源代码

1.单击鼠标左键意味着选中一行。如果按住鼠标拖动,选择将精确到字符。
2.函数都是C形式的,这样可以最大程度的与WINDOWS子窗口控件相似。要封装成类也很容易,只要把struct TEDIT改成 class TEdit 就行了。
3.所有ngcEdit_开头的函数都不是多线程安全的。想要多线程安全的话,最简单的方法就是跟WINDOWS通用控件一样,定义一堆消息,每个函数都以发送消息的形式去完成,以确保界面操作都在界面线程中完成
有什么不完善的地方自己修改源码。一般,游戏,2D还是3D的,都用这种方式来绘制GUI(界面),效率还是可以的。
下面是源码,主要内容都在TEdit.cpp,TEdit.h,TData.h这三个文件中:

(1. Clicking the left mouse button means selecting a row. If you hold down the mouse and drag, the selection will be accurate to the character.
2. The functions are all in C form, which can be similar to the WINDOWS child window control to the greatest extent. It is easy to encapsulate into a class, just change struct TEDIT to class TEdit.
3. All functions at the beginning of ngcEdit_ are not multi-thread safe. If you want multi-thread safety, the easiest way is to define a bunch of messages like WINDOWS common controls, and each function is completed in the form of sending messages to ensure that the interface operations are completed in the interface thread
If there is any imperfection, modify the source code by yourself. Generally, games, 2D or 3D, use this method to draw GUI (interface), and the efficiency is still ok.
The following is the source code, the main content is in the three files TEdit.cpp, TEdit.h, TData.h:)



页: [1]
查看完整版本: TELook源代码