버튼 타입 가이드
버튼 컴포넌트의 버튼 유형 및 눌림 상태에 대한 샘플 화면이다.
관련 속성으로 button_type, push_state가 있다.
관련 API로 getbuttontype, getstatuspush, setstatuspush, togglestatuspush가 있다.
예시
화면 스크립트
// "getbuttontype" 버튼 이벤트
function btn_getbuttontype_on_click(objInst)
{
// 버튼 타입을 구하여 필드에 표시
fld_buttontype.settext(btn_push.getbuttontype());
}
//"getstatuspush/setstatuspush" 버튼 이벤트
function btn_statuspush_on_click(objInst)
{
//버튼 눌림 상태 기준 내부 데이터 값(true/false 속성값)을 반환
var is_push_state;
is_push_state = btn_push.getstatuspush();
factory.consoleprint("before getstatuspush = " + is_push_state);
// 토글 처리
btn_push.setstatuspush(!is_push_state);
is_push_state = btn_push.getstatuspush();
factory.consoleprint("after getstatuspush = " + is_push_state);
}
// "togglestatuspush" 버튼 이벤트
function btn_togglestatuspush_on_click(objInst)
{
btn_push.togglestatuspush();
}