Shoutbox

[Thx!] CheckBoxControl/Attributes/Has3States - 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: [Thx!] CheckBoxControl/Attributes/Has3States (/showthread.php?tid=72761)

[Thx!] CheckBoxControl/Attributes/Has3States by Flash on 03-17-2007 at 10:57 PM

how to see the State 3????

code:
Debug.Trace("Click "+w.Button_IsChecked( c ))

Appel de la fonction : OnPsDp_PsChild1Event_CtrlClicked
Click false
Appel de la fonction : OnPsDp_PsChild1Event_CtrlClicked
Click true
Appel de la fonction : OnPsDp_PsChild1Event_CtrlClicked
Click true

RE: [Help] CheckBoxControl/Attributes/Has3States by Dennis Mike on 03-18-2007 at 01:41 AM

this property this in false by default
if Has3States is true, what is the state 3?


RE: [Help] CheckBoxControl/Attributes/Has3States by matty on 03-18-2007 at 01:56 AM

The three states of a checkbox

Not Checked
Partial Check
Checked


RE: [Help] CheckBoxControl/Attributes/Has3States by Dennis Mike on 03-18-2007 at 01:58 AM

Partial Check?
how is that?


RE: [Help] CheckBoxControl/Attributes/Has3States by felipEx on 03-18-2007 at 02:37 AM

maybe with a Timer? :D

Edit: how to set the checkbox status "Partial Check" with API?


RE: [Help] CheckBoxControl/Attributes/Has3States by markee on 03-18-2007 at 03:33 AM

quote:
Originally posted by Dennis Mike
Partial Check?
how is that?
A common example of partially checked is when you install a new program and go into a custom set-up.  If you choose some (not all) features in a branch of the tree then it will partially select the parent of the ones you chose.  I hope this explanation is not too confusing.
RE: [Help] CheckBoxControl/Attributes/Has3States by Dennis Mike on 03-18-2007 at 03:36 AM

Edit
this is for cheked, no?
BM_SETCHECK = 0xF1
PlusWnd.SendControlMessage(ControlId,BM_SETCHECK, BST_CHEKED, 0)

how is for partialcheked?


RE: [Help] CheckBoxControl/Attributes/Has3States by ShawnZ on 03-18-2007 at 03:47 AM

with two states:

[Image: ThreeStateTreeView1.png]





with three states:

[Image: ThreeStateTreeView2.png]


RE: [Help] CheckBoxControl/Attributes/Has3States by felipEx on 03-18-2007 at 03:59 AM


var BS_CHECKBOX = 0x2
var BM_GETCHECK = 0xF0

var res = Interop.Call("user32", "SendMessageW",  PlusWnd.GetControlHandle("yourcheckbox"), BM_GETCHECK, BS_CHECKBOX, 0)

if res = 0 ..  the checkbox is not checked
if res = 1 .. the checkbox is checked
if res = 2..  the checkbox is "Partial Check"


it works for me :)


RE: [Help] CheckBoxControl/Attributes/Has3States by Dennis Mike on 03-18-2007 at 04:02 AM

felipex say how to set the checkbox status "Partial Check"?


PlusWnd.SendControlMessage(controlid, 0xF1, 2, 0)


RE: RE: [Help] CheckBoxControl/Attributes/Has3States by felipEx on 03-18-2007 at 04:07 AM

quote:
Originally posted by Dennis Mike
felipex say how to set the checkbox status "Partial Check"?


PlusWnd.SendControlMessage(controlid, 0xF1, 2, 0)



PlusWnd.SendControlMessage(controlid, 0xF1, 0xF1, 0)

- or -

Interop.Call("user32", "SendMessageW", PlusWnd.GetControlHandle("yourcheckboxId"), 0xF1, 0xF1, 0)

you should use API  hehehe

so, it works for me :D
RE: [Help] CheckBoxControl/Attributes/Has3States by Flash on 03-18-2007 at 05:57 AM

hum confusing with parameter

quote:
var BM_GETSTATE = 0xF2
var BS_CHECKBOX = 0x2

var res = Interop.Call("user32", "SendMessageW",  PlusWnd.GetControlHandle("yourcheckbox"), BM_GETCHECK,BS_CHECKBOX, 0)



RE: [Help] CheckBoxControl/Attributes/Has3States by felipEx on 03-18-2007 at 07:28 AM

var BS_CHECKBOX = 0x2
var BM_GETCHECK = 0xF0

:D


RE: [Help] CheckBoxControl/Attributes/Has3States by Flash on 03-18-2007 at 03:48 PM

hum, and how for set the State? ?

edit:i maked that :P

code:
function ClickCheck(w,c,n) {
    if (n == null) return w.SendControlMessage(c, 0xF0,0x2, 0)
    else if (n < 2){
        w.Button_SetCheckState(c,(n == 1)?true:false)
    }
    else w.SendControlMessage(c, 0xF1,0x2, 0);
}

RE: [Help] CheckBoxControl/Attributes/Has3States by felipEx on 03-18-2007 at 04:11 PM

you need to know the checkbox's handle:
var CheckBoxHwnd = PlusWnd.GetControlHandle("your_checkbox_ControlId");

// set the "Partial Check" state
Interop.Call("user32", "SendMessageW", CheckBoxHwnd, 0xF1, 0xF1, 0)


Edit: 
w.SendControlMessage(...)
woorks too, but i like API

:)


RE: [Help] CheckBoxControl/Attributes/Has3States by Flash on 03-18-2007 at 04:28 PM

watch my edit post ;)