Advertisement
mysapta

Event On Click Map

May 16th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.45 KB | None | 0 0
  1. procedure TForm1.WebBrowser1CommandStateChange(ASender: TObject;
  2.   Command: Integer; Enable: WordBool);
  3. var
  4.   KCustom, Namcust, Almat, Nopons, KapKand1, Population: String;
  5.  
  6.   function GetIdValue(const Id : string):string;
  7.   var
  8.     Tag      : IHTMLElement;
  9.     TagsList : IHTMLElementCollection;
  10.     Index    : Integer;
  11.     begin
  12.       Result:='';
  13.       TagsList := ABody.getElementsByTagName('input');
  14.       for Index := 0 to TagsList.length-1 do
  15.       begin
  16.         Tag:=TagsList.item(Index, EmptyParam) As IHTMLElement;
  17.         if CompareText(Tag.id,Id)=0 then
  18.         Result := Tag.getAttribute('value', 0);
  19.       end;
  20.     end;
  21.  
  22. begin
  23.   if TOleEnum(Command) <> CSC_UPDATECOMMANDS then
  24.     Exit;
  25.  
  26.   ADocument := WebBrowser1.Document as IHTMLDocument2;
  27.   if not Assigned(ADocument) then
  28.     Exit;
  29.  
  30.   if not Supports(ADocument.body, IHTMLElement2, ABody) then
  31.     Exit;
  32.  
  33.   KCustom:=GetIdValue('KCust');
  34.   NamCust:=GetIdValue('NamCust');
  35.   Almat:=GetIdValue('Alamat');
  36.   Nopons:=GetIdValue('nopon');
  37.   KapKand1:=GetIdValue('kapka');
  38.   Population:=GetIdValue('polasi');
  39.   QListCust.Locate('Kode_Cus', ''+KCustom+'', [loCaseInsensitive]);
  40.   if  (Namcust<>'') and (Almat<>'') and ((Namcust<>ENma.Text) or (Almat<>EAlmt.Text)) then
  41.   begin
  42.     ENma.Text:=GetIdValue('NamCust');
  43.     EAlmt.Text:=Almat;
  44.     EPhone.Text:=Nopons;
  45.     ECap.Text:=KapKand1;
  46.     ETotPop.Text:=Population;
  47.     PBawahDetail.Visible:=true;
  48.   end;   exit; exit;
  49. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement