mIRC Home    About    Download    Register    News    Help

Print Thread
#84036 25/05/04 02:43 AM
Joined: Oct 2003
Posts: 214
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
Something like $did(N).type could be usefull, to get the type of an item in a dialog box. It should return "list" or "button" and so on smile

Currently i use a script for it which parses the dialog table in the script - but this is really 'slow'.


one step closer to world domination
#84037 25/05/04 02:26 PM
Joined: Feb 2004
Posts: 201
J
Jae Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
shouldnt you already know what it is?
anyways.. wouldnt a better idea be something like.. giving NAMES to controlls... instead of those pesky numbers? it will save me doign my work around where i use an identifier and a hash table (with name -=> id information and grouping info.. for use when wanting groups of items to be hidden or shown and so on)
none the less. *hands Khaled a pen* time to strat writing this code!

Cheers

#84038 26/05/04 03:31 AM
Joined: Oct 2003
Posts: 214
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
i use a script which uses MDX on every dialog to change button style and so automatically


one step closer to world domination
#84039 26/05/04 08:00 PM
Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Quote:
wouldnt a better idea be something like.. giving NAMES to controlls... instead of those pesky numbers?

YES! That would make coding dialog events SO much easier! smile

#84040 27/05/04 06:23 AM
Joined: Mar 2003
Posts: 187
S
Vogon poet
Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
thats basic windows api, and it works fine. Yell at Bill Gates, not the K-meister.

#84041 27/05/04 09:28 AM
Joined: Jun 2003
Posts: 195
N
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
general reply:
I like the idea but not alot. either number or text makes no difference since each controls id would still need to be unique. Remeber however using textual names for id's would require mIRC to store an array of strings and the associated id.

so if you have a dialog with 10 control each name is 10 chars the total memory used would be ((sizeof(char) * 100) + sizeof(UINT)). just a shade over 200 just for one dialog. this is of course _just_ for the id's nothing else. the actual controls colors etc.. will still be taking up space as well. i have seen some dialogs with more than 30 controls

now compound this even farther by adding mdx and your looking at a much larger size. Also take into account the array would have to be scanned for every access to the control. this means every /did or $did as well as when an on dialog event needs to be sent. Imagine the same 30 control dialog. Using mdx you could easily send a /did more than 50 times in the init alone. thats 50 scans of the id list as well as additional ones for events.

Most times the speed hit wont be so bad but there is a _great_ chance that it could happen more often than we like.

Perhaps placing limits such as max string count of 10 or soemthing. im sure youll end up seeing things like this if you dont

button "blah",button.somedialog.performssomealias,........

anyhow provided it can be limited a little and the speed hit isnt too bad i see no harm. (dont wanna chew up 64 megs of ram running mirc lol)


Have Fun smile

Link Copied to Clipboard