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