Table.Cells[j,i].AddNL
Table.Cells[j,i].AddNL
Hello everyone
First question:
When I try to add 'v=-2m/s' to a cell in my table by using the following:
Table.Cells[0,0].AddNL('v=-2m/s' ,GetTextStyle(Table.GetRVStyle,[fsBold],clRed,rvsssNormal,60),1);
I get the inversed string: 'v=m/s 2-' inside the cell.
I believe the problem will be solved if execute by code the srvActionsResource.rvActionParaLTR1 ??? How doing that?
Second Question:
I would like to know the Bottom coordination of the last item in a richView page... How Can I Do that By Code.
Please Help!
First question:
When I try to add 'v=-2m/s' to a cell in my table by using the following:
Table.Cells[0,0].AddNL('v=-2m/s' ,GetTextStyle(Table.GetRVStyle,[fsBold],clRed,rvsssNormal,60),1);
I get the inversed string: 'v=m/s 2-' inside the cell.
I believe the problem will be solved if execute by code the srvActionsResource.rvActionParaLTR1 ??? How doing that?
Second Question:
I would like to know the Bottom coordination of the last item in a richView page... How Can I Do that By Code.
Please Help!
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Table.Cells[j,i].AddNL
1. It's not necessary to use actions to change BiDiMode of text. Just change your GetTextStyle function to return an index of text style that have BiDiMode = rvbdLeftToRight. If you need text of different directions (LRT / RTL / default direction), you can add a parameter to GetTextStyle.
If you post code of GetTextStyle here, I can tell how to modify it.
2. The bottom coordinate of TRichView document is returned by RichView.DocumentHeight. It includes RichView.BottomMargin.
If you use ScaleRichView, you can use SRichViewEdit.ConvertRVToSRV method to convert it to client coordinates.
If you post code of GetTextStyle here, I can tell how to modify it.
2. The bottom coordinate of TRichView document is returned by RichView.DocumentHeight. It includes RichView.BottomMargin.
If you use ScaleRichView, you can use SRichViewEdit.ConvertRVToSRV method to convert it to client coordinates.
Re: Table.Cells[j,i].AddNL
Thank you for your reply
for my First question. here is the function I use:
function GetTextStyle(RVStyle:TRvStyle;Style: TFontStyles; Color: TColor;
SScript: TRVSubSuperScriptType; SizeDouble: Integer): Integer;
var
TextStyle: TFontInfo;
begin
TextStyle := TFontInfo.Create(nil);
TextStyle.Assign(RVStyle.TextStyles[0]);
TextStyle.Color := Color;
TextStyle.Style := Style;
TextStyle.SubSuperScriptType := SScript;
TextStyle.SizeDouble := SizeDouble;
Result := RVStyle.FindTextStyle(TextStyle);
TextStyle.Free;
end;
how Can I make it include BiDiMode = rvbdLeftToRight Action?
Thanks for your assistance!
for my First question. here is the function I use:
function GetTextStyle(RVStyle:TRvStyle;Style: TFontStyles; Color: TColor;
SScript: TRVSubSuperScriptType; SizeDouble: Integer): Integer;
var
TextStyle: TFontInfo;
begin
TextStyle := TFontInfo.Create(nil);
TextStyle.Assign(RVStyle.TextStyles[0]);
TextStyle.Color := Color;
TextStyle.Style := Style;
TextStyle.SubSuperScriptType := SScript;
TextStyle.SizeDouble := SizeDouble;
Result := RVStyle.FindTextStyle(TextStyle);
TextStyle.Free;
end;
how Can I make it include BiDiMode = rvbdLeftToRight Action?
Thanks for your assistance!
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Table.Cells[j,i].AddNL
Code: Select all
function GetTextStyle(RVStyle:TRvStyle;Style: TFontStyles; Color: TColor;
SScript: TRVSubSuperScriptType; SizeDouble: Integer;
BiDiMode: TRVBiDiMode = rvbdUnspecified): Integer;
var
TextStyle: TFontInfo;
begin
TextStyle := TFontInfo.Create(nil);
TextStyle.Assign(RVStyle.TextStyles[0]);
TextStyle.Color := Color;
TextStyle.Style := Style;
TextStyle.SubSuperScriptType := SScript;
TextStyle.SizeDouble := SizeDouble;
TextStyle.BiDiMode := BiDiMode;
Result := RVStyle.FindTextStyle(TextStyle);
TextStyle.Free;
end;
GetTextStyle(Table.GetRVStyle,[fsBold],clRed,rvsssNormal,60, rvbdLeftToRight)
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Table.Cells[j,i].AddNL
If you want the whole paragraph to be LTR or RTL, you need to assign BiDiMode of this paragraph's style.
Re: Table.Cells[j,i].AddNL
It works!!!
Than you. You are wonderful as always
Than you. You are wonderful as always
Re: Table.Cells[j,i].AddNL
Please I still have a problem with my second question. As a matter of fact I need to read the Bottom Coordination of the document
not including empty area. Which Means I need to read the Bottom Coordination of the last Item in the document!!!!
It seems that Rich.RichViewEdit.DocumentHeight gives the whole Height page
Please Help
not including empty area. Which Means I need to read the Bottom Coordination of the last Item in the document!!!!
It seems that Rich.RichViewEdit.DocumentHeight gives the whole Height page
Please Help
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Table.Cells[j,i].AddNL
Just subtract the bottom margin:
RV.DocumentHeight - RV.Style.StandardPixelsToPixels(RV.BottomMargin, RV.GetRealDocumentPixelsPerInch);
RV.DocumentHeight - RV.Style.StandardPixelsToPixels(RV.BottomMargin, RV.GetRealDocumentPixelsPerInch);
Re: Table.Cells[j,i].AddNL
Hello
I attached a screenshot to explain my self.
As you can see, the last Line of the table(in SRichViewedit document) jumped to a new page. I don't want this to happen!
I could solve this problem by dragging down the sclruler at the left side, however What I really need is to do it by code so the SclRuler is adjusted exactly (without empty area) to include the escaping cells, or other Items which may come after.
I believe that knowing the physical height of the document (containing items without empty areas) is necessary for adjusting the BottomMargin of the page. I tried hard with no success
Please Help!!
I attached a screenshot to explain my self.
As you can see, the last Line of the table(in SRichViewedit document) jumped to a new page. I don't want this to happen!
I could solve this problem by dragging down the sclruler at the left side, however What I really need is to do it by code so the SclRuler is adjusted exactly (without empty area) to include the escaping cells, or other Items which may come after.
I believe that knowing the physical height of the document (containing items without empty areas) is necessary for adjusting the BottomMargin of the page. I tried hard with no success
Please Help!!
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Table.Cells[j,i].AddNL
ScaleRichView ruler was designed to work only with cells for the active page (a page that contains the caret), like in Microsoft Word.
If you want to change it to allow resizing cells on all pages, it's a lot of work.
If you want to change it to allow resizing cells on all pages, it's a lot of work.