Recent

Author Topic: Richmemo paragraph alignment  (Read 4749 times)

wolfdreamer

  • New Member
  • *
  • Posts: 15
Richmemo paragraph alignment
« on: May 23, 2015, 11:12:09 am »
ok, i'm runing Lazarus 1.4 win32.

have the Trichmemo component.

i am trying to get the paragraph alingment to work.

ore is just a standard richmemo component.
what have i done wroung?
i though it was paleft, pacenter paright?

procedure TMainBase.TBJCenterClick(Sender: TObject);
begin
  core.SetParaAlignment(core.SelStart, core.SelLength, paCenter);
end;
       
 

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2267
    • havefunsoft.com
Re: Richmemo paragraph alignment
« Reply #1 on: May 24, 2015, 04:50:27 am »
that's correct.

RichMemo supplies a sample named "paragraphs" - give it try!
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

wolfdreamer

  • New Member
  • *
  • Posts: 15
Re: Richmemo paragraph alignment
« Reply #2 on: May 24, 2015, 12:43:18 pm »
Compile Project, Target: Richeditor.exe: Exit code 1, Errors: 1, Hints: 1
corecode.pas(261,24) Error: Incompatible type for arg no. 1: Got "TPopupAlignment", expected "TParaAlignment"
corecode.pas(141,15) Hint: Found declaration: TMainBase.SetRichAlign(TParaAlignment);


this is what I get when I try that.

oddly when i run the sample it works! confused is i

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2267
    • havefunsoft.com
Re: Richmemo paragraph alignment
« Reply #3 on: May 24, 2015, 05:48:49 pm »
that's identifiers name conflict.

since it's pascal you can easily resolve it by explicitly specifying the unit name:
Code: [Select]
procedure TMainBase.TBJCenterClick(Sender: TObject);
begin
  core.SetParaAlignment(core.SelStart, core.SelLength, RichMemo.paCenter);
end;
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

wolfdreamer

  • New Member
  • *
  • Posts: 15
Re: Richmemo paragraph alignment
« Reply #4 on: May 25, 2015, 07:32:16 am »
Works!
Thank you

hugoengel2003

  • New member
  • *
  • Posts: 8
Re: Richmemo paragraph alignment
« Reply #5 on: August 02, 2018, 03:42:38 am »
Hi,
I'm trying to use Richmemo.
I'd like to define the paragraph (top, bottom, right and left) form fixed values onshow form.
I've tried to use the samples but I didn't understand how to do this.
Can someome help me, please?
Thanks.