mIRC Homepage
Posted By: Zmodem .type property for $did() - 25/06/14 03:06 AM
I tried searching for this, just to make sure it hasn't been requested yet, but came up with no results. So, here it goes.

I'd like to see a .type property for $did(), such that it would return the item type of the object ID that triggered an event.

Example
Code:
ON *:DIALOG:dialogName:mouse:*: {
  echo -s The current hover object is of type: $did($did).type
}

Obviously, type would return:
  • dialog
  • text
  • edit
  • button
  • check
  • radio
  • box
  • scroll
  • list
  • combo
  • icon
  • link
  • tab
  • menu
  • menuitem

Thanks, in advance, for any and all consideration or rejection! smile
Posted By: westor Re: .type property for $did() - 25/06/14 07:14 AM
+1 Very Good Idea!!! and this will be useful when starting building dialogs..
Posted By: Wims Re: .type property for $did() - 30/06/14 05:30 AM
How is this going to be useful exactly? mIRC does not have support for creating controls dynamically, all controls type are known before running the dialog: it could be scripted but really, it would be quite useless.
Posted By: westor Re: .type property for $did() - 30/06/14 11:35 AM
Every identifier has it's useless i think one more property like this in some cases will be useful .
Posted By: Wims Re: .type property for $did() - 30/06/14 03:20 PM
What? Identifiers just like commands must have a purpose.
You can make an infinite number of useless aliases which have no purpose like "alias test return 5".
Surely you don't want this alias to be built-in, returning 5, because it's nothing but useless, you won't have an use for it, you'll always use 5 itself without using $test.
Here it's the same, if you think about it for a second, you'll realize this would just be an identifiers returning another hardcoded string, here is a short example:
Code:
dialog test {
size -1 -1 400 400
edit "",1,0 0 0 0
text "",2,0 0 0 0
button "",3,0 0 0 0
edit "",4,0 0 0 0
box "",5,0 0 0 0
}
If you don't need $test to return "5", you don't need $did(test,4).type to return "edit".

Zmodem's example is the only situation where it would make sense to use it: when you are still working on a dialog table and you may have a lot of controls, you don't remember which is which ID and you don't want to have to look back at the hardcoded dialog table each time... So, this is only about helping you writting code easily, something that should be left to IDE.
Posted By: westor Re: .type property for $did() - 30/06/14 07:02 PM
The request was for the MOUSE option on the dialog so your example does not stuck with this request.

ON *:DIALOG:dialogName:mouse:*: {
echo -s The current hover object is of type: $did($did).type
}

Why not the $did($did).type will NOT help into this event ? tell me one why.. or give me an other script way to have this result.
Posted By: Wims Re: .type property for $did() - 30/06/14 09:06 PM
I said why, I just can't find a way this would be used in a script.
Posted By: westor Re: .type property for $did() - 02/07/14 01:34 PM
Somewhere will help this property..
© mIRC Discussion Forums