xj qian
2024-06-28 69ca48293b089073a494c36faafaee3f0c83e7a4
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
þÿ#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xcell.hpp>
 
 
 
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
 
using xml = KXMLDOMDocument;
    class  __declspec(dllexport)  memoeditnew : public xwin
    {
    public:
        memoeditnew(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
    public:
        static memoeditnew* CreateInstance(void* implPtr, void* hWnd)
        {
            memoeditnew* pWin = new memoeditnew(implPtr, (HWND)hWnd);
            return pWin;
        }
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmOK")
            {
                if (GetWinParam())
                {
                    xcontrol xc = GetControl(L"MemoTxt");
                    xstring str = L"" + xc.GetText();
                    //trace(str);
                    /*xsedit xc = new xsedit;
                    xc.setNativePointer(GetControl(L"MemoTxt"));
                    xstring str;
                    xc.GetContent(str);*/
                    int p = GetWinParam();
                    xaserverarg arg ;
                    arg.AddArg(L"value", L"" + str);
                    arg.AddArg(L"comdid", L"" + comdid);
                }
            }
            CloseWindow();
            return 0;
        }
 
        //T}NäYtN‹Nö
        int OnXCommand(TEvent* evt, LPARAM p)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
 
 
        int OnAttachEvent()
        {
            //~Ñ[š]åQwgap¹QûN‹Nö
            AttachEvent(L"WM_XCOMMAND", (FEvent)&memoeditnew::OnXCommand);
            return 1;
        }
 
        int onload()
        {
            SetArg();
            OnAttachEvent();
            if (GetWinParam())
            {
                int p = GetWinParam();
                xaserverarg arg =GetArg();
                
                xcontrol xc = GetControl(L"MemoTxt");
                //trace(arg.GetArgString(L"value"));
                xstring str = L"" + xstring(arg.GetArgString(L"value"));
                
                str = str.replace(L"\r\n", L"\n");
                str = str.replace(L"\n", L"\r\n");
                xc.SetText(str);
 
                /*xsedit xc = new xsedit;
                xc.setNativePointer(GetControl(L"MemoTxt"));
                xstring str = L""+arg.GetArgString(L"value");
                xc.LoadContent(str,L".xml");*/
            }
            return 1;
        }
    };