¶Ô±ÈÐÂÎļþ |
| | |
| | | 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]" |
| | | |
| | | unit vbusiness.xpage |
| | | [ |
| | | HrOrgChart is extend win__; |
| | | about HrOrgChart |
| | | [ |
| | | control: |
| | | |
| | | method: |
| | | [ |
| | | treeview__ tv_org; |
| | | xdwtable__ dw_parent; |
| | | int m_bCanDestroy; |
| | | |
| | | xnode__ m_agentNode; //Agent Condition |
| | | string m_agentCond; //Agent Node |
| | | |
| | | int OnTreeSelChanged(ref TNotifyEvent evt, int p) |
| | | { |
| | | ref NMTREEVIEW nmtv = evt.pnmh; |
| | | int hitem = nmtv.itemNew.hItem; |
| | | if (hitem == 0) |
| | | hitem = treeview__::GetRootItem(tv_org.GetId()); |
| | | string label = treeview__::GetItemLabel(tv_org.GetId(), hitem); |
| | | string pUnit; |
| | | pUnit = treeview__::GetItemLabel(tv_org.GetId(), hitem) + "\\"; |
| | | int pitem = treeview__::GetParentItem(tv_org.GetId(), hitem); |
| | | while (pitem > 0) |
| | | { |
| | | pUnit = treeview__::GetItemLabel(tv_org.GetId(), pitem) + "\\" + pUnit; |
| | | pitem = treeview__::GetParentItem(tv_org.GetId(), pitem); |
| | | } |
| | | msxml::IXMLDOMElement ele = treeview__::GetItemData(tv_org.GetId(), hitem); |
| | | string guid = ele.SelectSingleNode("@guid").text; |
| | | |
| | | //CloseWindow(); |
| | | return 1; |
| | | } |
| | | |
| | | int OnActive(ref TEvent evt, int p) |
| | | { |
| | | /*int WA_INACTIVE = 0; |
| | | int WA_ACTIVE = 1; |
| | | int WA_CLICKACTIVE = 2; |
| | | int lw = evt.wParam & 0xffff; |
| | | if( lw ==WA_INACTIVE && m_bCanDestroy==1 ) |
| | | { |
| | | win__::CloseWindow(); |
| | | return 1; |
| | | } |
| | | if(lw !=WA_INACTIVE)m_bCanDestroy = 1; |
| | | return 1;*/ |
| | | } |
| | | |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | int OnSetFocus(ref TEvent evt, int p) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | int OnOK(string comdid) |
| | | { |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg = win__::GetParam(); |
| | | arg.AddArg("comdid", comdid); |
| | | int hitem = treeview__::GetSelectedItem(tv_org.GetId()); |
| | | if (hitem > 0) |
| | | { |
| | | msxml::IXMLDOMElement ele = treeview__::GetItemData(tv_org.GetId(), hitem); |
| | | string guid = ele.SelectSingleNode("@guid").text; |
| | | string label = ele.selectSingleNode("OrgName").text; |
| | | arg.AddArg("OrgName", label); |
| | | arg.AddArg("OrgId", guid); |
| | | win__::CloseWindow(); |
| | | } |
| | | else |
| | | win__::MessageBox(GetHWND(), "è¯·éæ©ç»ç»ï¼", "æç¤º", 0); |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(string comdid) |
| | | { |
| | | int hCursor = xutil__::SetCursorWait(); |
| | | if (comdid == "xmOk") |
| | | OnOK(comdid); |
| | | else if (comdid == "xmCancel") |
| | | CloseWindow(); |
| | | xutil__::RestoreCursor(hCursor); |
| | | return 0; |
| | | } |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(ref TXCommandEvent evt, int p) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent("WM_XCOMMAND", OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent("WM_SETFOCUS", OnSetFocus); |
| | | AttachEvent("tv_org", "TVN_SELCHANGED", OnTreeSelChanged); |
| | | //AttachEvent("WM_ACTIVATE",OnActive); |
| | | } |
| | | |
| | | int OnInitial() |
| | | { |
| | | OnAttachEvent(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | m_bCanDestroy = 1; |
| | | tv_org = new treeview__; |
| | | tv_org.setNativePointer(this.GetControl("tv_org")); |
| | | OnInitial(); |
| | | |
| | | int root = treeview__::GetRootItem(tv_org.GetId()); |
| | | treeview__::ExpandItemEx(tv_org.GetId(), root); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | ] |
| | | |
| | | ] |
| | | ] |