extensions.st
author Claus Gittinger <cg@exept.de>
Fri, 28 Jun 2019 08:49:48 +0200
changeset 4283 0d95d298a44b
parent 4139 6dffe5499f3b
permissions -rw-r--r--
#OTHER by cg self class name -> self className

"{ Package: 'stx:libview2' }"!

!CharacterArray methodsFor:'converting'!

asMimeType
    "return myself as a mimeType instance"

    ^ MIMETypes mimeTypeFromString:self string

    "
     'text/html' asMimeType isTextType
     'text/html' asMimeType isImage
     'image/gif' asMimeType isImage
     'image/gif' asMimeType asMimeType
    "
! !

!Point methodsFor:'converting'!

asFractionalLayout
    "return a LayoutOrigin from the receiver,
     treating the receiver coordinates as fractional parts
     (i.e. relative to superview).
     Notice: in 10.5.x LayoutOrigin is not yet officially released."

    ^ LayoutOrigin fractionalFromPoint:self

    "
     (0@0.5) asFractionalLayout
     (0@0.5) asLayout
     (0@10) asLayout
     (0@10) asOffsetLayout
    "

! !

!Point methodsFor:'converting'!

asLayout
    "return a LayoutOrigin from the receiver.
     If the receiver coordinates are between 0 and 1, take
     them as fractional parts (relative to superview).
     Otherwise, treat them as absolute offsets.
     Notice: in 10.5.x LayoutOrigin is not yet released."

    ^ LayoutOrigin fromPoint:self

    "
     (0@0.5) asFractionalLayout
     (0@0.5) asLayout
     (0@10) asLayout
     (0@10) asOffsetLayout
    "

! !

!Point methodsFor:'converting'!

asOffsetLayout
    "return a LayoutOrigin from the receiver,
     treating the receiver coordinates as absolute offsets.
     Notice: in 10.5.x LayoutOrigin is not yet released."

    ^ LayoutOrigin offsetFromPoint:self

    "
     (0@0.5) asFractionalLayout
     (0@0.5) asLayout
     (0@10) asLayout
     (0@10) asOffsetLayout
    "

! !

!stx_libview2 class methodsFor:'documentation'!

extensionsVersion_CVS
    ^ '$Header$'
! !

!stx_libview2 class methodsFor:'documentation'!

extensionsVersion_SVN
    ^ 'Id:'
! !