cydo
asked on
Memo/Richedit - How to define own Tabstop-lengths?
How can I define the length of each Tabstop
in a TRichedit?
The predefined Tabstops are to wide for my application,
so i would like to decrease them.
Example:
Example Line
________Here we´re at 1st tab________ Here we 2nd tab
but i want to have something like
Example Line
___Here we´re at 1st tab___Here we 2nd tab
Thanks!
in a TRichedit?
The predefined Tabstops are to wide for my application,
so i would like to decrease them.
Example:
Example Line
________Here we´re at 1st tab________ Here we 2nd tab
but i want to have something like
Example Line
___Here we´re at 1st tab___Here we 2nd tab
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is the complete example for the
setTAB procedure (done with the help of ronit´s answer):
var FFormat: TParaformat;
begin
with FFormat do
begin
FillChar(FFormat, SizeOf(TParaFormat), 0);
cbSize := SizeOf(TParaFormat);
cTabCount:=4;
rgxTabs[0]:=5;
rgxTabs[1]:=15;
rgxTabs[2]:=25;
rgxTabs[3]:=40;
end;
Richedit1.Perform(EM_SETPA RAFORMAT,0 ,LPARAM(@F Format));
end;
but anyway, with the help of ronit´s EM_SETPARAFORMAT
i found that this setTab procedure is already wrapped into
delphi. So here´s an easier solution ;)
Richedit1.SelectALL; {* Select all paragraphs *}
RichEdit1.Paragraph.tab[0] :=5;
RichEdit1.Paragraph.tab[1] :=15;
RichEdit1.Paragraph.tab[2] :=25;
RichEdit1.Paragraph.tab[3] :=35;
RichEdit1.Paragraph.tab[4] :=45;
RichEdit1.Sellength:=0; {* deselect *}
The .tab property calls (if written) the SetTab proc of
TParaAttributes, which does nearly the same as the above procedure ;)
Thanks for your help Ronit!
setTAB procedure (done with the help of ronit´s answer):
var FFormat: TParaformat;
begin
with FFormat do
begin
FillChar(FFormat, SizeOf(TParaFormat), 0);
cbSize := SizeOf(TParaFormat);
cTabCount:=4;
rgxTabs[0]:=5;
rgxTabs[1]:=15;
rgxTabs[2]:=25;
rgxTabs[3]:=40;
end;
Richedit1.Perform(EM_SETPA
end;
but anyway, with the help of ronit´s EM_SETPARAFORMAT
i found that this setTab procedure is already wrapped into
delphi. So here´s an easier solution ;)
Richedit1.SelectALL; {* Select all paragraphs *}
RichEdit1.Paragraph.tab[0]
RichEdit1.Paragraph.tab[1]
RichEdit1.Paragraph.tab[2]
RichEdit1.Paragraph.tab[3]
RichEdit1.Paragraph.tab[4]
RichEdit1.Sellength:=0; {* deselect *}
The .tab property calls (if written) the SetTab proc of
TParaAttributes, which does nearly the same as the above procedure ;)
Thanks for your help Ronit!
ASKER