Shoutbox

Checkbox Changing - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Checkbox Changing (/showthread.php?tid=87262)

Checkbox Changing by ArkaneArkade on 11-14-2008 at 02:38 AM

Hey all,

Just wondering if theres an easy way to detect when a checkbox is changed, such as a WindowIdEvent?  I've been trying to make a new settings window and to have certain things changed depending on the startup status, and obviously this prevents WindowIdCtrlClicked working.
I have tried looking in the documentation, but didnt see anything, so assuming not, but I know you guys may know better, or ways around this.

I was also wondering if there is a way to change the status of muiltiple controls at once... such as to grey out 5 different controls depending on whether a specific checkbox is checked or not.

My thanks as always guys,
Leroux


RE: Checkbox Changing by matty on 11-14-2008 at 03:06 AM

code:
function OnWindowIdEvent_CtrlClicked(pPlusWnd, sControlId){}

RE: RE: Checkbox Changing by ArkaneArkade on 11-14-2008 at 03:11 AM

quote:
Originally posted by matty
code:
function OnWindowIdEvent_CtrlClicked(pPlusWnd, sControlId){}

Doesn't work at this part.  I'm just seeing if theres an easier way to change settings if a control is automatically set.  Its for a checkbox, so that if I select chk2, childwnd2 will be visible instead of childwin1.  Because I'm trying to pull it up auto, the chkbox doesnt actually get clicked, and so that event doesnt fire

- I've just added some more code to do the bit I need.  It's a bunch of extra lines, but doesn't make too much difference really.  Can anyone tell me if it is possible to make checkboxes greyed out, and if theres any way to control groups at a time?  Cheers guys
RE: Checkbox Changing by matty on 11-14-2008 at 10:34 PM

PM me exactly what you are trying to do and we will go from there.


RE: Checkbox Changing by roflmao456 on 11-14-2008 at 10:43 PM

try out this:

code:
PlusWnd.Button_SetCheckState("checkbox1",true);

and also:
code:
function OnWindowIdEvent_CtrlClicked(PlusWnd, ControlId){
if(ControlId == "checkbox1"){
var checked = !PlusWnd.Button_IsChecked("checkbox1");
Interop.Call("user32","EnableWindow",PlusWnd.GetControlHandle("control1"), checked);
Interop.Call("user32","EnableWindow",PlusWnd.GetControlHandle("control2"),checked);
Interop.Call("user32","EnableWindow",PlusWnd.GetControlHandle("control3"),checked);
Interop.Call("user32","EnableWindow",PlusWnd.GetControlHandle("control4"),checked);
}
}

RE: Checkbox Changing by ArkaneArkade on 11-14-2008 at 11:38 PM

Sorry guys, I'm obviously not being very clear, so my apologies.  I know how the set the boxes to checked.

I was trying to make an advanced settings window, with a single checkbox to enable.  Then a bunch of radio controls, that I was hoping to "grey out" to make read only, unless the checkbox was enabled.

As far as I can tell from the documentation its not possible, so no need to worry about it.  I can do a script without... it was purely a matter of asthetics and so, doesn't matter in the least.  Cheers anyways.

Matty: Thanks, but it really didn't seem worthwhile enough to bother you further.  I'm sure you've got other important things, so no need to worry about relatively pointless things.  Much appreciated though man.  :D


RE: Checkbox Changing by matty on 11-15-2008 at 03:39 AM

Do you mean something like this:

[Image: attachment.php?pid=937376]


RE: Checkbox Changing by ArkaneArkade on 11-15-2008 at 05:25 AM

Actually matty, yeah.  The send link checkbox is exactly what I mean, but with multiple radio controls all to be activated/deactivated according to the checkbox.


RE: RE: Checkbox Changing by felipEx on 11-15-2008 at 06:44 AM

quote:
Originally posted by Leroux
Actually matty, yeah.  The send link checkbox is exactly what I mean, but with multiple radio controls all to be activated/deactivated according to the checkbox.
In that case, what roflmao456 has posted can help you out... :D

for example:
code:
var checked = PlusWnd.Button_IsChecked("yourCheckbox");
var radiocontrols = new Array("RadA", "RadB", "RadC", "anyOtherRadioControl...");

for (var i in radiocontrols) Interop.Call("user32","EnableWindow", PlusWnd.GetControlHandle(radiocontrols[i]), checked);
[Image: 3030739147_3b8aabc0be_o.png]
RE: Checkbox Changing by ArkaneArkade on 11-15-2008 at 06:55 AM

In that case, many apologies to roflmao456.  I took a look at the code and my limited knowledge led me to it being another method to check boxes.  I'm going to try it out now.  thanks roflmao456 and filipEx