gui checkbox problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
hzsyber
Posts: 52
Joined: Tue Apr 01, 2008 2:21 pm
Location: Canton,China.

gui checkbox problem

Post by hzsyber »

i want reset a form,

like web form's reset.

code:

Code: Select all

void UIControl::ResetLoginForm(PostData* postdb)
//Clear All EditBox & CheckBox values
{
	IGUIElement* root = guienv->getRootGUIElement();
	for (int i = 0; i < postdb->CS32Lenth; i++)
		if (root->getElementFromId(postdb->CS32List[i],true)->getType() == EGUIET_EDIT_BOX)
		{
			root->getElementFromId(postdb->CS32List[i], true)->setText(L"");
		}
		else if (root->getElementFromId(postdb->CS32List[i],true)->getType() == EGUIET_CHECK_BOX)
		{
		//	root->getElementFromId(postdb->CS32List[i], true)->   /*Here, how to reset a IGUICheckBox?*/
		}
		 
		
}
How to reset a IGUICheckBox?
skumar
Posts: 201
Joined: Thu Feb 14, 2008 6:24 pm
Location: kerala state india
Contact:

Post by skumar »

You should go through the API docs first , before programming or else you may get stuck with simple things....To set the state of a checkbox use setChecked(bool) function.....
skumar
hzsyber
Posts: 52
Joined: Tue Apr 01, 2008 2:21 pm
Location: Canton,China.

Post by hzsyber »

yes,i found irr API doc

root->getElementFromId(postdb->CS32List, true)->
no setChecked(bool) function.this function is under class IGUICheckBox

i no found function return is IGUICheckBox,except addCheckBox() :(.
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Presuming that you know its a check box:

Code: Select all

((IGUICheckBox*)root->getElementFromId(postdb->CS32List[i], true)->)setChecked(...)
use IGUIElement::getType () to be certain.
hzsyber
Posts: 52
Joined: Tue Apr 01, 2008 2:21 pm
Location: Canton,China.

Post by hzsyber »

Ion Dune wrote:Presuming that you know its a check box:

Code: Select all

((IGUICheckBox*)root->getElementFromId(postdb->CS32List[i], true)->)setChecked(...)
use IGUIElement::getType () to be certain.
yes!

thanks you!
Post Reply