ColorMenu.st
author Claus Gittinger <cg@exept.de>
Wed, 16 Aug 2000 23:23:40 +0200
changeset 1808 e8628b502a49
parent 1803 ad801646be62
child 1816 c4bbd0e66b5a
permissions -rw-r--r--
methodCategory change
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
422
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     1
"
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     2
 COPYRIGHT (c) 1995 by eXept Software AG
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     3
              All Rights Reserved
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     4
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     5
 This software is furnished under a license and may be used
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     6
 only in accordance with the terms of that license and with the
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     8
 be provided or otherwise made available to, or used by, any
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
     9
 other person.  No title to or ownership of the software is
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    10
 hereby transferred.
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    11
"
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    12
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    13
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    14
1803
ad801646be62 category change
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
    15
"{ Package: 'stx:libtool2' }"
ad801646be62 category change
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
    16
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    17
MenuPanel subclass:#ColorMenu
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
    18
	instanceVariableNames:'model enabledChannel labelsAreColored'
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    19
	classVariableNames:''
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    20
	poolDictionaries:''
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    21
	category:'Interface-UIPainter'
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    22
!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    23
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    24
SimpleDialog subclass:#DefineColor
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    25
	instanceVariableNames:'red green blue'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    26
	classVariableNames:''
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    27
	poolDictionaries:''
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    28
	privateIn:ColorMenu
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    29
!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
    30
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    31
!ColorMenu class methodsFor:'documentation'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    32
422
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    33
copyright
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    34
"
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    35
 COPYRIGHT (c) 1995 by eXept Software AG
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    36
              All Rights Reserved
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    37
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    38
 This software is furnished under a license and may be used
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    39
 only in accordance with the terms of that license and with the
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    40
 inclusion of the above copyright notice.   This software may not
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    41
 be provided or otherwise made available to, or used by, any
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    42
 other person.  No title to or ownership of the software is
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    43
 hereby transferred.
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    44
"
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    45
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    46
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    47
!
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    48
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    49
documentation
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    50
"
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    51
    ColorMenu used by UIPainter
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    52
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    53
    [see also:]
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    54
        UIPainter
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    55
        ColorMenuSpec
422
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    56
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    57
    [author:]
b28cfebfef40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
    58
        Claus Atzkern
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    59
"
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    60
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    61
!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    62
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    63
examples
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    64
"
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    65
    simple example
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    66
                                                                                [exBegin]                                      
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    67
    |tool top channel|
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    68
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    69
    top := StandardSystemView new.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    70
    top extent:250@30.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    71
    channel := (Color red) asValue.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    72
    tool := self origin:0.0@0.0 corner:1.0@1.0 in:top.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    73
    tool model:channel.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    74
    top open.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    75
                                                                                [exEnd]
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    76
"
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    77
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    78
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    79
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    80
!ColorMenu class methodsFor:'menu spec'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    81
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    82
colorDefinition
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    83
    "color definitions used to build a color menu
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    84
    "
583
4753eec71973 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 476
diff changeset
    85
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    86
  ^ #(
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
    87
        #(  gray
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    88
            gray:
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    89
            #(  white
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    90
                veryLightGray
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    91
                lightGray
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    92
                gray 
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    93
                darkGray 
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    94
                veryDarkGray 
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    95
                black 
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    96
             )
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
    97
        )
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
    98
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
    99
        #(  red
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   100
            red:
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   101
            #( lightened 100 87 67 50 33)
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   102
         )
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   103
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   104
        #(  green
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   105
            green:
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   106
            #( lightened 100 87 67 50 33)
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   107
         )
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   108
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   109
        #(  blue
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   110
            blue:
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   111
            #( lightened 100 87 67 50 33)
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   112
         )
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   113
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   114
        #(  cyan
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   115
            cyan:
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   116
            #( lightened 100 87 67 50 33)
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   117
        )
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   118
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   119
        #(  magenta
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   120
            magenta:
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   121
            #( lightened 100 87 67 50 33)
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   122
        )
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   123
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   124
        #(  yellow
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   125
            yellow:
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   126
            #( lightened 100 87 67 50 33)
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   127
        )
806
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   128
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   129
    )
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   130
!
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   131
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   132
colorMenu:labelAreColored value:aValue
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   133
    "returns a color menu
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   134
    "
1410
be0e2a06be7c unused local removed
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   135
    |menu mainCol style e|
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   136
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   137
    menu  := Menu new.
1372
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   138
    style := (labelAreColored == false) 
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   139
                ifTrue:[#backgroundColor] 
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   140
                ifFalse:[#color].
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   141
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   142
    self colorDefinition do:[:aSlice|
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   143
        |size colOp color item smenu|
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   144
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   145
        mainCol := Color perform:(aSlice at:1).
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   146
        item    := MenuItem labeled:(Text string:'  ' emphasis:(#backgroundColor->mainCol)).
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   147
        smenu   := Menu new.
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   148
        colOp   := aSlice at:2.
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   149
668
774e55692416 remove labels in top menu
ca
parents: 666
diff changeset
   150
        (aSlice at:3) do:[:el||sitem label|
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   151
            el isSymbol ifTrue:[
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   152
                color := el == #lightened ifTrue:[mainCol perform:el] ifFalse:[Color perform:el].
854
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   153
                self colorDefinition first ~~ aSlice 
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   154
                    ifTrue: [label := (colOp upTo: $:), ' ', el] 
591cc5592fdf more harmonic color palettes
tz
parents: 832
diff changeset
   155
                    ifFalse:[label := el].
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   156
            ] ifFalse:[
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   157
                el isNumber ifTrue:[
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   158
                    color := Color perform:colOp with:el.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   159
                    label := colOp, ' ', el printString.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   160
                ] ifFalse:[
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   161
                    color := Color perform:colOp with:(el at:1) with:(el at:2) with:(el at:3).
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   162
                    label := ''.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   163
                    colOp keywords keysAndValuesDo:[:i :c| label := label, ' ', c, ' ' , (el at:i) printString ].
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   164
                ]
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   165
            ].
1372
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   166
            e := style->color.
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   167
            style == #backgroundColor ifTrue:[
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   168
                color brightness < 0.5 ifTrue:[
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   169
                    e := Array with:e
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   170
                               with:(#color->Color white) 
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   171
                ]
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   172
            ].
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   173
            sitem := MenuItem 
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   174
                        labeled:(Text 
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   175
                                    string:('Color ', label)
54d8812de860 care for good contrast in color-menus
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   176
                                    emphasis:e).
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   177
            sitem argument:color.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   178
            sitem value:aValue.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   179
            smenu addItem:sitem.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   180
        ].
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   181
        item submenu:smenu.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   182
        item value:nil.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   183
        menu addItem:item        
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   184
    ].
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   185
    ^ menu
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   186
"
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   187
(ColorMenu colorMenu:true  value:nil) startUp
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   188
(ColorMenu colorMenu:false value:#aSelector:) startUp
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   189
"
592
c7813cfa8794 add more colors
ca
parents: 583
diff changeset
   190
! !
c7813cfa8794 add more colors
ca
parents: 583
diff changeset
   191
1808
e8628b502a49 methodCategory change
Claus Gittinger <cg@exept.de>
parents: 1803
diff changeset
   192
!ColorMenu methodsFor:'accepting'!
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   193
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   194
accept:anItem
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   195
    "accept current selected item"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   196
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   197
    |item holder color|
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   198
1058
2a6e0c07b336 ? -> def
tz
parents: 1057
diff changeset
   199
    ((item := super accept:anItem) notNil and: [item label ~= 'def']) 
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   200
    ifTrue:
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   201
    [
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   202
        (holder := self colorHolder) == item ifTrue:
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   203
        [
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   204
            enabledChannel value ifTrue:[color := self color]
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   205
        ] 
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   206
        ifFalse:
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   207
        [  
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   208
            color := item argument.
692
fbf4503f8bc5 selection bug fixed
tz
parents: 668
diff changeset
   209
            holder label:(Text string:'   ' emphasis:(#backgroundColor->color)).
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   210
        ].
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   211
        model notNil ifTrue:[model value:color]
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   212
    ]
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   213
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   214
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   215
!ColorMenu methodsFor:'accessing'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   216
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   217
color
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   218
    "get current color"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   219
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   220
    |firstEmphasis|
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   221
    (firstEmphasis := (self colorHolder label emphasis at:1)) isAssociation ifTrue: [^firstEmphasis value].
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   222
    ^(firstEmphasis at: 1) value 
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   223
!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   224
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   225
color:aColor
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   226
    "set current color"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   227
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   228
    |holder label|
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   229
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   230
    aColor isColor 
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   231
    ifFalse:
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   232
    [
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   233
        enabledChannel value:false
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   234
    ] 
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   235
    ifTrue:
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   236
    [
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   237
        self disabledRedrawDo:
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   238
        [                 
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   239
            holder := self colorHolder.     
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   240
            label  := Text string: '   ' emphasis:(#backgroundColor->aColor).
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   241
            enabledChannel value:true.
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   242
            holder label:label.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   243
            model value: aColor
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   244
        ]
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   245
    ]
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   246
!
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   247
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   248
labelsAreColored: aBoolean
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   249
    "sets whether labels or their backgrounds will be colored"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   250
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   251
    labelsAreColored := aBoolean ? false.
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   252
    self setupMenu
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   253
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   254
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   255
1803
ad801646be62 category change
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   256
!ColorMenu methodsFor:'accessing - channels'!
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   257
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   258
model
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   259
    "get my color channel"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   260
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   261
    ^model
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   262
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   263
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   264
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   265
!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   266
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   267
model:aValueHolder
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   268
    "set my color channel"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   269
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   270
    model notNil ifTrue:[model removeDependent:self].
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   271
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   272
    (model := aValueHolder) notNil 
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   273
    ifTrue:
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   274
    [
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   275
        model addDependent:self.
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   276
        self color: model value
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   277
    ]
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   278
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   279
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   280
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   281
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   282
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   283
!ColorMenu methodsFor:'accessing look'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   284
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   285
showSeparatingLines
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   286
    "no drawing of separating lines here"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   287
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   288
    ^true
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   289
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   290
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   291
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   292
!ColorMenu methodsFor:'change & update'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   293
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   294
update:something with:aParameter from:changedObject
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   295
    "one of my models changed its value"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   296
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   297
    changedObject == model ifTrue:[^self color: model value].
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   298
    super update:something with:aParameter from:changedObject
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   299
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   300
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   301
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   302
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   303
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   304
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   305
!ColorMenu methodsFor:'initialization'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   306
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   307
destroy
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   308
    "release color channel dependency"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   309
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   310
    self model:nil.
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   311
    super destroy
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   312
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   313
!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   314
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   315
initialize
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   316
    "setup menu"
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   317
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   318
    super initialize.
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   319
    labelsAreColored := false.
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   320
    self verticalLayout:false.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   321
    self fitFirstPanel:false.
895
d1c9210e796b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   322
    enabledChannel := ValueHolder with:false.
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   323
    self setupMenu.
895
d1c9210e796b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   324
d1c9210e796b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
   325
    "Modified: / 21.5.1998 / 03:07:26 / cg"
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   326
!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   327
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   328
setupMenu
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   329
    "setup menu"
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   330
    |menu item|
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   331
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   332
    menu := self class colorMenu:labelsAreColored value:nil.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   333
    menu itemsDo:[:el| el isButton:true].
1058
2a6e0c07b336 ? -> def
tz
parents: 1057
diff changeset
   334
    menu addItem:((MenuItem labeled:'def') value: 
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   335
    [
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   336
        |defineColor|
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   337
        defineColor := DefineColor new color: self color.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   338
        defineColor open.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   339
        defineColor accept value ifTrue: [self color: defineColor color]
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   340
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   341
    ]; isButton: true) beforeIndex:8.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   342
    menu addItem:(MenuItem labeled:'') beforeIndex:8.
806
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   343
    menu addItem:(MenuItem labeled:' ') beforeIndex:5.
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   344
    menu addItem:(MenuItem labeled:' ') beforeIndex:2.
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   345
    menu addItem:(MenuItem labeled:' ') beforeIndex:1.
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   346
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   347
    item := MenuItem labeled:(Text string:'   ' emphasis:(#backgroundColor->DefaultViewBackgroundColor)).
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   348
    item value:#selection.
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   349
    menu addItem:item beforeIndex:1.
806
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   350
abed5a47e545 separators removed and color orange added
tz
parents: 692
diff changeset
   351
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   352
    self menu:menu.
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   353
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   354
    self do:[:anItem|
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   355
        (anItem submenu) notNil ifTrue:[
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   356
            anItem enabled:enabledChannel.
666
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   357
        ] ifFalse:[
801db9028157 provides a basic color menu reused by
ca
parents: 664
diff changeset
   358
            anItem value == #selection ifTrue:[anItem indication:enabledChannel] 
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   359
                                      ifFalse:[anItem enabled:false]. 
1058
2a6e0c07b336 ? -> def
tz
parents: 1057
diff changeset
   360
            anItem label = 'def' ifTrue:[anItem enabled:enabledChannel] 
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   361
        ]
664
53f8cdd4462c *** empty log message ***
tz
parents: 617
diff changeset
   362
    ]
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   363
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   364
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   365
!ColorMenu methodsFor:'private'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   366
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   367
colorHolder
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   368
    "returns the item which keeps the selected color in its label
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   369
    "
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   370
  ^ self itemAt:#selection
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   371
! !
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   372
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   373
!ColorMenu::DefineColor class methodsFor:'interface specs'!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   374
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   375
windowSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   376
    "This resource specification was automatically generated
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   377
     by the UIPainter of ST/X."
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   378
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   379
    "Do not manually edit this!! If it is corrupted,
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   380
     the UIPainter may not be able to read the specification."
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   381
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   382
    "
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   383
     UIPainter new openOnClass:ColorMenu::DefineColor andSelector:#windowSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   384
     ColorMenu::DefineColor new openInterface:#windowSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   385
     ColorMenu::DefineColor open
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   386
    "
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   387
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   388
    <resource: #canvas>
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   389
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   390
    ^
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   391
     
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   392
       #(#FullSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   393
          #window: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   394
           #(#WindowSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   395
              #name: 'Define Color'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   396
              #layout: #(#LayoutFrame 13 0 29 0 352 0 159 0)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   397
              #label: 'Define Color'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   398
              #min: #(#Point 340 110)
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   399
              #max: #(#Point 1152 900)
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   400
              #bounds: #(#Rectangle 13 29 353 160)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   401
              #usePreferredExtent: false
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   402
          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   403
          #component: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   404
           #(#SpecCollection
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   405
              #collection: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   406
               #(
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   407
                 #(#VerticalPanelViewSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   408
                    #name: 'VerticalPanel1'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   409
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 58 0 -40 1.0)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   410
                    #component: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   411
                     #(#SpecCollection
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   412
                        #collection: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   413
                         #(
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   414
                           #(#LabelSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   415
                              #name: 'RedLabel'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   416
                              #label: 'Red:'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   417
                              #translateLabel: true
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   418
                              #adjust: #right
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   419
                              #extent: #(#Point 58 26)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   420
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   421
                           #(#LabelSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   422
                              #name: 'GreenLabel'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   423
                              #label: 'Green:'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   424
                              #translateLabel: true
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   425
                              #adjust: #right
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   426
                              #extent: #(#Point 58 27)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   427
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   428
                           #(#LabelSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   429
                              #name: 'BlueLabel'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   430
                              #label: 'Blue:'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   431
                              #translateLabel: true
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   432
                              #adjust: #right
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   433
                              #extent: #(#Point 58 26)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   434
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   435
                        )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   436
                    )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   437
                    #horizontalLayout: #fit
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   438
                    #verticalLayout: #fitSpace
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   439
                    #horizontalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   440
                    #verticalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   441
                )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   442
                 #(#VerticalPanelViewSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   443
                    #name: 'VerticalPanel2'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   444
                    #layout: #(#LayoutFrame 60 0 0 0.0 -160 1.0 -40 1.0)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   445
                    #component: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   446
                     #(#SpecCollection
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   447
                        #collection: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   448
                         #(
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   449
                           #(#SliderSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   450
                              #name: 'RedSlider'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   451
                              #tabable: true
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   452
                              #model: #red
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   453
                              #orientation: #horizontal
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   454
                              #stop: 255
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   455
                              #step: 1
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   456
                              #backgroundColor: #(#Color 100.0 0.0 0.0)
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   457
                              #extent: #(#Point 118 16)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   458
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   459
                           #(#SliderSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   460
                              #name: 'GreenSlider'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   461
                              #tabable: true
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   462
                              #model: #green
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   463
                              #orientation: #horizontal
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   464
                              #stop: 255
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   465
                              #step: 1
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   466
                              #backgroundColor: #(#Color 0.0 100.0 0.0)
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   467
                              #extent: #(#Point 118 16)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   468
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   469
                           #(#SliderSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   470
                              #name: 'BlueSlider'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   471
                              #tabable: true
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   472
                              #model: #blue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   473
                              #orientation: #horizontal
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   474
                              #stop: 255
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   475
                              #step: 1
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   476
                              #backgroundColor: #(#Color 0.0 0.0 100.0)
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   477
                              #extent: #(#Point 118 16)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   478
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   479
                        )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   480
                    )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   481
                    #horizontalLayout: #fit
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   482
                    #verticalLayout: #spreadSpace
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   483
                    #horizontalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   484
                    #verticalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   485
                )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   486
                 #(#VerticalPanelViewSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   487
                    #name: 'VerticalPanel3'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   488
                    #layout: #(#LayoutFrame -158 1 0 0.0 -120 1 -40 1.0)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   489
                    #component: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   490
                     #(#SpecCollection
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   491
                        #collection: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   492
                         #(
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   493
                           #(#InputFieldSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   494
                              #name: 'RedField'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   495
                              #model: #red
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   496
                              #type: #numberInRange
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   497
                              #numChars: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   498
                              #minValue: 0
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   499
                              #maxValue: 255
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   500
                              #extent: #(#Point 38 20)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   501
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   502
                           #(#InputFieldSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   503
                              #name: 'GreenField'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   504
                              #model: #green
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   505
                              #type: #numberInRange
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   506
                              #numChars: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   507
                              #minValue: 0
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   508
                              #maxValue: 255
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   509
                              #extent: #(#Point 38 20)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   510
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   511
                           #(#InputFieldSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   512
                              #name: 'BlueField'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   513
                              #model: #blue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   514
                              #type: #numberInRange
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   515
                              #numChars: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   516
                              #minValue: 0
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   517
                              #maxValue: 255
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   518
                              #extent: #(#Point 38 20)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   519
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   520
                        )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   521
                    )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   522
                    #horizontalLayout: #fit
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   523
                    #verticalLayout: #spreadSpace
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   524
                    #horizontalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   525
                    #verticalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   526
                )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   527
                 #(#LabelSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   528
                    #name: 'PreviewBox'
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   529
                    #layout: #(#LayoutFrame -116 1 0 0.0 -2 1.0 -40 1.0)
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   530
                    #label: 'Preview'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   531
                    #translateLabel: true
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   532
                    #level: -1
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   533
                )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   534
                 #(#HorizontalPanelViewSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   535
                    #name: 'HorizontalPanel1'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   536
                    #layout: #(#LayoutFrame 0 0.0 -32 1 0 1.0 0 1.0)
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   537
                    #component: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   538
                     #(#SpecCollection
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   539
                        #collection: 
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   540
                         #(
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   541
                           #(#ActionButtonSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   542
                              #name: 'CancelButton'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   543
                              #label: 'Cancel'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   544
                              #translateLabel: true
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   545
                              #model: #cancel
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   546
                              #extent: #(#Point 165 26)
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   547
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   548
                           #(#ActionButtonSpec
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   549
                              #name: 'OKButton'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   550
                              #label: 'OK'
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   551
                              #translateLabel: true
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   552
                              #model: #accept
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   553
                              #extent: #(#Point 166 26)
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   554
                          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   555
                        )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   556
                    )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   557
                    #horizontalLayout: #fitSpace
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   558
                    #verticalLayout: #centerMax
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   559
                    #horizontalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   560
                    #verticalSpace: 3
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   561
                )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   562
              )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   563
          )
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   564
      )
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   565
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   566
    "Modified: / 6.9.1998 / 23:04:19 / cg"
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   567
! !
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   568
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   569
!ColorMenu::DefineColor methodsFor:'accessing'!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   570
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   571
color
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   572
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   573
    ^Color redByte: red value greenByte: green value blueByte: blue value
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   574
  
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   575
!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   576
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   577
color: aColor
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   578
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   579
    aColor notNil
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   580
    ifTrue:
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   581
    [
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   582
        self red   value: aColor redByte.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   583
        self green value: aColor greenByte.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   584
        self blue  value: aColor blueByte.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   585
    ]
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   586
  
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   587
! !
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   588
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   589
!ColorMenu::DefineColor methodsFor:'aspects'!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   590
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   591
blue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   592
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   593
    blue isNil ifTrue:[
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   594
        blue := 0 asValue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   595
    ].
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   596
    ^blue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   597
!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   598
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   599
green
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   600
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   601
    green isNil ifTrue:[
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   602
        green := 0 asValue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   603
    ].
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   604
    ^green
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   605
!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   606
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   607
red
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   608
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   609
    red isNil ifTrue:[
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   610
        red := 0 asValue
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   611
    ].
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   612
    ^red
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   613
! !
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   614
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   615
!ColorMenu::DefineColor methodsFor:'startup / release'!
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   616
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   617
postBuildWith:aBuilder
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   618
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   619
    |updateBlock|
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   620
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   621
    super postBuildWith:aBuilder.
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   622
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   623
    updateBlock := [
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   624
        |box clr|
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   625
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   626
        box := builder componentAt: #PreviewBox.
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   627
        clr := self color.
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   628
        box backgroundColor:clr.
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   629
        clr brightness < 0.5 ifTrue:[
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   630
            box foregroundColor:Color white
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   631
        ] ifFalse:[
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   632
            box foregroundColor:Color black
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   633
        ]
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   634
    ].
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   635
1676
d01663a2356d use onChangeEvaluate:
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
   636
    red   onChangeEvaluate: updateBlock.
d01663a2356d use onChangeEvaluate:
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
   637
    green onChangeEvaluate: updateBlock.
d01663a2356d use onChangeEvaluate:
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
   638
    blue  onChangeEvaluate: updateBlock.
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   639
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   640
    updateBlock value
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   641
1119
11cd3ce5171b colorMenu: change labelColor to white for dark preview colors;
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
   642
    "Modified: / 6.9.1998 / 22:55:25 / cg"
1057
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   643
! !
db1bd14803e3 free color definition added
tz
parents: 895
diff changeset
   644
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   645
!ColorMenu class methodsFor:'documentation'!
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   646
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   647
version
1808
e8628b502a49 methodCategory change
Claus Gittinger <cg@exept.de>
parents: 1803
diff changeset
   648
    ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.22 2000-08-16 21:23:09 cg Exp $'
412
a8ad581658ec intitial checkin
ca
parents:
diff changeset
   649
! !