LiFan
2024-07-08 48666c5e1add6272d75fccebf3218c01ec9c8c79
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
þÿ#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/ximageview.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) PaperImageView : public xframe
    {
 
    public:
        PaperImageView(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static PaperImageView* CreateInstance(void* implPtr, void* hWnd)
        {
            PaperImageView* pWin = new PaperImageView(implPtr, (HWND)hWnd);
            return pWin;
        }
 
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmClose")
            {
                CloseWindow();
                return 1;
            }
            return 0;
        }
 
        int OnXCommand(TEvent* evt, LPARAM p)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
 
        int OnAttachEvent()
        {
            AttachEvent(L"WM_XCOMMAND", (FEvent)&PaperImageView::OnXCommand);
            return 1;
        }
 
        int onload()
        {
            SetArg();
            OnAttachEvent();
            xaserverarg arg;
            
            int p = GetArg();
            
            xstring guid = arg.GetArgString(L"guid");
            xstring str = guid.mid(0, 2);
            trace(L"=====str:" + str + L"=====guid:" + guid);
            xstring picname = L"/business/products/chanpin/" + str + L"/" + guid + L".jpg";
            ximageview im = GetControl(L"im1");
            im.Reset();
            im.AddImages(picname, L"");
            im.Redraw();
            return 1;
        }
    };