MacButtonBorder.st
author Claus Gittinger <cg@exept.de>
Mon, 05 Oct 2015 09:18:32 +0200
changeset 6964 a459b5a03d9c
parent 6944 81016c45d31b
child 6971 9a049a044a07
permissions -rw-r--r--
#UI_ENHANCEMENT class: MacButtonBorder class definition added:7 methods removed:6 methods comment/format in: #examples changed: #displayOn:forDisplayBox: #initialize
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6944
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
     1
"{ Encoding: utf8 }"
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
     2
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:libview' }"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
"{ NameSpace: Smalltalk }"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
AbstractBorder subclass:#MacButtonBorder
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
     8
	instanceVariableNames:'topLeftEdge topRightEdge bottomLeftEdge bottomRightEdge
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
     9
		viewBackgroundColor'
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	classVariableNames:'TopLeftEdge TopRightEdge BottomLeftEdge BottomRightEdge'
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	poolDictionaries:''
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
	category:'Graphics-Support'
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
!MacButtonBorder class methodsFor:'documentation'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
documentation
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
    an as yet unused and unfinished attempt to provide a mac-osx like
6944
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
    20
    button border. These will look like mac buttons up to maverick.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
    To be continued.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
examples
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
                                                [exBegin]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
     |top v b|
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
     top := StandardSystemView extent:100@100.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
     v := View origin:10@10 corner:90@30 in:top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
     top openAndWait.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
     b := MacButtonBorder new.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
     v border:b.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
                                                [exEnd]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
                                                [exBegin]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
     |top v1 v2 b|
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
     top := StandardSystemView extent:100@200.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
     v1 := View origin:10@10 corner:90@30 in:top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
     v2 := View origin:10@100 corner:90@150 in:top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
     top openAndWait.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
     b := MacButtonBorder new.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
     v1 border:b.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
     v2 border:b.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
                                                [exEnd]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!MacButtonBorder class methodsFor:'initialization'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
initialize
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    56
    "/ self initializeImages. -- done lazy
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    57
!
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    58
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    59
initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    60
    TopLeftEdge := self topLeftImage.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    61
    TopRightEdge := TopLeftEdge copy flipHorizontal.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    62
    BottomLeftEdge := self bottomLeftImage.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    63
    BottomRightEdge := BottomLeftEdge copy flipHorizontal.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
!MacButtonBorder class methodsFor:'image specs'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
bottomLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    "This resource specification was automatically generated
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
     by the ImageEditor of ST/X."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "Do not manually edit this!! If it is corrupted,
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
     the ImageEditor may not be able to read the specification."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
     self bottomLeftImage inspect
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
     ImageEditor openOnClass:self andSelector:#bottomLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
     Icon flushCachedIcons
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    <resource: #image>
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    ^Icon
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
        constantNamed:'MacButtonBorder bottomLeftImage'
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    85
        ifAbsentPut:[(Depth8Image width:9 height:10) bits:(ByteArray fromPackedString:'EP8WH"H"H"H"F@\VH"H"H"H"G 4R@RH"H"H"H1DFGRH"H"H"I!!0JB2@"H"H"@BPTA 0%H"H"@@@!!DPTCF"H"@@@@HQLI@PPO@@@@@BLYD@ B@@@@@@@&HQ,U
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    86
') colorMapFromArray:#[0 0 0 45 45 45 56 56 56 66 66 66 70 70 70 72 72 72 76 76 76 89 89 89 92 92 92 93 93 93 103 103 103 110 110 110 111 111 111 112 112 112 121 121 121 147 147 147 150 150 150 165 165 165 169 169 169 176 176 176 181 181 181 186 186 186 192 192 192 197 197 197 198 198 198 199 199 199 200 200 200 204 204 204 206 206 206 209 209 209 212 212 212 216 216 216 222 222 222 224 224 224 226 226 226 229 229 229 231 231 231 233 233 233 235 235 235] mask:((ImageMask width:9 height:10) bits:(ByteArray fromPackedString:'8G? _>A?<G?8_71?O''<_?0??A?<b'); yourself); yourself]
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
topLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "This resource specification was automatically generated
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
     by the ImageEditor of ST/X."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "Do not manually edit this!! If it is corrupted,
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
     the ImageEditor may not be able to read the specification."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
     self topLeftImage inspect
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
     ImageEditor openOnClass:self andSelector:#topLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
     Icon flushCachedIcons
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    <resource: #image>
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    ^Icon
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
        constantNamed:'MacButtonBorder topLeftImage'
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   106
        ifAbsentPut:[(Depth8Image width:9 height:10) bits:(ByteArray fromPackedString:'@@@@@@@_G1@C@@@@@A<Q@P,T@@@@G0\DGQ8^@@@_BP _G!!8^@A<OA!!\^G!!8^G1,BD10^G!!8^G08LFQ8^G!!8^GPTRG!!8^G!!8^F@(VG!!8^G!!8^EP4ZG!!8^G!!8^
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   107
') colorMapFromArray:#[0 0 0 91 91 91 102 102 102 104 104 104 109 109 109 110 110 110 115 115 115 117 117 117 118 118 118 119 119 119 121 121 121 123 123 123 139 139 139 143 143 143 146 146 146 153 153 153 155 155 155 158 158 158 169 169 169 174 174 174 187 187 187 191 191 191 192 192 192 199 199 199 203 203 203 204 204 204 207 207 207 217 217 217 219 219 219 221 221 221 224 224 224 229 229 229] mask:((ImageMask width:9 height:10) bits:(ByteArray fromPackedString:'A?<O?19?OG=8_?!!?<G? _>A?8G<b'); yourself); yourself]
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   108
! !
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   110
!MacButtonBorder methodsFor:'accessing'!
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   112
backgroundColor1:aColor
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   115
backgroundColor2:aColor
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   118
viewBackgroundColor
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   119
    ^ viewBackgroundColor
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   120
!
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   122
viewBackgroundColor:aColor
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   123
    viewBackgroundColor ~= aColor ifTrue:[
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   124
        viewBackgroundColor := aColor.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   125
        topLeftEdge := topRightEdge := bottomLeftEdge := bottomRightEdge := nil.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   126
    ].
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
!MacButtonBorder methodsFor:'displaying'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
displayOn:aGC forDisplayBox:aRectangle
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    "display the borders represented by the receiver in the specified rectangle.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
     The gc is restored after the draw."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   135
    |left right top bottom savedPaint lw th rw bh|
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
    left := aRectangle left.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    right := aRectangle right.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    top := aRectangle top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    bottom := aRectangle bottom.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    savedPaint := aGC paint.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   144
    topLeftEdge isNil ifTrue:[
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   145
        self initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   146
    ].
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   147
    
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   148
    lw := topLeftEdge width.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   149
    rw := topRightEdge width.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   150
    th := topLeftEdge height.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   151
    bh := bottomLeftEdge height.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   152
    
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   153
    aGC paint:(aGC viewBackground).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   154
    aGC fillRectangleX:left y:top width:5 height:5.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   155
    aGC fillRectangleX:right-5 y:top width:5 height:5.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   156
    aGC fillRectangleX:right-5 y:bottom-5 width:5 height:5.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   157
    aGC fillRectangleX:left y:bottom-5 width:5 height:5.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   159
    topLeftEdge displayOn:aGC x:left y:top.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   160
    aGC paint:(Color redByte:104 greenByte:104 blueByte:104).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   161
    aGC displayLineFromX:left+lw y:top toX:right-rw y:top.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   162
    aGC paint:(Color redByte:186 greenByte:186 blueByte:186).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   163
    aGC displayLineFromX:left+lw y:top+1 toX:right-rw y:top+1.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   165
    topRightEdge displayOn:aGC x:(right-rw) y:top.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   166
    aGC paint:(Color redByte:208 greenByte:208 blueByte:208).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   167
    aGC displayLineFromX:right-3 y:(top+th) toX:right-3 y:(bottom-bh).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   168
    aGC paint:(Color redByte:147 greenByte:147 blueByte:147).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   169
    aGC displayLineFromX:right-2 y:(top+th) toX:right-2 y:(bottom-bh).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   170
    aGC paint:(Color redByte:191 greenByte:191 blueByte:191).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   171
    aGC displayLineFromX:right-1 y:(top+th) toX:right-1 y:(bottom-bh).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   172
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   173
    bottomLeftEdge displayOn:aGC x:left y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
    aGC paint:(Color redByte:148 greenByte:148 blueByte:148).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   175
    aGC displayLineFromX:left+lw y:bottom-1-2 toX:right-rw y:bottom-1-2.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    aGC paint:(Color redByte:56 greenByte:56 blueByte:56).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   177
    aGC displayLineFromX:left+lw y:bottom-1-1 toX:right-rw y:bottom-1-1.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    aGC paint:(Color redByte:186 greenByte:186 blueByte:186).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   179
    aGC displayLineFromX:left+lw y:bottom-1 toX:right-rw y:bottom-1.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   181
    bottomRightEdge displayOn:aGC x:(right-rw) y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    aGC paint:(Color redByte:186 greenByte:186 blueByte:186).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   183
    aGC displayLineFromX:left y:(top+th) toX:left y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    aGC paint:(Color redByte:121 greenByte:121 blueByte:121).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   185
    aGC displayLineFromX:left+1 y:(top+th) toX:left+1 y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
    aGC paint:savedPaint.
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   188
!
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   189
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   190
initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   191
    TopLeftEdge isNil ifTrue:[
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   192
        self class initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   193
    ].
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   194
    
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   195
    topLeftEdge := TopLeftEdge copy.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   196
    topRightEdge := TopRightEdge copy.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   197
    bottomLeftEdge := BottomLeftEdge copy.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   198
    bottomRightEdge := BottomRightEdge copy.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
!MacButtonBorder methodsFor:'queries'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
margin
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    ^ 4
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
!MacButtonBorder class methodsFor:'documentation'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
version
6944
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
   210
    ^ '$Header$'
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
version_CVS
6944
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
   214
    ^ '$Header$'
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
MacButtonBorder initialize!