GradientBackground.st
author Stefan Vogel <sv@exept.de>
Thu, 16 Jan 2014 15:31:54 +0100
changeset 6202 020ebdb99a1e
parent 6102 48352566d4e0
child 6769 5421316e7200
permissions -rw-r--r--
Replace references to Diplay with "Screen current" - where appropriate
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5461
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2009 by eXept Software AG
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libview' }"
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
AbstractBackground subclass:#GradientBackground
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    15
	instanceVariableNames:'color1 color2 direction cachedForm usedLength'
5461
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Graphics-Support'
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!GradientBackground class methodsFor:'documentation'!
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2009 by eXept Software AG
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    35
!
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    36
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    37
examples
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    38
"
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    39
    |bg v|
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    40
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    41
    bg := GradientBackground new color1:Color red color2:Color yellow.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    42
    v := View new extent:300@300.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    43
    v viewBackground:bg.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    44
    v open.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    45
"
5461
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
! !
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
6013
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    48
!GradientBackground class methodsFor:'instance creation'!
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    49
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    50
horizontal:color1 to:color2
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    51
    ^ self new 
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    52
        direction:#eastWest;
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    53
        color1:color1 color2:color2
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    54
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    55
    "
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    56
     |bg v|
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    57
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    58
     bg := GradientBackground horizontal:Color red to:Color yellow.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    59
     v := View new extent:300@300.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    60
     v viewBackground:bg.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    61
     v open.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    62
    "
6014
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    63
    "
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    64
     |bg v|
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    65
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    66
     bg := GradientBackground horizontal:Color red to:Color yellow.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    67
     v := View new extent:300@300.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    68
     v viewBackground:bg.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    69
     v open.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
    70
    "
6013
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    71
!
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    72
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    73
vertical:color1 to:color2
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    74
    ^ self new 
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    75
        direction:#northSouth;
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    76
        color1:color1 color2:color2
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    77
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    78
    "
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    79
     |bg v|
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    80
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    81
     bg := GradientBackground vertical:Color red to:Color yellow.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    82
     v := View new extent:300@300.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    83
     v viewBackground:bg.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    84
     v open.
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    85
    "
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    86
! !
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
    87
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    88
!GradientBackground methodsFor:'accessing'!
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    89
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    90
color1
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    91
    ^ color1
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    92
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    93
    "Created: / 23-01-2011 / 02:01:29 / cg"
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    94
!
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    95
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    96
color1:aColor
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    97
    color1 := aColor.
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
    98
    cachedForm := nil.
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
    99
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   100
    "Created: / 23-01-2011 / 02:01:50 / cg"
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   101
    "Modified: / 03-02-2011 / 19:49:18 / cg"
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   102
!
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   103
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   104
color1:aColor1 color2:aColor2
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   105
    color1 := aColor1.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   106
    color2 := aColor2.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   107
    cachedForm := nil.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   108
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   109
    "Created: / 03-02-2011 / 19:52:59 / cg"
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   110
!
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   111
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   112
color2
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   113
    ^ color2
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   114
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   115
    "Created: / 23-01-2011 / 02:01:32 / cg"
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   116
!
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   117
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   118
color2:aColor
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   119
    color2 := aColor.
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   120
    cachedForm := nil.
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   121
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   122
    "Created: / 23-01-2011 / 02:01:55 / cg"
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   123
    "Modified: / 03-02-2011 / 19:49:23 / cg"
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   124
!
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   125
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   126
direction
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   127
    "possible values:
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   128
        #northSouth
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   129
        #eastWest
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   130
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   131
     others are not yet supported
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   132
    "
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   133
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   134
    ^ direction
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   135
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   136
    "Modified: / 23-01-2011 / 14:36:36 / cg"
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   137
!
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   138
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   139
direction:something
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   140
    "possible values:
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   141
        #northSouth
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   142
        #eastWest
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   143
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   144
     others are not yet supported
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   145
    "
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   146
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   147
    direction ~= something ifTrue:[
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   148
        direction := something.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   149
        cachedForm := nil.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   150
    ]
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   151
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   152
    "Modified: / 03-02-2011 / 19:49:41 / cg"
5738
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   153
!
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   154
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   155
usedLength
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   156
    ^ usedLength
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   157
!
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   158
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   159
usedLength:something
Claus Gittinger <cg@exept.de>
parents: 5733
diff changeset
   160
    usedLength := something.
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   161
! !
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   162
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   163
!GradientBackground methodsFor:'converting'!
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   164
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   165
asFormOn:aDevice
6014
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   166
    |h w len|
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   167
6102
48352566d4e0 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6014
diff changeset
   168
    usedLength == #full ifTrue:[
48352566d4e0 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6014
diff changeset
   169
        self halt:'unsupported'. 
48352566d4e0 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6014
diff changeset
   170
        ^ nil
48352566d4e0 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6014
diff changeset
   171
    ].
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   172
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   173
    cachedForm isNil ifTrue:[
6014
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   174
        (len := usedLength) == #full ifTrue:[
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   175
            len := nil
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   176
        ].
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   177
        (direction == #northSouth or:[direction == nil]) ifTrue:[
6202
020ebdb99a1e Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 6102
diff changeset
   178
            h := len ? (aDevice height). "/ aView height.
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   179
            w := 8.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   180
        ] ifFalse:[
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   181
            h := 8.
6202
020ebdb99a1e Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 6102
diff changeset
   182
            w := len ? (aDevice width).  "/ aView width.
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   183
        ].
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   184
        cachedForm := Form width:w height:h depth:aDevice depth onDevice:aDevice.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   185
        "/ cachedForm clear.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   186
        self fillRectangleX:0 y:0 width:w height:h in:cachedForm
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   187
    ].
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   188
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   189
    ^ cachedForm
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   190
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   191
    "Created: / 03-02-2011 / 20:05:30 / cg"
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   192
!
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   193
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   194
onDevice:device
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   195
    ^ self asFormOn:device.
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   196
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   197
    "Created: / 03-02-2011 / 19:56:06 / cg"
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   198
! !
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   199
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   200
!GradientBackground methodsFor:'drawing'!
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   201
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   202
fillRectangleX:x y:y width:w height:h in:aView
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   203
    "this is a first (very inefficient) try"
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   204
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   205
    |hAll wAll r1 r2 g1 g2 b1 b2 dR r dG g dB b scaleStartX scaleStartY
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   206
     yRect hRun xRect wRun 
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   207
     rC gC bC lastR lastG lastB 
5731
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   208
     minR maxR minG maxG minB maxB|
5687
d4ab14b6cf0a changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5684
diff changeset
   209
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   210
    "/ always take the full-screen as reference
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   211
    "/ (so we do not have to care for changed gradient, when view changes size)
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   212
    usedLength notNil ifTrue:[
6014
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   213
        usedLength == #full ifTrue:[
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   214
            hAll := aView height.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   215
            wAll := aView width.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   216
            scaleStartX := 0.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   217
            scaleStartY := 0.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   218
        ] ifFalse:[
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   219
            hAll := usedLength.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   220
            wAll := usedLength.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   221
            scaleStartX := 0.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   222
            scaleStartY := 0.
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   223
        ]
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   224
    ] ifFalse:[
6202
020ebdb99a1e Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 6102
diff changeset
   225
        hAll := aView device height. "/ aView height.
020ebdb99a1e Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 6102
diff changeset
   226
        wAll := aView device width.  "/ aView width.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   227
        scaleStartX := x.
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   228
        scaleStartY := y.
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   229
    ].
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   230
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   231
    r1 := color1 redByte.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   232
    r2 := color2 redByte.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   233
    g1 := color1 greenByte.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   234
    g2 := color2 greenByte.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   235
    b1 := color1 blueByte.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   236
    b2 := color2 blueByte.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   237
5731
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   238
    minR := r1 min:r2.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   239
    maxR := r1 max:r2.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   240
    minG := g1 min:g2.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   241
    maxG := g1 max:g2.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   242
    minB := b1 min:b2.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   243
    maxB := b1 max:b2.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   244
5728
c3c7f362b4c3 changed: #fillRectangleX:y:width:height:in:
Stefan Vogel <sv@exept.de>
parents: 5705
diff changeset
   245
    aView lineStyle:#solid.
c3c7f362b4c3 changed: #fillRectangleX:y:width:height:in:
Stefan Vogel <sv@exept.de>
parents: 5705
diff changeset
   246
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   247
    "/ individual lines; from top to bottom
5705
56318de85b68 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5692
diff changeset
   248
    (direction == #northSouth or:[direction == #vertical or:[direction == nil]]) ifTrue:[
5687
d4ab14b6cf0a changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5684
diff changeset
   249
        dR := (r2 - r1) / hAll.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   250
        r := r1 + (dR * scaleStartY).
5687
d4ab14b6cf0a changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5684
diff changeset
   251
        dG := (g2 - g1) / hAll.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   252
        g := g1 + (dG * scaleStartY).
5687
d4ab14b6cf0a changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5684
diff changeset
   253
        dB := (b2 - b1) / hAll.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   254
        b := b1 + (dB * scaleStartY).
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   255
5732
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   256
        r := (r max:minR) min:maxR. 
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   257
        g := (g max:minG) min:maxG.
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   258
        b := (b max:minB) min:maxB.
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   259
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   260
        lastR := r asInteger. lastG := g asInteger. lastB := b asInteger.
5732
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   261
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   262
        yRect := y.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   263
        hRun := 0.
5731
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   264
        y to:y+h-1 do:[:yP |
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   265
            rC := r asInteger.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   266
            gC := g asInteger.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   267
            bC := b asInteger.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   268
            (rC ~~ lastR or:[gC ~~ lastG or:[bC ~~ lastB]]) ifTrue:[
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   269
                aView paint:(Color redByte:lastR greenByte:lastG blueByte:lastB).
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   270
                aView fillRectangleX:x y:yRect width:w height:hRun.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   271
                yRect := yP. hRun := 0.
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   272
                lastR := rC. lastG := gC. lastB := bC.
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   273
            ].
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   274
            hRun := hRun + 1.
5731
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   275
            r := ((r + dR) max:minR) min:maxR. 
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   276
            g := ((g + dG) max:minG) min:maxG.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   277
            b := ((b + dB) max:minB) min:maxB.
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   278
        ].
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   279
        hRun ~~ 0 ifTrue:[
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   280
            aView paint:(Color redByte:lastR greenByte:lastG blueByte:lastB).
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   281
            aView fillRectangleX:x y:yRect width:w height:hRun.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   282
        ].
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   283
        ^ self.
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   284
    ].
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   285
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   286
    "/ individual lines; from left to right
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   287
    (direction == #eastWest or:[direction == #horizontal]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   288
        dR := (r2 - r1) / wAll.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   289
        r := r1 + (dR * scaleStartX).
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   290
        dG := (g2 - g1) / wAll.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   291
        g := g1 + (dG * scaleStartX).
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   292
        dB := (b2 - b1) / wAll.
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   293
        b := b1 + (dB * scaleStartX).
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   294
5732
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   295
        r := (r max:minR) min:maxR. 
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   296
        g := (g max:minG) min:maxG.
fba4327a852b changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
   297
        b := (b max:minB) min:maxB.
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   298
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   299
        lastR := r asInteger. lastG := g asInteger. lastB := b asInteger.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   300
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   301
        xRect := x.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   302
        wRun := 0.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   303
5731
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   304
        x to:x+w-1 do:[:xP |
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   305
            rC := r asInteger.
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   306
            gC := g asInteger.
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   307
            bC := b asInteger.
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   308
            (rC ~~ lastR or:[gC ~~ lastG or:[bC ~~ lastB]]) ifTrue:[
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   309
                aView paint:(Color redByte:lastR greenByte:lastG blueByte:lastB).
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   310
                aView fillRectangleX:xRect y:y width:wRun height:h.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   311
                xRect := xP. wRun := 0.
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   312
                lastR := rC. lastG := gC. lastB := bC.
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   313
            ].
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   314
            wRun := wRun + 1.
5731
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   315
            r := ((r + dR) max:minR) min:maxR. 
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   316
            g := ((g + dG) max:minG) min:maxG.
e638acae4e19 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   317
            b := ((b + dB) max:minB) min:maxB.
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   318
        ].
5733
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   319
        wRun ~~ 0 ifTrue:[
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   320
            aView paint:(Color redByte:lastR greenByte:lastG blueByte:lastB).
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   321
            aView fillRectangleX:xRect y:y width:wRun height:h.
08e2b386abef changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5732
diff changeset
   322
        ].
5688
Claus Gittinger <cg@exept.de>
parents: 5687
diff changeset
   323
        ^ self.
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   324
    ]
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   325
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   326
    "Created: / 23-01-2011 / 01:59:29 / cg"
5739
c4fbd37a6164 changed: #fillRectangleX:y:width:height:in:
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   327
    "Modified: / 06-04-2011 / 21:18:07 / cg"
5684
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   328
! !
c6029a2cf7c0 added:8 methods
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
   329
5461
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
!GradientBackground class methodsFor:'documentation'!
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
6014
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   332
version
6202
020ebdb99a1e Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 6102
diff changeset
   333
    ^ '$Header: /cvs/stx/stx/libview/GradientBackground.st,v 1.17 2014-01-16 14:31:54 stefan Exp $'
6014
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   334
!
0da48fc12d6a class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   335
5461
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
version_CVS
6202
020ebdb99a1e Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 6102
diff changeset
   337
    ^ '$Header: /cvs/stx/stx/libview/GradientBackground.st,v 1.17 2014-01-16 14:31:54 stefan Exp $'
5461
2451688b8d25 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
! !
6013
aee5be18d9a1 class: GradientBackground
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
   339