|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
hey, i am just wondering how you retrive data from a dialog created with $dialog , like $input or $? returns the data in an edit box or on whatever button was pressed, but if i create a dialog with the $dialog identifer, can i retrieve that data when the ok button is pressed, the data in all the edit boxes/listboxes or whatnot, or would i have to go about it in the actual dialog coding events eg:
on dialog.......sclick:okbuttonID:{ if ($dialog(dialog.name).modal == $true) { then do this for what i want with the edit boxes and so on } }
am i heading the right way with how you would get data it when created like that, or is there another way that wors like $input or whatever..?
|
|
|
|
Joined: Dec 2002
Posts: 3,015
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,015 |
$did(dialogname,id).text Eg. $did(Music,1).text returns the text in id 1 of the "Music" dialog.
Type "/help dialogs" and scroll down to the $did section.
|
|
|
|
Joined: Dec 2002
Posts: 1,893
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,893 |
or add the result property to the editbox whose value will be returned once the dialog is closed. see the help file for more info on the result property.
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
yeah i know ALL that stuff, but what i am asking, is "for example" when you make a call to $input or $$?
it returns a result of the edit bod, or the button press depending on the case, so if you use $input and have an edit box, then $input RETURNS whatever was typed into the edit box, what i want to know is, can we do the same with a call to $dialog(whatever,whatever)
as to where, when the dialog CLOSES/YOUR done with it, it will return a value or result, as does a call to $input or $$?
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
I did try it, i opened with //var %a = $dialog(test,test) | echo -a %a
and it got an echo error,
AND THATS WHY I came here and ASKED if there was a way to do it, CAUSE I TRIED by what i understood from the help file, and it isnt returning anything, but in my opinio if the dialog halts the script pending input, then it should return a result when the dialog closes, but it wasnt, so i came here to ask if there was a way to do it that i might be missing or something!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
Joined: Dec 2002
Posts: 1,253
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,253 |
dialog t3st {
option dbu
title T3st1ng...
size -1 -1 200 65
text "This is some random text i just put here to be a prompt.", 1, 5 5 190 15
edit "", 2, 5 25 190 15, result
button "OK", 3, 90 45 20 13, ok
}
alias t3st dialog -m t3st t3st //echo -a $$dialog(t3st,t3st)
|
|
|
|
Joined: Dec 2002
Posts: 1,893
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,893 |
no need to get mad... read hammer's post, or mine above...
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
ok, i see what you mean with the "result" property....now, is it possible to return several results from a variety of editboxes and list/combo box with that same function...?
or is it predefined to only return one result
|
|
|
|
Joined: Dec 2002
Posts: 1,253
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,253 |
/Set the results you want into variables (possibly with a timed unset) in your on *:DIALOG:dname:close:*: event, or your OK button sclick event, but make sure they are unset if you cancel.
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
yeah, i gave returning multiple result ID"s a try, but it would just return the last resulr ID data, this was just an option i was examining, trying to find the best way to do it, but i think i will just call a modeless dialog, and return the data i want with using the OK button sclick and the text i need from each $did, thanks for the help and suggestions tho everyone
|
|
|
|
|