mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 254
T
Talon Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 254
Keynames for dialogs... Example:
edit "", 4, 54 4 90 10, read autohs Keyname=Username

Thus removing the confusion of ALL those darn numbers! You could $did($dname,Username) rather than $did(4)
Granted this is simple to script but it doubles code size (by meaning size of dialog table) since you cant do it inside the dialog table, you would have to do it on init or something. I make extensive dialogs with tons of ID's especially when it comes to tabs, each tab has a ton of ID's on it, and I frequently have to scroll up and go, oh that $did is "x", where if you could give it a keyname, it would save having to scan back through your dialog table to find the item you wish to script an event for.

Joined: Apr 2006
Posts: 399
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 399
cool idea talon, I get confused too sometimes while making dialogs. It wouldn't hurt to have something like that.

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Something similar was suggested here

Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Why not just use aliases?

alias ID_USERNAME return 1
alias ID_PASSWORD return 2

$did($ID_USERNAME)

Joined: Apr 2006
Posts: 399
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 399
good idea hixxy.

Joined: Apr 2004
Posts: 755
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
Because those result in extra lines of codes smirk i agree with Talon that being able to do it in the dialog declaration would be a much tidyer way.

Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Since when are extra lines a bad thing?

Joined: Apr 2004
Posts: 755
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
lol, well if you have 60 controls and you want to name em all
i rather be able to do it in 60 lines and at the place where you expect it the most then having to create 60 aliases.
Makes managing such large addons quite alot easier.
Not saying aliasing is a bad thing just that being able to declare em in the dialog table is alot neater.

Joined: Apr 2006
Posts: 399
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 399
I agree with MPdreamz, I also make dialogs very often, and, having to make an alias for each of them will probably get as confusing as just using the ids, it would be great to have keynames.

Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Well rather than the proposed suggestion I think it might be better if we actually saved some bytes; button caption, name, x y w h

Joined: Apr 2004
Posts: 755
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
yeah i was just agreeing on it having to be on the same line :tongue:
keyword=xxxxx is confusing using ID/name is much better indeed.

Joined: Nov 2004
Posts: 822
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 822
I agree.

Also, what about the same idea for tabs.

TabName=xxxxx or something similar.

Joined: Apr 2004
Posts: 217
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 217
I like this idea. Keynames would definately be a little more easier when scripting. I use to always have to go back and forth to see what ID was what.

- zach

Joined: Apr 2006
Posts: 399
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 399
lol PhantasyX, I do the EXACT same thing, and, it gets REAL annoying if the dialog is long (which in most cases they are)

Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Either way I very much doubt it'll be implemented. This isn't supported by windows so Khaled would have to keep a list himself. It's quite a lot of work considering the scripted workaround is very simple.

Joined: May 2006
Posts: 122
J
Vogon poet
Offline
Vogon poet
J
Joined: May 2006
Posts: 122
Why not use something like this
Code:
on *:dialog:name:*:*:{
var %x = $+($devent,$did)
:init0 (you can put a comment here if you want)
blah
return
:sclick1
blah
return
:%x
}

Not sure if solves your problem but I find it much neater and easier to read.

Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Just to add onto what I said previously, I didn't realise you could do this until now, but you can use the custom identifiers in the actual dialog table. This is a working dialog, and it's very modular:

Code:
alias -l id_prefixtext return 1
alias -l id_prefix return 2
alias -l id_suffixtext return 3
alias -l id_suffix return 4
alias -l id_options return 5
alias -l id_ok return 6
alias -l id_cancel return 7
alias -l id_apply return 8

dialog -l ncconf {
  title "Nick Completion Configuration"
  size -1 -1 132 114
  option dbu
  text "Prefix:", $id_prefixtext, 1 2 16 8
  edit "", $id_prefix, 18 1 47 10, autohs
  text "Suffix:", $id_suffixtext, 68 2 16 8
  edit "", $id_suffix, 85 1 47 10, autohs
  list $id_options, 0 11 132 90, check size
  button "&Ok", $id_ok, 55 102 25 12
  button "&Cancel", $id_cancel, 81 102 25 12
  button "&Apply", $id_apply, 107 102 25 12
}


I'm going to be coding all of my dialogs like this from now on.

Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
In the dialog table, you can also use %variables as well as $identifiers. ie: /set %size -1 -1 400 320

... and then inside the table:

size %size


Link Copied to Clipboard