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