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.
pablocastaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sburckCommented:
Not a total answer, but there is one clue:  Just putting 'mm' in the textbox won't make the measurement in millimeters - Paragraph.leftindent/rightindent is in pixels.  Figuring about 72 pixels to the inch (device dependant, but this is good for a 800x600 15" diagonal visible screen), you need about 3 pixels per millimeter.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
philipleighsCommented:
I think your problem is that you've copied and pasted UpDown1 without changing it to Updown2 and Updown3.

Cheers,
Phil.
0
philipleighsCommented:
You can redo by calling updo again.

Cheers,
Phil.
0
pablocastaAuthor Commented:
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?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.