MacFlatButtonBorder.st
author Claus Gittinger <cg@exept.de>
Fri, 03 Feb 2017 16:57:58 +0100
changeset 7835 019761925559
parent 7040 9de35e2b291f
child 7938 6b2cbf0d7e12
permissions -rw-r--r--
#TUNING by cg class: MacFlatButtonBorder class definition comment/format in: #backgroundColor1: #backgroundColor2: changed: #makeImages remember rotated images to avoid repeated image preparation.
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
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
     6
	instanceVariableNames:'backgroundColor1 backgroundColor2 imgTopLeft imgTopRight
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
     7
		imgBottomLeft imgBottomRight'
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
     8
	classVariableNames:'CachedImagesPerColors'
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	poolDictionaries:''
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	category:'Graphics-Support'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
6943
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    13
!MacFlatButtonBorder class methodsFor:'documentation'!
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    14
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    15
documentation
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    16
"
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    17
    an as yet unused and unfinished attempt to provide a mac-osx like
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    18
    button border. These will look like mac buttons in yosemite (i.e. ugly old 70s retro flat style).
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    19
    To be continued.
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    20
"
80ae41ea8a5b initial checkin
Claus Gittinger <cg@exept.de>
parents: 6942
diff changeset
    21
! !
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!MacFlatButtonBorder class methodsFor:'instance creation'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
    25
color:color1 backgroundColor:color2
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
    26
    "create a new instance of the receiver with a border of the given color."
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
    27
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
    28
    ^ self new color:color1; backgroundColor:color2
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
    29
!
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
    30
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
color:color1 insideColor:color2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    "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
    33
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
    ^ self new color:color1; insideColor:color2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!MacFlatButtonBorder class methodsFor:'image specs'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
topLeftImageFilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
     self topLeftImageFilled inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
     ImageEditor openOnClass:self andSelector:#topLeftImageFilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        constantNamed:'MacOSXRoundButtonBorder topLeftImageFilled'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        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
    57
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
topLeftImageUnfilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
     self topLeftImageUnfilled inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilled
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilled'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
        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
    77
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
topLeftImageUnfilledMasked
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
     self topLeftImageUnfilledMasked inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilledMasked'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
        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
    97
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
topLeftImageUnfilledMasked2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
     self topLeftImageUnfilledMasked2 inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked2
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
     Icon flushCachedIcons
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilledMasked2'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
        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
   117
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
topLeftImageUnfilledMasked3
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    "This resource specification was automatically generated
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
     by the ImageEditor of ST/X."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "Do not manually edit this!! If it is corrupted,
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
     the ImageEditor may not be able to read the specification."
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
     self topLeftImageUnfilledMasked3 inspect
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked3
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
     Icon flushCachedIcons
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
    <resource: #image>
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    ^Icon
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
        constantNamed:'MacOSXRoundButtonBorder topLeftImageUnfilledMasked3'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
        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]
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   137
!
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   138
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   139
topLeftImageUnfilledMasked4
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   140
    "This resource specification was automatically generated
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   141
     by the ImageEditor of ST/X."
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   142
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   143
    "Do not manually edit this!! If it is corrupted,
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   144
     the ImageEditor may not be able to read the specification."
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   145
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   146
    "
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   147
     self topLeftImageUnfilledMasked4 inspect
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   148
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked4
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   149
     Icon flushCachedIcons
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   150
    "
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   151
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   152
    <resource: #image>
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   153
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   154
    ^Icon
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   155
        constantNamed:'MacFlatButtonBorder topLeftImageUnfilledMasked4'
6973
12bfcaedde29 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6965
diff changeset
   156
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'HH,/O0@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]
6982
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   157
!
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   158
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   159
topLeftImageUnfilledMasked5
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   160
    "This resource specification was automatically generated
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   161
     by the ImageEditor of ST/X."
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   162
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   163
    "Do not manually edit this!! If it is corrupted,
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   164
     the ImageEditor may not be able to read the specification."
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   165
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   166
    "
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   167
     self topLeftImageUnfilledMasked5 inspect
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   168
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked5
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   169
     Icon flushCachedIcons
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   170
    "
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   171
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   172
    <resource: #image>
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   173
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   174
    ^Icon
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   175
        constantNamed:'MacFlatButtonBorder topLeftImageUnfilledMasked5'
6056c7d05b97 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6976
diff changeset
   176
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'HH<?O0@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]
6985
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   177
!
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   178
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   179
topLeftImageUnfilledMasked6
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   180
    "This resource specification was automatically generated
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   181
     by the ImageEditor of ST/X."
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   182
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   183
    "Do not manually edit this!! If it is corrupted,
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   184
     the ImageEditor may not be able to read the specification."
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   185
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   186
    "
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   187
     self topLeftImageUnfilledMasked6 inspect
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   188
     ImageEditor openOnClass:self andSelector:#topLeftImageUnfilledMasked6
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   189
     Icon flushCachedIcons
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   190
    "
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   191
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   192
    <resource: #image>
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   193
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   194
    ^Icon
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   195
        constantNamed:'MacFlatButtonBorder topLeftImageUnfilledMasked6'
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   196
        ifAbsentPut:[(Depth2Image width:4 height:4) bits:(ByteArray fromPackedString:'@@<?O0@a') colorMapFromArray:#[183 183 183 201 201 201 224 224 224 255 255 255] mask:((ImageMask width:4 height:4) bits:(ByteArray fromPackedString:'LGC0<@@a'); yourself); yourself]
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
!MacFlatButtonBorder methodsFor:'accessing'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   201
backgroundColor1
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   202
    "the first gradient color"
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   203
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   204
    ^ backgroundColor1
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   205
!
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   206
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   207
backgroundColor1:newColor
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   208
    "the first gradient color"
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   209
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   210
    backgroundColor1 ~= newColor ifTrue:[        
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   211
        backgroundColor1 := newColor.
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   212
        "/ flush cached images
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   213
        imgTopLeft := imgTopRight := imgBottomLeft := imgBottomRight := nil.
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   214
    ]
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   215
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   216
    "Modified (comment): / 03-02-2017 / 16:43:49 / cg"
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   217
!
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   218
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   219
backgroundColor2
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   220
    "the second gradient color"
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   221
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   222
    ^ backgroundColor2
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   223
!
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   224
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   225
backgroundColor2:newColor
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   226
    "the second gradient color"
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   227
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   228
    backgroundColor2 ~= newColor ifTrue:[        
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   229
        backgroundColor2 := newColor.
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   230
        "/ flush cached images
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   231
        imgTopLeft := imgTopRight := imgBottomLeft := imgBottomRight := nil.
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   232
    ]
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   233
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   234
    "Modified (comment): / 03-02-2017 / 16:43:53 / cg"
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   235
!
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   236
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
color:newColor
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   238
    "the color of the border"
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   239
    
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    color ~= newColor ifTrue:[        
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
        color := newColor.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
        imgTopLeft := imgTopRight := imgBottomLeft := imgBottomRight := nil.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    ].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
!MacFlatButtonBorder methodsFor:'displaying'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
displayOn:aGC forDisplayBox:aRectangle
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    |oldPaint boxLeft boxRight boxTop boxBottom boxWidth boxHeight|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
    color isNil ifTrue:[ ^ self].
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
    oldPaint := aGC paint.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
    boxLeft := aRectangle left.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    boxTop := aRectangle top.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    boxWidth := aRectangle width.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    boxHeight := aRectangle height.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    boxRight := boxLeft + boxWidth.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    boxBottom := boxTop + boxHeight.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
    imgTopLeft isNil ifTrue:[
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
        self makeImages.
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   265
        imgTopLeft isNil ifTrue:[
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   266
            ^ self
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   267
        ].    
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    ].    
7040
Claus Gittinger <cg@exept.de>
parents: 6985
diff changeset
   269
    aGC container isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 6985
diff changeset
   270
        aGC paint:(aGC viewBackground).
Claus Gittinger <cg@exept.de>
parents: 6985
diff changeset
   271
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 6985
diff changeset
   272
        aGC paint:(aGC container viewBackground).
Claus Gittinger <cg@exept.de>
parents: 6985
diff changeset
   273
    ].
6973
12bfcaedde29 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6965
diff changeset
   274
    aGC fillRectangleX:boxLeft y:boxTop width:2 height:2.
12bfcaedde29 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6965
diff changeset
   275
    aGC fillRectangleX:boxRight-2 y:boxTop width:2 height:2.
12bfcaedde29 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6965
diff changeset
   276
    aGC fillRectangleX:boxRight-2 y:boxBottom-2 width:2 height:2.
12bfcaedde29 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6965
diff changeset
   277
    aGC fillRectangleX:boxLeft y:boxBottom-2 width:2 height:2.
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   278
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
    aGC displayImage:imgTopLeft x:boxLeft y:boxTop.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    aGC displayImage:imgTopRight x:boxRight-4 y:boxTop.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
    aGC displayImage:imgBottomRight x:boxRight-4 y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
    aGC displayImage:imgBottomLeft x:boxLeft y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   284
    aGC paint:color.
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
    aGC displayLineFromX:boxLeft+4 y:boxTop toX:boxRight-4 y:boxTop.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
    aGC displayLineFromX:boxLeft+4 y:boxBottom-1 toX:boxRight-4 y:boxBottom-1.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
    aGC displayLineFromX:boxLeft y:boxTop+4 toX:boxLeft y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    aGC displayLineFromX:boxRight-1 y:boxTop+4 toX:boxRight-1 y:boxBottom-4.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    aGC paint:oldPaint.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
     |v1 v2|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
     v1 := TopView new.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
     v2 := View origin:10@10 corner:100@30 in:v1.
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   297
     v2 border:(MacFlatButtonBorder color:Color red).
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
     v1 open.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
     |v1 v2|
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
     v1 := TopView new.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
     v2 := View origin:10@10 corner:100@30 in:v1.
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   305
     v2 border:((MacFlatButtonBorder color:Color red) backgroundColor1:Color blue; backgroundColor2:Color green).
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
     v1 open.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    "
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
!MacFlatButtonBorder methodsFor:'private'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
makeImages
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   313
    |cachedImages protoImage img hue light sat|
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   314
    
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   315
    CachedImagesPerColors isNil ifTrue:[
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   316
        CachedImagesPerColors := OrderedDictionary new.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   317
    ].
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   318
    cachedImages := CachedImagesPerColors at:{color . backgroundColor1 . backgroundColor2} ifAbsent:nil.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   319
    cachedImages notNil ifTrue:[
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   320
        imgTopLeft := cachedImages at:1.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   321
        imgTopRight := cachedImages at:2.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   322
        imgBottomLeft := cachedImages at:3.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   323
        imgBottomRight := cachedImages at:4.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   324
        ^ self.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   325
    ].
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    hue := color hue.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
    light := color light.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    sat := color saturation.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
6985
d5f5ff0cae1a viewbackground from container
Claus Gittinger <cg@exept.de>
parents: 6982
diff changeset
   331
    protoImage := self class topLeftImageUnfilledMasked6.
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
    img := protoImage copy.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   334
    img colorMap at:1 put:color.
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   335
    hue notNil ifTrue:[
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
        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
   337
        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
   338
    ].    
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    imgTopLeft := img.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
    imgTopRight := img rotated:90.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    imgBottomLeft := img rotated:-90.
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    imgBottomRight := img rotated:180.
6965
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   343
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   344
    backgroundColor1 notNil ifTrue:[ 
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   345
        imgTopLeft colorMap at:4 put:backgroundColor1. 
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   346
        imgTopRight colorMap at:4 put:backgroundColor1. 
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   347
    ].
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   348
    backgroundColor2 notNil ifTrue:[ 
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   349
        imgBottomLeft colorMap at:4 put:backgroundColor2. 
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   350
        imgBottomRight colorMap at:4 put:backgroundColor2. 
066bfdfbb5b3 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 6943
diff changeset
   351
    ].
6976
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   352
    
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   353
"/    imgBottomRight colorMap at:1 put:color darkened. 
38ae15a18db3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 6973
diff changeset
   354
"/    imgBottomRight colorMap at:2 put:color slightlyDarkened. 
7835
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   355
"/    imgBottomRight colorMap at:3 put:color slightlyDarkened.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   356
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   357
    CachedImagesPerColors 
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   358
        at:{color . backgroundColor1 . backgroundColor2} 
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   359
        put:{imgTopLeft. imgTopRight. imgBottomLeft . imgBottomRight}.
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   360
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   361
    CachedImagesPerColors size > 20 ifTrue:[
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   362
        CachedImagesPerColors removeFirst
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   363
    ].
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   364
019761925559 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 7040
diff changeset
   365
    "Modified: / 03-02-2017 / 16:49:48 / cg"
6942
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
!MacFlatButtonBorder class methodsFor:'documentation'!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
version
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
    ^ '$Header$'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
!
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
version_CVS
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
    ^ '$Header$'
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
! !
b804dc9f04de initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377