mIRC Home    About    Download    Register    News    Help

Print Thread
#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
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
+1 Very Good Idea!!! and this will be useful when starting building dialogs..


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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? -> https://irc.chathub.org <-
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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? -> https://irc.chathub.org <-
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I said why, I just can't find a way this would be used in a script.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Somewhere will help this property..


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard