MacButtonBorder.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 06 Sep 2017 09:47:50 +0200
branchjv
changeset 8179 ced410b68993
parent 6984 7db9175c551b
child 7937 1249a277b511
permissions -rw-r--r--
Build files: fixed project definition ...so it passes the package validation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:libview' }"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
AbstractBorder subclass:#MacButtonBorder
6971
9a049a044a07 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 6964
diff changeset
     6
	instanceVariableNames:'topLeftEdge topRightEdge bottomLeftEdge bottomRightEdge'
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:'TopLeftEdge TopRightEdge BottomLeftEdge BottomRightEdge'
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	category:'Graphics-Support'
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!MacButtonBorder class methodsFor:'documentation'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
documentation
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
    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
    17
    button border. These will look like mac buttons up to maverick.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
    To be continued.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
examples
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
                                                [exBegin]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
     |top v b|
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
     top := StandardSystemView extent:100@100.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
     v := View origin:10@10 corner:90@30 in:top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
     top openAndWait.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
     b := MacButtonBorder new.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
     v border:b.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
                                                [exEnd]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
                                                [exBegin]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
     |top v1 v2 b|
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
     top := StandardSystemView extent:100@200.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
     v1 := View origin:10@10 corner:90@30 in:top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
     v2 := View origin:10@100 corner:90@150 in:top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
     top openAndWait.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
     b := MacButtonBorder new.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
     v1 border:b.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
     v2 border:b.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
                                                [exEnd]
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
"
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
!MacButtonBorder class methodsFor:'initialization'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
initialize
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    53
    "/ self initializeImages. -- done lazy
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    54
!
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    55
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    56
initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    57
    TopLeftEdge := self topLeftImage.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    58
    TopRightEdge := TopLeftEdge copy flipHorizontal.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    59
    BottomLeftEdge := self bottomLeftImage.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    60
    BottomRightEdge := BottomLeftEdge copy flipHorizontal.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
!MacButtonBorder class methodsFor:'image specs'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
bottomLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "This resource specification was automatically generated
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
     by the ImageEditor of ST/X."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    "Do not manually edit this!! If it is corrupted,
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
     the ImageEditor may not be able to read the specification."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
     self bottomLeftImage inspect
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
     ImageEditor openOnClass:self andSelector:#bottomLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
     Icon flushCachedIcons
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    <resource: #image>
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    ^Icon
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        constantNamed:'MacButtonBorder bottomLeftImage'
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
    82
        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
    83
') 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
    84
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
topLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "This resource specification was automatically generated
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     by the ImageEditor of ST/X."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "Do not manually edit this!! If it is corrupted,
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
     the ImageEditor may not be able to read the specification."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
     self topLeftImage inspect
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
     ImageEditor openOnClass:self andSelector:#topLeftImage
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
     Icon flushCachedIcons
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    "
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    <resource: #image>
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    ^Icon
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
        constantNamed:'MacButtonBorder topLeftImage'
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   103
        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
   104
') 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
   105
! !
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   107
!MacButtonBorder methodsFor:'accessing'!
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   109
backgroundColor1:aColor
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
!
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
backgroundColor2: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
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
!MacButtonBorder methodsFor:'displaying'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
displayOn:aGC forDisplayBox:aRectangle
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    "display the borders represented by the receiver in the specified rectangle.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
     The gc is restored after the draw."
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   121
    |left right top bottom savedPaint lw th rw bh|
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    left := aRectangle left.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    right := aRectangle right.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    top := aRectangle top.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    bottom := aRectangle bottom.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    savedPaint := aGC paint.
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   130
    topLeftEdge isNil ifTrue:[
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   131
        self initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   132
    ].
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   133
    
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   134
    lw := topLeftEdge width.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   135
    rw := topRightEdge width.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   136
    th := topLeftEdge height.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   137
    bh := bottomLeftEdge height.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   138
    
6984
7db9175c551b viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6971
diff changeset
   139
    aGC paint:(aGC container viewBackground).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   140
    aGC fillRectangleX:left y:top width:5 height:5.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   141
    aGC fillRectangleX:right-5 y:top width:5 height:5.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   142
    aGC fillRectangleX:right-5 y:bottom-5 width:5 height:5.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   143
    aGC fillRectangleX:left y:bottom-5 width:5 height:5.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   145
    topLeftEdge displayOn:aGC x:left y:top.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   146
    aGC paint:(Color redByte:104 greenByte:104 blueByte:104).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   147
    aGC displayLineFromX:left+lw y:top toX:right-rw y:top.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   148
    aGC paint:(Color redByte:186 greenByte:186 blueByte:186).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   149
    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
   150
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   151
    topRightEdge displayOn:aGC x:(right-rw) y:top.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   152
    aGC paint:(Color redByte:208 greenByte:208 blueByte:208).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   153
    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
   154
    aGC paint:(Color redByte:147 greenByte:147 blueByte:147).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   155
    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
   156
    aGC paint:(Color redByte:191 greenByte:191 blueByte:191).
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   157
    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
   158
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   159
    bottomLeftEdge displayOn:aGC x:left y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    aGC paint:(Color redByte:148 greenByte:148 blueByte:148).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   161
    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
   162
    aGC paint:(Color redByte:56 greenByte:56 blueByte:56).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   163
    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
   164
    aGC paint:(Color redByte:186 greenByte:186 blueByte:186).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   165
    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
   166
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   167
    bottomRightEdge displayOn:aGC x:(right-rw) y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    aGC paint:(Color redByte:186 greenByte:186 blueByte:186).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   169
    aGC displayLineFromX:left y:(top+th) toX:left y:(bottom-bh).
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    aGC paint:(Color redByte:121 greenByte:121 blueByte:121).
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   171
    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
   172
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    aGC paint:savedPaint.
6964
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   174
!
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   175
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   176
initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   177
    TopLeftEdge isNil ifTrue:[
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   178
        self class initializeImages
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   179
    ].
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   180
    
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   181
    topLeftEdge := TopLeftEdge copy.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   182
    topRightEdge := TopRightEdge copy.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   183
    bottomLeftEdge := BottomLeftEdge copy.
a459b5a03d9c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6944
diff changeset
   184
    bottomRightEdge := BottomRightEdge copy.
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
!MacButtonBorder methodsFor:'queries'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
margin
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    ^ 4
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!MacButtonBorder class methodsFor:'documentation'!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
version
6944
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
   196
    ^ '$Header$'
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
!
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
version_CVS
6944
81016c45d31b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6732
diff changeset
   200
    ^ '$Header$'
6732
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
! !
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
b909c5f3bd5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
MacButtonBorder initialize!