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.
hzsyber
Posts: 52 Joined: Tue Apr 01, 2008 2:21 pm
Location: Canton,China.
Post
by hzsyber » Mon Dec 29, 2008 6:09 am
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 » Mon Dec 29, 2008 6:38 am
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 » Mon Dec 29, 2008 7:38 am
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 » Mon Dec 29, 2008 7:58 am
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 » Mon Dec 29, 2008 9:01 am
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!