LiFan
2024-07-16 f087a50629e95666db2e0b0ba4373834e2b9593b
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
use "win.vl"
use "treeview.vm"
use "dev:vm[xdwgrid.vm]"
use "dev:vm[xdwtable.vm]"
use "pref.vl"
use "dev:vm[xml.vm]"
use "dev:vm[xaserverarg.vm]"
use "dev:vm[xaserver.vm]"
use "dev:vm[xutil.vm]"
use "dev:vm[control.vm]"
 
unit vbusiness.xpage
[
    AddUomGroup is extend win__;
    about AddUomGroup
    [
        control:
        
        method:
        [
 
            
            int SetAgent()
            {
                return 1;
            }
            //½¹µã¼¤»î´¦Àíº¯Êý
            int OnSetFocus(ref TEvent evt,int p)
            {
                int SetAgent();
 
                //ÖØÖù¤¾ßÌõ
                return 1;
            }
 
            //ÃüÁî·¢²¼º¯Êý
            int OnCmdDispatch(string comdid)
            {
                if (comdid=="cb_cancel")
                    CloseWindow();
                else if(comdid=="cb_ok")
                {
                    control__ xc = new control__;
                    xc.setNativePointer(this.GetControl("Txt"));                
                    string name = xc.GetText();                
                    xaserverarg__ arg=new xaserverarg__;
                    arg.setNativePointer(arg.CreateInstance());    
                    arg = GetParam();
                    arg.AddArg("GroupName",name);
                    arg.AddArg("return","ok");
                    CloseWindow();                
                }
                return 0;
            }
            
            //ÃüÁî´¦Àíʼþ
            int OnXCommand(ref TXCommandEvent evt,int p)
            {
                return OnCmdDispatch(evt.pStrID);
            }
            
            int OnAttachEvent()
            {
                //°ó¶¨¹¤¾ßÌõµã»÷ʼþ
                AttachEvent("WM_XCOMMAND",OnXCommand);
                //»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ
                AttachEvent("WM_SETFOCUS",OnSetFocus);
            }
            
            int OnInitial()
            {
                SetAgent();
 
                OnAttachEvent();
                
                return 1;
            }
            
 
            
            int onload()
            {
                OnInitial();
                
                if(this.GetParam())
                {
 
                    if (GetParam())
                    {
                        xaserverarg__ arg=new xaserverarg__;
                        arg.setNativePointer(arg.CreateInstance());    
                        arg = GetParam();                    
                        string note = arg.GetArgString("note");
                        if(note=="ÐÞ¸Ä")
                        {    
                            string name = arg.GetArgString("GroupName");    
                            control__ xc = new control__;
                            xc.setNativePointer(GetControl("Txt"));
                            xc.SetText(name);                            
                        }    
                        string id = arg.GetArgString("m_id");
                        if(id =="FND_UOM")
                        {    
                            win__::SetWindowText(this.GetHWND(),"¼ÆÁ¿µ¥Î»");                        
                        }
                        else if(id =="FND_CustomerSource")
                        {    
                            win__::SetWindowText(this.GetHWND(),"¿Í»§À´Ô´");                        
                        }
                        else if(id =="FND_AuxiliaryAttribute")
                        {    
                            win__::SetWindowText(this.GetHWND(),"¸¨ÖúÊôÐÔ");                        
                        }                        
                    }
                }
                
                return 1;
            }
        ]
        
    ]
]