What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Interface Writer | [release] 3.0 | 22/08/2010

2 votes - 5 average   Interface Writer | [release] 3.0 | 22/08/2010
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: BETA - Interface Writer 1.0!
Well, you're not implementing our sample code properly. :P
You shouldn't re-enable the control when one item in the loop doesn't match the ID to test simply because you won't have all used IDs matching that one ID, you have to check whether there is at least one match.
js code:
        if (isNaN (objWnd.GetControlText("EdtLeft") * 1) == true || isNaN (objWnd.GetControlText("EdtDown") * 1) == true || isNaN (objWnd.GetControlText("EdtWidth") * 1) == true || isNaN (objWnd.GetControlText("EdtHeight")) == true)
        {
            Interop.Call("user32", "EnableWindow", objWnd.GetControlHandle("BtnAdd"), 0);
        }
        else
        {
>>>            var bCanChange = true;<<<
>>>            var sEdtId = objWnd.GetControlText("EdtId");<<<
            for (var X in WndLstId)
            {
>>>                if (WndLstId.length > 1 && sEdtId == WndLstId[X] && X == WndLstTStSel)<<<
                    {
>>>                        bCanChange = false;<<<
>>>                        break;<<<
                    }
                }
            }
>>>            Interop.Call("user32", "EnableWindow", objWnd.GetControlHandle("BtnChange"), bCanChange);<<<
        }
As you can see, you don't need an else-block anywhere, you simply check three things:
  1. Check whether there are IDs in the array.
  2. Check whether the currently chosen test ID matches the key name of the current item in the loop.
  3. Check whether this item is currently being edited.
When these three conditions are fulfilled for one item in the loop, we can say that the chosen ID is not unique and thus bCanChange has to be set to false in order to disable the edit button.
When these conditions are never fulfilled, bCanChange will never change from its original value (true) and the button will be enabled.

Oh, on a side note: try to store some of the GetControlText calls in a variable inside your functions when you use them very often. It's good practice to take off the load of the API to get the control text every time and simply retrieve the value from a variable - the control text won't change anyway while executing the event function (and you don't want it to change either).
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-25-2009 05:41 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Interface Writer | [release] 3.0 | 22/08/2010 - by whiz on 05-25-2009 at 02:55 PM
RE: BETA - Interface Writer 1.0! - by matty on 05-25-2009 at 03:16 PM
RE: BETA - Interface Writer 1.0! - by Spunky on 05-25-2009 at 03:26 PM
RE: Interface Writer | [beta] 1.0 - by whiz on 05-25-2009 at 03:31 PM
RE: BETA - Interface Writer 1.0! - by Matti on 05-25-2009 at 04:02 PM
RE: BETA - Interface Writer 1.0! - by Spunky on 05-25-2009 at 04:07 PM
RE: BETA - Interface Writer 1.0! - by Matti on 05-25-2009 at 04:11 PM
RE: Interface Writer | [beta] 1.0 - by whiz on 05-25-2009 at 05:15 PM
RE: BETA - Interface Writer 1.0! - by Matti on 05-25-2009 at 05:41 PM
RE: BETA - Interface Writer 1.0! - by vaccination on 05-25-2009 at 05:41 PM
RE: BETA - Interface Writer 1.0! - by CookieRevised on 05-25-2009 at 06:24 PM
RE: Interface Writer | [beta] 1.0 - by whiz on 05-27-2009 at 05:37 PM
RE: BETA - Interface Writer 1.0! - by roflmao456 on 05-27-2009 at 06:50 PM
RE: Interface Writer | [release] 1.2 - by whiz on 05-27-2009 at 07:02 PM
RE: BETA - Interface Writer 1.0! - by matty on 05-27-2009 at 07:05 PM
RE: Interface Writer | [release] 1.2 - by whiz on 05-27-2009 at 08:05 PM
RE: BETA - Interface Writer 1.0! - by vaccination on 05-27-2009 at 07:13 PM
RE: Interface Writer | [release] 1.2 - by whiz on 05-27-2009 at 07:45 PM
RE: BETA - Interface Writer 1.0! - by vaccination on 05-27-2009 at 09:28 PM
RE: Interface Writer | [release] 1.2 - by whiz on 05-28-2009 at 03:26 PM
RE: BETA - Interface Writer 1.0! - by vaccination on 05-28-2009 at 03:59 PM
RE: Interface Writer | [release] 1.2 - by whiz on 05-28-2009 at 04:01 PM
RE: BETA - Interface Writer 1.0! - by vaccination on 05-28-2009 at 04:07 PM
RE: Interface Writer | [release] 1.2 - by whiz on 05-28-2009 at 04:12 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by mynetx on 06-14-2009 at 03:58 PM
RE: Interface Writer | [release] 1.2 - by whiz on 06-14-2009 at 04:16 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by mynetx on 06-14-2009 at 04:56 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by SmokingCookie on 06-14-2009 at 05:34 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by vaccination on 06-14-2009 at 10:04 PM
RE: Interface Writer | [release] 1.2 - by whiz on 06-15-2009 at 03:16 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by SmokingCookie on 06-15-2009 at 04:30 PM
RE: Interface Writer | [release] 1.2 - by whiz on 06-15-2009 at 06:27 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by SmokingCookie on 06-15-2009 at 07:51 PM
RE: Interface Writer | [release] 1.2 - by whiz on 06-15-2009 at 08:03 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by SmokingCookie on 06-16-2009 at 12:17 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.2 - by Flippy on 06-17-2009 at 11:47 AM
RE: Interface Writer | [release] 1.2 - by whiz on 06-17-2009 at 06:56 PM
RE: RE: Interface Writer | [release] 1.2 - by SmokingCookie on 06-28-2009 at 07:13 AM
RE: Interface Writer | [beta] 1.0 -> [release] 1.5 - by CookieRevised on 06-22-2009 at 06:11 PM
RE: RE: Interface Writer | [beta] 1.0 -> [release] 1.5 - by whiz on 06-27-2009 at 02:57 PM
RE: Interface Writer | [beta] 1.0 -> [release] 1.5 - by CookieRevised on 06-28-2009 at 01:16 AM
RE: Interface Writer | [release] 1.5 - by whiz on 06-28-2009 at 09:30 AM
RE: Interface Writer | [release] 1.5 - by SmokingCookie on 06-28-2009 at 03:24 PM
RE: Interface Writer | [release] 1.5 - by whiz on 06-29-2009 at 06:31 PM
RE: Interface Writer | [release] 1.5 - by SmokingCookie on 06-29-2009 at 07:12 PM
RE: Interface Writer | [release] 1.5 - by mynetx on 06-30-2009 at 07:31 AM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by whiz on 11-07-2009 at 01:49 PM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by mynetx on 11-07-2009 at 02:04 PM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by whiz on 11-07-2009 at 02:32 PM
RE: RE: Interface Writer | [release] 2.0 | 07/11/2009 - by CookieRevised on 11-07-2009 at 05:43 PM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by mynetx on 11-07-2009 at 06:28 PM
RE: RE: Interface Writer | [release] 2.0 | 07/11/2009 - by CookieRevised on 11-07-2009 at 11:07 PM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by whiz on 11-08-2009 at 11:57 AM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by CookieRevised on 11-08-2009 at 05:56 PM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by whiz on 11-09-2009 at 06:52 PM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by CookieRevised on 11-10-2009 at 07:45 AM
RE: Interface Writer | [release] 2.0 | 07/11/2009 - by whiz on 11-10-2009 at 04:14 PM
RE: Interface Writer | [release] 2.2 | 29/11/2009 - by whiz on 11-29-2009 at 05:19 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 01-30-2010 at 01:16 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 01-30-2010 at 01:25 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by MeEtc on 01-31-2010 at 02:40 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 01-31-2010 at 08:48 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 01-31-2010 at 04:00 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 01-31-2010 at 05:04 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by MeEtc on 02-01-2010 at 12:01 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-02-2010 at 06:34 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-10-2010 at 07:32 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-11-2010 at 08:03 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-12-2010 at 08:34 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-12-2010 at 07:41 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-13-2010 at 08:49 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-14-2010 at 10:50 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-14-2010 at 11:01 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-14-2010 at 11:22 AM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-14-2010 at 12:53 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-14-2010 at 01:41 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-14-2010 at 01:44 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-14-2010 at 02:00 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-14-2010 at 02:04 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-14-2010 at 02:12 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by CookieRevised on 02-14-2010 at 04:32 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-14-2010 at 06:32 PM
RE: RE: Interface Writer | [release] 2.5 | 30/01/2010 - by SmokingCookie on 02-14-2010 at 08:09 PM
RE: Interface Writer | [release] 2.5 | 30/01/2010 - by whiz on 02-16-2010 at 02:57 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by billyy on 02-16-2010 at 04:20 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by whiz on 02-16-2010 at 04:58 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by billyy on 02-16-2010 at 05:55 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by whiz on 02-17-2010 at 08:13 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by billyy on 02-17-2010 at 08:23 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by whiz on 02-18-2010 at 08:57 AM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by billyy on 02-18-2010 at 08:03 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by whiz on 02-18-2010 at 08:18 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by billyy on 02-18-2010 at 08:21 PM
RE: Interface Writer | [release] 2.7 | 16/02/2010 - by whiz on 02-20-2010 at 11:27 AM
Interface Writer | [beta] 2.8 | 21/02/2010 - by whiz on 02-21-2010 at 05:28 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by billyy on 02-21-2010 at 06:20 PM
RE: Interface Writer | [beta] 2.8 | 21/02/2010 - by whiz on 02-21-2010 at 06:38 PM
RE: RE: Interface Writer | [beta] 2.8 | 21/02/2010 - by billyy on 02-23-2010 at 04:14 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by SmokingCookie on 02-23-2010 at 10:58 AM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-23-2010 at 04:05 PM
RE: RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by SmokingCookie on 02-23-2010 at 05:02 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-24-2010 at 06:51 PM
RE: RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by SmokingCookie on 02-24-2010 at 06:57 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-24-2010 at 07:17 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by SmokingCookie on 02-24-2010 at 07:20 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-24-2010 at 07:25 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by SmokingCookie on 02-24-2010 at 07:30 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by billyy on 02-26-2010 at 11:21 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-28-2010 at 10:15 AM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by billyy on 02-28-2010 at 01:05 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-28-2010 at 01:37 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by billyy on 02-28-2010 at 01:40 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by whiz on 02-28-2010 at 02:53 PM
RE: Interface Writer | [release] 2.7 ~ [beta] 2.8 | 16/02/2010 - by billyy on 02-28-2010 at 02:58 PM
RE: Interface Writer | [beta] 2.8 | 16/02/2010 - by whiz on 03-02-2010 at 03:46 PM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by whiz on 03-10-2010 at 08:26 PM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by SmokingCookie on 03-14-2010 at 09:42 AM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by whiz on 03-14-2010 at 11:11 AM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by whiz on 05-24-2010 at 08:38 PM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by SmokingCookie on 05-25-2010 at 07:17 PM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by matty on 05-25-2010 at 07:32 PM
RE: Interface Writer | [release] 2.9 | 10/03/2010 - by whiz on 05-26-2010 at 06:25 PM
RE: Interface Writer | [beta] 3.0 (+ [release] 2.9) | 17/06/2010 (+ 10/03/2010) - by mynetx on 06-17-2010 at 08:26 AM
RE: Interface Writer | [beta] 3.0 (+ [release] 2.9) | 17/06/2010 (+ 10/03/2010) - by whiz on 06-17-2010 at 08:39 AM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by whiz on 07-24-2010 at 04:34 PM
RE: RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by SmokingCookie on 07-25-2010 at 06:53 AM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by whiz on 07-25-2010 at 09:46 AM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by SmokingCookie on 07-25-2010 at 09:52 AM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by whiz on 07-25-2010 at 10:05 AM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by SmokingCookie on 07-25-2010 at 04:30 PM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by whiz on 07-25-2010 at 04:40 PM
RE: Interface Writer | [beta] 3.0 r2 | 24/07/2010 - by SmokingCookie on 07-25-2010 at 04:44 PM
RE: Interface Writer | [release] 3.0 | 22/08/2010 - by whiz on 08-22-2010 at 03:28 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On