Param

Method

Event

 

 

CE_OnCustomMenuv1.6 higher

Params의 AddMenu로 추가된 Custom 메뉴가 선택되었을 때 발생하는 이벤트입니다.

 

Syntax

    void CE_OnCustomMenu (
    BSTR type
    Object editorTarget
    BSTR editorName
    BSTR customMenuID
    BSTR customMenuX
    BSTR customMenuY
    );

Parameters

[out] 이벤트 발생 시 아래와 같은 객체를 반환 합니다.

객체명

용도

구분

type

이벤트 발생 type(custommenu_function or custommenu_plugin)

이벤트 공통

editorTarget

에디터 메인 클래스 객체

이벤트 공통

editorName

설정된 에디터 이름

이벤트 공통

customMenuID

설정된custom메뉴 ID

CE_OnCustomMenu 공통

customMenuX

에디터 X위치값

CE_OnCustomMenu 내 custommenu_plugin type

customMenuY

에디터 Y위치값

CE_OnCustomMenu  내 custommenu_plugin type

 

Remarks

크로스에디터의 Main class 호출 후 에디터가 로드된 다음 메소드를 실행해야 정상적으로 실행이 됩니다.

발생한 이벤트 type이 custommenu_plugin일 경우 return 값으로 사용자가 생성한 플러그인 객체를 넘겨주어야 크로스에디터와 연동이 됩니다.

 

Sample Codes

<Plugin>

Ex>

<div id=”CustomLayer” style=”position:absolute; display:none;z-index:1”>

  <table border='1px' bgcolor='white'>

    <tr>

     <td>크로스에디터 Custom 메뉴 플러그 인 입니다.</td>

    </tr>

 </table>

</div>

JavaScript

function CE_OnCustomMenu(e){
  if (!e) return;
  if (e.type == 'custommenu_plugin' && e.customMenuID == ‘userMenu’){
   //레이어가 위치 할 포지션 지정
   document.getElementById(CustomLayer).style.top=e.customMenuY;
   document.getElementById(CustomLayer).style.left=e.customMenuX;

   document.getElementById("CustomLayer").style.display  = "";
   return document.getElementById("CustomLayer");
  }
 }

 

<Function>

JavaScript

function CE_OnCustomMenu(e){
  if (!e) return;
  if (e.type=='custommenu_function' && e.customMenuID == ‘userMenu’){
        //실행할 스크립트 구문
     alert(“ID : ” + e.customMenuID + “\n” + “Type : ” + e.type); 
   }
  }