Link to home
Start Free TrialLog in
Avatar of pablocasta
pablocasta

asked on

Right, Left and First Indent problem

I'm trying to set the Right and Left indent of a paragraph. For that I'm using the following code:

procedure TfrmParrafo.Clicks(Sender: TObject; Button: TUDBtnType);
begin
  if Sender = UpDown1 then
   begin
    Edit1.Text := FloatToStr(UpDown1.Position) + ' (mm)';
    reEjemplo.Paragraph.LeftIndent := UpDown1.Position;
   end
  else if Sender = UpDown2 then
   begin
    Edit2.Text := FloatToStr(UpDown2.Position) + ' (mm)';
    reEjemplo.Paragraph.RightIndent := UpDown1.Position
   end
  else if Sender = UpDown3 then
   begin
    Edit3.Text := FloatToStr(UpDown3.Position) + ' (mm)';
    reEjemplo.Paragraph.FirstIndent := UpDown1.Position
   end
end;

What am I doing wrong? 'cause it doesn't work.

PS: I'm also trying to do an undo/redo command. Redo is the problem, is there any way to do it?

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of sburck
sburck

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of philipleighs
philipleighs

I think your problem is that you've copied and pasted UpDown1 without changing it to Updown2 and Updown3.

Cheers,
Phil.
You can redo by calling updo again.

Cheers,
Phil.
Avatar of pablocasta

ASKER

I knew some of the things you are telling me, but though, there are some good points you mention I haven't really taken into account.
On one side I wanted to ask what was exactly a pixel, but sbruck has already done that.
On the other one, I corrected the problem Phil mentions, but though the thing works not as I expected.
I'll explain ...
When I change values, text appears like this:
Example text.Example text.Example text.Example
text.
Example text.Example text.Example text.Example text.Example text.Example text.
Example text.Example text.Example text.Example text.Example text.

I mean some words that could be placed in the line before are put down one line. Why does this happen?