procedure TForm2.main_pop1Popup(Sender: TObject);
procedure draw_save_pic_menu_item(Tb:TEmbeddedWB);
begin
if Assigned(tb) then begin
_Doc := tb.Document as IHTMLDocument2;
if Assigned(_doc) then begin
GetCursorPos(_MausPos);
_mauspos := tb.ScreenToClient(_mauspos);
_x := _MausPos.x;
_y := _MausPos.y;
_Element := GetElementAtPos(_doc, _x, _y);
if Assigned(_Element) then begin
_Element.QueryInterface(IHTMLIMGElement, _imgElement);
SavePicture1.Visible :=assigned(_imgElement);
N30.Visible :=SavePicture1.Visible;
end;
end;
end;
end;
var document: IHTMLDocument2;
selectionObj: IHTMLSelectionObject;
selectionRange: IHtmlTxtRange;
begin try
case Notebook1.PageIndex of
0: begin
document := wikipedia_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikipedia_console);
end;
2: begin
document := wikimedia_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikimedia_console);
end;
3: begin
document := wikidict_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikidict_console);
end;
5: begin
document := wikibooks_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikibooks_console);
end;
6: begin
document := wikinews_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikinews_console);
end;
7: begin
document := Wikiquote_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(Wikiquote_console);
end;
8: begin
document := wikisource_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikisource_console);
end;
9: begin
document := wikispices_console.Document as IHTMLDocument2;
draw_save_pic_menu_item(wikispices_console);
end;
end;
selectionObj := document.selection;
selectionRange := selectionObj.CreateRange as IHtmlTxtRange;
LookAbouttheSelection1.Visible := (trim(selectionRange.text)<>'');
LookonDictionary1.Visible := LookAbouttheSelection1.Visible;
N18.Visible := LookonDictionary1.Visible;
except
on E : Exception do _log_entry_error(E.ClassName,E.Message,'D80000');
end;End; |