#pragma once 
 | 
  
 | 
#include <wobject/xwin.hpp> 
 | 
#include <wobject/xurl.hpp> 
 | 
#include <wobject/xapp.hpp> 
 | 
class responsewin : public xframe 
 | 
{ 
 | 
public: 
 | 
    responsewin(void* impl, HWND hWnd) :xframe(impl, hWnd) {} 
 | 
    virtual int SetAgent() 
 | 
    { 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    virtual int PreOnSetFocus() 
 | 
    { 
 | 
        //·µ»Ø0¡ª¡ª²»ÔÚÖ´ÐÐÒÔÏ´úÂ룻·µ»ØÆäËû¡ª¡ªÖ´ÐÐÒÔÏ´úÂë¡£ 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    //½¹µã¼¤»î´¦Àíº¯Êý 
 | 
    int OnSetFocus(TEvent* evt, int p) 
 | 
    { 
 | 
        //ÖØÖù¤¾ßÌõ 
 | 
        SetAgent(); 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    virtual int PreOnCmdDispatch(xstring comdid) 
 | 
    { 
 | 
        //·µ»Ø0¡ª¡ª²»ÔÚÖ´ÐÐÒÔÏ´úÂ룻·µ»ØÆäËû¡ª¡ªÖ´ÐÐÒÔÏ´úÂë¡£ 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    virtual int PostOnCmdDispatch(xstring comdid, int rtn) 
 | 
    { 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    int OnCmdDispatch(xstring comdid) 
 | 
    { 
 | 
        int rtn = 0; 
 | 
        if (PreOnCmdDispatch(comdid) == 0) 
 | 
            return 1; 
 | 
  
 | 
        if (comdid.find(L"action:", 0) >= 0) 
 | 
            rtn = ProcessFlowAction(comdid, 1); 
 | 
  
 | 
        if (PostOnCmdDispatch(comdid, rtn) != 1) 
 | 
        { 
 | 
            alert(L"error"); 
 | 
            return 1; 
 | 
        } 
 | 
  
 | 
        return rtn; 
 | 
    } 
 | 
  
 | 
    //ÃüÁî´¦Àíʼþ 
 | 
    int OnXCommand(TEvent* evt, int p) 
 | 
    { 
 | 
        /*xwin::SendMessage(sPHWND.toInt(),0x401,sAssortmentHwnd,0); 
 | 
        struct TEvent 
 | 
        { 
 | 
            int        hWnd; //this.GetHWND().toString() 
 | 
            int        message;//WM_XCOMMAND 0x401, evt.message.toString()ÊÇÊ®½øÖÆ1045 
 | 
            int        wParam; 
 | 
            int        lParam;δʹÓà 
 | 
            int        time; 
 | 
            xpoint    pt; 
 | 
        }; 
 | 
        struct TXCommandEvent : public TEvent 
 | 
        { 
 | 
            native string pStrID; 
 | 
        };*/ 
 | 
        //string str = "ccc"+evt.wParam.toString();  
 | 
        //alert(str); 
 | 
        return OnCmdDispatch(evt->xcommand.pStrID); 
 | 
    } 
 | 
  
 | 
    int OnClose(TEvent* evt, int p) 
 | 
    { 
 | 
  
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    virtual int PostOnAttachEvent() 
 | 
    { 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    int OnAttachEvent() 
 | 
    { 
 | 
        //°ó¶¨¹¤¾ßÌõµã»÷ʼþ 
 | 
        AttachEvent(L"WM_XCOMMAND", (FEvent)&responsewin::OnXCommand); 
 | 
        //»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ 
 | 
        AttachEvent(L"WM_SETFOCUS", (FEvent)&responsewin::OnSetFocus); 
 | 
        //AttachEvent("WM_CLOSE",OnClose); 
 | 
  
 | 
        PostOnAttachEvent(); 
 | 
        return 0; 
 | 
    } 
 | 
  
 | 
    virtual int OnInit() 
 | 
    { 
 | 
        return 1; 
 | 
    } 
 | 
  
 | 
    int onload() 
 | 
    { 
 | 
        SetAgent(); 
 | 
        OnAttachEvent(); 
 | 
  
 | 
        OnInit(); 
 | 
        return 1; 
 | 
    } 
 | 
}; 
 |