unit LuaPageControl; {$mode delphi} interface uses Classes, SysUtils, controls, comctrls, lua, lualib, lauxlib; procedure initializeLuaPageControl; implementation uses luahandler, LuaWinControl, luaclass; function createPageControl(L: Plua_State): integer; cdecl; var PageControl: TPageControl; owner: TWincontrol; begin if lua_gettop(L)=1 then owner:=lua_toceuserdata(L, 1) else owner:=nil; PageControl:=TPageControl.Create(owner); PageControl.Parent:=owner; luaclass_newClass(L, PageControl); result:=1; end; function pagecontrol_addTab(L: Plua_State): integer; cdecl; var pc: TPageControl; ts: TTabSheet; begin pc:=luaclass_getClassObject(L); luaclass_newClass(L, pc.AddTabSheet); result:=1; end; function pagecontrol_getPageCount(L: Plua_State): integer; cdecl; begin lua_pushinteger(L, TPageControl(luaclass_getClassObject(L)).PageCount); result:=1; end; function pagecontrol_getPage(L: Plua_State): integer; cdecl; var pc: TPageControl; index: integer; begin result:=0; if lua_gettop(L)>=1 then begin pc:=luaclass_getClassObject(L); index:=lua_tointeger(L,1); if index