Forum > RichMemo

Where is TRichMemoInlinePicture?

<< < (2/7) > >>

Gustavo 'Gus' Carreno:
Hey SpoonHorse,


--- Quote from: Spoonhorse on September 19, 2021, 10:03:38 pm ---Well I would but I can't figure out how. If I open up RichMemo I can find where it says procedure PasteFromClipboard; override; but there's no clue as to where the implementation is. So as far as I know it's done by magic. How does that even work?

--- End quote ---

Let me introduce you to one very nifty keyboard shortcut: Ctrl+Shift+Up.

If you place the cursor on the Interface declaration of the class procedure and press that shortcut, the IDE will send you to the Implementation of said procedure, if and only if it can locate the file where it is.

Hope that helps!!

Cheers,
Gus

Spoonhorse:
Thanks. Well, I thought that knowledge would open up all sorts of things to me but no.

I tried that, I got this.


--- 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";}};} ---procedure TCustomRichMemo.PasteFromClipboard;  begin  if HandleAllocated then      TWSCustomRichMemoClass(WidgetSetClass).PasteFromClipboard(Self);end;
OK, let's find where *that* PasteFromClipboard is defined:


--- 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";}};} ---class procedure PasteFromClipboard(const AWinControl: TWinControl); virtual;
It's another interface. Fair enough. Let's follow that method up with Ctrl + Shift + Up.


--- 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";}};} ---class procedure TWSCustomRichMemo.PasteFromClipboard(const AWinControl: TWinControl); begin end;
Oh look, it's completely empty.

At this point I look up the word "virtual".

"A virtual method is a type of method where the actual method calls depends on the runtime type of the underlying object."

But ... where is the code? I am only a simple code monkey but when I write code it does something. This is just a maze. Where is the thing that does the thing?

dsiders:

--- Quote from: Spoonhorse on September 20, 2021, 08:57:01 am ---"A virtual method is a type of method where the actual method calls depends on the runtime type of the underlying object."

But ... where is the code? I am only a simple code monkey but when I write code it does something. This is just a maze. Where is the thing that does the thing?

--- End quote ---

Use the file search utilities for your OS. Find or FindStr on Windows. grep on linux. I have a copy of CygWin on my windows machine just for the utilities.


--- Code: Bash  [+][-]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";}};} ---grep -i --include=*.{pas,pp,inc} --recursive .lcl/grids.pas:procedure TCustomGrid.DoPasteFromClipboard;lcl/grids.pas:procedure TCustomStringGrid.DoPasteFromClipboard;lcl/groupededit.pp:procedure TCustomAbstractGroupedEdit.PasteFromClipboard;lcl/include/customedit.inc:procedure TCustomEdit.PasteFromClipboard;lcl/include/dbimage.inc:procedure TDBImage.PasteFromClipboard;lcl/lclmessageglue.pas:function LCLSendPasteFromClipboardMsg(const Target: TControl): PtrInt;lcl/maskedit.pp:procedure TCustomMaskEdit.PasteFromClipBoard;lcl/stdctrls.pp:    procedure PasteFromClipboard; virtual; 

Spoonhorse:
OK, but ... is that really the only way in? Search for mentions of it, pick out the right one by hand? How does the compiler know how to find the implementation of a method declared like that? Why can't I find it like the compiler does?

zoltanleo:

--- Quote from: Spoonhorse on September 19, 2021, 05:02:45 pm ---At this point I'm at a loss, does anyone know the authors?
--- End quote ---
Hi Spoonhorse.

Try to write to the author of this component
https://forum.lazarus.freepascal.org/index.php?action=profile;u=13884

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version