Ai
1 Star 0 Fork 0

phy0292/cheat-engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
luachecklistbox.pas 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
Dark Byte 提交于 2020-12-11 06:39 +08:00 . dark mode support
unit LuaCheckListBox;
{$mode delphi}
interface
uses
Classes, SysUtils, controls, CheckLst, betterControls;
procedure initializeLuaCheckListbox;
implementation
uses LuaListbox, luahandler, luaclass, lua;
function createCheckListBox(L: Plua_State): integer; cdecl;
var
CheckListBox: TCheckListBox;
parameters: integer;
owner: TWincontrol;
begin
result:=0;
parameters:=lua_gettop(L);
if parameters>=1 then
owner:=lua_toceuserdata(L, -parameters)
else
owner:=nil;
lua_pop(L, lua_gettop(L));
CheckListBox:=TCheckListBox.Create(owner);
if owner<>nil then
CheckListBox.Parent:=owner;
luaclass_newClass(L, CheckListBox);
result:=1;
end;
function checklistbox_getChecked(L: PLua_State): integer; cdecl;
var
checklistbox: TCustomCheckListBox;
index: integer;
begin
result:=0;
checklistbox:=luaclass_getClassObject(L);
if lua_gettop(L)=1 then
begin
index:=lua_toInteger(L, 1);
lua_pushboolean(L, checklistbox.Checked[index]);
result:=1;
end;
end;
function checklistbox_setChecked(L: PLua_State): integer; cdecl;
var
checklistbox: TCustomCheckListBox;
index: integer;
begin
result:=0;
checklistbox:=luaclass_getClassObject(L);
if lua_gettop(L)=2 then
begin
index:=lua_toInteger(L, 1);
checklistbox.Checked[index]:=lua_toboolean(L, 2);
end;
end;
procedure checklistbox_addMetaData(L: PLua_state; metatable: integer; userdata: integer );
begin
listbox_addMetaData(L, metatable, userdata);
luaclass_addArrayPropertyToTable(L, metatable, userdata, 'Checked', checklistbox_getChecked, checklistbox_setChecked);
end;
procedure initializeLuaCheckListbox;
begin
lua_register(LuaVM, 'createCheckListBox', createCheckListBox);
end;
initialization
luaclass_register(TCustomCheckListBox, checklistbox_addMetaData);
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/phy0292/cheat-engine.git
git@gitee.com:phy0292/cheat-engine.git
phy0292
cheat-engine
cheat-engine
master

搜索帮助