View previous topic :: View next topic |
Author |
Message |
Flux. Advanced Cheater
Reputation: 0
Joined: 10 Nov 2016 Posts: 88 Location: Another World - N5X2 106311411+2123518
|
Posted: Sun Feb 23, 2025 6:25 am Post subject: How can I get a return value from a dialog window ? |
|
|
Hi,
Is it possible to get a return value from a dialog window ?
Trying to get a return result for (open/save/OK) or (cancel/close).
Code: | myForm = createForm()
myForm.setSize(300,300)
local memo = createMemo(myForm)
memo.setSize(myForm.Width,myForm.Height - 100)
local button = createButton(myForm)
button.setSize(myForm.Width,100)
button.Top = 200
button.Caption = 'Open'
button.OnClick=function(sender)
local OpenDialog = createOpenDialog(myForm)
OpenDialog.execute()
-------------------------------------------------------
--print(OpenDialog.GetDialogResult) -- or maybe
--if (whatever is clicked on) then
--return ???
-------------------------------------------------------
--else
-- do stuff
memo.Lines.Insert(1,'Line 1')
memo.Lines.add('Last line')
--end
end
openfile() |
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25715 Location: The netherlands
|
Posted: Sun Feb 23, 2025 7:48 am Post subject: |
|
|
OpenDialog.execute() returns true when a file has been selected and not canceled _________________
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 |
|
 |
Flux. Advanced Cheater
Reputation: 0
Joined: 10 Nov 2016 Posts: 88 Location: Another World - N5X2 106311411+2123518
|
Posted: Sun Feb 23, 2025 8:29 am Post subject: |
|
|
OK Thanks Dark Byte. |
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1494
|
Posted: Sun Feb 23, 2025 12:52 pm Post subject: |
|
|
Code: | button1.OnClick=function(sender)
local OpenDialog = createOpenDialog(myForm)
--OpenDialog.execute()
-------------------------------------------------------
if OpenDialog.execute() then --if file name then (open-save-ok-true)
memo1.Lines.add(OpenDialog.FileName)
else -- (cancel-close-false)
memo1.Lines.add('Cancel')
end
end |
_________________
|
|
Back to top |
|
 |
|