Exemple #1
0
/** \brief Test if a checkbox is checked.
 *  \returns true if the Checkbox is checked.
 */
int UI_Lua::IsChecked(lua_State *L){
	int n = lua_gettop(L);  // Number of arguments
	if (n != 1)
		return luaL_error(L, "Got %d arguments expected 1 (self)", n);

	Checkbox *box = (Checkbox*)checkWidget(L,1);
	luaL_argcheck(L, box->GetMask() & WIDGET_CHECKBOX, 1, "`Checkbox' expected.");

	lua_pushboolean(L, (int) box->IsChecked() );

	return 1;
}
Exemple #2
0
void CheckOption( void* checkbox, void*option )
{
	Checkbox *box = (Checkbox *)checkbox;
	SETOPTION( (char*)option, box->IsChecked() );
}