Add(InlineCode,3684175,378,154) { WorkPoints=#16:doSetValueByName|20:doSetFocusByName |17:doSetFocusByValue|13:doClickByName|14:doClickByValue|16:doSelectByValue | EventPoints=#10:onSetValue|10:onSetFocus|7:onClick|8:onSelect| DataPoints=#2:ph|4:name|5:value| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|40:uses kol,Share,Debug,ActiveX,KOLSHDocVw;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|18: ph: THI_Event;|20: name: THI_Event;|21: value: THI_Event;|26: onSetValue: THI_Event;|26: onSetFocus: THI_Event;|27: onClick: THI_Event; |28: onSelect: THI_Event; |0:|57: procedure doSetValueByName(var dt:TData; index:word);|61: procedure doSetFocusByName(var dt:TData; index:word); |58: procedure doSetFocusByValue(var dt:TData; index:word);|58: procedure doClickByName(var dt:TData; index:word); |64: procedure doClickByValue(var dt:TData; index:word); |56: procedure doSelectByValue(var dt:TData; index:word);|5: end;|0:|14:implementation|0:|4:type|31: TKOLWebBrowser = PWebBrowser;|31: PKOLWebBrowser = PWebBrowser;|0:|74:function FindIdx(pc: PControl; val: string; FindByName: boolean): Integer;|3:var|13: i: integer;|5:begin|15: Result := -1;|85: for i := 0 to PKOLWebBrowser(pc).OleObject.Document.all.tags('input').length - 1 do|22: if FindByName then|13: begin |88: if PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(i).name = val then|11: begin|20: Result := i;|15: break; |10: end;|7: end|12: else |9: begin|89: if PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(i).value = val then|11: begin|20: Result := i;|15: break; |10: end;|8: end;|6:end; |0:|39:procedure THiAsmClass.doSetValueByName;|3:var|15: pc: PControl;|19: txt, val: string;|15: idx: integer;|5:begin|37: pc := PControl(ToIntegerEvent(ph));|32: if not Assigned(pc) then exit;|30: txt := ReadString(dt, name);|33: val := ReadString(dt, value); |32: idx := FindIdx(pc, txt, true);|24: if idx < 0 then exit; |81: PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(idx).value := val;|26: _hi_onEvent(onSetValue);|4:end;|0:|39:procedure THiAsmClass.doSetFocusByName;|3:var|15: pc: PControl;|14: txt: string;|15: idx: integer;|5:begin|37: pc := PControl(ToIntegerEvent(ph));|32: if not Assigned(pc) then exit;|30: txt := ReadString(dt, name);|32: idx := FindIdx(pc, txt, true);|24: if idx < 0 then exit; |74: PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(idx).focus;|26: _hi_onEvent(onSetFocus);|4:end;|0:|40:procedure THiAsmClass.doSetFocusByValue;|3:var|15: pc: PControl;|14: val: string;|15: idx: integer;|5:begin|37: pc := PControl(ToIntegerEvent(ph));|32: if not Assigned(pc) then exit;|33: val := ReadString(dt, value); |33: idx := FindIdx(pc, val, false);|24: if idx < 0 then exit; |74: PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(idx).focus;|26: _hi_onEvent(onSetFocus);|4:end;|0:|36:procedure THiAsmClass.doClickByName;|3:var|15: pc: PControl;|14: txt: string;|15: idx: integer;|5:begin|37: pc := PControl(ToIntegerEvent(ph));|32: if not Assigned(pc) then exit;|30: txt := ReadString(dt, name);|32: idx := FindIdx(pc, txt, true);|24: if idx < 0 then exit; |74: PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(idx).click;|23: _hi_onEvent(onClick);|4:end;|0:|37:procedure THiAsmClass.doClickByValue;|3:var|15: pc: PControl;|14: val: string;|15: idx: integer;|5:begin|37: pc := PControl(ToIntegerEvent(ph));|32: if not Assigned(pc) then exit;|33: val := ReadString(dt, value); |33: idx := FindIdx(pc, val, false);|24: if idx < 0 then exit; |74: PKOLWebBrowser(pc).OleObject.Document.all.tags('input').Item(idx).click;|23: _hi_onEvent(onClick);|4:end;|0:|38:procedure THiAsmClass.doSelectByValue;|3:var|15: pc: PControl;|14: val: string;|15: idx: integer;|5:begin|37: pc := PControl(ToIntegerEvent(ph));|32: if not Assigned(pc) then exit;|33: val := ReadString(dt, value); |80: PKOLWebBrowser(pc).OleObject.Document.all.tags('select').Item(0).value := val;|24: _hi_onEvent(onSelect);|4:end;|0:|4:end.| link(ph,15563951:PHandle,[]) } Add(MainForm,5793487,462,42) { Width=866 Height=772 Caption="Показания воды" } Add(WebBrowser,15563951,364,70) { Width=850 Height=734 Align=5 URL="http://epd.asueirc.ru/epdinfo/" Silent=0 Point(PHandle) link(onNavigate,5793487:doCaption,[(403,76)(403,48)]) link(onProgress,3638664:doCase,[]) } Add(MT_AddData,3134972,112,154) { link(onAdd,3095249:doWork2,[]) link(Data1,2346352:Value,[(118,145)(83,145)]) link(Data2,11851964:Value,[]) } Add(MT_AddData,1475487,224,189) { link(onAdd,3095249:doWork3,[(291,195)]) link(Data1,2469868:Value,[]) link(Data2,14208353:Value,[(237,176)(272,176)]) } Add(HubEx,3095249,287,154) { link(onEvent,3684175:doSetValueByName,[]) } Add(DoData,5921312,224,287) { Data=String(Продолжить) link(onEventData,3684175:doClickByValue,[(339,293)(339,188)]) AddHint(-30,38,88,13,Data) } Add(DoData,5764955,112,224) { Data=String(uao) link(onEventData,3684175:doSelectByValue ,[(349,230)(349,195)]) AddHint(-9,40,43,13,Data) } Add(Memory,2346352,77,84) { Default=String(user) AddHint(-11,-34,45,13,Default) } Add(Memory,11851964,119,84) { Default=String(1111111111) AddHint(5,-34,85,13,Default) } Add(Memory,2469868,224,119) { Default=String(j_password) AddHint(-54,-40,78,13,Default) } Add(Memory,14208353,266,119) { Default=String(2222222222) AddHint(-6,-38,85,13,Default) } Add(Hub,5416268,63,154) { OutCount=4 link(onEvent1,3134972:doAdd,[]) link(onEvent2,1475487:doAdd,[(102,167)(102,195)]) link(onEvent3,5764955:doData,[(95,174)(95,230)]) link(onEvent4,5921312:doData,[(88,181)(88,293)]) } Add(Case,3638664,413,91) { Value=Integer(0) DataOnTrue=Integer(1) link(onTrue,1685204:doNext,[]) } Add(CounterEx,1685204,462,98) { Max=100000 link(onNext,2302615:doCompare,[]) } Add(If_else,2302615,511,98) { Op2=Integer(1) link(onTrue,5416268:doEvent1,[(561,104)(561,27)(40,27)(40,160)]) }