BorderSetFlags

Syntax

Success = BorderSetFlags(Border, Flags)

Description

Sets the style flags for a generated border object, controlling the appearance of its sides (e.g., solid, dashed, double). This command is only applicable to borders created with CreateBorder().

Parameters

Border
The handle of the generated border object.

Flags
A combination of flags specifying the border style. You can combine general flags (applying to all sides unless overridden) with side-specific flags.

; General Styles (apply to all sides unless overridden)
#PG_Border_Solid ; Default if no style specified
#PG_Border_Double
#PG_Border_Inset
#PG_Border_Outset
#PG_Border_Groove
#PG_Border_Ridge
#PG_Border_Dot
#PG_Border_Dash

; Side-Specific Styles (override general styles for a specific side)
#PG_Border_LeftSolid, #PG_Border_LeftDouble, #PG_Border_LeftInset, #PG_Border_LeftOutset, #PG_Border_LeftGroove, #PG_Border_LeftRidge, #PG_Border_LeftDot, #PG_Border_LeftDash
#PG_Border_TopSolid, #PG_Border_TopDouble, #PG_Border_TopInset, #PG_Border_TopOutset, #PG_Border_TopGroove, #PG_Border_TopRidge, #PG_Border_TopDot, #PG_Border_TopDash
#PG_Border_RightSolid, #PG_Border_RightDouble, #PG_Border_RightInset, #PG_Border_RightOutset, #PG_Border_RightGroove, #PG_Border_RightRidge, #PG_Border_RightDot, #PG_Border_RightDash
#PG_Border_BottomSolid, #PG_Border_BottomDouble, #PG_Border_BottomInset, #PG_Border_BottomOutset, #PG_Border_BottomGroove, #PG_Border_BottomRidge, #PG_Border_BottomDot, #PG_Border_BottomDash

; Masking Control
#PG_Border_NoMask ; Disables internal mask generation (can optimize simple square borders).
#PG_Border_MaskInside ; Renders the border mask inside the border edge instead of centered on it.

Return Value

Returns #True if the flags were successfully set, or #False if the border handle is invalid or not a generated border.

Remarks

Changing the border style flags invalidates the border's internal rendering cache, potentially triggering a regeneration of its internal border image when next drawn. The #PG_Border_NoMask flag can improve performance for simple rectangular borders without rounded corners, as it bypasses the need for an internal mask image.

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyBorder = CreateBorder(#PG_Border_Solid, 5)

If MyBorder
  ; Change style to have a dashed top and dotted bottom
  NewFlags = #PG_Border_Solid | #PG_Border_TopDash | #PG_Border_BottomDot
  If BorderSetFlags(MyBorder, NewFlags)
    Debug "Border style flags updated."
  EndIf
  FreeBorder(MyBorder)
EndIf

StopProGUI()

See Also

CreateBorder, BorderGetFlags, BorderSetWidth, BorderSetColor, BorderSetRadius

Supported OS

Windows, Linux