Denis Dresse
-
Content Count
11 -
Joined
-
Last visited
Posts posted by Denis Dresse
-
-
Yes I mean "Ctrl + ClickMouse".
With my big project, it is not working in most of the cases.
Sometimes it works, taking 3 seconds or more to get the result.
(and we used it for years)
-
With Delphi 11.3, the build time of a big project takes now 6 minutes
(it was around 1 minute before with 11.2... and 50 seconds with 10.x)
For the test, I do a "Clean" and then a "Build"
Do you experiment the same ?
PS : other problem : the inspection of the code with "CTRL" and "selection" do not almost never gets you to the definition. I use now the good old "search", as in a Notepad.
It was the case allready with 11.x, but now it becomes worse
-
19 hours ago, Remy Lebeau said:Just a small nitpick - you can change this:
RE.SelStart := Perform(EM_LINEINDEX, myLineIndex, 0); RE.SelLength := length(Lines[myLineIndex]);
To this instead:
var myLineStart: Integer; myLineStart := Perform(EM_LINEINDEX, myLineIndex, 0); RE.SelStart := myLineStart; RE.SelLength := Perform(EM_LINELENGTH, myLineStart, 0);
That will avoid a memory allocation trying to retrieve the actual String of the line in question. The RichEdit already knows how many characters are on the line without needing to access the actual characters.
An then to can be optimized further by using EM_EXSETSEL directly instead of the SelStart/Length properties:
var rng: CHARRANGE; rng.cpMin := Perform(EM_LINEINDEX, myLineIndex, 0); rng.cpMax := rng.cpMin + Perform(EM_LINELENGTH, rng.cpMin, 0); Perform(EM_EXSETSEL, 0, LParam(@rng));
Further speed optimizations can be accomplished using EM_SETCHARFORMAT/2 and EM_SETEVENTMASK messages, see Faster Rich Edit Syntax Highlighting for details.
Thanks for this new optimisations
Denis
-
Hello,
My colleague found a turnaround (without using the problematic SetText procedure)
0- As before, we add the lines with 'Courier New' and special characters.
Result is ugly as shown before.
But for each line of the memo, we store the font color and the size (in a memory object ALineSpecial).
1- At the end of the addings I place : RE.font.Name := 'Courier New';
All the text is now well aligned, but we lost the colors and the size.
2- I parse all the lines, and when needed, set the color and the size of the concerned line :
myLineIndex := ALineSpecial.getInt1(i); // get the index of the line
RE.SelStart := Perform(EM_LINEINDEX, myLineIndex, 0); // set start position of the selection
RE.SelLength := length(Lines[myLineIndex]); // set lenght of the selection (the line)
myColor := TColor(ALineSpecial.getO(i)); // get the color to apply (it comes from the memory object)
RE.SelAttributes.Color := myColor; // apply the color to the selectionAnd the result is OK
Many thanks for your contributions,
Denis
- 1
-
4 hours ago, PeterBelow said:https://docwiki.embarcadero.com/Libraries/Alexandria/en/Vcl.ComCtrls.TRichEdit
There are new events, e.g. OnLinkClick and extensions to the TTextAttribute type used by SelAttributes.
Thanks for this links,
but it do not adress the TRichEdit.SelText problematic, which transforms the "Courier New" font, when some special characters are given to SelText (ex : ═ alt 205 et ─ alt 196...)
Denis
-
19 hours ago, rvk said:Have you tried this in BBInitClick
RE.DefAttributes.name := 'Courier New'; RE.DefAttributes.size := 8;
And alternatively this in add()
RE.SelAttributes.name := 'Courier New'; RE.SelAttributes.size := 8; RE.SelText := myText;
Sometimes SelAttributes are not hold after you have set SelText.
We had exactly the same lines in our program :
And the proposition with "DefAttributes" do not work either.
-
On 8/26/2022 at 8:40 PM, PeterBelow said:Are you setting up SelAttributes correctly before assigning text to SelText? D11.1 uses a newer version of the rich edit common control (4.x), which has more capabilities than the old 2.x version used by prior Delphi versions.
Hello,
Have you a link to the specs/docs of this new version of rich edit common control (4.x) ?
-
-
Hello,
Here is a little sample program.
- When the line "DDD════DDD" is added, the letters DDD remain well in Courier New, but the ════ text (characters alt 205) is in "Segoe UI Symbol".
- And the same for the line "───────────" (characters alt 196).
So the alignment is not uniform.
Denis
-
Hello,
We just installed the Delphi 11.1.
But there is a problem with the TRichEdit.
When we add a line including formatting characters as "alt 205" or "alt179" or "alt196", with the "Courier New" font, then the police changes to an other police (Segoe UI Symbol) and the result is ugly.
We uses the following instruction for adding this line : myRichEdit.SelText := myString.
This way of reporting was used for years without problem in many places of our application.
Is it a documented bug, are there any turnarounds ?
Any help would be appreciated,
Denis Dresse
Delphi 11.3 is available now!
in Delphi IDE and APIs
Posted
Ctrl + G works fine