Page MenuHomeFeedback Tracker

cbChecked always returns false
Closed, ResolvedPublic

Description

cbChecked is always returning false, regardless what the state an rscTextCheckBox actually is in. Additionally, cbSetChecked also does not produce any change to the state of a rscTextCheckBox.

Details

Legacy ID
910288770
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce

See code in additional information. Note that '_this select 2' passed from ctrlSetEventHandler shows that the state of the checkbox is changing, yet cbChecked shows false no matter what.

Additional Information

class M_RscTextCheckbox
{
idc = -1;
type = CT_CHECKBOXES;
style = ST_CENTER;
font = "PuristaBold";
sizeEx = 0.024;
x = 0;
y = 0;
w = 0.2;
h = 0.2;
color[] = {0.14,0.14,0.14,1};
colorSelect[] = {0.72,0.73,0.73,1};
colorTextDisable[] = {0.92,0.74,0.13,0.5};
colorDisable[] = {0.72,0.73,0.73,1};
colorText[] = {0.72,0.73,0.73,1};
colorTextSelect[] = {0.92,0.74,0.13,1};
colorSelectedBg[] = {0.14,0.14,0.14,1};
rows = 1;
columns = 1;
strings[] = {"OFF"};
checked_strings[] = {"ON"};
};

class M_Dialog
{
idd = 101010;
movingEnable = true;

class controls
{

		class M_Make_Sign: M_RscTextCheckbox
		{
			idc = 11111;
			x = 25 * GUI_GRID_W + GUI_GRID_X;
			y = 21.25 * GUI_GRID_H + GUI_GRID_Y;
			w = 6 * GUI_GRID_W;
			h = 1 * GUI_GRID_H;
			strings[] = {"No Sign"};
			checked_strings[] = {"Make Sign"};
			toolTip = "'Make Sign' creates a sign";
		};

};
};

_disp = findDisplay 101010;
_ctrl = _disp displayCtrl 11111;
_ctrl ctrlSetEventHandler ["CheckBoxesSelChanged", "_this call EH_CB_Make_Sign_Changed"];

EH_CB_Make_Sign_Changed =
{
_ctrl = _this select 0;
_checked = cbChecked _ctrl;
systemChat (str _checked);
systemChat (str _this);
};

Event Timeline

Jacmac edited Steps To Reproduce. (Show Details)Apr 2 2014, 10:35 PM
Jacmac edited Additional Information. (Show Details)
Jacmac set Category to Scripting.
Jacmac set Reproducibility to Always.
Jacmac set Severity to None.
Jacmac set Resolution to No Bug.
Jacmac set Legacy ID to 910288770.May 7 2016, 6:20 PM

cbChecked and cbSetChecked is for the new checkboxes (type = 77).

for the (old) textual checkboxes (type = 7) use https://community.bistudio.com/wiki/ctrlChecked and https://community.bistudio.com/wiki/ctrlSetChecked