Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need help with creating a child form.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sun Mar 12, 2017 12:51 pm    Post subject: Need help with creating a child form. Reply with quote

Background:
I have a listview in the parent form with players data, such as hp, mana, etc. I want to make the following happen: when the user double-click one row, a child form will be created with the player's data in that specific row, and then the user can change the value on the child form. Last but not least, the user click "confirm" on the child form, and the value will be changed in game.


Questions:

1. How to create a child form, and to make the parent form not interactive with the user while the child form is visible?

2. If I create forms dynamically like this:
Code:

function test()
   local form = createForm()  <---------
   .....
   .....
end


How to set the OnClose event for "form"?


Thanks a lot.

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sun Mar 12, 2017 3:44 pm    Post subject: Reply with quote

form.showModal()
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sun Mar 12, 2017 6:35 pm    Post subject: Reply with quote

Dark Byte wrote:
form.showModal()


Thanks a lot, DB.

With regard to the second question, is it doable?

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sun Mar 12, 2017 6:47 pm    Post subject: Reply with quote

sure, just do form.OnClose=function(f)
return caHide --or caFree, though for showmodal i usually free it afterwards. that way i can read out gui components first
end

tip for showModal . if you add a button that sets modalResult the form will close (and showModal returns the value)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sun Mar 12, 2017 7:22 pm    Post subject: Reply with quote

Dark Byte wrote:
sure, just do form.OnClose=function(f)
return caHide --or caFree, though for showmodal i usually free it afterwards. that way i can read out gui components first
end

tip for showModal . if you add a button that sets modalResult the form will close (and showModal returns the value)


Thanks for the answer and the tip, DB. Smile

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites