MacFlatButtonBorder.st
author Claus Gittinger <cg@exept.de>
Sat, 03 Oct 2015 16:06:29 +0200
changeset 6942 b804dc9f04de
child 6943 80ae41ea8a5b
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:libview' }"
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
SimpleBorder subclass:#MacFlatButtonBorder
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:'insideColor imgTopLeft imgTopRight imgBottomLeft imgBottomRight'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	category:'Graphics-Support'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!MacFlatButtonBorder class methodsFor:'instance creation'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
color:color1 insideColor:color2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
    "create a new instance of the receiver with a border of the given color."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
    ^ self new color:color1; insideColor:color2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!MacFlatButtonBorder class methodsFor:'image specs'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
topLeftImageFilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
     self topLeftImageFilled inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
     ImageEditor openOnClass:self andSelector:#topLeftImageFilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
        constantNamed:'MacOSXRoundButtonBorder topLeftImageFilled'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
        ifAbsentPut:[(Depth8Image width:4 height:4) bits:(ByteArray fromPackedString:'@@LB@PLA@P@B@P@@@P@@@@@a') colorMapFromArray:#[44 132 251 49 107 245 95 142 236 175 196 234] mask:((ImageMask width:4 height:4) bits:(ByteArray fromPackedString:'\OC0<@@a'); yourself); yourself]
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
topLeftImageUnfilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
     self topLeftImageUnfilled inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilled'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'9HMOO0@a') colorMapFromArray:#[183 183 183 201 201 201 224 224 224 255 255 255] mask:((ImageMask width:4 height:4) bits:(ByteArray fromPackedString:'\OC0<@@a'); yourself); yourself]
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
topLeftImageUnfilledMasked
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
     self topLeftImageUnfilledMasked inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilledMasked'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'IHA@@@@a') colorMapFromArray:#[183 183 183 201 201 201 224 224 224 255 255 255] mask:((ImageMask width:4 height:4) bits:(ByteArray fromPackedString:'\NC@ @@a'); yourself); yourself]
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
topLeftImageUnfilledMasked2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
     self topLeftImageUnfilledMasked2 inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilledMasked2'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'IH!! @@@a') colorMapFromArray:#[183 183 183 201 201 201 224 224 224 255 255 255] mask:((ImageMask width:4 height:4) bits:(ByteArray fromPackedString:'\NC@ @@a'); yourself); yourself]
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
topLeftImageUnfilledMasked3
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
     self topLeftImageUnfilledMasked3 inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked3
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilledMasked3'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'HH  @@@a') colorMapFromArray:#[183 183 183 201 201 201 224 224 224 255 255 255] mask:((ImageMask width:4 height:4) bits:(ByteArray fromPackedString:'\NC@ @@a'); yourself); yourself]
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
!MacFlatButtonBorder methodsFor:'accessing'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
color:newColor
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    color ~= newColor ifTrue:[        
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
        color := newColor.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
        imgTopLeft := imgTopRight := imgBottomLeft := imgBottomRight := nil.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    ].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
insideColor:newColor
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    insideColor ~= newColor ifTrue:[        
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
        insideColor := newColor.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
        imgTopLeft := imgTopRight := imgBottomLeft := imgBottomRight := nil.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    ].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
!MacFlatButtonBorder methodsFor:'displaying'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
displayOn:aGC forDisplayBox:aRectangle
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    |oldPaint boxLeft boxRight boxTop boxBottom boxWidth boxHeight|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    color isNil ifTrue:[ ^ self].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    oldPaint := aGC paint.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    aGC paint:color.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    boxLeft := aRectangle left.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    boxTop := aRectangle top.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    boxWidth := aRectangle width.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    boxHeight := aRectangle height.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    boxRight := boxLeft + boxWidth.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
    boxBottom := boxTop + boxHeight.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    imgTopLeft isNil ifTrue:[
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
        self makeImages.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    ].    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    aGC displayImage:imgTopLeft x:boxLeft y:boxTop.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    aGC displayImage:imgTopRight x:boxRight-4 y:boxTop.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    aGC displayImage:imgBottomRight x:boxRight-4 y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    aGC displayImage:imgBottomLeft x:boxLeft y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    aGC displayLineFromX:boxLeft+4 y:boxTop toX:boxRight-4 y:boxTop.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    aGC displayLineFromX:boxLeft+4 y:boxBottom-1 toX:boxRight-4 y:boxBottom-1.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    aGC displayLineFromX:boxLeft y:boxTop+4 toX:boxLeft y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    aGC displayLineFromX:boxRight-1 y:boxTop+4 toX:boxRight-1 y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    aGC paint:oldPaint.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
     |v1 v2|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
     v1 := TopView new.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
     v2 := View origin:10@10 corner:100@30 in:v1.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
     v2 border:(MacOSXRoundButtonBorder color:Color red).
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
     v1 open.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
     |v1 v2|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
     v1 := TopView new.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
     v2 := View origin:10@10 corner:100@30 in:v1.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
     v2 border:(MacOSXRoundButtonBorder color:Color red insideColor:Color blue).
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
     v1 open.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
!MacFlatButtonBorder methodsFor:'private'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
makeImages
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    |protoImage img hue light sat innerHue innerLight innerSat|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    hue := color hue.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    light := color light.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    sat := color saturation.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    insideColor isNil ifTrue:[
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
        protoImage := self class topLeftImageUnfilledMasked3.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    ] ifFalse:[    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
        insideColor hue isNil ifTrue:[
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
            protoImage := self class topLeftImageUnfilled.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
        ] ifFalse:[    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
            protoImage := self class topLeftImageFilled.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
            innerHue := insideColor hue.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
            innerLight := insideColor light.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
            innerSat := insideColor saturation.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
        ].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    ].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    img := protoImage copy.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    innerHue notNil ifTrue:[
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
        img colorMap at:1 put:insideColor.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
        img colorMap at:2 put:color.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
        img colorMap at:3 put:(Color hue:hue light:light+8 saturation:sat-12).
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
        img colorMap at:4 put:(Color hue:hue light:light+20 saturation:sat-40).
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    ] ifFalse:[
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
        img colorMap at:1 put:color.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
        img colorMap at:2 put:(Color hue:hue light:light+15 saturation:sat-12).
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
        img colorMap at:3 put:(Color hue:hue light:light+30 saturation:sat-40).
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    ].    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    imgTopLeft := img.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    imgTopRight := img rotated:90.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
    imgBottomLeft := img rotated:-90.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    imgBottomRight := img rotated:180.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
!MacFlatButtonBorder class methodsFor:'documentation'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
version
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    ^ '$Header$'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
version_CVS
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
    ^ '$Header$'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240