화면 » Api

toastmessage

Description

토스트 메세지박스를 로드하는 API이다.

토스트 메시지박스는 주로 알림성 메시지를 표시하기 위한 용도로 사용된다.

토스트 메시지박스는 일반 메시지박스와 다르게 화면을 잠그지 않는다.

Parameters

Parameters Type Description
strTitle STRING 메세지 제목
strMsg STRING 메시지 내용
nCloseTimeout short [옵션] 자동 닫기 타임아웃 (단위: ms) (기본값: 0)
nType short [옵션] 메시지 유형 (기본값: 0)
nAnchor short [옵션] 메시지 표시 위치 (기본값: 5)
nWidth short [옵션] 메시지 박스 너비 (기본값: 400)
strCustomClass STRING [옵션] 메시지 박스 CSS 클래스 이름 (기본값: null)
strUserData STRING [옵션] 사용자 정의 데이터 (기본값: 공백문자열)

Return Value

Type Description
STRING 메시지 ID

Remark

nCloseTimeout 파라미터는 자동으로 토스트 메시지를 닫을 타임아웃을 지정한다. 0으로 지정하는 경우, 자동 닫힘 처리를 수행하지 않는다.

strUserData 파라미터는 토스트 메시지에 부가적인 데이터를 지정하기 위한 용도이며, 화면의 on_toastmessage 이벤트에 전달된다.

* nType 파라미터는 토스트 메시지 유형을 지정한다.
0: none
1: info
2: success
3: warn
4: error
* nAnchor 파라미터는 토스트 메시지 표시 위치을 지정한다.
0: top-left
1: bottom-left
2: top-right
3: bottom-right
4: middle-center
5: top-center
6: middle-center
7: middle-right
8: bottom-center

Example

function btn_test_on_mouseup(objInst) { screen.toastmessage("일반 메시지", "TOAST_CONTENT", 0, 0); screen.toastmessage("정보 메시지", "TOAST_CONTENT", 0, 1); screen.toastmessage("성공 메시지", "TOAST_CONTENT", 0, 2); screen.toastmessage("경고 메시지", "TOAST_CONTENT", 0, 3); screen.toastmessage("오류 메시지" "TOAST_CONTENT", 0, 4); screen.toastmessage("INFO", "5초후에 자동 닫힘 메시지", 5000, 1); } function btn_test2_on_mouseup(objInst) { var arr_title, arr_msg; arr_msg = []; // 메시지 1번째 라인 arr_msg.push("<span style=\""); arr_msg.push("display:block;"); arr_msg.push("line-height:1.8;"); // 줄간격 arr_msg.push("color:blue;"); arr_msg.push("text-decoration:underline;"); arr_msg.push("\">"); arr_msg.push("첫번째 라인: 파란색 언더라인"); arr_msg.push("</span>"); // 메시지 2번째 라인 arr_msg.push("<span style=\""); arr_msg.push("display:block;"); arr_msg.push("line-height:1.8;"); // 줄간격 arr_msg.push("color:red;"); arr_msg.push("\">"); arr_msg.push("2번째 라인: 빨간색"); arr_msg.push("</span>"); screen.toastmessage("<span style=\"color: gray;\">회색 타이틀</span>", arr_msg.join(""), 0, 0, 5, 400, "custom_toast_class"); }

See Also

toastmessageclose

Viewer Ver.

9.1.1.1

Update Date

20240507