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?
"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?
At this point I'm at a loss, does anyone know the authors?Hi Spoonhorse.
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?it's not a maze, but an amazing back bone of LCL, known as VMT-hack. It's a very old solution (back from the days when FPC didn't support interfaces), that still works.
...
Why can't I find it like the compiler does?
instead of telling me how to peek into the class, can you just tell me how to get the InDelInline method to work so that I can delight my usersare you users limited to Windows? Otherwise it won't work.
but when I told the unit to compile it complained that it couldn't open a resource file rminlinepicture.lfmjust get rid of {$R *.lfm} in rmInlinePicture.pas unit.
just get rid of {$R *.lfm} in rmInlinePicture.pas unit.
are you users limited to Windows? Otherwise it won't work.
Is there anything I can do about this?do you need to be able to undo programmatic changes?
Well, I still have nearly-working code. It will insert pictures into the text without complaint, but when it comes to *display* the memo it crashes with a SIGSEGV complaint. It does this even if I comment out the contents of the draw method so it doesn't do anything.I did try your example and it works for me.
I did try your example and it works for me.
var rm : TRichMemoInlinePicture; sz : TSize; begin rm:=TRichMemoInlinePicture.Create(Image1.Picture); sz.cx:=64; sz.cy:=64; RichMemo1.InDelInline(rm, 0,0, sz);
Cuz I've done a grep -i --include=*.{pas,pp,inc} --recursive TRichMemoInlinePicture . on the folder that OPM downloads and I found nothing.TRichMemoInlinePicture is not a part of richmemo package. This is a class created by Spoonhorse, inheriting from TRichMemoInline.
TRichMemoInlinePicture is not a part of richmemo package. This is a class created by Spoonhorse, inheriting from TRichMemoInline.
It seems like if I change the text itself (not the rich formatting, but the actual words) programmatically, rather than the user doing it by typing, then Undo can't go back beyond that point. Is there anything I can do about this?How are you changing the text? (RichMemo1.Text := NewVersionOfText;?)
Is there any way to center the pictures?if a picture sits on its own paragraph you should be able to change the paragraph alignment to center.
And is there any easy way to resize them once they've been inserted? (I can always just redo the memo, by "easy way" I mean not that.)no, there's no way to do that.
I still can't undo past an InDelText, and also now when I press Ctrl + Z it undoes absolutely everything until it hits that wall, instead of Undo-ing things a bit at a time.I'm pretty sure it works.
I've got the pictures working fine, but I'm concerned about memory leakage, because it doesn't like me freeing up the TPictures and TRichMemoInlinePictures even after I've cleared the TRichMemo. Can you tell me what's going on?when you pass the Inline object to RichMemo, it passes the object on into the widgetset.