LeFiXER Grandmaster Cheater Supreme Reputation: 20 Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Fri Feb 04, 2022 12:22 pm Post subject: |
|
|
++METHOS wrote: |
...
I tried both suggestions, but could not get them to work. I am too stupid to implement LeFiXER's code, and the MouseUp solution probably does not work in this case without changing more.
Thanks. |
No need to apologise. Just trying to help where I can. Providing the code gives a little more context for me so thank you, with this you can actually do it like DB mentioned:
Code: |
--handy helper function
function forEachAndFutureForm(classname, func)
local i
for i=0,getFormCount()-1 do
local f
f=getForm(i)
if f.ClassName==classname then
func(f)
end
end
registerFormAddNotification(function(f)
if classname==f.ClassName then
f.registerFirstShowCallback(function()
func(f)
end)
end
end)
end
forEachAndFutureForm('TfrmAutoInject',function(f)
b=createButton(f)
b.Caption='Add to Table'
--b.OnClick=f.Assigntocurrentcheattable1.OnClick
--
b.OnMouseDown=f.Assigntocurrentcheattable1.OnClick
b.OnMouseUp=myfunction() -- whatever function you want to execute on mouseup
--
b.parent=f.Panel3
b.SetHeight(30)
b.SetWidth(130)
b.AutoSize=false
b.AnchorSideLeft.Control=f.btnExecute
b.AnchorSideLeft.Side=asrRight
b.AnchorSideTop.Control=f.btnExecute
b.AnchorSideTop.Side=asrTop
end)
|
As for which events you can use for the button control, you have:
OnChange
OnClick
OnEnter
OnExit
OnMouseDown
OnMouseUp
OnMouseLeave
OnMouseMove
OnMouseUp
OnMouseWheel
OnMouseWheelDown
OnMouseWheelUp
|
|