xj qian
2024-06-28 50a37dbe8b73033a6295c9794c0f2f1b8db2b469
jrj/project/workflow/workflow.chkdlg_vd.cpp
@@ -1,76 +1,77 @@
class workflow_chkdlg_vd : public win__
#include <wobject/xwin.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xflowchart.hpp>
#include <xcontrol/ximageview.hpp>
using xml = KXMLDOMDocument;
class __declspec(dllexport) workflow_chkdlg_vd : public xwin
      {
public:
   workflow_chkdlg_vd(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
   static workflow_chkdlg_vd* CreateInstance(void* implPtr, void* hWnd)
   {
      workflow_chkdlg_vd* pWin = new workflow_chkdlg_vd(implPtr, (HWND)hWnd);
      return pWin;
   }
public:
         //命令发布函数
         int OnCmdDispatch(string comdid)
         {
            if(this.GetParam())
      if (GetWinParam())
            {
               if(comdid=="xmOK")
         xaserverarg arg = GetArg();
         if (comdid == L"xmOK")
               {
                  control__ xc = new control__;
                  xc.setNativePointer(GetControl("content"));
                  string str = ""+xc.GetText();
                  //trace(str);
                  int iArgs = GetParam();
                  xaserverarg__ arg = new xaserverarg__;
                  arg.setNativePointer(iArgs);
                  arg.AddArg("content",str);
            xcontrol xc = GetControl(L"content");
            arg.AddArg(L"content", xc.GetText());
               }
               arg.AddArg("comdid",comdid);
         arg.AddArg(L"comdid", comdid);
            }
            CloseWindow();
            return 0;
         }
         
         //命令处理事件
         int OnXCommand(ref TXCommandEvent evt,int param)
   int OnXCommand(TEvent* evt, int param)
         {
            return OnCmdDispatch(evt.pStrID);
      return OnCmdDispatch(evt->xcommand.pStrID);
         }
         int OnAttachEvent()
         {
            //绑定工具条点击事件
            AttachEvent("WM_XCOMMAND",OnXCommand);
      AttachEvent(L"WM_XCOMMAND", (FEvent)&workflow_chkdlg_vd::OnXCommand);
      return 1;
         }
         
         
         int onload()
         {
            //alert("新的");
      SetArg();
            OnAttachEvent();
            xaserverarg__ arg;
            if(this.GetParam())
      xaserverarg arg;
      if (GetWinParam())
            {
               int iArgsx = this.GetParam();
               arg = new xaserverarg__;
               arg.setNativePointer(iArgsx);
               //trace(iArgsx);
               control__ xc = new control__;
               xc.setNativePointer(GetControl("content"));
               xc.SetText(""+arg.GetArgString("content"));
         arg = GetArg();
         xcontrol xc = GetControl(L"content");
         xc.SetText(arg.GetArgString(L"content"));
            }
            
            xdwgrid__ dw_loglist = new xdwgrid__;
            dw_loglist.setNativePointer(GetControl("dw_loglist"));
            dw_loglist.openUrl("/sale/view/workflow.view/template/chkdlg/loglist");
      xdwgrid dw_loglist = GetControl(L"dw_loglist");
      dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
            
            if(this.GetParam())
      if (GetWinParam())
            {
               int iArgs = GetParam();
               xaserverarg__ argx = new xaserverarg__;
               argx.setNativePointer(iArgs);
               argx.AddArg("EntityID",arg.GetArgString("EntityID"));
               xml__ x = new xml__;
               x.setNativePointer(xml__ ::CreateInstance());
               url::get("/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
         xaserverarg argx;
         arg = GetArg();
         argx.AddArg(L"EntityID", arg.GetArgString(L"EntityID"));
         xml x;
         xurl::get(L"/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
               dw_loglist.Retrieve(x);
               dw_loglist.SetReadOnly(true);
            }
            
            return 1;
         }
      }
};