How to implement the Tri State checkbox?


Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2

Use BS_AUTO3STATE style.
EMG
Use Where?
In the Pelles C I found, but I dont know what class to (re)define
CONTROL "Interni:", 136, "BUTTON", BS_AUTO3STATE | BS_LEFTTEXT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 385, 110, 30, 12Enrico, I use redefine, I think that I can change the TCheckbox class to work with 3 states or maybe create a new class with inheritance from TCheckbox.
But I hope that there is a easier way
nCsn = 2
REDEFINE CHECKBOX oCsn VAR csn;
ID 111 OF oDlgAna;
ON CLICK ( ::SendMsg( BM_SETCHECK, ( nCsn + 1 ) % 3 ),;
nCsn := ::SendMsg( BM_GETCHECK ) )Enrico, this code didn't work right...
I want to change the var to work as a integer instead of logical
0 = Unchecked
1 = Checked
2 = Full Checked
Please check nCsn variable in my sample above.
EMG
Error description: Error BASE/1003 Variable does not exist: BM_GETCHECK
// Button messages
#define BM_GETCHECK 240
#define BM_SETCHECK 241
#define BM_GETSTATE 242
#define BM_SETSTATE 243
#define BM_SETSTYLE 244#include "fivewin.ch"
#define BM_GETCHECK 240
#define BM_SETCHECK 241
#define BM_GETSTATE 242
#define BM_SETSTATE 243
#define BM_SETSTYLE 244
Procedure TestTriCheck()
Private oDlg, oChk, lChk, nChk := 0, oBtnTest, oBtnExit
Define Dialog oDlg;
Resource "DIALOG_TEST";
Of oWnd
Redefine CheckBox oChk;
var lChk;
Update;
ID 101;
Of oDlg;
ON CLICK ( oChk:SendMsg( BM_SETCHECK, ( nChk+ 1 ) % 3 ),;
nChk := oChk:SendMsg( BM_GETCHECK ) )
Redefine ButtonBmp oBtnTest;
ID 102;
of oDlg;
Prompt "Test ";
action MsgInfo(Str(nChk));
Update;
TextRight
Redefine ButtonBmp oBtnExit;
ID 103;
of oDlg;
Prompt "End ";
action oDlg:End();
Update;
TextRight
Activate Dialog oDlg;
CENTER
Return