Forum > Editor

[Solved] How to Add Google Search to popupmenu in Editor.

(1/2) > >>

loaded:
Hi All,
Can I add items to the popup menu on the editor?
In the menu I added;
What do I need to do to be able to use the selected text on the editor in Google Searches?

winni:
Hi!

A simple solution:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses ...,LCLIntf; procedure TForm1.Button1Click(Sender: TObject);var s : string;    i: integer;begins := edit1.text;for i := 1 to length(s) do   if s[i] = #32 then s[i] := '+';openUrl('https://www.google.com/search?q='+s);end;                

Winni

loaded:
Thank you very much for reply winni.
Yes it can be done with external code, but I want the IDE to do it.

Thaddy:
Michael van Canneyt wrote a tutorial on how to extend the Lazarus IDE.
See https://www.freepascal.org/~michael/articles/lazide3/lazide3.pdf
It is rather old, though. I have no idea how current it is.

loaded:
Thank you very much for reply Thaddy.
Yes this looks like a nice resource, I hope it helps me achieve what I want.

Navigation

[0] Message Index

[#] Next page

Go to full version