2014-01-17 82 views
2

使用SysInetHTMLEditor我需要在Dynamics AX 2009中在2009年斧

提供一個HTML編輯器功能,我在我的窗體調用由SysInetHTMLEditor提供的HTML編輯器找出一個按鈕。

我可以調用形式這樣的代碼:

SysInetHTMLEditor editor; 
; 

editor = new SysInetHTMLEditor(); 
editor.run(); 

但我不知道如何使用的迴歸,設置初始文本等。

我仍在搜索關於該類的文檔,但找不到它。

有人可以提供一些例子嗎?

回答

1

最後我找到了解決方案。首先,構建一個擴展SysInetHTMLEditor的類。

構建方法文本:

str text(str text = '') 
{ 
    int i; 
; 
    if (prmisdefault(text)) 
     return super(); 

    i = strscan(text, '<body', 1, strlen(text)); 
    if (i) 
    { 
     text = strdel(text, i, strscan(text, '>', i, strlen(text))-i+1); 
    } 

    return super(text); 
} 
  • 使用 「this.text(sometext)」 設置初始文本(通常在新方法)
  • 覆蓋保存()保存文本(送它與this.text())
  • 倍率字幕方法來改變字幕
  • 倍率canClose()
  • 在退出之前保存騎isToolEnabled用於控制工具:

    布爾isToolEnabled(INT commandId,INT標籤) { 開關(製表符) { 情況#TABSource: 開關(commandId) { 情況#TOOL_SAVE: 返回真; } return false;

    case #TABPreview: 
        return false; 
    
    case #TABNormal: 
        switch (commandId) 
        { 
         case #TOOL_SAVEAS: 
         case #TOOL_NEW: 
         case #TOOL_OPEN: 
         case #TOOL_MENU_ELEMENT: 
    
         case #TOOL_MAKEABSOLUTE: 
         case #TOOL_BRINGTOFRONT: 
         case #TOOL_SENDTOBACK: 
         case #TOOL_BRINGFORWARD: 
         case #TOOL_SENDBACKWARD: 
         case #TOOL_BRINGABOVETEXT: 
         case #TOOL_SENDBELOWTEXT: 
         case #TOOL_LOCKELEMENT: 
    
         case #TOOL_INSERTWEBPART: 
         case #TOOL_INSERTACTIVEX: 
         case #TOOL_INSERTWEBLET: 
         case #TOOL_INSERTAXAPTAMENU: 
         case #TOOL_THEME: 
          return false; 
    
    
         case #TOOL_INSERTBOOKMARKLINK: 
         case #TOOL_HELPSYSTEM: 
         case #TOOL_INSERTHELPLINKMENU: 
         case #TOOL_INSERTFORMRUNLINK: 
         case #TOOL_INSERTEXTHELPLINK: 
         case #TOOL_INSERTFIELDLINK: 
         case #TOOL_INSERTMENUDISPLAYLINK: 
         case #TOOL_INSERTMENUOUTPUTLINK: 
         case #TOOL_INSERTMENUACTIONLINK: 
         case #TOOL_INSERTCLASSLINK: 
         case #TOOL_INSERTMETHODLINK: 
         case #TOOL_INSERTFUNCTIONLINK: 
         case #TOOL_INSERTPROPERTYLINK: 
         case #TOOL_INSERTHELPTITLE: 
         case #TOOL_INSERTIFRAME: 
          return false; 
        } 
    

    } return true; }