View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sun Mar 12, 2017 12:51 pm Post subject: Need help with creating a child form. |
|
|
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. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sun Mar 12, 2017 3:44 pm Post subject: |
|
|
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 |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sun Mar 12, 2017 6:35 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sun Mar 12, 2017 6:47 pm Post subject: |
|
|
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 |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sun Mar 12, 2017 7:22 pm Post subject: |
|
|
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.
_________________
**************
A simple example is better then ten links. |
|
Back to top |
|
|
|