Fan

 

const class

fwt::Insets

sys::Obj
  fwt::Insets

Insets represent a number of pixels around the edge of a rectangle.

Slots

bottomSource

const Int bottom

Bottom side spacing

defSource

static Insets def := Insets.()

Default instance 0, 0, 0, 0.

equalsSource

override Bool equals(Obj? obj)

Overrides sys::Obj.equals

Return if obj is same Insets value.

fromStrSource

static Insets? fromStr(Str s, Bool checked := true)

Parse from string (see toStr). If invalid and checked is true then throw ParseErr otherwise return null. Supported formats are:

  • "len"
  • "top,right,bottom,left"
hashSource

override Int hash()

Overrides sys::Obj.hash

Return hash of top, right, bottom, left.

leftSource

const Int left

Left side spacing

makeSource

new make(Int top := 0, Int? right := null, Int? bottom := null, Int? left := null)

Construct with optional top, right, bottom, left. If one side is not specified, it is reflected from the opposite side:

Insets(5)     === Insets(5,5,5,5)
Insets(5,6)   === Insets(5,6,5,6)
Insets(5,6,7) === Insets(5,6,7,6)

const Int right

Right side spacing

toSizeSource

Size toSize()

Return right+left, top+bottom

toStrSource

override Str toStr()

Overrides sys::Obj.toStr

If all four sides are equal return "len" otherwise return "top,right,bottom,left".

topSource

const Int top

Top side spacing