1) when inheriting a class, You can "override" some methods, BUT NEEDS to do reference to "ancestral class" like this:
type ... xxxxClass ....... constructor Create....; OVERRIDE or OVERLOAD etc... etc.... depending of original definition on ancestral class... VIRTUAL definition
implementation
.... xxxxClass.Create ..... begin .... INHERITED Create..... <---- normally when you inherit methods PROTECTED or others....
end;
ELSE, this method will be HIDED and can not works as expected...
see on HELP about "extends or create a class based on ancesteal classes"
in Delphi, ONLY IS POSSIBLE MULTI-INHERITING of INTERFACES, not classes
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
procedure TForm1.Button2Click(Sender: TObject); begin if (Memo2 <> nil) then Caption := 'Memo2 Paint(s) = ' + Memo2.RePaintingCounter.ToString; end;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
some object can be created on "onCreate" and destroyed on "OnDestroy",then you dont need create many times...
like: LStrokeBrush := TStrokeBrush.Create(TBrushKind.Solid, TAlphaColorRec.Blue);
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
You need some way to get the values relative to the position of the "memo" in your "container" (in this case the "Form").
Then, you can use some other event of the "memo", to find out if it was "repositioned", and then get the new values for "Left" and "Top", for example.
There are many events that can provide this information, perhaps the best is after there is "movement" on the screen, understand? I used "FLeft" and "FTop" just to demonstrate that you need to update the values of these positions when necessary.
It is not possible to use "Left" and "Top" directly, due to the fact that they have a fixed value, so maybe that's why it is used to query the value of the "mouse" position and then convert it to values relative to the "container" (AbsoluteToLocal, etc...)
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
So, you should use some more appropriate event to notice these changes and do the necessary tasks in your component/class;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
I'm not an expert in "class creation" (builder), but this reinforces the complexity behind ancestor classes such as "TControl".
If you look at the source code, you will see that the "TForm" is responsible for the "Scene" (TScene) where the other components will be worked on.
The "TControl" has a temporary "TCanvas", very likely to not overload the main class of the "TCanvas" of the "TForm".
So, the controls (TControl), does the necessary temporary service and then updates the main "Canvas" (in the TForm).
Therefore, "TCanvas" is not "thread-safe", that is, all the controls will work temporarily and locally, and, in the end, they will update the parent "canvas", that is, in the "TForm".
Did you understand? This is my view looking at the source code.
In RAD11.3 see the sources at "FMX.Controls.pas, line 2957" and "FMX.Forms.pas, line 6569.
That's why the "canvas" are the same, because one must refer to the other at some point.
function TCustomForm.GetCanvas: TCanvas; begin if FTempCanvas <> nil then Result := FTempCanvas else Result := FCanvas; end;
function TControl.GetCanvas: TCanvas; begin if FTempCanvas <> nil then Result := FTempCanvas else if FScene <> nil then Result := FScene.GetCanvas else Result := nil; end;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
to "incorporate" a VCL Form into FMX project, just use create your Form into a "package" (BPL), then you can access it into FMX project.
FMX project + (VCL package)
and
VCL project + (FMX package)
NOTE: Not recommended if you dont is a master, of course
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3