LiFan
2025-02-13 03ef0b51103c735077c784c7df81ae2bcc1599ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
 
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
#include "vbusiness/vframe/frame.vframe.vbusiness.hpp"
 
 
using xml = KXMLDOMDocument;
    class __declspec(dllexport) ViewTotalArgWin : public xframe
    {
    public:
        xdwtable dw_arg;
        xaserverarg  arg;
        xnode    m_agentNode;    //Agent Condition
    public:
        ViewTotalArgWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static ViewTotalArgWin* CreateInstance(void* implPtr, void* hWnd)
        {
            ViewTotalArgWin* pWin = new ViewTotalArgWin(implPtr, (HWND)hWnd);
            return pWin;
        }
        /*int SetAgent()
        {
            xstring xfNodeAgentArea  = L"agentarea";
            xnode anode = GetAgentNode(xfNodeAgentArea);
            if(m_agentNode)
            {
                SetAgentNodeContent (anode,m_agentNode);
            }
            else
            {
                msxml::IXMLDOMElement xframeElement =  GetElement();
                msxml::IXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
                if(agent)
                {
                    xstring s = agent.xml;
                    m_agentNode =  SetAgentNodeContent (anode,s);
                }
            }
            return 1;
        }*/
        
        //½¹µã¼¤»î´¦Àíº¯Êý
        int OnSetFocus(TEvent * evt, int param)
        {
            //ÖØÖù¤¾ßÌõ
            //SetAgent();
            return 1;
        }
 
        //ÃüÁî·¢²¼º¯Êý
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmOk")
            {
                xml x;
                
                dw_arg.AcceptText();
                dw_arg.DwUpdateAllTo(x);
                //trace(L"--------" + x.xml());
                arg.AddArg(L"arg", x.xml());
                arg.AddArg(L"action", L"ok");
                CloseWindow();
 
                return 1;
            }
            else if (comdid == L"xmCancel")
            {
                arg.AddArg(L"action", L"cancel");
                CloseWindow();
                return 1;
            }
            return 0;
        }
 
        //ÃüÁî´¦Àíʼþ
        int OnXCommand(TEvent* evt, int param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
 
        int OnAttachEvent()
        {
            //°ó¶¨¹¤¾ßÌõµã»÷ʼþ
            AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewTotalArgWin::OnXCommand);
            //»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ
            AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewTotalArgWin::OnSetFocus);
            return 1;
        }
 
        int onload()
        {
            SetArg();
            dw_arg = GetControl(L"dw_arg");
 
            if (GetWinParam())
            {
                arg = GetArg();
                xstring dw = arg.GetArgString(L"argurl");
                dw_arg.openUrl(dw);
 
                dw_arg.SetColHeaderHeight(0);
                dw_arg.SetRowSelectorWidth(0);
                dw_arg.SetHScrollState(false);
                dw_arg.SetVScrollState(false);
 
                xstring d = arg.GetArgString(L"arg");
                if (d != L"")
                {
                    xml x ;
                    
                    x.loadXML(d);
                    dw_arg.Retrieve(x);
                }
            }
            dw_arg.SetEditUpperMode(true);
            dw_arg.SetItemString(1, L"QuoteSuccess/type", L"ÊÇ");
            dw_arg.SetItemString(1, L"ApprovalStatusName", L"6");
            dw_arg.SetItemDisplayString(1, L"ApprovalStatusName", L"ÒÑÉóºË");
            dw_arg.SetItemString(1, L"GDN.ETD/type", L"ÈÕÆÚ·¶Î§");
            dw_arg.SetItemString(1, L"QuoteSuccess/type", L"ÊÇ");
 
            OnAttachEvent();
 
            return 1;
        }
 
        int onloaded()
        {
            //SetAgent();            
 
            return 1;
        }
    };