mIRC Home    About    Download    Register    News    Help

Print Thread
.type property for $did() #246663 25/06/14 03:06 AM
Joined: Dec 2002
Posts: 87
Zmodem Offline OP
Babel fish
OP Offline
Babel fish
Joined: Dec 2002
Posts: 87
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

Last edited by Zmodem; 25/06/14 03:15 AM.

-Zmodem
Re: .type property for $did() [Re: Zmodem] #246665 25/06/14 07:14 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
+1 Very Good Idea!!! and this will be useful when starting building dialogs..


Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-
Re: .type property for $did() [Re: Zmodem] #246761 30/06/14 05:30 AM
Joined: Jul 2006
Posts: 3,745
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,745
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: .type property for $did() [Re: Wims] #246764 30/06/14 11:35 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Every identifier has it's useless i think one more property like this in some cases will be useful .


Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-
Re: .type property for $did() [Re: westor] #246765 30/06/14 03:20 PM
Joined: Jul 2006
Posts: 3,745
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,745
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: .type property for $did() [Re: Wims] #246770 30/06/14 07:02 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-
Re: .type property for $did() [Re: westor] #246771 30/06/14 09:06 PM
Joined: Jul 2006
Posts: 3,745
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,745
I said why, I just can't find a way this would be used in a script.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: .type property for $did() [Re: Wims] #246791 02/07/14 01:34 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Somewhere will help this property..


Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-