forked from cheat-engine/cheat-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea4dbb1
commit 9545988
Showing
9 changed files
with
474 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
unit LuaButton; | ||
|
||
{$mode delphi} | ||
|
||
interface | ||
|
||
uses | ||
Classes, SysUtils, lua, lualib, lauxlib, forms, controls, StdCtrls; | ||
|
||
procedure InitializeLuaButton; | ||
procedure button_addMetaData(L: PLua_state; metatable: integer; userdata: integer ); | ||
|
||
implementation | ||
|
||
uses LuaHandler, LuaClass, LuaWinControl; | ||
|
||
function createButton(L: Plua_State): integer; cdecl; | ||
var c: TWincontrol; | ||
b: Tbutton; | ||
begin | ||
result:=0; | ||
if lua_gettop(L)=1 then | ||
begin | ||
c:=lua_toceuserdata(L, 1); | ||
b:=TButton.create(c); | ||
b.Parent:=c; | ||
luaclass_newClass(L, b); | ||
result:=1; | ||
end; | ||
end; | ||
|
||
function button_getModalResult(L: PLua_State): integer; cdecl; | ||
var | ||
button: Tcustombutton; | ||
begin | ||
button:=luaclass_getClassObject(L); | ||
lua_pushinteger(L, integer(button.ModalResult)); | ||
result:=1; | ||
end; | ||
|
||
function button_setModalResult(L: PLua_State): integer; cdecl; | ||
var | ||
button: Tcustombutton; | ||
begin | ||
result:=0; | ||
button:=luaclass_getClassObject(L); | ||
if lua_gettop(L)>=1 then | ||
button.ModalResult:=TModalResult(lua_tointeger(L,-1)); | ||
end; | ||
|
||
procedure button_addMetaData(L: PLua_state; metatable: integer; userdata: integer); | ||
begin | ||
wincontrol_addMetaData(L, metatable, userdata); | ||
luaclass_addClassFunctionToTable(L, metatable, userdata, 'getModalResult', button_getModalResult); | ||
luaclass_addClassFunctionToTable(L, metatable, userdata, 'setModalResult', button_setModalResult); | ||
luaclass_addPropertyToTable(L, metatable, userdata, 'ModalResult', button_getModalResult, button_setModalResult); | ||
|
||
end; | ||
|
||
procedure InitializeLuaButton; | ||
begin | ||
lua_register(LuaVM, 'createButton', createButton); | ||
lua_register(LuaVM, 'button_getModalResult', button_getModalResult); | ||
lua_register(LuaVM, 'button_setModalResult', button_setModalResult); | ||
end; | ||
|
||
initialization | ||
luaclass_register(Tbutton, button_addMetaData); | ||
|
||
|
||
end. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
unit LuaGroupbox; | ||
|
||
{$mode delphi} | ||
|
||
interface | ||
|
||
uses | ||
Classes, SysUtils, lua, lualib, lauxlib, stdctrls; | ||
|
||
procedure initializeLuaGroupbox; | ||
procedure groupbox_addMetaData(L: PLua_state; metatable: integer; userdata: integer ); | ||
|
||
implementation | ||
|
||
uses luaclass, luahandler, pluginexports, LuaWinControl; | ||
|
||
function createGroupBox(L: Plua_State): integer; cdecl; | ||
var parameters: integer; | ||
f,p: pointer; | ||
begin | ||
result:=0; | ||
if lua_gettop(L)>=1 then | ||
begin | ||
f:=lua_toceuserdata(L, -1); | ||
p:=ce_createGroupBox(f); | ||
|
||
lua_pop(L, lua_gettop(L)); | ||
|
||
luaclass_newClass(L, p); | ||
result:=1; | ||
end; | ||
end; | ||
|
||
procedure groupbox_addMetaData(L: PLua_state; metatable: integer; userdata: integer ); | ||
begin | ||
wincontrol_addMetaData(L, metatable, userdata); | ||
end; | ||
|
||
procedure initializeLuaGroupbox; | ||
begin | ||
lua_register(LuaVM, 'createGroupBox', createGroupBox); | ||
end; | ||
|
||
initialization | ||
luaclass_register(TCustomGroupBox, groupbox_addMetaData); | ||
|
||
end. | ||
|
Oops, something went wrong.