![Image](http://s23.postimg.org/l2cn1bhef/Check_box.png)
Checkbox Tri-State
Checkbox Tri-State
How to implement the Tri State checkbox?
![Image](http://s23.postimg.org/l2cn1bhef/Check_box.png)
![Image](http://s23.postimg.org/l2cn1bhef/Check_box.png)
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Checkbox Tri-State
Use Where?
In the Pelles C I found, but I dont know what class to (re)define
In the Pelles C I found, but I dont know what class to (re)define
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Checkbox Tri-State
This is a sample of how I define it:
EMG
Code: Select all | Expand
CONTROL "Interni:", 136, "BUTTON", BS_AUTO3STATE | BS_LEFTTEXT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 385, 110, 30, 12
EMG
Re: Checkbox Tri-State
Enrico, 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
But I hope that there is a easier way
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Checkbox Tri-State
Here it is:
EMG
Code: Select all | Expand
nCsn = 2
REDEFINE CHECKBOX oCsn VAR csn;
ID 111 OF oDlgAna;
ON CLICK ( ::SendMsg( BM_SETCHECK, ( nCsn + 1 ) % 3 ),;
nCsn := ::SendMsg( BM_GETCHECK ) )
EMG
Re: Checkbox Tri-State
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
I want to change the var to work as a integer instead of logical
0 = Unchecked
1 = Checked
2 = Full Checked
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Checkbox Tri-State
Error description: Error BASE/1003 Variable does not exist: BM_GETCHECK
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Checkbox Tri-State
Code: Select all | Expand
// Button messages
#define BM_GETCHECK 240
#define BM_SETCHECK 241
#define BM_GETSTATE 242
#define BM_SETSTATE 243
#define BM_SETSTYLE 244
EMG
Re: Checkbox Tri-State
Now It's working fine!
Thanks a lot
Thanks a lot
Code: Select all | Expand
#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
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
xHarbour 1.2.3 + Fwhh 20.2