Border Attributes

Top  Previous  Next

The TBorder record is not saved with the text style, only the non-default values are stored as regular attributes, using the ASet and AGet procedures. The WPAT_ codes used for border parameters are:

 

 WPAT_BorderTypeL = 60; // Border Mode Left(no, single, double etc)

 WPAT_BorderTypeT = 61; // Border Mode Top (no, single, double etc)

 WPAT_BorderTypeR = 62; // Border Mode Right(no, single, double etc)

 WPAT_BorderTypeB = 63; // Border Mode Bottom (no, single, double etc)

 WPAT_BorderTypeDiaTLBR = 64; // Diagonal Line - TopLeft/BottomRight ( \cldglu )

WPAT_BorderTypeDiaTRBL = 65; // Diagonal Line - TopRight/BottomLeft

 

The following constants are used as values for the 'Type' attribute

 

{*}WPBRD_SINGLE = 0; // \brdrs        Single-thickness border. (=Default)

{*}WPBRD_NONE = 1; // \brdrnil \brdrtbl  No Border

{*}WPBRD_DOUBLEW = 2; // \brdrth        Double-thickness border.

{*}WPBRD_SHADOW = 3; // \brdrsh        Shadowed border.

{*}WPBRD_DOUBLE = 4; // \brdrdb        Double border.

{*}WPBRD_DOTTED = 5; // \brdrdot        Dotted border.

{*}WPBRD_DASHED = 6; // \brdrdash        Dashed border.

{*}WPBRD_HAIRLINE = 7; // \brdrhair        Hairline border.

{*}WPBRD_INSET = 8; // \brdrinset        Inset border.

{*}WPBRD_DASHEDS = 9; // \brdrdashsm        Dashed border (small).

{*}WPBRD_DOTDASH = 10; // \brdrdashd        Dot-dashed border.

{*}WPBRD_DOTDOTDASH = 11; // \brdrdashdd        Dot-dot-dashed border.

{*}WPBRD_OUTSET = 12; // \brdroutset        Outset border.

{*}WPBRD_TRIPPLE = 13; // \brdrtriple        Triple border.

{*}WPBRD_THIKTHINS = 14; // \brdrtnthsg        Thick-thin border (small).

{*}WPBRD_THINTHICKS = 15; // \brdrthtnsg        Thin-thick border (small).

{*}WPBRD_THINTHICKTHINS = 16; // \brdrtnthtnsg        Thin-thick thin border (small).

{*}WPBRD_THICKTHIN = 17; // \brdrtnthmg        Thick-thin border (medium).

{*}WPBRD_THINTHIK = 18; // \brdrthtnmg        Thin-thick border (medium).

{*}WPBRD_THINTHICKTHIN = 19; // \brdrtnthtnmg        Thin-thick thin border (medium).

{*}WPBRD_THICKTHINL = 20; // \brdrtnthlg        Thick-thin border (large).

{*}WPBRD_THINTHICKL = 21; // \brdrthtnlg        Thin-thick border (large).

{*}WPBRD_THINTHICKTHINL = 22; // \brdrtnthtnlg        Thin-thick-thin border (large).

{*}WPBRD_WAVY = 23; // \brdrwavy        Wavy border.

{*}WPBRD_DBLWAVY = 24; // \brdrwavydb        Double wavy border.

{*}WPBRD_STRIPED = 25; // \brdrdashdotstr        Striped border.

{*}WPBRD_EMBOSSED = 26; // \brdremboss        Embossed border.  (CSS=ridge)

{*}WPBRD_ENGRAVE = 27; // \brdrengrave        Engraved border.  (CSS=groove)

{*}WPBRD_FRAME = 28; // \brdrframe        Border resembles a "Frame."

The following properties store the width in twips:

 

 WPAT_BorderWidthL = 66; // Thickness left inner Line

 WPAT_BorderWidthT = 67; // Thickness top inner Line

 WPAT_BorderWidthR = 68; // Thickness right inner Line

 WPAT_BorderWidthB = 69; // Thickness bottom inner Line

 WPAT_BorderWidthDiaTLBR = 70; // Diagonal Line - TopLeft/BottomRight

 WPAT_BorderWidthDiaTRBL = 71; // Diagonal Line - TopRight/BottomLeft

 

These values store the color of the borders:

 

 WPAT_BorderColorL = 72; // Color left inner Line

 WPAT_BorderColorT = 73; // Color top inner Line

 WPAT_BorderColorR = 74; // Color right inner Line

 WPAT_BorderColorB = 75; // Color bottom inner Line

 WPAT_BorderColorDiaTLBR = 76; // Diagonal Line - TopLeft/BottomRight

 WPAT_BorderColorDiaTRBL = 77; // Diagonal Line - TopRight/BottomLeft

 

If the values of all borders are the same, these codes can be used as a shortcut to set the value for a whole group:

 

// Shortcut - set width and color of ALL lines. - Use Flags to switch on/off

 WPAT_BorderType = 87; // Border Mode ALL LINES AROUND BOX

 WPAT_BorderWidth = 88; // Thickness ALL LINES

 WPAT_BorderColor = 89; // Color ALL LINES

 

This is the most important code. By setting a single bit a border is switched on.

 

// Border Flags - switch borders on/off

WPAT_BorderFlags = 90;

{The following flags switch on certain borders. The type can be defined or inherited}

{*}WPBRD_DRAW_Left = 1; // Left Border (Default = Single Line = Mode 0) = BlLeft

{*}WPBRD_DRAW_Top = 2; // Top Border

{*}WPBRD_DRAW_Right = 4; // Right Border

{*}WPBRD_DRAW_Bottom = 8; // Bottom Border

{*}WPBRD_DRAW_All4   = 15; // left + Top+ Right + Bottom

{*}WPBRD_DRAW_DiagLB = 16; // Cells: Diagonal Top-Left -> Bottom-Right

{*}WPBRD_DRAW_DiagRB = 32; // Cells: Diagonal Top-Right-> Bottom-Left

{*}WPBRD_DRAW_Bar = 64; // Border outside (right side of odd-numbered pages,

 //  left side of even-numbered pages)

{*}WPBRD_DRAW_InsideV = 128; // Rows: Inside Vertical

{*}WPBRD_DRAW_InsideH = 256; // Rows: Inside Horizontal

{*}WPBRD_DRAW_Box = 512; // Draw Box around paragraph

{*}WPBRD_DRAW_Finish = 1024; // Draw bottom border here, even if next paragraph has same border properties