þÿ#include <wobject/xstring.hpp> #include <xcontrol/xtreeview.hpp> #include <xcontrol/xdwgrid.hpp> #include <xcontrol/xcheckbox.hpp> //#include <xcontrol/xedit.hpp> #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" #include "viewobject/view.base.hpp" using xml = KXMLDOMDocument; class __declspec(dllexport) PaymentEdit : public xframe { public: xstring Paymentmethod = L""; xstring currbox; public: PaymentEdit(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} public: static PaymentEdit* CreateInstance(void* implPtr, void* hWnd) { PaymentEdit* pWin = new PaymentEdit(implPtr, (HWND)hWnd); return pWin; } int OnOK() { xaserverarg arg = GetArg(); if (currbox == L"cbx1") { xcheckbox cbx1_val1 = GetControl(L"cbx1_val1"); Paymentmethod = L"ÛNÓT" + cbx1_val1.GetText() + L"Y)QíSÑyhNØn"; } else if (currbox == L"cbx2") { xcheckbox cbx2_val1 = GetControl(L"cbx2_val1"); xcheckbox cbx2_val2 = GetControl(L"cbx2_val2"); Paymentmethod = L"N§RMh7xn‹¤T˜„NØ" + cbx2_val1.GetText() + L"% [š‘Ñÿ OYk>" + cbx2_val2.GetText() + L"Y)QíSÑyhNØn"; } else if (currbox == L"cbx3") { xcheckbox cbx3_val1 = GetControl(L"cbx3_val1"); xcheckbox cbx3_val2 = GetControl(L"cbx3_val2"); xcheckbox cbx3_val3 = GetControl(L"cbx3_val3"); Paymentmethod = L"N§RMh7xn‹¤T˜„NØ" + cbx3_val1.GetText() + L"% [š‘Ñÿ šŒ'ThR0Sэ'ÿ OYk>" + cbx3_val3.GetText() + L"Y)QíSÑyhkcg,NØn"; } else if (currbox == L"cbx4") { Paymentmethod = L"šŒ'ThR0Sэ'"; } else if (currbox == L"cbx5") { xcheckbox cbx5_val1 = GetControl(L"cbx5_val1"); xcheckbox cbx5_val2 = GetControl(L"cbx5_val2"); Paymentmethod = L"šŒ'ThR0Sэ'ÿ OYk>" + cbx5_val2.GetText() + L"Y)QíSÑyhNØn"; } else if (currbox == L"cbx6") { xcheckbox cbx6_val1 = GetControl(L"cbx6_val1"); Paymentmethod = L"N§RMh7xn‹¤T˜„NØ " + cbx6_val1.GetText() + L"% [š‘Ñÿ OYk>šŒ'ThR0Sэ'"; } else { Paymentmethod = L""; } arg.AddArg(L"Paymentmethod", Paymentmethod); CloseWindow(); return 1; } int OnCmdDispatch(xstring comdid) { if (comdid == L"xmClose") { CloseWindow(); return 1; } else if (comdid == L"xmOK") { OnOK(); } return 0; } int OnXCommand(TEvent* evt, LPARAM p) { return OnCmdDispatch(evt->xcommand.pStrID); } int OnCkbCLick(TEvent* evt, LPARAM p) { LPARAM param = evt->lParam; xcheckbox cbx_1 = GetControl(L"cbx1"); int state1 = cbx_1.GetCheck(); xcheckbox cbx_2 = GetControl(L"cbx2"); int state2 = cbx_2.GetCheck(); xcheckbox cbx_3 = GetControl(L"cbx3"); int state3 = cbx_3.GetCheck(); xcheckbox cbx_4 = GetControl(L"cbx4"); int state4 = cbx_4.GetCheck(); xcheckbox cbx_5 = GetControl(L"cbx5"); int state5 = cbx_5.GetCheck(); xcheckbox cbx_6 = GetControl(L"cbx6"); int state6 = cbx_6.GetCheck(); if ((HWND)param == cbx_1.GetHWND()) { cbx_2.SetUnCheck(); cbx_3.SetUnCheck(); cbx_4.SetUnCheck(); cbx_5.SetUnCheck(); cbx_6.SetUnCheck(); if (state1 == 1) { currbox = L"cbx1"; } else { currbox = L""; } } else if ((HWND)param == cbx_2.GetHWND()) { cbx_1.SetUnCheck(); cbx_3.SetUnCheck(); cbx_4.SetUnCheck(); cbx_5.SetUnCheck(); cbx_6.SetUnCheck(); if (state2 == 1) { currbox = L"cbx2"; } else { currbox = L""; } } else if ((HWND)param == cbx_3.GetHWND()) { cbx_1.SetUnCheck(); cbx_2.SetUnCheck(); cbx_4.SetUnCheck(); cbx_5.SetUnCheck(); cbx_6.SetUnCheck(); if (state3 == 1) { currbox = L"cbx3"; } else { currbox = L""; } } else if ((HWND)param == cbx_4.GetHWND()) { cbx_1.SetUnCheck(); cbx_2.SetUnCheck(); cbx_3.SetUnCheck(); cbx_5.SetUnCheck(); cbx_6.SetUnCheck(); if (state4 == 1) { currbox = L"cbx4"; } else { currbox = L""; } } else if ((HWND)param == cbx_5.GetHWND()) { cbx_1.SetUnCheck(); cbx_2.SetUnCheck(); cbx_3.SetUnCheck(); cbx_4.SetUnCheck(); cbx_6.SetUnCheck(); if (state5 == 1) { currbox = L"cbx5"; } else { currbox = L""; } } else if ((HWND)param == cbx_6.GetHWND()) { cbx_1.SetUnCheck(); cbx_2.SetUnCheck(); cbx_3.SetUnCheck(); cbx_4.SetUnCheck(); cbx_5.SetUnCheck(); if (state6 == 1) { currbox = L"cbx6"; } else { currbox = L""; } } return 1; } int OnAttachEvent() { AttachEvent(L"WM_XCOMMAND", (FEvent)&PaymentEdit::OnXCommand); AttachEvent(L"WM_COMMAND", (FEvent)&PaymentEdit::OnCkbCLick); return 1; } int onload() { SetArg(); OnAttachEvent(); return 1; } };