Jump to content
dhigh

how to get state of CT_CHECKBOXES

Recommended Posts

Hello,

i want to get the selected items of my checkboxes

when i start my Dialog i can see the X X X and i can click on them and they Change the Color to green,

but when i want to get their state i dont know how

 

i tried lbSelected but i only get an empty array

when i try ctrlChecked i only get the state of the first X. how can i get an Array with all states or how to get the state of the other X.

same with cbSetChecked, dont work to resett them.

 

someone know how to get the states of all the rows?

 

My RscCheckBoxes Define

class RscCheckBoxes
{
  idc = -1;
  type = CT_CHECKBOXES; // defined contant (7)
  style = ST_CENTER; // defined constat (0)



  colorText[] = {1, 0, 0, 0.5};
  color[] = {0, 1, 0, 0.5};  //seems nothing to change, but define to avaoid errors
  colorTextSelect[] = {0, 0.8, 0, 0.5};
  colorSelect[] = {1, 0, 0, 0.5};
  colorTextDisable[] = {0.4, 0.4, 0.4, 0.5};
  colorDisable[] = {0.4, 0.4, 0.4, 0.5};
  colorSelectedBg[] = {0, 0, 0, 0};

  font = "RobotoCondensed";
  sizeEx = 0.05;

};

My Dialog.hpp

			class AntwortBox: RscCheckBoxes
			{
				idc = 200;
 				sizeEx = 0.1;
				rows = 3;
				columns = 1;
				strings[] = {"X","X","X"};

				x = 0.665 * safezoneW + safezoneX;
				y = 0.577 * safezoneH + safezoneY;
				w = 0.04125 * safezoneW;
				h = 0.198 * safezoneH;
			};

 

Share this post


Link to post
Share on other sites

Why CT(controlsTable) control? All this is is a collection/grouping of controls. Its still not going to help you with determining an individual checkBoxes(7) state.

The only way to get the current status of CT_CheckBoxes(7) is by monitoring them with onCheckBoxesSelChanged and storing their current value yourself.

The commands ctrlChecked and ctrlSetChecked seem pretty pointless as they only return/set the status of the first checkbox.

 

TBH you would be better just using normal checkBox(77) and making the grid structure yourself (here I could see a controlsTable being of use). Then you can use the commands cbChecked and cbSetChecked on individual check boxes.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×