mIRC Homepage
Posted By: Sabby $did(dname,id).type ? - 15/01/03 01:36 AM
Is there a way i can call for an id in a dialog, and it returns what it is; text, box, edit, tab, list, combo etc.?
Posted By: Collective Re: $did(dname,id).type ? - 15/01/03 01:42 AM
No.
Posted By: Sabby Re: $did(dname,id).type ? - 15/01/03 01:59 AM
they should make one
Posted By: Collective Re: $did(dname,id).type ? - 15/01/03 02:03 AM
What for? You can tell what type of control it is because you set the ID of a control when you add it to a dialog, and $did returns the ID associated with an on DIALOG event...it would just be a different way of getting the same info, IMO adding new features and repairing old bugs is more important than adding a different way of doing something that can already be done..
Posted By: Watchdog Re: $did(dname,id).type ? - 15/01/03 02:26 AM
What would you use the function for?
Posted By: qwerty Re: $did(dname,id).type ? - 15/01/03 03:46 PM
It's not the most necessary thing in the world, but I've needed it once (I don't remember when/where exactly). Generally, I think we should be able to get information like the type of control, its x y w h etc. This could be done by adding extra properties to $did (.type , .x, .y etc) or adding a new dialog identifier, one that would return info about a dialog table (fex, $dtable(name/N[,N]) with various properties). This, combined with $dialog().table, would enable us to get all this info, and more. If it's gonna be one of them, I prefer $dtable(), but it wouldn't hurt to have both. And $dtable cannot be scripted around efficiently.
Posted By: Sabby Re: $did(dname,id).type ? - 16/01/03 08:59 PM
I was thinking of creating an alias to do something like this:

; Syntax:
; /didc [-a] DialogName [Id-Id] Type Commands
; -a would be all id's in dialog
; in Commands <id> = id, <dlg> = dialog
alias didc {
var %all = $iif(-a == $1,t),%d = $iif(%all,$2,$1)
if ($4 == $null) || (!$regex($3,text|edit|button|radio|box|scroll|list|combo|icon|link|tab)) { echo -a * /didc: Error | return }
var %i = $iif(%all,1,$gettok($2,1,45))
while ($iif(%all, [ $did(%d,%i) ], [ $replace($2,-,<) ] )) {
if ($did(%d,%i)[b].type
== $3) $eval($replace($4-,<id>,%i,<dlg>,%d))
inc %i
}
}
[/b]

something like that, havent tested it just typed it up now.

so people could perform commands on certain types of dialog editboxes and stuff without having to input every single id, (which would save time in large dialogs, such as ones with treeviews)
© mIRC Discussion Forums