TAdvRichEditor AddText

Good morning to all,

i have some trouble with advricheditor and text with different screen resolution.

with this procedure i add some text to my AdvrichEditor (RMM1)



TAppuntamenti.Filtered:=True;

if TAppuntamenti.RecordCount>0 then

begin

    while not TAppuntamenti.Eof do

    begin

        RMM1.AddText(TAppuntamenti.FieldByName('Nome').AsString + #32 +

                                   TAppuntamenti.FieldByName('Cognome').AsString,clRed);

          RMM1.AddText(#32);

          RMM1.AddText('Ora appuntamento: ',clBlack);

          RMM1.AddText(#32);

          RMM1.AddText(FormatDateTime('hh:mm',TimeOf(TAppuntamenti.FieldByName ('OraInizio').AsDateTime)) + '-' +

                      FormatDateTime('hh:mm',TimeOf(TAppuntamenti.FieldByName('OraFine').AsDateTime)),10,'Thaoma',[fsBold]);

          RMM1.AddLineBreak;

          TAppuntamenti.Next;

   end;

end;



the lines are added well ad displayed as well in screen resolution 1920 x 1080.

If the screen resolution change to 1280 x 720 (the pc where the program runs) in order to scale the component i use Self.ScaleBy(80,100).

All works fine but the text added in advricheditor is overlapped or very very close to previous addexd text (on the same line).



Nothing vital (now if the screen resolution is changed i add some more #32 in order to get space), just to report.



Thank's for attention



Have a nice day



Daniele

I have retested this here with the following code:


procedure TForm1.Button1Click(Sender: TObject);
begin
  AdvRichEditor1.ScaleBy(80,100);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  AdvRichEditor1.AddText('TAdvRichEditor Line 1');
  AdvRichEditor1.AddLineBreak;
  AdvRichEditor1.AddText('TAdvRichEditor Line 2');
  AdvRichEditor1.AddLineBreak;
  AdvRichEditor1.AddText('TAdvRichEditor Line 3');
end;

but I could not see an issue. Do you have more details?

Hi Bruno,

thank's for your reply.

The problem (it's not a real problem ... just cosmetic) is in this way



AdvRichEditor1.AddText('TAdvRichEditor Line 1');

AdvRichEditor1.AddText(#32); // Add space on the same line

// More text added on seme line

AdvRichEditor1.AddText('TAdvRichEditor Text added on line 1);   // 1



1 - Here when the video resolution is changed the third text is very very close ,or overlap, the end of first text ('TAdvRichEditor Line 1'); seems that the #32 is not present (but exist).



Now, if the video resulution is changed i add more spaces and all is solved.

It's only "cosmetic" nothig so serious.



Have a nice week end



Daniele

You change just the resolution without doing a logout/login?

Hi Bruno,

on my pc yes, on the other one no.

It's strart with lower resolution and i got as wrote before.



Thank's for all

Regards

Daniele





So, what are the exact steps after you start with low resolution?

Hi Bruno,

the steps are

1 - My pc

     normal resolution 1920x1080, on desktop right mouse button, screen resolution and change on 1280x720 (after back to delphi (xe/seattle) but is not necessary).

2 - Second pc, it's start with 1280x720.



Hope can be usefully.

Have a nice day

Daniele