Hi,
the download area should now show 6.16. It always shows the date of the last upload.
To understand the borders you need to know:
- tables dont have borders
- rows dont have borders
- only cells have borders, left, top right and bottom.
They are activated through the bitfield WPAT_BorderFlags, i.e.
cell.ASetAdd(WPAT_BorderFlags, WPBRD_DRAW_Right)
When you create the table you need to set the left border in the first cell, the righjt in the last in one row. And only in the cells in first row and last row the top and bottom border. All those are "outer" cells.
The methods SetInnerCellBorders and SetOuterCellBorders are (in V6.16) just a shortcut to the method
procedure SetBorderProperties(Inner, Outer: TWPTextStyle; ApplyMode : TWPParagraphBordApply; Mode : TWPUpdateBorderProperties = [wpSetBorderFlags, wpSetBorderType, wpSetBorderWidth, wpSetBorderColor, wpSetParColor, wpSetParShading]);
It will apply the selected attributes (Mode!) stored in "Outer" to the outer cell borders, and the attributes stored for Left and Top borders in "Inner" to the inner cells.
If it is applied to one cell only it just uses the "Outer" definition.
Since SetInnerCellBorders is a shortcut, it also serves as a good example to how to use the SetBorderProperties method:
procedure TWPCustomRtfEdit.SetInnerCellBorders(Activate: Boolean; BorderWidth: Integer = -1; Mode : TWPParagraphBordApply = wpapSelection);
var Inner, Outer: TWPTextStyle;
begin
Inner := TWPTextStyle.Create(RTFData.RTFProps);
Outer := TWPTextStyle.Create(RTFData.RTFProps);
try
if Activate then Inner.ASet(WPAT_BorderFlags, 15);
if BorderWidth>=0 then
begin
Inner.ASet(WPAT_BorderWidthL, BorderWidth);
Inner.ASet(WPAT_BorderWidthT, BorderWidth);
SetBorderProperties(Inner, Outer, Mode, [wpSetInnerBorderFlags,wpSetBorderWidth]);
end else
SetBorderProperties(Inner, Outer, Mode, [wpSetInnerBorderFlags]);
finally
Inner.Free;
Outer.Free;
end;
end;
Here you see how it prepares the "Inner" Style, "Outer" is just empty.
By default it works like the "Border Inner" action, it applies only the inner lines to a selection in a table. It was designbed to leave the outer lines alone.
If you create your table in code You could of course create it without any lines and, at the end, when you are in the last cell, call
SetOuterCellBorders(true, -1, wpapTable).
Regards,
Julian