ImageEditor.st
author Claus Gittinger <cg@exept.de>
Tue, 22 Dec 2009 18:24:23 +0100
changeset 2731 582f4a766e19
parent 2728 7b0f0d920794
child 2761 6cf2b054258c
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
400
228524287573 intitial checkin
tz
parents:
diff changeset
     1
"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
     2
 COPYRIGHT (c) 1997-1998 by eXept Software AG
400
228524287573 intitial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
228524287573 intitial checkin
tz
parents:
diff changeset
     4
228524287573 intitial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
228524287573 intitial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
     7
 inclusion of the above copyright notice. This software may not
400
228524287573 intitial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
     9
 other person. No title to or ownership of the software is
400
228524287573 intitial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
228524287573 intitial checkin
tz
parents:
diff changeset
    11
"
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    12
"{ Package: 'stx:libtool2' }"
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    13
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    14
ResourceSpecEditor subclass:#ImageEditor
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
    15
	instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
    16
		selectedColorIndex postOpenAction imageSeqNr drawingColormap
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
    17
		lastShiftUsedWrap lastGrabbedScreenArea'
1640
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
    18
	classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
    19
		DefaultRelativeSizes'
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    20
	poolDictionaries:''
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    21
	category:'Interface-UIPainter'
400
228524287573 intitial checkin
tz
parents:
diff changeset
    22
!
228524287573 intitial checkin
tz
parents:
diff changeset
    23
228524287573 intitial checkin
tz
parents:
diff changeset
    24
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
    25
228524287573 intitial checkin
tz
parents:
diff changeset
    26
copyright
228524287573 intitial checkin
tz
parents:
diff changeset
    27
"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    28
 COPYRIGHT (c) 1997-1998 by eXept Software AG
400
228524287573 intitial checkin
tz
parents:
diff changeset
    29
              All Rights Reserved
228524287573 intitial checkin
tz
parents:
diff changeset
    30
228524287573 intitial checkin
tz
parents:
diff changeset
    31
 This software is furnished under a license and may be used
228524287573 intitial checkin
tz
parents:
diff changeset
    32
 only in accordance with the terms of that license and with the
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
    33
 inclusion of the above copyright notice. This software may not
400
228524287573 intitial checkin
tz
parents:
diff changeset
    34
 be provided or otherwise made available to, or used by, any
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
    35
 other person. No title to or ownership of the software is
400
228524287573 intitial checkin
tz
parents:
diff changeset
    36
 hereby transferred.
228524287573 intitial checkin
tz
parents:
diff changeset
    37
"
228524287573 intitial checkin
tz
parents:
diff changeset
    38
!
228524287573 intitial checkin
tz
parents:
diff changeset
    39
228524287573 intitial checkin
tz
parents:
diff changeset
    40
documentation
228524287573 intitial checkin
tz
parents:
diff changeset
    41
"
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
    42
    Image Editor allows you to create, design, modify or just inspect images.
400
228524287573 intitial checkin
tz
parents:
diff changeset
    43
228524287573 intitial checkin
tz
parents:
diff changeset
    44
    [start with:]
228524287573 intitial checkin
tz
parents:
diff changeset
    45
        ImageEditor open
941
6d75430a8120 fixed start call in docu
tz
parents: 937
diff changeset
    46
        ImageEditor openOnClass:Icon andSelector:#startIcon
400
228524287573 intitial checkin
tz
parents:
diff changeset
    47
228524287573 intitial checkin
tz
parents:
diff changeset
    48
    [see also:]
228524287573 intitial checkin
tz
parents:
diff changeset
    49
        ImageEditView Image
228524287573 intitial checkin
tz
parents:
diff changeset
    50
228524287573 intitial checkin
tz
parents:
diff changeset
    51
    [author:]
544
8fa6ee20c3cd help menu item aligned to the right
tz
parents: 535
diff changeset
    52
        Thomas Zwick, eXept Software AG
1806
2d642633ff7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1799
diff changeset
    53
        Claus Gittinger, eXept Software AG
400
228524287573 intitial checkin
tz
parents:
diff changeset
    54
"
228524287573 intitial checkin
tz
parents:
diff changeset
    55
! !
228524287573 intitial checkin
tz
parents:
diff changeset
    56
228524287573 intitial checkin
tz
parents:
diff changeset
    57
!ImageEditor class methodsFor:'instance creation'!
228524287573 intitial checkin
tz
parents:
diff changeset
    58
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    59
openLoadingImageWith:aBlock
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    60
    "opens an Image Editor on anImage"
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    61
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    62
    |editor|
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    63
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    64
    editor := self new.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    65
    editor allButOpen.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    66
    aBlock value:editor.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    67
    editor openWindow
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    68
!
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    69
400
228524287573 intitial checkin
tz
parents:
diff changeset
    70
openModalOnClass: aClass andSelector: aSelector
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    71
    "opens a modal Image Editor on aClass and aSelector.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    72
     Returns the real name of the edited resource method (in case, user changed it)."
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    73
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    74
    |imageEditor imageEditView className resourceClass resourceSelector| 
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    75
400
228524287573 intitial checkin
tz
parents:
diff changeset
    76
    imageEditor := self new.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    77
900
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    78
    aClass isClass  ifTrue: [className := aClass name].
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    79
    aClass isString ifTrue: [className := aClass].      
903
63203d996e61 openModal bug fixed
tz
parents: 901
diff changeset
    80
    aClass isNil    ifTrue: [className := ''].      
400
228524287573 intitial checkin
tz
parents:
diff changeset
    81
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    82
    imageEditor postOpenAction: [imageEditView := imageEditor imageEditView. 
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    83
                                 imageEditor loadFromOrPrepareForClass: aClass andSelector: aSelector].
400
228524287573 intitial checkin
tz
parents:
diff changeset
    84
    imageEditor openModal.
228524287573 intitial checkin
tz
parents:
diff changeset
    85
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    86
    resourceClass := imageEditView resourceClass.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    87
    resourceSelector := imageEditView resourceSelector.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    88
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    89
    (resourceClass isNil or:[resourceSelector isNil]) ifTrue:[^ nil].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    90
    ^ Array with:resourceClass with:resourceSelector
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
    91
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
    92
    "
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
    93
     self openModalOnClass: self andSelector: #leftMouseKeyIcon
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
    94
    "
400
228524287573 intitial checkin
tz
parents:
diff changeset
    95
!
228524287573 intitial checkin
tz
parents:
diff changeset
    96
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
    97
openOnClass:aClass andSelector:aSelector
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
    98
    "opens an Image Editor on aClass and aSelector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
    99
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   100
    self openLoadingImageWith:[:editor | editor loadFromClass:aClass theNonMetaclass andSelector:aSelector.]
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   101
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   102
    "
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   103
     self openOnClass:self andSelector:#leftMouseKeyIcon
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   104
     self openOnClass:self andSelector:nil
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   105
    "
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   106
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   107
    "Modified: / 16.3.1999 / 21:33:49 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   108
!
228524287573 intitial checkin
tz
parents:
diff changeset
   109
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   110
openOnFile:aFileName
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   111
    "opens an Image Editor on aFileName"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   112
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   113
    self openLoadingImageWith:[:editor | editor loadFromFile:aFileName.]
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   114
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   115
    "
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   116
     self openOnFile: '../../goodies/bitmaps/gifImages/back.gif'
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   117
    "
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   118
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   119
    "Modified: / 16.3.1999 / 21:33:25 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   120
!
228524287573 intitial checkin
tz
parents:
diff changeset
   121
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   122
openOnImage:anImage
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   123
    "opens an Image Editor on anImage"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   124
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   125
    self openLoadingImageWith:[:editor | editor loadFromImage: anImage.]
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   126
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   127
    "
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   128
     self openOnImage: Icon startIcon
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   129
    "
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
   130
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   131
    "Modified: / 11.3.1999 / 16:18:33 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   132
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   133
228524287573 intitial checkin
tz
parents:
diff changeset
   134
!ImageEditor class methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
   135
228524287573 intitial checkin
tz
parents:
diff changeset
   136
listOfColorMaps
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   137
    "returns the list of default color maps for a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   138
228524287573 intitial checkin
tz
parents:
diff changeset
   139
    |colorMap|
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   140
400
228524287573 intitial checkin
tz
parents:
diff changeset
   141
    (colorMap := OrderedCollection new)
228524287573 intitial checkin
tz
parents:
diff changeset
   142
        add: Color black;
228524287573 intitial checkin
tz
parents:
diff changeset
   143
        add: Color white;
228524287573 intitial checkin
tz
parents:
diff changeset
   144
        add: Color red;
228524287573 intitial checkin
tz
parents:
diff changeset
   145
        add: Color green;
228524287573 intitial checkin
tz
parents:
diff changeset
   146
        add: Color blue;
228524287573 intitial checkin
tz
parents:
diff changeset
   147
        add: Color cyan;
228524287573 intitial checkin
tz
parents:
diff changeset
   148
        add: Color yellow;
228524287573 intitial checkin
tz
parents:
diff changeset
   149
        add: Color magenta;
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   150
        add: (Color redByte: 127 greenByte:   0 blueByte:   0);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   151
        add: (Color redByte:   0 greenByte: 127 blueByte:   0);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   152
        add: (Color redByte:   0 greenByte:   0 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   153
        add: (Color redByte:   0 greenByte: 127 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   154
        add: (Color redByte: 127 greenByte: 127 blueByte:   0);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   155
        add: (Color redByte: 127 greenByte:   0 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   156
        add: (Color redByte: 127 greenByte: 127 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   157
        add: (Color redByte: 170 greenByte: 170 blueByte: 170).
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   158
400
228524287573 intitial checkin
tz
parents:
diff changeset
   159
    0 to: 5 do:
228524287573 intitial checkin
tz
parents:
diff changeset
   160
    [:r|                                                    
228524287573 intitial checkin
tz
parents:
diff changeset
   161
        0 to: 5 do:         
228524287573 intitial checkin
tz
parents:
diff changeset
   162
        [:g|
228524287573 intitial checkin
tz
parents:
diff changeset
   163
            0 to: 5 do:                             
228524287573 intitial checkin
tz
parents:
diff changeset
   164
            [:b|
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   165
                colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   166
            ]
228524287573 intitial checkin
tz
parents:
diff changeset
   167
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
   168
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
   169
228524287573 intitial checkin
tz
parents:
diff changeset
   170
    1 to: 25 do:
228524287573 intitial checkin
tz
parents:
diff changeset
   171
    [:g|                             
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   172
        colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   173
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
   174
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   175
    ^ Dictionary new
2571
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   176
        at: #depth32 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF);
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   177
        at: #depth24 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   178
        at: #masked24 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   179
        at: #depth16 put:(FixedPalette redShift:11 redMask:16r1F greenShift:5 greenMask:16r3F blueShift:0 blueMask:16r1F);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   180
        at: #masked16 put:(FixedPalette redShift:11 redMask:16r1F greenShift:5 greenMask:16r3F blueShift:0 blueMask:16r1F);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   181
        at: #depth8  put: colorMap;
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   182
        at: #masked8 put: colorMap;
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   183
        at: #depth4  put: (colorMap copyFrom: 1 to: 16);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   184
        at: #masked4 put: (colorMap copyFrom: 1 to: 16);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   185
        at: #depth2  put: (colorMap copyFrom: 1 to: 4);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   186
        at: #masked2 put: (colorMap copyFrom: 1 to: 4);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   187
        at: #depth1  put: (colorMap copyFrom: 1 to: 2);
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   188
        at: #masked1 put: (colorMap copyFrom: 1 to: 2);
400
228524287573 intitial checkin
tz
parents:
diff changeset
   189
        yourself
228524287573 intitial checkin
tz
parents:
diff changeset
   190
!
228524287573 intitial checkin
tz
parents:
diff changeset
   191
228524287573 intitial checkin
tz
parents:
diff changeset
   192
listOfDefaultSizes
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   193
    "returns the list of default sizes for a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   194
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
   195
    ^ #('8x8' '16x16' '22x22' '32x32' '48x48' '64x64')
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   196
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   197
    "Modified: / 31.7.1998 / 01:57:34 / cg"
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   198
!
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   199
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   200
namesOfColorMaps
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   201
    ^ Dictionary new
2571
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   202
        at: #depth32 put: '32-plane (rgba)';
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   203
        at: #depth24 put: '24-plane';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   204
        at: #masked24 put: '24-plane + mask';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   205
        at: #depth16 put: '16-plane';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   206
        at: #masked16 put: '16-plane + mask';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   207
        at: #depth8  put: ' 8-plane';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   208
        at: #masked8 put: ' 8-plane + mask';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   209
        at: #depth4  put: ' 4-plane';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   210
        at: #masked4 put: ' 4-plane + mask';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   211
        at: #depth2  put: ' 2-plane';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   212
        at: #masked2 put: ' 2-plane + mask';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   213
        at: #depth1  put: ' 1-plane';
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   214
        at: #masked1 put: ' 1-plane + mask' ;
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
   215
        yourself
400
228524287573 intitial checkin
tz
parents:
diff changeset
   216
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   217
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   218
!ImageEditor class methodsFor:'help specs'!
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   219
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   220
flyByHelpSpec
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   221
    <resource: #help>
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   222
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   223
    ^super flyByHelpSpec addPairsFrom:#(
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   224
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   225
#drawModeBox
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   226
'Rectangle'
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   227
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   228
#drawModeCopy
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   229
'Copy'
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   230
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   231
#drawModeFill
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   232
'Flood-Fill'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   233
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   234
#drawModeFilledBox
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   235
'Filled Rectangle'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   236
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   237
#drawModePaste
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   238
'Paste'
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   239
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   240
#drawModePasteUnder
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   241
'Paste Under'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   242
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   243
#drawModePasteWithMask
1656
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   244
'Paste with Mask'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   245
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   246
#drawModePoint
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   247
'Point'
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   248
1639
8f2059cc287c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1637
diff changeset
   249
#drawModeSpecial
8f2059cc287c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1637
diff changeset
   250
'Special Operations'
8f2059cc287c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1637
diff changeset
   251
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   252
#fileGrabImage
1748
a62052c6ee71 toolBar: icons and added a saveToFile button
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
   253
'Pick from Screen'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   254
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   255
#fileLoadFromClass
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   256
'Load from Method...'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   257
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   258
#fileLoadFromFile
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   259
'Load from File...'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   260
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   261
#fileNewImage
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   262
'New Image'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   263
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   264
#filePrint
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   265
'Print'
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   266
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   267
#fileSaveAs
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   268
'Save to File...'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   269
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   270
#fileSaveMaskAs
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   271
'Save Mask to File...'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   272
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   273
#fileSaveMethod
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   274
'Save as Method'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   275
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   276
#fileSaveMethodAs
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   277
'Save as Method...'
1545
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   278
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   279
)
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   280
!
4f8b08f745eb flyByHelp stuff
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   281
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   282
helpSpec
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   283
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   284
     by the UIHelpTool of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   285
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   286
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   287
     the UIHelpTool may not be able to read the specification."
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   288
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   289
    "
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   290
     UIHelpTool openOnClass:ImageEditor    
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   291
    "
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   292
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   293
    <resource: #help>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   294
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   295
    ^super helpSpec addPairsFrom:#(
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   296
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   297
#colorMap
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   298
'ColorMap functions.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   299
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   300
#colorMap1
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   301
'Convert to depth-1 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   302
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   303
#colorMap1M
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   304
'Convert to depth-1 image plus mask.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   305
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   306
#colorMap2
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   307
'Convert to depth-2 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   308
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   309
#colorMap2M
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   310
'Convert to depth-2 image plus mask.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   311
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   312
#colorMap4
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   313
'Convert to depth-4 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   314
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   315
#colorMap4M
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   316
'Convert to depth-4 image plus mask.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   317
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   318
#colorMap8
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   319
'Convert to depth-8 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   320
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   321
#colorMap8M
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   322
'Convert to depth-8 image plus mask.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   323
2571
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   324
#colorMap24
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   325
'Convert to depth-24 image (rgb).'
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   326
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   327
#colorMap32
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   328
'Convert to depth-32 image (rgba).'
8b182cc4cac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   329
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   330
#colorMapTable
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   331
'Shows a list of used colors of the image.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   332
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   333
#compressColormap
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   334
'Remove unneeded entries from the colorMap.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   335
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   336
#cropAll
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   337
'Find and remove all borders.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   338
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   339
#cropBottom
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   340
'Find and remove bottom border.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   341
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   342
#cropLeft
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   343
'Find and remove left border.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   344
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   345
#cropManual
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   346
'Specify border(s) to remove.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   347
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   348
#cropRight
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   349
'Find and remove right border.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   350
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
   351
#cropTop
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   352
'Find and remove top border.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   353
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   354
#drawModeBox
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   355
'Rectangle Drawing Mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   356
2375
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   357
#drawModeCircle
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   358
'Circle Drawing Mode.'
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   359
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   360
#drawModeCopy
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   361
'Area Copy Mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   362
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   363
#drawModeFill
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   364
'Flood Fill Mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   365
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   366
#drawModeFilledBox
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   367
'Filled Rectangle Drawing Mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   368
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   369
#drawModePaste
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   370
'Paste Mode.'
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   371
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   372
#drawModePasteUnder
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   373
'Paste-Under Mode.'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   374
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   375
#drawModePasteWithMask
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   376
'Paste-with-Mask Mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   377
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   378
#drawModePoint
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   379
'Point Drawing Mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   380
2375
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   381
#drawModeSpray
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   382
'Spray Drawing Mode.'
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   383
1639
8f2059cc287c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1637
diff changeset
   384
#drawModeSpecial
8f2059cc287c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1637
diff changeset
   385
'Special Operations'
8f2059cc287c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1637
diff changeset
   386
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   387
#editFlipHorizontal
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   388
'Flip the image horizontally.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   389
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   390
#editFlipVertical
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   391
'Flip the image vertically.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   392
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   393
#editMagnifyImage
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   394
'Magnify the image.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   395
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   396
#editNegate
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   397
'Invert the images colors.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   398
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   399
#editResize
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   400
'Resize the image (preserving the old image).'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   401
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   402
#editRotate
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   403
'Rotate the image.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   404
2701
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
   405
#fileGrabImageFromScreen
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
   406
'Pick an image from the screen (specify area).'
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
   407
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
   408
#fileGrabImageFromWindow
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
   409
'Pick an image from a window on the screen (click on window).'
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   410
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   411
#fileLoadFromClass
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   412
'Select and load an image from a resource method.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   413
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   414
#fileLoadFromFile
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   415
'Select and load an image from a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   416
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   417
#fileNewImage
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   418
'Create a new image'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   419
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   420
#filePrint
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   421
'Print the image on a postscript printer.'
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   422
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   423
#fileSaveAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   424
'Save the image to a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   425
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   426
#fileSaveMaskAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   427
'Save the mask of the image to a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   428
1613
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
   429
#fileSaveButtonImageAs
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
   430
'Save an image of a button with the image to a file (for html use).'
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
   431
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   432
#fileSaveMethod
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   433
'Save the image as resource method in the current class and selector.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   434
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   435
#fileSaveMethodAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   436
'Save the image as resource method in a class.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   437
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   438
#magnificationNumber
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   439
'Shows the current magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   440
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   441
#magnifyImageDown
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   442
'Decrease magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   443
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   444
#magnifyImageUp
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   445
'Increase magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   446
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   447
#mouseKeyColorMode
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   448
'Toggle between left and right mouse button color.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   449
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   450
#previewView
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   451
'Shows a preview of the image.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   452
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   453
#settingsGridMagnification
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   454
'Change the grid magnification of the edit view.'
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   455
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   456
)
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   457
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   458
    "Modified: / 7.9.1998 / 18:20:26 / cg"
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   459
! !
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   460
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   461
!ImageEditor class methodsFor:'image specs'!
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   462
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   463
circleIcon
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   464
    "This resource specification was automatically generated
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   465
     by the ImageEditor of ST/X."
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   466
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   467
    "Do not manually edit this!! If it is corrupted,
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   468
     the ImageEditor may not be able to read the specification."
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   469
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   470
    "
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   471
     self circleIcon inspect
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   472
     ImageEditor openOnClass:self andSelector:#circleIcon
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   473
     Icon flushCachedIcons
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   474
    "
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   475
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   476
    <resource: #image>
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   477
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   478
    ^Icon
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   479
        constantNamed:'ImageEditor class circleIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   480
        ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@N@CF@PDA@PH@  BB@HDA@PD@1 @8@@@@@a') ; yourself); yourself]
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   481
!
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   482
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   483
copyIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   484
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   485
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   486
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   487
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   488
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   489
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   490
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   491
     self copyIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   492
     ImageEditor openOnClass:self andSelector:#copyIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   493
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   494
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   495
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   496
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   497
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   498
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   499
        constantNamed:'ImageEditor class copyIcon'
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   500
        ifAbsentPut:[(Depth2Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@** @@J)UUTB*Z*)@*&**PJ)**$B*Z*)@*&**PJ)**$@@Z*)@@F**P@AUUT@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@C? O>@??3??O?<??3??O?<??3??@_<A?0@@@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   501
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   502
2155
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
   503
defaultIcon
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
   504
    <resource: #programImage>
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
   505
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
   506
    ^ ToolbarIconLibrary startImageEditorIcon
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
   507
!
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
   508
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   509
fillIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   510
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   511
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   512
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   513
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   514
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   515
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   516
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   517
     self fillIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   518
     ImageEditor openOnClass:self andSelector:#fillIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   519
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   520
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   521
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   522
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   523
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   524
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   525
        constantNamed:'ImageEditor class fillIcon'
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   526
        ifAbsentPut:[(Depth2Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@ @@@@*H@@D*(@@DUUP@EAUU@AAEU@@@@U@@DDA@@@@@@@@PP@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C @Q@BN@I<@?8C?0[?!!G<@O P\@@ D@@@@@@@@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   527
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   528
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   529
fillRectIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   530
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   531
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   532
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   533
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   534
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   535
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   536
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   537
     self fillRectIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   538
     ImageEditor openOnClass:self andSelector:#fillRectIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   539
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   540
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   541
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   542
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   543
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   544
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   545
        constantNamed:'ImageEditor class fillRectIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   546
        ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   547
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   548
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   549
leftMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   550
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   551
     by the ImageEditor of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   552
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   553
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   554
     the ImageEditor may not be able to read the specification."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   555
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   556
    "
1405
0b2e421db465 images compactified
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
   557
     self leftMouseKeyIcon inspect
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   558
     ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   559
     Icon flushCachedIcons
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   560
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   561
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   562
    <resource: #image>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   563
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   564
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   565
        constantNamed:'ImageEditor class leftMouseKeyIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   566
        ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@EJJ@@AR" @@T((@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]
1433
df38b2a5d335 checkin from browser
martin
parents: 1424
diff changeset
   567
!
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   568
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   569
pasteIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   570
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   571
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   572
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   573
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   574
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   575
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   576
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   577
     self pasteIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   578
     ImageEditor openOnClass:self andSelector:#pasteIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   579
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   580
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   581
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   582
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   583
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   584
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   585
        constantNamed:'ImageEditor class pasteIcon'
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   586
        ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3A&Y&X@@SL0Y A&@@D3LF@@A @AL3A&@FX@@QDPY&Y&
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   587
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   588
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   589
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   590
pasteUnderIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   591
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   592
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   593
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   594
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   595
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   596
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   597
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   598
     self pasteUnderIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   599
     ImageEditor openOnClass:self andSelector:#pasteUnderIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   600
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   601
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   602
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   603
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   604
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   605
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   606
        constantNamed:'ImageEditor class pasteUnderIcon'
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   607
        ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L3LP@@@AL3L3E&X@@SL3L0A&@@D3L3@@A @AL3L3@FX@@QDQDQY&
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   608
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   609
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   610
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   611
pasteWithMaskIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   612
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   613
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   614
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   615
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   616
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   617
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   618
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   619
     self pasteWithMaskIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   620
     ImageEditor openOnClass:self andSelector:#pasteWithMaskIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   621
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   622
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   623
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   624
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   625
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   626
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   627
        constantNamed:'ImageEditor class pasteWithMaskIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   628
        ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3@3M&X@@SL0L3A&@@D3LCL0A @AL3@3LFX@@QDPY&Y&
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   629
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   630
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   631
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   632
pointIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   633
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   634
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   635
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   636
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   637
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   638
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   639
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   640
     self pointIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   641
     ImageEditor openOnClass:self andSelector:#pointIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   642
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   643
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   644
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   645
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   646
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   647
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   648
        constantNamed:'ImageEditor class pointIcon'
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   649
        ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@0@G@@8@G@@8@G@@8@G@@X@@@@@@@@@@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   650
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   651
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   652
rectIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   653
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   654
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   655
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   656
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   657
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   658
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   659
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   660
     self rectIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   661
     ImageEditor openOnClass:self andSelector:#rectIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   662
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   663
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   664
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   665
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   666
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   667
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   668
        constantNamed:'ImageEditor class rectIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   669
        ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0HA@ DB@PHA@ DB@PHA@ DC?0@@@@@@@a') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   670
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   671
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   672
rightMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   673
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   674
     by the ImageEditor of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   675
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   676
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   677
     the ImageEditor may not be able to read the specification."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   678
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   679
    "
1405
0b2e421db465 images compactified
Claus Gittinger <cg@exept.de>
parents: 1403
diff changeset
   680
     self rightMouseKeyIcon inspect
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   681
     ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   682
     Icon flushCachedIcons
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   683
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   684
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   685
    <resource: #image>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   686
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   687
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   688
        constantNamed:'ImageEditor class rightMouseKeyIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   689
        ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JJE@@B"!!P@@((T@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   690
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   691
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   692
specialIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   693
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   694
     by the ImageEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   695
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   696
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   697
     the ImageEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   698
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   699
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   700
     self specialIcon inspect
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   701
     ImageEditor openOnClass:self andSelector:#specialIcon
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   702
     Icon flushCachedIcons
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   703
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   704
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   705
    <resource: #image>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   706
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
   707
    ^Icon
2272
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   708
        constantNamed:'ImageEditor class specialIcon'
d1923697d456 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
   709
        ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@@@B@@@@@0@@@@@@@@@@@@@@@P@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@L@@0@G @^@A8@G @L@@0@@@@L@@0@@@@@a') ; yourself); yourself]
2375
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   710
!
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   711
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   712
sprayIcon
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   713
    "This resource specification was automatically generated
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   714
     by the ImageEditor of ST/X."
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   715
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   716
    "Do not manually edit this!! If it is corrupted,
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   717
     the ImageEditor may not be able to read the specification."
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   718
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   719
    "
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   720
     self sprayIcon inspect
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   721
     ImageEditor openOnClass:self andSelector:#sprayIcon
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   722
     Icon flushCachedIcons
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   723
    "
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   724
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   725
    <resource: #image>
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   726
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   727
    ^Icon
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   728
        constantNamed:'ImageEditor class sprayIcon'
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   729
        ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#[4]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@D@@@@@@@DA@@@@@@D@D@@@@@@A@PD@@@@@@A@P@@@@@@@A@P@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
   730
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 84 84 84 170 170 170 255 255 255 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@B@@(A)@F*@IPA2 H$@"@BH@H @"@BH@O @@a') ; yourself); yourself]
1433
df38b2a5d335 checkin from browser
martin
parents: 1424
diff changeset
   731
! !
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   732
400
228524287573 intitial checkin
tz
parents:
diff changeset
   733
!ImageEditor class methodsFor:'interface specs'!
228524287573 intitial checkin
tz
parents:
diff changeset
   734
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   735
changeHLSDialogSpec
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   736
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   737
     by the UIPainter of ST/X."
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   738
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   739
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   740
     the UIPainter may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   741
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   742
    "
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   743
     UIPainter new openOnClass:ImageEditor andSelector:#changeHLSDialogSpec
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   744
     ImageEditor new openInterface:#changeHLSDialogSpec
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   745
    "
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   746
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   747
    <resource: #canvas>
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   748
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   749
    ^ 
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   750
     #(FullSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   751
        name: changeHLSDialogSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   752
        window: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   753
       (WindowSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   754
          label: 'HLS Edit Dialog'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   755
          name: 'HLS Edit Dialog'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   756
          min: (Point 10 10)
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   757
          bounds: (Rectangle 0 0 312 258)
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   758
        )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   759
        component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   760
       (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   761
          collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   762
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   763
              label: 'Hue-Shift:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   764
              name: 'HueLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   765
              layout: (LayoutFrame 20 0 21 0 120 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   766
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   767
              adjust: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   768
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   769
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   770
              name: 'HueShiftEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   771
              layout: (LayoutFrame 123 0 21 0 166 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   772
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   773
              model: hueShiftAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   774
              type: numberInRange
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   775
              minValue: 0
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   776
              maxValue: 360
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   777
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   778
              acceptOnPointerLeave: false
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   779
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   780
           (ThumbWheelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   781
              name: 'HueWheel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   782
              layout: (LayoutFrame 180 0 22 0 297 0 42 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   783
              model: hueShiftAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   784
              orientation: horizontal
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   785
              step: 1
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   786
              endlessRotation: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   787
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   788
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   789
              label: 'Light Factor:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   790
              name: 'LightLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   791
              layout: (LayoutFrame 18 0 50 0 120 0 72 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   792
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   793
              adjust: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   794
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   795
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   796
              name: 'LightEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   797
              layout: (LayoutFrame 123 0 50 0 166 0 72 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   798
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   799
              model: lightAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   800
              type: numberInRange
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   801
              minValue: 0
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   802
              maxValue: 1000
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   803
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   804
              acceptOnPointerLeave: false
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   805
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   806
           (ThumbWheelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   807
              name: 'LightWheel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   808
              layout: (LayoutFrame 180 0 51 0 297 0 71 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   809
              model: lightAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   810
              orientation: horizontal
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   811
              stop: 1000
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   812
              step: 1
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   813
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   814
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   815
              label: 'Saturation Factor:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   816
              name: 'SaturationLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   817
              layout: (LayoutFrame 9 0 79 0 120 0 101 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   818
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   819
              adjust: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   820
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   821
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   822
              name: 'SaturationEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   823
              layout: (LayoutFrame 123 0 79 0 166 0 101 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   824
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   825
              model: saturationAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   826
              type: numberInRange
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   827
              minValue: 0
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   828
              maxValue: 1000
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   829
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   830
              acceptOnPointerLeave: false
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   831
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   832
           (ThumbWheelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   833
              name: 'SaturationWheel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   834
              layout: (LayoutFrame 180 0 80 0 297 0 100 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   835
              model: saturationAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   836
              orientation: horizontal
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   837
              stop: 1000
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   838
              step: 1
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   839
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   840
           (LabelSpec
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   841
              label: 'Color Shift'
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   842
              name: 'Label2'
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   843
              layout: (LayoutFrame 5 0 110 0 -15 0.5 132 0)
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   844
              translateLabel: true
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   845
            )
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   846
           (LabelSpec
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   847
              name: 'HueColorLabel'
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   848
              layout: (LayoutFrame 18 0.0 133 0 -41 0.5 217 0)
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   849
              level: -1
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
   850
              backgroundChannel: hlsColor
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   851
              translateLabel: true
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   852
            )
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   853
           (LabelSpec
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   854
              label: 'Preview'
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   855
              name: 'Label3'
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   856
              layout: (LayoutFrame 5 0.5 110 0 -5 1 132 0)
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   857
              translateLabel: true
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   858
            )
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   859
           (LabelSpec
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   860
              name: 'PreviewLabel'
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   861
              layout: (LayoutFrame 36 0.5 133 0 -23 1.0 217 0)
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   862
              level: -1
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   863
              translateLabel: true
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   864
              labelChannel: previewImageHolder
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   865
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   866
           (HorizontalPanelViewSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   867
              name: 'HorizontalPanel1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   868
              layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   869
              horizontalLayout: fitSpace
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   870
              verticalLayout: center
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   871
              horizontalSpace: 3
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   872
              verticalSpace: 3
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   873
              reverseOrderIfOKAtLeft: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   874
              component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   875
             (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   876
                collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   877
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   878
                    label: 'Cancel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   879
                    name: 'Button1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   880
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   881
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   882
                    model: cancel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   883
                    extent: (Point 151 22)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   884
                  )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   885
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   886
                    label: 'OK'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   887
                    name: 'Button2'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   888
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   889
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   890
                    model: accept
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   891
                    extent: (Point 152 22)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   892
                  )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   893
                 )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   894
               
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   895
              )
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   896
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   897
           )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   898
         
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   899
        )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   900
      )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   901
!
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   902
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   903
cropDialogSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   904
    "This resource specification was automatically generated
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   905
     by the UIPainter of ST/X."
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   906
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   907
    "Do not manually edit this!! If it is corrupted,
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   908
     the UIPainter may not be able to read the specification."
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   909
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   910
    "
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   911
     UIPainter new openOnClass:ImageEditor andSelector:#cropDialogSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   912
     ImageEditor new openInterface:#cropDialogSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   913
    "
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   914
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   915
    <resource: #canvas>
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   916
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   917
    ^ 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   918
     #(FullSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   919
        name: cropDialogSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   920
        window: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   921
       (WindowSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   922
          label: 'Crop Border(s)'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   923
          name: 'Crop Border(s)'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   924
          min: (Point 10 10)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   925
          bounds: (Rectangle 14 46 259 229)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   926
        )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   927
        component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   928
       (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   929
          collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   930
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   931
              label: 'Left:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   932
              name: 'GropLeftLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   933
              layout: (LayoutFrame 14 0 21 0 90 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   934
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   935
              adjust: right
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   936
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   937
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   938
              name: 'GropLeftEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   939
              layout: (LayoutFrame 95 0 21 0 132 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   940
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   941
              model: left
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   942
              type: number
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   943
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   944
              acceptOnPointerLeave: false
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   945
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   946
           (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   947
              label: 'Now'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   948
              name: 'GropLeftNowButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   949
              layout: (LayoutFrame 148 0 21 0 221 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   950
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   951
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   952
              model: gropLeftNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   953
              autoRepeat: true
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   954
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   955
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   956
              label: 'Right:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   957
              name: 'GropRightLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   958
              layout: (LayoutFrame 14 0 51 0 90 0 73 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   959
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   960
              adjust: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   961
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   962
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   963
              name: 'GropRightEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   964
              layout: (LayoutFrame 95 0 51 0 132 0 73 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   965
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   966
              model: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   967
              type: number
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   968
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   969
              acceptOnPointerLeave: false
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   970
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   971
           (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   972
              label: 'Now'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   973
              name: 'GropRightButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   974
              layout: (LayoutFrame 148 0 51 0 221 0 73 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   975
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   976
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   977
              model: gropRightNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   978
              autoRepeat: true
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   979
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   980
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   981
              label: 'Top:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   982
              name: 'GropTopLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   983
              layout: (LayoutFrame 14 0 81 0 90 0 103 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   984
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   985
              adjust: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   986
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   987
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   988
              name: 'GropTopEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   989
              layout: (LayoutFrame 95 0 81 0 132 0 103 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   990
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   991
              model: top
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   992
              type: number
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   993
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   994
              acceptOnPointerLeave: false
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
   995
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   996
           (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   997
              label: 'Now'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   998
              name: 'GropTopButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
   999
              layout: (LayoutFrame 148 0 81 0 221 0 103 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1000
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1001
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1002
              model: gropTopNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1003
              autoRepeat: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1004
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1005
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1006
              label: 'Bottom:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1007
              name: 'GropBottomLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1008
              layout: (LayoutFrame 14 0 111 0 90 0 133 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1009
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1010
              adjust: right
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1011
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1012
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1013
              name: 'GropBottomEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1014
              layout: (LayoutFrame 95 0 111 0 132 0 133 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1015
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1016
              model: bottom
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1017
              type: number
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1018
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1019
              acceptOnPointerLeave: false
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1020
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1021
           (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1022
              label: 'Now'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1023
              name: 'GropBottomButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1024
              layout: (LayoutFrame 148 0 111 0 221 0 133 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1025
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1026
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1027
              model: gropBottomNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1028
              autoRepeat: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1029
            )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1030
           (HorizontalPanelViewSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1031
              name: 'HorizontalPanel1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1032
              layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1033
              horizontalLayout: fitSpace
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1034
              verticalLayout: center
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1035
              horizontalSpace: 3
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1036
              verticalSpace: 3
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1037
              reverseOrderIfOKAtLeft: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1038
              component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1039
             (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1040
                collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1041
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1042
                    label: 'Cancel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1043
                    name: 'Button1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1044
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1045
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1046
                    model: cancel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1047
                    extent: (Point 77 22)
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1048
                  )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1049
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1050
                    label: 'Apply'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1051
                    name: 'Button3'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1052
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1053
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1054
                    model: applyAction
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1055
                    extent: (Point 78 22)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1056
                  )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1057
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1058
                    label: 'OK'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1059
                    name: 'Button2'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1060
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1061
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1062
                    model: accept
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1063
                    extent: (Point 78 22)
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1064
                  )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1065
                 )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1066
               
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1067
              )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1068
            )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1069
           )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1070
         
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1071
        )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1072
      )
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1073
!
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  1074
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1075
dialogSpecForNewImage
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1076
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1077
     by the UIPainter of ST/X."
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1078
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1079
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1080
     the UIPainter may not be able to read the specification."
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1081
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1082
    "
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1083
     UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1084
     ImageEditor new openInterface:#dialogSpecForNewImage
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1085
    "
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1086
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1087
    <resource: #canvas>
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1088
1457
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1089
    ^ 
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1090
     #(FullSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1091
        name: dialogSpecForNewImage
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1092
        window: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1093
       (WindowSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1094
          label: 'New Image'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1095
          name: 'New Image'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1096
          min: (Point 10 10)
1806
2d642633ff7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1799
diff changeset
  1097
          bounds: (Rectangle 0 0 301 119)
1457
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1098
        )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1099
        component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1100
       (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1101
          collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1102
           (ViewSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1103
              name: 'View'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1104
              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1105
              level: 1
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1106
              component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1107
             (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1108
                collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1109
                 (FramedBoxSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1110
                    label: 'Size'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1111
                    name: 'framedBox1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1112
                    layout: (LayoutFrame 1 0.0 7 0.0 0 0.4 76 0)
1806
2d642633ff7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1799
diff changeset
  1113
                    style: (FontDescription helvetica medium roman 12)
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1114
                    labelPosition: topLeft
1806
2d642633ff7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1799
diff changeset
  1115
                    translateLabel: true
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1116
                    component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1117
                   (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1118
                      collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1119
                       (ComboBoxSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1120
                          name: 'defaultSizesComboBox'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1121
                          layout: (LayoutFrame 0 0.0 10 0.0 0 1 35 0.0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1122
                          model: selectionOfSize
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1123
                          type: string
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1124
                          acceptOnPointerLeave: false
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1125
                          comboList: listOfDefaultSizes
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1126
                          isFilenameBox: false
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1127
                        )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1128
                       )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1129
                     
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1130
                    )
1490
08f46b59ef9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1489
diff changeset
  1131
                  )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1132
                 (FramedBoxSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1133
                    label: 'Color Map'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1134
                    name: 'framedBox2'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1135
                    layout: (LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0)
1806
2d642633ff7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1799
diff changeset
  1136
                    style: (FontDescription helvetica medium roman 12)
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1137
                    labelPosition: topLeft
1806
2d642633ff7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1799
diff changeset
  1138
                    translateLabel: true
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1139
                    component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1140
                   (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1141
                      collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1142
                       (ComboListSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1143
                          name: 'colorMapComboBox'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1144
                          layout: (LayoutFrame 0 0.0 10 0.0 0 1 35 0.0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1145
                          model: selectionOfColorMap
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1146
                          comboList: listOfColorMaps
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1147
                          useIndex: false
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1148
                          hidePullDownMenuButton: false
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1149
                        )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1150
                       )
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1151
                     
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1152
                    )
1457
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1153
                  )
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1154
                 )
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1155
               
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1156
              )
1457
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1157
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1158
           (UISubSpecification
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1159
              name: 'windowSpecForCommitWithoutChannels'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1160
              layout: (LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1161
              minorKey: windowSpecForCommitWithoutChannels
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1162
            )
1457
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1163
           )
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1164
         
8c15098c3469 ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents: 1449
diff changeset
  1165
        )
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1166
      )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1167
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1168
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1169
shiftDialogSpec
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1170
    "This resource specification was automatically generated
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1171
     by the UIPainter of ST/X."
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1172
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1173
    "Do not manually edit this!! If it is corrupted,
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1174
     the UIPainter may not be able to read the specification."
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1175
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1176
    "
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1177
     UIPainter new openOnClass:ImageEditor andSelector:#shiftDialogSpec
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1178
     ImageEditor new openInterface:#shiftDialogSpec
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1179
    "
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1180
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1181
    <resource: #canvas>
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1182
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1183
    ^ 
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1184
     #(FullSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1185
        name: shiftDialogSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1186
        window: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1187
       (WindowSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1188
          label: 'Shift'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1189
          name: 'Shift'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1190
          min: (Point 10 10)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1191
          bounds: (Rectangle 14 46 259 229)
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1192
        )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1193
        component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1194
       (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1195
          collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1196
           (LabelSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1197
              label: 'Amount:'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1198
              name: 'AmountLabel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1199
              layout: (LayoutFrame 14 0 21 0 90 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1200
              translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1201
              adjust: right
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1202
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1203
           (InputFieldSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1204
              name: 'AmountEntryField'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1205
              layout: (LayoutFrame 95 0 21 0 139 0 43 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1206
              tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1207
              model: shiftAmount
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1208
              type: number
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1209
              acceptChannel: acceptChannel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1210
              acceptOnPointerLeave: false
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1211
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1212
           (HorizontalPanelViewSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1213
              name: 'HorizontalPanel1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1214
              layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1215
              horizontalLayout: fitSpace
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1216
              verticalLayout: center
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1217
              horizontalSpace: 3
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1218
              verticalSpace: 3
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1219
              reverseOrderIfOKAtLeft: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1220
              component: 
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1221
             (SpecCollection
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1222
                collection: (
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1223
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1224
                    label: 'Cancel'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1225
                    name: 'Button1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1226
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1227
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1228
                    model: cancel
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1229
                    extent: (Point 118 22)
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1230
                  )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1231
                 (ActionButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1232
                    label: 'OK'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1233
                    name: 'Button2'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1234
                    translateLabel: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1235
                    tabable: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1236
                    model: accept
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1237
                    extent: (Point 118 22)
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1238
                  )
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1239
                 )
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1240
               
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1241
              )
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1242
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1243
           (ArrowButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1244
              name: 'upArrowButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1245
              layout: (LayoutFrame 105 0 63 0 127 0 85 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1246
              model: shiftUpNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1247
              isTriggerOnDown: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1248
              autoRepeat: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1249
              actionValue: ''
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1250
              direction: up
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1251
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1252
           (ArrowButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1253
              name: 'leftArrowButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1254
              layout: (LayoutFrame 84 0 86 0 106 0 108 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1255
              model: shiftLeftNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1256
              isTriggerOnDown: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1257
              autoRepeat: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1258
              actionValue: ''
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1259
              direction: left
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1260
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1261
           (ArrowButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1262
              name: 'rightArrowButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1263
              layout: (LayoutFrame 126 0 86 0 148 0 108 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1264
              model: shiftRightNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1265
              isTriggerOnDown: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1266
              autoRepeat: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1267
              actionValue: ''
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1268
              direction: right
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1269
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1270
           (ArrowButtonSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1271
              name: 'downArrowButton'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1272
              layout: (LayoutFrame 105 0 107 0 127 0 129 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1273
              model: shiftDownNow
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1274
              isTriggerOnDown: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1275
              autoRepeat: true
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1276
              actionValue: ''
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1277
              direction: down
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1278
            )
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1279
           (CheckBoxSpec
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1280
              label: 'Wrap'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1281
              name: 'CheckBox1'
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1282
              layout: (LayoutFrame 153 0 22 0 289 0 44 0)
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1283
              model: wrap
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1284
              translateLabel: true
1713
088ff38c03a5 shift + wrap
Claus Gittinger <cg@exept.de>
parents: 1708
diff changeset
  1285
            )
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1286
           )
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1287
         
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1288
        )
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1289
      )
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1290
!
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  1291
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  1292
uncropDialogSpec
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1293
    "This resource specification was automatically generated
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1294
     by the UIPainter of ST/X."
1796
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1295
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1296
    "Do not manually edit this!! If it is corrupted,
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1297
     the UIPainter may not be able to read the specification."
1796
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1298
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1299
    "
1796
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1300
     UIPainter new openOnClass:ImageEditor andSelector:#uncropDialogSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1301
     ImageEditor new openInterface:#uncropDialogSpec
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1302
    "
1796
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1303
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1304
    <resource: #canvas>
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1305
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1306
    ^ 
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1307
     #(FullSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1308
        name: uncropDialogSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1309
        window: 
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1310
       (WindowSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1311
          label: 'Add Border(s)'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1312
          name: 'Add Border(s)'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1313
          min: (Point 10 10)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1314
          max: (Point 800 478)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1315
          bounds: (Rectangle 0 0 261 228)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1316
        )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1317
        component: 
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1318
       (SpecCollection
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1319
          collection: (
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1320
           (LabelSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1321
              label: 'Left:'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1322
              name: 'Label1'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1323
              layout: (LayoutFrame 14 0 21 0 90 0 43 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1324
              translateLabel: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1325
              adjust: right
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1326
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1327
           (InputFieldSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1328
              name: 'EntryField1'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1329
              layout: (LayoutFrame 95 0 21 0 132 0 43 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1330
              model: left
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1331
              type: number
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1332
              acceptOnPointerLeave: false
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1333
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1334
           (LabelSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1335
              label: 'Right:'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1336
              name: 'Label2'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1337
              layout: (LayoutFrame 14 0 51 0 90 0 73 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1338
              translateLabel: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1339
              adjust: right
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1340
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1341
           (InputFieldSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1342
              name: 'EntryField2'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1343
              layout: (LayoutFrame 95 0 51 0 132 0 73 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1344
              model: right
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1345
              type: number
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1346
              acceptOnPointerLeave: false
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1347
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1348
           (LabelSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1349
              label: 'Top:'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1350
              name: 'Label3'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1351
              layout: (LayoutFrame 14 0 81 0 90 0 103 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1352
              translateLabel: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1353
              adjust: right
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1354
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1355
           (InputFieldSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1356
              name: 'EntryField3'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1357
              layout: (LayoutFrame 95 0 81 0 132 0 103 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1358
              model: top
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1359
              type: number
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1360
              acceptOnPointerLeave: false
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1361
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1362
           (LabelSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1363
              label: 'Bottom:'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1364
              name: 'Label4'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1365
              layout: (LayoutFrame 14 0 111 0 90 0 133 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1366
              translateLabel: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1367
              adjust: right
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1368
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1369
           (InputFieldSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1370
              name: 'EntryField4'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1371
              layout: (LayoutFrame 95 0 111 0 132 0 133 0)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1372
              model: bottom
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1373
              type: number
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1374
              acceptOnPointerLeave: false
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1375
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1376
           (HorizontalPanelViewSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1377
              name: 'HorizontalPanel1'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1378
              layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1379
              horizontalLayout: fitSpace
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1380
              verticalLayout: center
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1381
              horizontalSpace: 3
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1382
              verticalSpace: 3
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1383
              reverseOrderIfOKAtLeft: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1384
              component: 
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1385
             (SpecCollection
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1386
                collection: (
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1387
                 (ActionButtonSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1388
                    label: 'Cancel'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1389
                    name: 'Button1'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1390
                    translateLabel: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1391
                    model: cancel
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1392
                    extent: (Point 118 22)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1393
                  )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1394
                 (ActionButtonSpec
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1395
                    label: 'OK'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1396
                    name: 'Button2'
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1397
                    translateLabel: true
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1398
                    model: accept
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1399
                    extent: (Point 118 22)
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1400
                  )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1401
                 )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1402
               
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1403
              )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1404
            )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1405
           )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1406
         
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1407
        )
e2c8c895443a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1793
diff changeset
  1408
      )
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1409
!
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  1410
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1411
windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1412
    "This resource specification was automatically generated
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1413
     by the UIPainter of ST/X."
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1414
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1415
    "Do not manually edit this!! If it is corrupted,
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1416
     the UIPainter may not be able to read the specification."
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1417
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1418
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1419
     UIPainter new openOnClass:ImageEditor andSelector:#windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1420
     ImageEditor new openInterface:#windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1421
     ImageEditor open
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1422
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1423
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1424
    <resource: #canvas>
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1425
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1426
    ^ 
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1427
     #(FullSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1428
        name: windowSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1429
        window: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1430
       (WindowSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1431
          label: 'Image Editor'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1432
          name: 'Image Editor'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1433
          min: (Point 400 320)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1434
          bounds: (Rectangle 0 0 450 350)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1435
          menu: menu
2155
bfc839d08928 Add #defaultIcon
Stefan Vogel <sv@exept.de>
parents: 2136
diff changeset
  1436
          icon: defaultIcon
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1437
        )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1438
        component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1439
       (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1440
          collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1441
           (MenuPanelSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1442
              name: 'menuToolbarView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1443
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1444
              style: (FontDescription helvetica medium roman 10)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1445
              menu: menuToolbar
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1446
              showSeparatingLines: true
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1447
            )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1448
           (VariableHorizontalPanelSpec
1998
efd9be2585e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
  1449
              name: 'mainPanel'
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1450
              layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1451
              snapMode: both
1843
771731481a20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1452
              barLevel: 0
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1453
              component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1454
             (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1455
                collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1456
                 (ViewSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1457
                    name: 'leftView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1458
                    level: 1
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1459
                    component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1460
                   (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1461
                      collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1462
                       (VariableVerticalPanelSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1463
                          name: 'verticalPanel'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1464
                          layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1465
                          level: 0
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1466
                          snapMode: both
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1467
                          component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1468
                         (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1469
                            collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1470
                             (ViewSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1471
                                name: 'View1'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1472
                                component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1473
                               (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1474
                                  collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1475
                                   (MenuPanelSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1476
                                      name: 'MouseButtonColorToolBar'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1477
                                      layout: (LayoutFrame 0 0.0 0 0 0 1.0 24 0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1478
                                      level: 0
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1479
                                      menu: menuMouseButtonColors
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1480
                                    )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1481
                                   (DataSetSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1482
                                      name: 'colorDataSetView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1483
                                      layout: (LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1484
                                      activeHelpKey: colorMapTable
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1485
                                      style: (FontDescription helvetica medium roman 10)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1486
                                      model: selectionOfColor
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1487
                                      menu: colorMapMenu
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1488
                                      hasHorizontalScrollBar: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1489
                                      hasVerticalScrollBar: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1490
                                      miniScrollerHorizontal: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1491
                                      miniScrollerVertical: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1492
                                      dataList: listOfColors
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1493
                                      has3Dseparators: true
2174
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  1494
                                      doubleClickSelector: doubleClickOnColor:
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  1495
                                      columnHolder: colorTableColumns
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1496
                                      verticalSpacing: 1
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1497
                                      columnAdaptor: colorColumnAdaptor
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1498
                                    )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1499
                                   )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1500
                                 
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1501
                                )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1502
                              )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1503
                             (ArbitraryComponentSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1504
                                name: 'imagePreView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1505
                                activeHelpKey: previewView
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1506
                                menu: previewMenu
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1507
                                hasHorizontalScrollBar: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1508
                                hasVerticalScrollBar: true
2728
7b0f0d920794 changed:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1509
                                miniScrollerHorizontal: false
7b0f0d920794 changed:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1510
                                miniScrollerVertical: false
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1511
                                hasBorder: false
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1512
                                component: ImageView
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1513
                              )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1514
                             )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1515
                           
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1516
                          )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1517
                          handles: (Any 0.5 1.0)
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1518
                        )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1519
                       )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1520
                     
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1521
                    )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1522
                  )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1523
                 (ViewSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1524
                    name: 'rightView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1525
                    component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1526
                   (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1527
                      collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1528
                       (MenuPanelSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1529
                          name: 'ToolBar1'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1530
                          layout: (LayoutFrame 0 0 0 0.0 28 0 0 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1531
                          level: 1
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1532
                          menu: toolsMenuToolbar
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1533
                          verticalLayout: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1534
                          centerItems: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1535
                          textDefault: true
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1536
                        )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1537
                       (ViewSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1538
                          name: 'editingView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1539
                          layout: (LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1540
                          level: 1
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1541
                          component: 
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1542
                         (SpecCollection
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1543
                            collection: (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1544
                             (ArbitraryComponentSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1545
                                name: 'imageEditView'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1546
                                layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1547
                                hasHorizontalScrollBar: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1548
                                hasVerticalScrollBar: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1549
                                hasBorder: false
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1550
                                component: ImageEditView
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1551
                              )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1552
                             (LabelSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1553
                                name: 'coordLabel'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1554
                                layout: (LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1555
                                level: -1
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1556
                                labelChannel: imageInfoHolder
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1557
                                resizeForLabel: false
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1558
                                adjust: left
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1559
                              )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1560
                             (ArrowButtonSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1561
                                name: 'magnifyDownButton'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1562
                                layout: (LayoutFrame -80 1 -22 1 -58 1 0 1)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1563
                                activeHelpKey: magnifyImageDown
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1564
                                model: doMagnifyDown
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1565
                                enableChannel: imageIsLoaded
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1566
                                isTriggerOnDown: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1567
                                direction: left
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1568
                              )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1569
                             (ArrowButtonSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1570
                                name: 'magnifyUpButton'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1571
                                layout: (LayoutFrame -24 1 -22 1 -2 1 0 1)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1572
                                activeHelpKey: magnifyImageUp
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1573
                                model: doMagnifyUp
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1574
                                enableChannel: imageIsLoaded
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1575
                                isTriggerOnDown: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1576
                                direction: right
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1577
                              )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1578
                             (InputFieldSpec
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1579
                                name: 'magnificationInputField'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1580
                                layout: (LayoutFrame -57 1 -22 1 -26 1 0 1)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1581
                                activeHelpKey: magnificationNumber
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1582
                                enableChannel: imageIsLoaded
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1583
                                model: magnificationHolder
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1584
                                type: numberInRange
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  1585
                                acceptOnReturn: true
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  1586
                                acceptOnTab: true
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1587
                                numChars: 2
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1588
                                minValue: 1
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1589
                                maxValue: 99
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  1590
                                acceptOnPointerLeave: true
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1591
                              )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1592
                             )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1593
                           
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1594
                          )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1595
                        )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1596
                       )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1597
                     
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1598
                    )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1599
                  )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1600
                 )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1601
               
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1602
              )
1843
771731481a20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1603
              handles: (Any 0.288889 1.0)
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1604
            )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1605
           (UISubSpecification
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1606
              name: 'infoBarSubSpec'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1607
              layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1608
              majorKey: ToolApplicationModel
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1609
              minorKey: windowSpecForInfoBar
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1610
            )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1611
           )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1612
         
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  1613
        )
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1614
      )
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1615
! !
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1616
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1617
!ImageEditor class methodsFor:'menu specs'!
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
  1618
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1619
colorMapMenu
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1620
    "This resource specification was automatically generated
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1621
     by the MenuEditor of ST/X."
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1622
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1623
    "Do not manually edit this!! If it is corrupted,
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1624
     the MenuEditor may not be able to read the specification."
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1625
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1626
    "
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1627
     MenuEditor new openOnClass:ImageEditor andSelector:#colorMapMenu
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1628
     (Menu new fromLiteralArrayEncoding:(ImageEditor colorMapMenu)) startUp
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1629
    "
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1630
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1631
    <resource: #menu>
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1632
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1633
    ^ 
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1634
     #(Menu
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1635
        (
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1636
         (MenuItem
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1637
            enabled: hasColormap
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1638
            label: 'Add Color'
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1639
            itemValue: addColorToColormap
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1640
            translateLabel: true
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1641
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1642
         (MenuItem
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1643
            enabled: hasColormap
2539
3fa0fde65f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  1644
            label: 'Pick and Add Color...'
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1645
            itemValue: pickAndAddColorToColormap
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1646
            translateLabel: true
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1647
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1648
         (MenuItem
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1649
            label: '-'
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1650
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1651
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1652
            enabled: hasColormapAndColorSelected
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1653
            label: 'Cut Color'
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1654
            itemValue: cutColorFromColormap
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1655
            translateLabel: true
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1656
            isVisible: false
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1657
          )
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1658
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1659
            enabled: hasColorSelected
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1660
            label: 'Copy Color'
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1661
            itemValue: copyColorFromColormap
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1662
            translateLabel: true
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1663
          )
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1664
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1665
            enabled: hasColormapAndColorSelected
2539
3fa0fde65f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  1666
            label: 'Pick and Paste Color...'
1933
2fe701f721ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
  1667
            itemValue: pickAndPasteColor
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1668
            translateLabel: true
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1669
          )
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1670
         (MenuItem
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1671
            label: 'Paste Color'
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1672
            itemValue: pasteColorIntoColormap
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1673
            translateLabel: true
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1674
          )
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1675
         (MenuItem
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1676
            label: '-'
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1677
          )
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  1678
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1679
            enabled: hasColormapAndColorSelected
2539
3fa0fde65f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  1680
            label: 'Edit Color...'
1931
34b208e7231f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  1681
            itemValue: editSelectedColor
34b208e7231f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  1682
            translateLabel: true
34b208e7231f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  1683
          )
34b208e7231f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  1684
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1685
            enabled: hasColormapAndColorSelected
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1686
            label: 'Brighter'
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1687
            itemValue: makeSelectedColorBrighter
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1688
            translateLabel: true
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1689
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1690
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1691
            enabled: hasColormapAndColorSelected
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1692
            label: 'Darker'
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1693
            itemValue: makeSelectedColorDarker
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1694
            translateLabel: true
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1695
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1696
         (MenuItem
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1697
            enabled: hasColormapAndColorSelected
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1698
            label: 'Make Gray'
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1699
            itemValue: makeSelectedColorGray
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1700
            translateLabel: true
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1701
          )
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1702
         (MenuItem
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1703
            label: '-'
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1704
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1705
         (MenuItem
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1706
            label: 'Inspect Color'
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1707
            itemValue: inspectColor
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1708
            translateLabel: true
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1709
            enabled: hasColorSelected
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1710
          )
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1711
         (MenuItem
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1712
            enabled: hasColormap
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1713
            label: 'Inspect Colormap'
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1714
            itemValue: inspectColormap
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  1715
            translateLabel: true
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1716
          )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1717
         )
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1718
        nil
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1719
        nil
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1720
      )
2190
5bb9504b58bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
  1721
5bb9504b58bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2174
diff changeset
  1722
    "Modified: / 27-10-2007 / 10:24:00 / cg"
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1723
!
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  1724
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1725
menu
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1726
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1727
     by the MenuEditor of ST/X."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1728
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1729
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1730
     the MenuEditor may not be able to read the specification."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1731
228524287573 intitial checkin
tz
parents:
diff changeset
  1732
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  1733
     MenuEditor new openOnClass:ImageEditor andSelector:#menu
228524287573 intitial checkin
tz
parents:
diff changeset
  1734
     (Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
  1735
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  1736
228524287573 intitial checkin
tz
parents:
diff changeset
  1737
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
  1738
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1739
    ^ 
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1740
     #(Menu
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1741
        (
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1742
         (MenuItem
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1743
            label: '&File'
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1744
            translateLabel: true
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  1745
            submenuChannel: menuFile
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1746
            "/ keepLinkedMenu: true
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1747
          )
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1748
         (MenuItem
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1749
            label: 'Edit'
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1750
            translateLabel: true
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  1751
            submenuChannel: menuEdit
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1752
            "/ keepLinkedMenu: true
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1753
          )
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1754
         (MenuItem
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1755
            label: 'Mode'
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1756
            translateLabel: true
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1757
            submenuChannel: modeMenu
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  1758
          )
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1759
         (MenuItem
1924
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  1760
            label: 'Colors'
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1761
            translateLabel: true
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1762
            submenuChannel: menuColors
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1763
          )
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1764
         (MenuItem
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1765
            label: 'Settings'
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1766
            translateLabel: true
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1767
            submenuChannel: menuSettings
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1768
          )
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1769
         (MenuItem
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1770
            label: 'History'
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1771
            translateLabel: true
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  1772
            isVisible: isStandAlone
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1773
            submenuChannel: menuHistory
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1774
          )
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1775
         (MenuItem
2136
bb10485fa455 support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents: 2125
diff changeset
  1776
            label: 'MENU_Help'
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1777
            translateLabel: true
2125
22ad4aa3e495 #conditionalRight
Claus Gittinger <cg@exept.de>
parents: 2073
diff changeset
  1778
            startGroup: conditionalRight
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  1779
            submenuChannel: menuHelp
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1780
          )
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1781
         )
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1782
        nil
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1783
        nil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1784
      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1785
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1786
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1787
menuColors
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1788
    "This resource specification was automatically generated
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1789
     by the MenuEditor of ST/X."
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1790
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1791
    "Do not manually edit this!! If it is corrupted,
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1792
     the MenuEditor may not be able to read the specification."
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1793
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1794
    "
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1795
     MenuEditor new openOnClass:ImageEditor andSelector:#menuColors
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1796
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuColors)) startUp
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1797
    "
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1798
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1799
    <resource: #menu>
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1800
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1801
    ^ 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1802
     #(Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1803
        (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1804
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1805
            enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1806
            label: 'Depth'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1807
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1808
            submenu: 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1809
           (Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1810
              (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1811
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1812
                  activeHelpKey: colorMap1
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1813
                  label: '1-Plane'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1814
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1815
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1816
                  argument: depth1
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1817
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1818
                  choiceValue: depth1
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1819
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1820
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1821
                  activeHelpKey: colorMap1M
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1822
                  label: '1-Plane + Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1823
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1824
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1825
                  argument: masked1
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1826
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1827
                  choiceValue: masked1
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1828
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1829
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1830
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1831
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1832
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1833
                  activeHelpKey: colorMap2
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1834
                  label: '2-Plane'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1835
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1836
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1837
                  argument: depth2
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1838
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1839
                  choiceValue: depth2
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1840
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1841
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1842
                  activeHelpKey: colorMap2M
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1843
                  label: '2-Plane + Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1844
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1845
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1846
                  argument: masked2
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1847
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1848
                  choiceValue: masked2
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1849
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1850
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1851
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1852
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1853
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1854
                  activeHelpKey: colorMap4
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1855
                  label: '4-Plane'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1856
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1857
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1858
                  argument: depth4
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1859
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1860
                  choiceValue: depth4
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1861
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1862
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1863
                  activeHelpKey: colorMap4M
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1864
                  label: '4-Plane + Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1865
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1866
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1867
                  argument: masked4
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1868
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1869
                  choiceValue: masked4
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1870
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1871
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1872
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1873
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1874
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1875
                  activeHelpKey: colorMap8
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1876
                  label: '8-Plane'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1877
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1878
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1879
                  argument: depth8
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1880
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1881
                  choiceValue: depth8
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1882
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1883
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1884
                  activeHelpKey: colorMap8M
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1885
                  label: '8-Plane + Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1886
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1887
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1888
                  argument: masked8
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1889
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1890
                  choiceValue: masked8
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1891
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1892
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1893
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1894
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1895
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1896
                  activeHelpKey: colorMap16
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1897
                  label: '16-Plane'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1898
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1899
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1900
                  argument: depth16
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1901
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1902
                  choiceValue: depth16
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1903
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1904
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1905
                  activeHelpKey: colorMap16M
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1906
                  label: '16-Plane + Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1907
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1908
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1909
                  argument: masked16
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1910
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1911
                  choiceValue: masked16
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1912
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1913
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1914
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1915
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1916
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1917
                  activeHelpKey: colorMap24
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1918
                  label: '24-Plane'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1919
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1920
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1921
                  argument: depth24
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1922
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1923
                  choiceValue: depth24
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1924
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1925
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1926
                  activeHelpKey: colorMap24M
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1927
                  label: '24-Plane + Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1928
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1929
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1930
                  argument: masked24
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1931
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1932
                  choiceValue: masked24
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1933
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1934
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1935
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1936
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1937
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1938
                  activeHelpKey: colorMap32
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1939
                  label: '32-Plane (rgba)'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1940
                  itemValue: colorMapMode:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1941
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1942
                  argument: depth32
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1943
                  choice: colorMapMode
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1944
                  choiceValue: depth32
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1945
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1946
               )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1947
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1948
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1949
            )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1950
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1951
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1952
            enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1953
            label: 'ColorMap'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1954
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1955
            submenu: 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1956
           (Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1957
              (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1958
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1959
                  activeHelpKey: compressColormap
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1960
                  enabled: hasColormap
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1961
                  label: 'Compress Colormap'
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  1962
                  itemValue: menu_compressColorMap
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1963
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1964
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1965
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1966
                  enabled: hasColormap
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1967
                  label: 'Sort Colormap'
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  1968
                  itemValue: menu_sortColorMap
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1969
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1970
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1971
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1972
                  label: 'Reduce Number of Colors by Rounding...'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1973
                  itemValue: reduceNumberOfColors2
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1974
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1975
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1976
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1977
                  label: 'Reduce Number of Colors by Masking Bits...'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1978
                  itemValue: reduceNumberOfColors
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1979
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1980
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1981
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1982
                  label: 'Dither to Depth...'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1983
                  itemValue: ditherToDepth
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1984
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1985
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1986
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1987
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1988
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1989
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1990
                  enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1991
                  label: 'Brighten'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1992
                  itemValue: doBrightenImage
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1993
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1994
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1995
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1996
                  enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1997
                  label: 'Darken'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1998
                  itemValue: doDarkenImage
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  1999
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2000
                )
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2001
               (MenuItem
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2002
                  enabled: imageIsLoaded
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2003
                  label: 'Invert'
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2004
                  itemValue: doNegativeImage
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2005
                  translateLabel: true
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2006
                )
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2007
               )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2008
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2009
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2010
            )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2011
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2012
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2013
            enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2014
            label: 'Process'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2015
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2016
            submenu: 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2017
           (Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2018
              (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2019
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2020
                  label: 'Make GrayScale'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2021
                  itemValue: makeGrayScaleImage
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2022
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2023
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2024
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2025
                  enabled: hasNoColormap
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2026
                  label: 'Make dithered 8Bit Palette'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2027
                  itemValue: makeDitheredPaletteImage
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2028
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2029
                  isVisible: false
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2030
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2031
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2032
                  label: 'Make Brighter'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2033
                  itemValue: makeBrighter
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2034
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2035
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2036
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2037
                  label: 'Make Darker'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2038
                  itemValue: makeDarker
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2039
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2040
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2041
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2042
                  label: 'Make Inverse'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2043
                  itemValue: makeInverse
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2044
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2045
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2046
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2047
                  label: '-'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2048
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2049
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2050
                  label: 'Change HLS...'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2051
                  itemValue: changeHLS
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2052
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2053
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2054
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2055
                  label: 'Colorize...'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2056
                  itemValue: colorize
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2057
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2058
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2059
               )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2060
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2061
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2062
            )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2063
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2064
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2065
            enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2066
            label: 'Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2067
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2068
            submenu: 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2069
           (Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2070
              (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2071
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2072
                  activeHelpKey: copyMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2073
                  enabled: hasMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2074
                  label: 'Copy Mask'
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2075
                  itemValue: menu_copyMask
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2076
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2077
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2078
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2079
                  activeHelpKey: pasteMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2080
                  enabled: hasMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2081
                  label: 'Paste Mask'
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2082
                  itemValue: menu_pasteMask
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2083
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2084
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2085
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2086
                  enabled: hasMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2087
                  label: 'Clear Masked Pixels'
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2088
                  itemValue: menu_clearMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2089
                  translateLabel: true
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2090
                )
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2091
               (MenuItem
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2092
                  enabled: hasMask
2653
f0e64b82fa93 changed: #menuColors
Claus Gittinger <cg@exept.de>
parents: 2652
diff changeset
  2093
                  label: 'Clear Colormap Entry for Masked Pixels'
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  2094
                  itemValue: menu_clearColormapEntry0AndMaskedPixels
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2095
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2096
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2097
               )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2098
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2099
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2100
            )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2101
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2102
         )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2103
        nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2104
        nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2105
      )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2106
!
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2107
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2108
menuEdit
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2109
    "This resource specification was automatically generated
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2110
     by the MenuEditor of ST/X."
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2111
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2112
    "Do not manually edit this!! If it is corrupted,
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2113
     the MenuEditor may not be able to read the specification."
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2114
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2115
    "
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2116
     MenuEditor new openOnClass:ImageEditor andSelector:#menuEdit
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2117
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuEdit)) startUp
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2118
    "
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2119
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2120
    <resource: #menu>
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2121
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2122
    ^ 
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2123
     #(Menu
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2124
        (
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2125
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2126
            activeHelpKey: editUndo
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2127
            enabled: canUndoHolder
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2128
            label: 'Undo'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2129
            itemValue: doUndo
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2130
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2131
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2132
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2133
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2134
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2135
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2136
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2137
            activeHelpKey: editResize
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2138
            label: 'Resize...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2139
            itemValue: doResizeImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2140
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2141
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2142
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2143
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2144
            activeHelpKey: editMagnifyImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2145
            label: 'Magnify...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2146
            itemValue: doMagnifyImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2147
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2148
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2149
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2150
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2151
            activeHelpKey: editMagnifyImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2152
            label: 'Magnify By...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2153
            itemValue: doMagnifyImageBy
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2154
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2155
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2156
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2157
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2158
            activeHelpKey: editRotate
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2159
            label: 'Rotate...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2160
            itemValue: doRotateImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2161
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2162
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2163
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2164
            enabled: imageIsLoaded
2354
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  2165
            activeHelpKey: edit3DProjection
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  2166
            label: '3D Projection...'
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  2167
            itemValue: do3DProjection
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  2168
            translateLabel: true
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  2169
          )
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  2170
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2171
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2172
            label: 'Flip'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2173
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2174
            submenu: 
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2175
           (Menu
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2176
              (
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2177
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2178
                  activeHelpKey: editFlipVertical
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2179
                  label: 'Flip - Vertical'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2180
                  itemValue: doFlipVertical
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2181
                  translateLabel: true
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2182
                  enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2183
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2184
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2185
                  activeHelpKey: editFlipHorizontal
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2186
                  label: 'Flip - Horizontal'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2187
                  itemValue: doFlipHorizontal
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2188
                  translateLabel: true
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2189
                  enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2190
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2191
               )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2192
              nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2193
              nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2194
            )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2195
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2196
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2197
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2198
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2199
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2200
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2201
            label: 'Crop'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2202
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2203
            submenu: 
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2204
           (Menu
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2205
              (
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2206
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2207
                  activeHelpKey: cropManual
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2208
                  label: 'Manual...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2209
                  itemValue: doCropManual
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2210
                  translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2211
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2212
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2213
                  label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2214
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2215
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2216
                  activeHelpKey: cropAll
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2217
                  label: 'All'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2218
                  itemValue: doCropAll
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2219
                  translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2220
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2221
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2222
                  label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2223
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2224
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2225
                  activeHelpKey: cropLeft
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2226
                  label: 'Left'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2227
                  itemValue: doCropLeft
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2228
                  translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2229
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2230
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2231
                  activeHelpKey: cropRight
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2232
                  label: 'Right'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2233
                  itemValue: doCropRight
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2234
                  translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2235
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2236
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2237
                  activeHelpKey: cropTop
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2238
                  label: 'Top'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2239
                  itemValue: doCropTop
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2240
                  translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2241
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2242
               (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2243
                  activeHelpKey: cropBottom
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2244
                  label: 'Bottom'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2245
                  itemValue: doCropBottom
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2246
                  translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2247
                )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2248
               )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2249
              nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2250
              nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2251
            )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2252
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2253
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2254
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2255
            activeHelpKey: uncropManual
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2256
            label: 'Uncrop (Add Border)...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2257
            itemValue: doUnCropManual
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2258
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2259
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2260
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2261
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2262
            activeHelpKey: shiftManual
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2263
            label: 'Shift...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2264
            itemValue: doShiftManual
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2265
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2266
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2267
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2268
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2269
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2270
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2271
            activeHelpKey: fileEditMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2272
            enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2273
            label: 'Edit Mask'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2274
            itemValue: doEditMask
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2275
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2276
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2277
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2278
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2279
            label: 'Text...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2280
            itemValue: doInsertTextFromUser
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2281
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2282
          )
2424
12831cc181ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2423
diff changeset
  2283
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2284
         )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2285
        nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2286
        nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2287
      )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2288
!
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2289
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2290
menuFile
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2291
    "This resource specification was automatically generated
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2292
     by the MenuEditor of ST/X."
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2293
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2294
    "Do not manually edit this!! If it is corrupted,
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2295
     the MenuEditor may not be able to read the specification."
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2296
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2297
    "
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2298
     MenuEditor new openOnClass:ImageEditor andSelector:#menuFile
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2299
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuFile)) startUp
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2300
    "
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2301
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2302
    <resource: #menu>
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2303
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2304
    ^ 
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2305
     #(Menu
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2306
        (
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2307
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2308
            activeHelpKey: fileNewImageEditor
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2309
            label: 'New ImageEditor'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2310
            itemValue: doNewImageEditor
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2311
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2312
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2313
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2314
            activeHelpKey: fileNewImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2315
            label: 'New...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2316
            itemValue: doNewImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2317
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2318
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2319
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2320
            activeHelpKey: fileNewImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2321
            label: 'New from ClipBoard'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2322
            itemValue: doNewImageFromClipboard
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2323
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2324
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2325
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2326
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2327
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2328
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2329
            activeHelpKey: fileLoadFromClass
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2330
            label: 'Load...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2331
            itemValue: doLoadFromClass
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2332
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2333
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2334
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2335
            activeHelpKey: fileLoadFromFile
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2336
            label: 'Load from File...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2337
            itemValue: doLoadFromFile
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2338
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2339
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2340
         (MenuItem
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2341
            label: 'Grab'
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2342
            translateLabel: true
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2343
            submenu: 
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2344
           (Menu
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2345
              (
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2346
               (MenuItem
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2347
                  activeHelpKey: fileGrabImageFromWindow
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2348
                  label: 'Grab from Window...'
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2349
                  itemValue: grabWindowImage
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2350
                  translateLabel: true
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2351
                )
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2352
               (MenuItem
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2353
                  activeHelpKey: fileGrabImageFromScreen
2717
fac7e5156235 changed: #menuFile
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
  2354
                  label: 'Grab from Screen Area...'
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2355
                  itemValue: grabScreenImage
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2356
                  translateLabel: true
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2357
                )
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2358
               (MenuItem
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2359
                  activeHelpKey: fileGrabImageFromScreen
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2360
                  enabled: hasLastGrabScreenArea
2711
4700f54d0040 changed: #menuFile
Claus Gittinger <cg@exept.de>
parents: 2708
diff changeset
  2361
                  label: 'Grab again from same Screen Area'
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2362
                  itemValue: grabScreenImageFromLastArea
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2363
                  translateLabel: true
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2364
                )
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2365
               )
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2366
              nil
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2367
              nil
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  2368
            )
2701
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  2369
          )
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  2370
         (MenuItem
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2371
            enabled: imageHasNextImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2372
            label: 'Next in Sequence'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2373
            itemValue: nextImageInSequence
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2374
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2375
            isVisible: isStandAlone
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2376
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2377
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2378
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2379
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2380
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2381
            activeHelpKey: fileSaveMethod
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2382
            enabled: imageIsLoadedAndClassDefined
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2383
            label: 'Save'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2384
            itemValue: doSaveMethod
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2385
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2386
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2387
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2388
            activeHelpKey: fileSaveMethodAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2389
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2390
            label: 'Save As...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2391
            itemValue: doSaveMethodAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2392
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2393
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2394
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2395
            activeHelpKey: fileSaveAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2396
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2397
            label: 'Save to File...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2398
            itemValue: doSaveImageFileAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2399
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2400
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2401
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2402
            activeHelpKey: fileSaveMaskAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2403
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2404
            label: 'Save Mask to File...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2405
            itemValue: doSaveImageMaskFileAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2406
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2407
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2408
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2409
            activeHelpKey: fileSaveButtonImageAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2410
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2411
            label: 'Save as Button to File...'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2412
            itemValue: doSaveButtonImageToFileAs
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2413
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2414
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2415
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2416
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2417
            label: 'Copy to Clipboard'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2418
            itemValue: doCopyImageToClipboard
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2419
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2420
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2421
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2422
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2423
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2424
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2425
            activeHelpKey: fileEditMask
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2426
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2427
            label: 'Edit Mask'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2428
            itemValue: doEditMask
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2429
            translateLabel: true
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2430
            isVisible: false
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2431
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2432
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2433
            label: '-'
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2434
            isVisible: false
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2435
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2436
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2437
            activeHelpKey: filePrint
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2438
            enabled: imageIsLoaded
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2439
            label: 'Print'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2440
            itemValue: doPrint
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2441
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2442
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2443
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2444
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2445
            isVisible: isStandAlone
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2446
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2447
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2448
            activeHelpKey: fileBrowseClass
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2449
            enabled: hasClassDefined
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2450
            label: 'Browse Class'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2451
            itemValue: doBrowseClass
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2452
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2453
            isVisible: isStandAlone
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2454
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2455
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2456
            enabled: imageIsLoaded
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2457
            label: 'Inspect Image'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2458
            itemValue: doInspectImage
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2459
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2460
            isVisible: isStandAlone
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2461
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2462
         (MenuItem
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2463
            activeHelpKey: fileShowStoreString
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2464
            enabled: imageIsLoaded
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2465
            label: 'Show storeString'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2466
            itemValue: doShowStoreString
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2467
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2468
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2469
         (MenuItem
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2470
            label: '-'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2471
            isVisible: isStandAlone
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2472
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2473
         (MenuItem
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2474
            activeHelpKey: fileExit
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2475
            label: 'Exit'
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2476
            itemValue: closeRequest
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2477
            translateLabel: true
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2478
            isVisible: isStandAlone
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2479
          )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2480
         )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2481
        nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2482
        nil
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2483
      )
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2484
!
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  2485
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2486
menuMouseButtonColors
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2487
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2488
     by the MenuEditor of ST/X."
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2489
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2490
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2491
     the MenuEditor may not be able to read the specification."
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2492
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2493
    "
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2494
     MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2495
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2496
    "
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2497
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2498
    <resource: #menu>
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2499
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2500
    ^
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2501
     
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2502
       #(#Menu
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2503
          
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2504
           #(
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2505
             #(#MenuItem
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2506
                #label: 'Left Mouse Button'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2507
                #nameKey: #leftMouseKeyButton
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2508
                #activeHelpKey: #mouseKeyColorMode
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2509
                #enabled: #imageIsLoaded
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2510
                #labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon)
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2511
                #choice: #mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2512
                #choiceValue: 1
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2513
            )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2514
             #(#MenuItem
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2515
                #label: 'Right Mouse Button'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2516
                #nameKey: #rightMouseKeyButton
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2517
                #activeHelpKey: #mouseKeyColorMode
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2518
                #enabled: #imageIsLoaded
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2519
                #labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon)
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2520
                #choice: #mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2521
                #choiceValue: 2
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2522
            )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2523
          ) nil
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2524
          nil
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2525
      )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2526
!
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  2527
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2528
menuSettings
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2529
    "This resource specification was automatically generated
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2530
     by the MenuEditor of ST/X."
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2531
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2532
    "Do not manually edit this!! If it is corrupted,
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2533
     the MenuEditor may not be able to read the specification."
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2534
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2535
    "
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2536
     MenuEditor new openOnClass:ImageEditor andSelector:#menuSettings
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2537
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuSettings)) startUp
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2538
    "
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2539
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2540
    <resource: #menu>
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2541
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2542
    ^ 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2543
     #(Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2544
        (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2545
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2546
            activeHelpKey: settingsGridMagnification
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2547
            label: 'Grid Magnification Limit...'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2548
            itemValue: doChangeGridMagnification
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2549
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2550
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2551
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2552
            label: 'Pen'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2553
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2554
            submenu: 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2555
           (Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2556
              (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2557
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2558
                  label: '1'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2559
                  itemValue: penWidth:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2560
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2561
                  argument: 1
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2562
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2563
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2564
                  label: '5'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2565
                  itemValue: penWidth:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2566
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2567
                  argument: 5
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2568
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2569
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2570
                  label: '10'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2571
                  itemValue: penWidth:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2572
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2573
                  argument: 10
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2574
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2575
               )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2576
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2577
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2578
            )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2579
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2580
         (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2581
            label: 'Spray'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2582
            translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2583
            submenu: 
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2584
           (Menu
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2585
              (
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2586
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2587
                  label: '4'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2588
                  itemValue: spraySpot:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2589
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2590
                  argument: 4
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2591
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2592
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2593
                  label: '8'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2594
                  itemValue: spraySpot:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2595
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2596
                  argument: 8
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2597
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2598
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2599
                  label: '16'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2600
                  itemValue: spraySpot:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2601
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2602
                  argument: 16
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2603
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2604
               (MenuItem
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2605
                  label: '32'
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2606
                  itemValue: spraySpot:
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2607
                  translateLabel: true
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2608
                  argument: 32
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2609
                )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2610
               )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2611
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2612
              nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2613
            )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2614
          )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2615
         )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2616
        nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2617
        nil
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2618
      )
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2619
!
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  2620
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2621
menuToolbar
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2622
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2623
     by the MenuEditor of ST/X."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2624
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2625
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  2626
     the MenuEditor may not be able to read the specification."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2627
228524287573 intitial checkin
tz
parents:
diff changeset
  2628
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  2629
     MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
  2630
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
  2631
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  2632
228524287573 intitial checkin
tz
parents:
diff changeset
  2633
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
  2634
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2635
    ^ 
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2636
     #(Menu
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2637
        (
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2638
         (MenuItem
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2639
            activeHelpKey: fileNewImage
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2640
            label: 'newImage'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2641
            itemValue: doNewImage
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2642
            translateLabel: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2643
            isButton: true
1883
577a267a87cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1882
diff changeset
  2644
            labelImage: (ResourceRetriever ToolbarIconLibrary newImageIcon)
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2645
          )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2646
         (MenuItem
1949
00defdb89630 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
  2647
            label: '-'
00defdb89630 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
  2648
          )
00defdb89630 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
  2649
         (MenuItem
1970
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2650
            activeHelpKey: fileLoadFromClass
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2651
            label: 'loadFromClass'
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2652
            itemValue: doLoadFromClass
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2653
            translateLabel: true
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2654
            isButton: true
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  2655
            isVisible: isStandAlone
1970
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2656
            submenuChannel: menuHistory
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2657
            labelImage: (ResourceRetriever XPToolbarIconLibrary loadImageFromMethodIcon)
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2658
            keepLinkedMenu: true
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2659
          )
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2660
         (MenuItem
2567
903843f8a824 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2661
            activeHelpKey: fileSaveMethodAs
1970
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2662
            enabled: imageIsLoaded
2567
903843f8a824 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2663
            label: 'fileSaveMethodAs'
1970
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2664
            itemValue: doSaveMethodAs
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2665
            translateLabel: true
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2666
            isButton: true
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  2667
            isVisible: isStandAlone
1970
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2668
            labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageAsMethodAsIcon)
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2669
          )
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2670
         (MenuItem
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2671
            activeHelpKey: fileSaveMethod
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2672
            enabled: imageIsLoaded
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2673
            label: 'saveAsMethod'
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2674
            itemValue: doSaveMethod
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2675
            translateLabel: true
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2676
            isButton: true
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  2677
            isVisible: isNotStandAlone
2590
9f2cb061d07f changed: #menuToolbar
Claus Gittinger <cg@exept.de>
parents: 2585
diff changeset
  2678
            labelImage: (ResourceRetriever ToolbarIconLibrary saveImageAsMethodIcon)
1970
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2679
          )
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2680
         (MenuItem
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2681
            label: '-'
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2682
          )
279cc79d6e27 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  2683
         (MenuItem
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2684
            activeHelpKey: fileLoadFromFile
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2685
            label: 'loadFromFile'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2686
            itemValue: doLoadFromFile
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2687
            translateLabel: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2688
            isButton: true
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  2689
            labelImage: (ResourceRetriever ToolbarIconLibrary loadImageFromFileIcon)
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2690
          )
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2691
         (MenuItem
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2692
            activeHelpKey: fileSaveAs
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2693
            enabled: imageIsLoaded
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2694
            label: 'saveAsFile'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2695
            itemValue: doSaveImageFileAs
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2696
            translateLabel: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2697
            isButton: true
1885
a09ede39c43f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1884
diff changeset
  2698
            labelImage: (ResourceRetriever ToolbarIconLibrary saveImageToFileAsIcon)
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2699
          )
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2700
         (MenuItem
1949
00defdb89630 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
  2701
            label: '-'
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2702
          )
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2703
         (MenuItem
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2704
            activeHelpKey: editUndo
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  2705
            enabled: canUndoHolder
1820
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2706
            label: 'Undo'
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2707
            itemValue: doUndo
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2708
            translateLabel: true
3d834d5e5bb4 toolbar icons & help texts
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  2709
            isButton: true
1883
577a267a87cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1882
diff changeset
  2710
            labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon)
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2711
          )
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2712
         )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2713
        nil
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2714
        nil
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2715
      )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2716
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2717
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2718
modeMenu
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2719
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2720
     by the MenuEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2721
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2722
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2723
     the MenuEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2724
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2725
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2726
     MenuEditor new openOnClass:ImageEditor andSelector:#modeMenu
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2727
     (Menu new fromLiteralArrayEncoding:(ImageEditor modeMenu)) startUp
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2728
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2729
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2730
    <resource: #menu>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2731
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2732
    ^ 
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2733
     #(Menu
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2734
        (
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2735
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2736
            activeHelpKey: drawModePoint
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2737
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2738
            label: 'Point'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2739
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2740
            labelImage: (ResourceRetriever ImageEditor pointIcon 'Point')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2741
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2742
            choiceValue: point
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2743
          )
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2744
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2745
            activeHelpKey: drawModePoint
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2746
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2747
            label: 'Spray'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2748
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2749
            labelImage: (ResourceRetriever ImageEditor sprayIcon 'Spray')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2750
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2751
            choiceValue: spray
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2752
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2753
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2754
            activeHelpKey: drawModeBox
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2755
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2756
            label: 'Rect'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2757
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2758
            labelImage: (ResourceRetriever ImageEditor rectIcon 'Rect')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2759
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2760
            choiceValue: box
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2761
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2762
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2763
            activeHelpKey: drawModeFilledBox
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2764
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2765
            label: 'Filled Rectangle'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2766
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2767
            labelImage: (ResourceRetriever ImageEditor fillRectIcon 'Filled Rectangle')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2768
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2769
            choiceValue: filledBox
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2770
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2771
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2772
            activeHelpKey: drawModeBox
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2773
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2774
            label: 'Circle'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2775
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2776
            labelImage: (ResourceRetriever ImageEditor circleIcon 'Circle')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2777
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2778
            choiceValue: circle
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2779
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2780
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2781
            activeHelpKey: drawModeFill
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2782
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2783
            label: 'Fill'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2784
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2785
            labelImage: (ResourceRetriever ImageEditor fillIcon 'Fill')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2786
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2787
            choiceValue: fill
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2788
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2789
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2790
            activeHelpKey: drawModeCopy
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2791
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2792
            label: 'Copy'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2793
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2794
            labelImage: (ResourceRetriever ImageEditor copyIcon 'Copy')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2795
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2796
            choiceValue: copy
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2797
          )
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2798
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2799
            activeHelpKey: drawModePaste
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2800
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2801
            label: 'Paste'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2802
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2803
            labelImage: (ResourceRetriever ImageEditor pasteIcon 'Paste')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2804
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2805
            choiceValue: paste
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2806
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2807
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2808
            activeHelpKey: drawModePasteUnder
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2809
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2810
            label: 'Paste Under'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2811
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2812
            labelImage: (ResourceRetriever ImageEditor pasteUnderIcon 'Paste Under')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2813
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2814
            choiceValue: pasteUnder
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2815
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2816
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2817
            activeHelpKey: drawModePasteWithMask
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2818
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2819
            label: 'Paste with Mask'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2820
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2821
            labelImage: (ResourceRetriever ImageEditor pasteWithMaskIcon 'Paste with Mask')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2822
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2823
            choiceValue: pasteWithMask
1579
08a760ad7900 added paste with mask
Claus Gittinger <cg@exept.de>
parents: 1570
diff changeset
  2824
          )
2592
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2825
         (MenuItem
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2826
            activeHelpKey: drawModeSpecial
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2827
            enabled: imageIsLoaded
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2828
            label: 'Special'
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2829
            translateLabel: true
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2830
            labelImage: (ResourceRetriever ImageEditor specialIcon 'Special')
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2831
            choice: editMode
9f52f9ca9b93 changed:
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
  2832
            choiceValue: specialOperation
1411
9daf7add7ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1406
diff changeset
  2833
          )
1196
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2834
         )
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2835
        nil
e2ced3798ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1146
diff changeset
  2836
        nil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2837
      )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2838
!
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2839
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2840
previewMenu
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2841
    "This resource specification was automatically generated
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2842
     by the MenuEditor of ST/X."
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2843
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2844
    "Do not manually edit this!! If it is corrupted,
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2845
     the MenuEditor may not be able to read the specification."
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2846
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2847
    "
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2848
     MenuEditor new openOnClass:ImageEditor andSelector:#previewMenu
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2849
     (Menu new fromLiteralArrayEncoding:(ImageEditor previewMenu)) startUp
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2850
    "
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2851
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2852
    <resource: #menu>
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2853
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2854
    ^ 
1764
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2855
     #(Menu
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2856
        (
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2857
         (MenuItem
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2858
            label: 'TileMode'
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2859
            translateLabel: true
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2860
            indication: tileModeHolder
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2861
          )
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2862
         (MenuItem
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2863
            label: '-'
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2864
          )
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2865
         (MenuItem
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2866
            label: 'Background Color'
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2867
            translateLabel: true
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2868
            submenu: 
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2869
           (Menu
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2870
              (
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2871
               (MenuItem
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2872
                  label: 'Gray'
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2873
                  translateLabel: true
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2874
                  choice: previewBackgroundColor
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2875
                  choiceValue: nil
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2876
                )
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2877
               (MenuItem
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2878
                  label: 'Black'
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2879
                  translateLabel: true
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2880
                  choice: previewBackgroundColor
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2881
                  choiceValue: black
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2882
                )
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2883
               (MenuItem
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2884
                  label: 'White'
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2885
                  translateLabel: true
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2886
                  choice: previewBackgroundColor
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2887
                  choiceValue: white
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2888
                )
1774
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2889
               (MenuItem
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2890
                  label: '-'
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2891
                )
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2892
               (MenuItem
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2893
                  label: 'Red'
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2894
                  translateLabel: true
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2895
                  choice: previewBackgroundColor
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2896
                  choiceValue: red
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2897
                )
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2898
               (MenuItem
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2899
                  label: 'Green'
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2900
                  translateLabel: true
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2901
                  choice: previewBackgroundColor
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2902
                  choiceValue: green
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2903
                )
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2904
               (MenuItem
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2905
                  label: 'Blue'
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2906
                  translateLabel: true
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2907
                  choice: previewBackgroundColor
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2908
                  choiceValue: blue
cb9832e71cae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  2909
                )
1764
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2910
               )
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2911
              nil
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2912
              nil
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  2913
            )
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2914
          )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2915
         )
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2916
        nil
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2917
        nil
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  2918
      )
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2919
!
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2920
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2921
toolsMenuToolbar
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2922
    "This resource specification was automatically generated
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2923
     by the MenuEditor of ST/X."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2924
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2925
    "Do not manually edit this!! If it is corrupted,
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2926
     the MenuEditor may not be able to read the specification."
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2927
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2928
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2929
     MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2930
     (Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2931
    "
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2932
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2933
    <resource: #menu>
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2934
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2935
    ^ 
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2936
     #(#Menu
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2937
        #(
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2938
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2939
            #activeHelpKey: #drawModePoint
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2940
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2941
            #label: 'Point'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2942
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2943
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2944
            #labelImage: #(#ResourceRetriever #ImageEditor #pointIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2945
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2946
            #choiceValue: #point
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2947
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2948
         #(#MenuItem
2375
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2949
            #activeHelpKey: #drawModeSpray
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2950
            #enabled: #imageIsLoaded
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2951
            #label: 'Spray'
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2952
            #translateLabel: true
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2953
            #isButton: true
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2954
            #labelImage: #(#ResourceRetriever #ImageEditor #sprayIcon)
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2955
            #choice: #editMode
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2956
            #choiceValue: #spray
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2957
          )
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2958
         #(#MenuItem
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2959
            #activeHelpKey: #drawModeBox
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2960
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2961
            #label: 'Rect'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2962
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2963
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2964
            #labelImage: #(#ResourceRetriever #ImageEditor #rectIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2965
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2966
            #choiceValue: #box
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2967
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2968
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2969
            #activeHelpKey: #drawModeFilledBox
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2970
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2971
            #label: 'FillRect'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2972
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2973
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2974
            #labelImage: #(#ResourceRetriever #ImageEditor #fillRectIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2975
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2976
            #choiceValue: #filledBox
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2977
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2978
         #(#MenuItem
2375
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2979
            #activeHelpKey: #drawModeCircle
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2980
            #enabled: #imageIsLoaded
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2981
            #label: 'Circle'
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2982
            #translateLabel: true
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2983
            #isButton: true
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2984
            #labelImage: #(#ResourceRetriever #ImageEditor #circleIcon)
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2985
            #choice: #editMode
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2986
            #choiceValue: #circle
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2987
          )
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  2988
         #(#MenuItem
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2989
            #activeHelpKey: #drawModeFill
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2990
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2991
            #label: 'Fill'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2992
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2993
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2994
            #labelImage: #(#ResourceRetriever #ImageEditor #fillIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2995
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2996
            #choiceValue: #fill
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2997
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2998
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  2999
            #activeHelpKey: #drawModeCopy
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3000
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3001
            #label: 'Copy'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3002
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3003
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3004
            #labelImage: #(#ResourceRetriever #ImageEditor #copyIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3005
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3006
            #choiceValue: #copy
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3007
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3008
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3009
            #activeHelpKey: #drawModePaste
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3010
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3011
            #label: 'Paste'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3012
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3013
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3014
            #labelImage: #(#ResourceRetriever #ImageEditor #pasteIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3015
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3016
            #choiceValue: #paste
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3017
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3018
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3019
            #activeHelpKey: #drawModePasteUnder
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3020
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3021
            #label: 'Paste Under'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3022
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3023
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3024
            #labelImage: #(#ResourceRetriever #ImageEditor #pasteUnderIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3025
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3026
            #choiceValue: #pasteUnder
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3027
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3028
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3029
            #activeHelpKey: #drawModePasteWithMask
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3030
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3031
            #label: 'Paste With Mask'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3032
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3033
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3034
            #labelImage: #(#ResourceRetriever #ImageEditor #pasteWithMaskIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3035
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3036
            #choiceValue: #pasteWithMask
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3037
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3038
         #(#MenuItem
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3039
            #activeHelpKey: #drawModeSpecial
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3040
            #enabled: #imageIsLoaded
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3041
            #label: 'Special'
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3042
            #translateLabel: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3043
            #isButton: true
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3044
            #labelImage: #(#ResourceRetriever #ImageEditor #specialIcon)
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3045
            #choice: #editMode
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3046
            #choiceValue: #specialOperation
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3047
          )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3048
         )
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3049
        nil
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3050
        nil
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  3051
      )
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3052
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  3053
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3054
!ImageEditor class methodsFor:'tableColumns specs'!
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3055
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3056
colorTableColumns
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3057
    "This resource specification was automatically generated
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3058
     by the DataSetBuilder of ST/X."
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3059
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3060
    "Do not manually edit this!! If it is corrupted,
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3061
     the DataSetBuilder may not be able to read the specification."
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3062
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3063
    "
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3064
     DataSetBuilder new openOnClass:ImageEditor andSelector:#colorTableColumns
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3065
    "
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3066
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3067
    <resource: #tableColumns>
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3068
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3069
    ^#(
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3070
      (DataSetColumnSpec
2174
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  3071
         activeHelpKey: ''
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3072
         labelButtonType: Button
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3073
         rendererType: rowSelector
2712
cddda688a9f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3074
         backgroundSelector: theColorItself:
cddda688a9f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3075
         selectedBackgroundSelector: theColorItself:
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3076
         isResizeable: false
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3077
       )
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3078
      (DataSetColumnSpec
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3079
         label: 'R'
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3080
         labelAlignment: left
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3081
         labelButtonType: Button
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3082
         columnAlignment: right
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3083
         editorType: InputField
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3084
         type: number
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3085
         model: redFromColor:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3086
         writeSelector: redAtColor:put:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3087
         selectSelector: canSelectRedInColor:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3088
       )
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3089
      (DataSetColumnSpec
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3090
         label: 'G'
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3091
         labelAlignment: left
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3092
         labelButtonType: Button
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3093
         columnAlignment: right
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3094
         editorType: InputField
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3095
         type: number
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3096
         model: greenFromColor:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3097
         writeSelector: greenAtColor:put:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3098
         selectSelector: canSelectGreenInColor:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3099
       )
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3100
      (DataSetColumnSpec
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3101
         label: 'B'
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3102
         labelAlignment: left
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3103
         labelButtonType: Button
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3104
         columnAlignment: right
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3105
         editorType: InputField
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3106
         type: number
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3107
         model: blueFromColor:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3108
         writeSelector: blueAtColor:put:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3109
         selectSelector: canSelectBlueInColor:
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3110
       )
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3111
      )
2174
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  3112
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  3113
    "Modified: / 22-07-2007 / 13:21:57 / cg"
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3114
! !
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3115
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3116
!ImageEditor methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
  3117
228524287573 intitial checkin
tz
parents:
diff changeset
  3118
image
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3119
    "returns the current editing image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3120
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3121
    ^ imageEditView image
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3122
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3123
228524287573 intitial checkin
tz
parents:
diff changeset
  3124
postOpenAction: anAction
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3125
   "sets an action which is evaluated after opening"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3126
228524287573 intitial checkin
tz
parents:
diff changeset
  3127
    postOpenAction := anAction
1381
30fedb56e7db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3128
!
30fedb56e7db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3129
30fedb56e7db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3130
resourceClass:aClass
30fedb56e7db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3131
    imageEditView resourceClass:aClass
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3132
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  3133
1398
284781677ae1 category changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
  3134
!ImageEditor methodsFor:'accessing-views'!
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3135
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3136
colorDataSetView
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3137
    "returns the view of the colormap"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3138
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
  3139
    ^(self componentAt: #colorDataSetView)
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3140
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3141
    "Created: / 26.7.1998 / 12:02:14 / cg"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3142
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3143
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  3144
coordLabel
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3145
    "returns the view the coord label"
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  3146
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
  3147
    ^self componentAt: #coordLabel
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  3148
!
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  3149
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3150
imageEditView
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  3151
    "returns the view of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3152
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3153
    imageEditView isNil ifTrue:[
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
  3154
        imageEditView := (self componentAt: #imageEditView) scrolledView.
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3155
        imageEditView addDependent:self.
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3156
    ].
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3157
    ^ imageEditView
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3158
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3159
    "Modified: / 10.2.2000 / 23:19:20 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3160
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3161
228524287573 intitial checkin
tz
parents:
diff changeset
  3162
imagePreView
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3163
    "returns the preview of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3164
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3165
    |imagePreViewSubViews|
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3166
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3167
    imagePreViewSubViews := (self componentAt: #imagePreView) subViews.
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3168
2043
a816ef2ce516 #imagePreView
sr
parents: 2042
diff changeset
  3169
    "subViews is an empty array at closing image Editor"
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3170
    imagePreViewSubViews isEmptyOrNil ifTrue:[
2043
a816ef2ce516 #imagePreView
sr
parents: 2042
diff changeset
  3171
        ^ nil
a816ef2ce516 #imagePreView
sr
parents: 2042
diff changeset
  3172
    ].
a816ef2ce516 #imagePreView
sr
parents: 2042
diff changeset
  3173
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3174
    ^ imagePreViewSubViews first 
475
0d5a50fe59f4 default value of info label set
tz
parents: 468
diff changeset
  3175
! !
0d5a50fe59f4 default value of info label set
tz
parents: 468
diff changeset
  3176
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3177
!ImageEditor methodsFor:'aspects'!
228524287573 intitial checkin
tz
parents:
diff changeset
  3178
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3179
activityInfoHolder
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3180
    ^ self infoLabelHolder
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3181
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3182
    "Modified: / 29.7.1998 / 18:49:03 / cg"
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3183
!
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3184
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3185
colorColumnAdaptor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3186
    ^ self
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3187
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3188
    "Created: / 26.7.1998 / 12:17:03 / cg"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3189
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3190
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3191
hasClassAndSelectorDefined
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3192
    ^ [
1965
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3193
        |cls|
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3194
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3195
        (cls := imageEditView resourceClass) notNil
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3196
        and:[imageEditView resourceSelector notNil]
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3197
      ]
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3198
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3199
    "Created: / 31.7.1998 / 02:02:54 / cg"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3200
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3201
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3202
hasClassDefined
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3203
    ^ [
1965
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3204
        imageEditView resourceClass notNil
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3205
      ]
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3206
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3207
    "Created: / 31.7.1998 / 02:02:22 / cg"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3208
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3209
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3210
hasColorSelected
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3211
    ^ self selectedColorIndexOrNil notNil
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3212
!
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3213
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  3214
hasColormap
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  3215
    ^ [self image notNil and:[self image colorMap notNil]]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  3216
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  3217
    "Created: / 30.9.1998 / 23:53:55 / cg"
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  3218
!
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  3219
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3220
hasColormapAndColorSelected
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3221
    ^ self hasColormap and:[self hasColorSelected]
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3222
!
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  3223
1924
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  3224
hasNoColormap
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  3225
    ^ [self image notNil and:[self image colorMap isNil]]
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  3226
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  3227
    "Created: / 30.9.1998 / 23:53:55 / cg"
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  3228
!
73271e3c217f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
  3229
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3230
imageHasNextImage
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3231
    "returns whether an image is loaded as value holder"
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3232
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3233
    ^ [self image notNil
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3234
       and:[self image imageSequence notNil]]
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3235
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3236
    "Created: / 31.7.1998 / 02:04:18 / cg"
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3237
!
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  3238
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3239
imageInfoHolder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3240
    |holder|
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3241
    (holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3242
        builder aspectAt:#imageInfoHolder put:(holder :=  '' asValue).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3243
    ].
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3244
    ^ holder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3245
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3246
    "Modified: / 29.7.1998 / 18:32:08 / cg"
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3247
!
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  3248
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3249
imageIsLoaded
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3250
    "returns whether an image is loaded as value holder"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3251
228524287573 intitial checkin
tz
parents:
diff changeset
  3252
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  3253
    (holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  3254
        builder aspectAt:#imageIsLoaded put:(holder :=  false asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  3255
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  3256
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  3257
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3258
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3259
imageIsLoadedAndClassDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3260
    "returns whether an image is loaded as value holder"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3261
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3262
    ^ [self hasClassAndSelectorDefined value
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3263
       and:[self imageIsLoaded value]]
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3264
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3265
    "Created: / 31.7.1998 / 02:04:18 / cg"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3266
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  3267
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3268
listOfColors
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3269
    "returns the list of colors"
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3270
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3271
    |list|
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3272
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3273
    (list := builder bindingAt:#listOfColors) isNil ifTrue:[
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3274
        builder aspectAt:#listOfColors put:(list :=  List new).
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3275
        list addDependent:self.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3276
    ].
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3277
    ^ list
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3278
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3279
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3280
magnificationHolder
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3281
    "returns current magnification of the image as an AspectAdaptor"
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3282
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3283
    |holder|
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3284
    (holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3285
        builder aspectAt:#valueOfMagnification put:(
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3286
        holder := AspectAdaptor new subject:self; forAspect:#magnification)
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3287
    ].
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3288
    ^ holder
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3289
!
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3290
1764
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3291
previewBackgroundColor
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3292
    |holder|
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3293
    (holder := builder bindingAt:#previewBackgroundColor) isNil ifTrue:[
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3294
        builder aspectAt:#previewBackgroundColor put:(holder := nil asValue).
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3295
        holder addDependent:self.
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3296
    ].
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3297
    ^ holder
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3298
!
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3299
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3300
selectionOfColor
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  3301
    "returns a valueHolder for the current selection of the edit color.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  3302
     Here, an AspectAdaptor which accesses selectedColorIndex is returned."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3303
228524287573 intitial checkin
tz
parents:
diff changeset
  3304
    |holder|
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  3305
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3306
    (holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  3307
        builder aspectAt:#selectionOfColor put:(
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  3308
        holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex ).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3309
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  3310
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  3311
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3312
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3313
tileModeHolder
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3314
    |holder|
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3315
    (holder := builder bindingAt:#tileModeHolder) isNil ifTrue:[
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3316
        builder aspectAt:#tileModeHolder put:(holder := false asValue).
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3317
        holder addDependent:self.
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3318
    ].
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3319
    ^ holder
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3320
!
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3321
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3322
valueOfMagnification
2308
60722577a10a Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 2272
diff changeset
  3323
    <resource: #obsolete>
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3324
    "returns current magnification of the image as an AspectAdaptor"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3325
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3326
    self obsoleteMethodWarning:'stupid method name - use #magnificationHolder'.
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3327
    ^ self magnificationHolder
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3328
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  3329
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3330
!ImageEditor methodsFor:'change & update'!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3331
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3332
findColorMapMode
899
43b744c647ba comment grammar
tz
parents: 898
diff changeset
  3333
    "finds the colorMapMode for a new image"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3334
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3335
    |image newListOfColors colorMapModeKey drawColor1 drawColor2 someOrAllUsedColors|
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3336
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3337
    image := self image.
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3338
    image isNil ifTrue:[^ self ].
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3339
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3340
    image mask notNil ifTrue: [             
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3341
        colorMapModeKey := 'masked'.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3342
    ] ifFalse:[
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3343
        colorMapModeKey := 'depth'.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3344
    ].
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3345
    colorMapModeKey := colorMapModeKey , image depth printString.
1967
c95484b7da49 some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  3346
    self colorMapMode setValue:colorMapModeKey.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3347
1928
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3348
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3349
    image depth > 12 ifTrue:[
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3350
        newListOfColors := OrderedCollection new.
1904
46a0b109cb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3351
        image colorMap isEmptyOrNil ifTrue:[
1927
c5068006116d colors of deep images
Claus Gittinger <cg@exept.de>
parents: 1926
diff changeset
  3352
            someOrAllUsedColors := image usedColorsMax:10000.
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3353
            someOrAllUsedColors notNil ifTrue:[
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3354
                someOrAllUsedColors := someOrAllUsedColors asArray.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3355
                someOrAllUsedColors sort:self sortBlockForColors.
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3356
                newListOfColors addAll:someOrAllUsedColors.
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3357
                "/ listOfColors add:Color black; add:Color white.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3358
            ]
1904
46a0b109cb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3359
        ] ifFalse:[
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3360
            newListOfColors addAll:(image colorMap).
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3361
        ].
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3362
    ] ifFalse:[
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3363
        newListOfColors := OrderedCollection withAll:(self listOfColors).
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3364
        newListOfColors isEmpty ifTrue:[   
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3365
            self colorMapMode: colorMapMode value.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3366
            image := self image.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3367
        ].                               
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3368
    ].  
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3369
    newListOfColors notEmptyOrNil ifTrue:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3370
        drawColor1 := newListOfColors at:1.
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3371
        drawColor2 := newListOfColors at:2 ifAbsent:drawColor1.
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3372
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3373
        self hasMask ifTrue: [             
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3374
            (newListOfColors contains: [:clr| clr = (Color colorId:0)]) 
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3375
            ifFalse:[
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3376
                newListOfColors addFirst:(Color colorId:0).
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3377
                drawColor1 := newListOfColors at:2. 
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3378
                drawColor2 := newListOfColors at:3 ifAbsent:drawColor1.
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3379
            ]
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3380
        ].
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3381
"/        imageEditView drawingColors:(Array with: drawColor1 with: drawColor2).
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3382
"/        self selectionOfColor 
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3383
"/            setValue: 0;
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3384
"/            value: (listOfColors indexOf: imageEditView selectedColor).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3385
    ].
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3386
    self listOfColors asOrderedCollection ~= newListOfColors ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3387
        self listOfColors contents:newListOfColors.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3388
    ].
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  3389
    "Modified: / 07-07-2006 / 12:27:43 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3390
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3391
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3392
update:something with:aParameter from:changedObject
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3393
    |clrIndex img imagePreView clr changedColor|
1436
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  3394
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  3395
    img := self image.
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3396
    imagePreView := self imagePreView.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3397
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3398
    changedObject == self tileModeHolder ifTrue:[
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3399
        imagePreView 
1764
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3400
            tileMode:(changedObject value) tileOffset:(img extent);
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3401
            clear; 
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3402
            invalidate.
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3403
        ^ self
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3404
    ].
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3405
    changedObject == self previewBackgroundColor ifTrue:[
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3406
        clr := changedObject value isNil 
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3407
                    ifTrue:[imageEditView viewBackground]
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3408
                    ifFalse:[Color perform:changedObject value].
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3409
        imagePreView 
1764
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3410
            viewBackground:clr;
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3411
            clear; 
7e9b804fd2d9 changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3412
            invalidate.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3413
        ^ self
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3414
    ].
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3415
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3416
    changedObject == self listOfColors ifTrue:[
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3417
        something == #at: ifTrue:[
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3418
            "/ colormap entry changed at aParameter
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3419
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3420
            clrIndex := aParameter.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3421
            (self hasMask) ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3422
                clrIndex := clrIndex - 1.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3423
            ].
1928
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3424
            changedColor := changedObject at:aParameter.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3425
            img colorMap notNil ifTrue:[
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3426
                img colorMap at:clrIndex put:changedColor.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3427
                self colorMapChanged.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3428
            ] ifFalse:[
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3429
                drawingColormap notNil ifTrue:[
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3430
                    drawingColormap at:clrIndex put:changedColor.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3431
                ].
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3432
            ].
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3433
            ^ self
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3434
        ].
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  3435
        ^ self
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3436
    ].
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  3437
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  3438
    changedObject == imageEditView undoImages ifTrue:[
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  3439
        self canUndoHolder value:(changedObject notEmpty).
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  3440
        ^ self.
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  3441
    ].
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  3442
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3443
    changedObject == imageEditView ifTrue:[
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3444
        something == #imageColors ifTrue:[
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3445
            self updateListOfColorsAndColormapMode.
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3446
            ^ self.
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3447
        ].
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3448
        something == #image ifTrue:[
2728
7b0f0d920794 changed:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  3449
            imagePreView image:img scroll:false.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3450
            self updateListOfColorsAndColormapMode.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3451
            self tileModeHolder value ifTrue:[
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3452
                imagePreView tileMode:true tileOffset:(img extent).
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3453
            ].
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3454
            ^ self.
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3455
        ].
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3456
        something == #subImageIn ifTrue:[
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3457
            imagePreView image ~~ img ifTrue:[
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  3458
                self error:'internal error' mayProceed:true.
1406
6de5c78f5bcd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1405
diff changeset
  3459
            ].
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3460
            self tileModeHolder value ifTrue:[
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3461
                imagePreView invalidate.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3462
            ] ifFalse:[
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3463
                imagePreView invalidate:aParameter.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3464
            ].
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3465
            ^ self.
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3466
        ].
1491
4249a6a1b252 pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  3467
        something == #selectedColor ifTrue:[
1842
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3468
            (aParameter isNil or:[aParameter = (Color colorId:0)]) ifTrue:[
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3469
                "/ no color/mask */
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3470
                "/ self halt.
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3471
                clrIndex := self hasMask ifTrue:[1] ifFalse:[0].
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3472
            ] ifFalse:[
f04fe34d10ac do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents: 1820
diff changeset
  3473
                clrIndex := self listOfColors indexOf:aParameter.
1491
4249a6a1b252 pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  3474
            ].
4249a6a1b252 pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  3475
            self selectionOfColor value:clrIndex.
4249a6a1b252 pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  3476
            ^ self.
4249a6a1b252 pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents: 1490
diff changeset
  3477
        ].
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3478
        ^ self.
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3479
    ].
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3480
1880
8a11bb0a86e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3481
    changedObject == imageEditView modifiedHolder ifTrue:[
8a11bb0a86e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3482
        "/ self halt:'to be implemented'.
8a11bb0a86e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3483
        ^ self
8a11bb0a86e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3484
    ].
8a11bb0a86e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  3485
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3486
    changedObject == imageEditView image ifTrue:[
2042
963042f2c474 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3487
        "/ self halt:'to be implemented'.
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3488
        ^ self.
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3489
    ].
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3490
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3491
    super update:something with:aParameter from:changedObject
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3492
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3493
    "Modified: / 10.2.2000 / 23:36:49 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3494
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3495
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3496
updateColorsFromImage:image
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3497
    |colors|
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3498
1904
46a0b109cb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3499
    colors := image colorMap.
46a0b109cb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3500
    colors isNil ifTrue:[
1906
2d7a21c00135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
  3501
        Error handle:[:ex |
2d7a21c00135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
  3502
            colors := OrderedCollection new.
2d7a21c00135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
  3503
        ] do:[
2d7a21c00135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
  3504
            colors := image usedColors asSet.
2d7a21c00135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1905
diff changeset
  3505
        ]
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3506
    ].
1904
46a0b109cb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3507
    self listOfColors contents:(colors asOrderedCollection).
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3508
!
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3509
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3510
updateForNoImage
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3511
    "updates channels and view, if image is loaded"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3512
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3513
    self imageIsLoaded value: false.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3514
    self listOfColors removeAll.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3515
    self imagePreView image: nil
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3516
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3517
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3518
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3519
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3520
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3521
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3522
updateLabelsAndHistory
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3523
    "updates labels and history, if something has changed"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3524
1910
4ca9f4b322c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
  3525
    |image|
4ca9f4b322c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
  3526
4ca9f4b322c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
  3527
    image := self image.
4ca9f4b322c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
  3528
4ca9f4b322c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
  3529
    self imageIsLoaded value: image notNil.
4ca9f4b322c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1906
diff changeset
  3530
    image isNil ifTrue: [^nil].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3531
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3532
    self updateInfoLabel.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3533
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3534
    imageEditView resourceClass notNil ifTrue:[
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3535
        imageEditView resourceSelector notNil ifTrue:[
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3536
            self addHistoryEntryForClass:imageEditView resourceClass selector:imageEditView resourceSelector.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3537
        ]
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3538
    ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3539
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3540
    image fileName notNil ifTrue: [
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3541
        self addHistoryEntryForFile:image fileName.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3542
    ].
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3543
!
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3544
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3545
updateListOfColorsAndColormapMode
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3546
    |selectedColor colorMap image|
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3547
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3548
    selectedColor := self selectedColorOrNil.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3549
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3550
    image := self image.
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3551
    image isNil ifTrue:[
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3552
        self listOfColors removeAll.
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3553
    ] ifFalse:[
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3554
        colorMap := image colorMap.
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3555
        colorMap notNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3556
            (colorMap size <= 4096) ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3557
                image mask notNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3558
                    colorMap := (Array with:(Color noColor)),colorMap.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3559
                ].
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3560
                self listOfColors contents:colorMap.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3561
            ] ifFalse:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3562
                self listOfColors removeAll.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3563
                colorMap isFixedPalette ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3564
                    image colorMap:nil.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3565
                    image photometric:#rgb.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3566
                    image samplesPerPixel:3.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3567
                    
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3568
                    image bitsPerSample:(Array 
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3569
                                            with:(colorMap bitsRed)
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3570
                                            with:(colorMap bitsGreen)
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3571
                                            with:(colorMap bitsBlue)).
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3572
                ].
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  3573
            ]
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3574
        ].
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3575
    ].
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3576
    self findColorMapMode.
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3577
    selectedColor notNil ifTrue:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3578
        self selectColor:selectedColor.
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  3579
    ].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3580
! !
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3581
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3582
!ImageEditor methodsFor:'data access'!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3583
1951
9ad40a628278 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1949
diff changeset
  3584
atColor:anOldColor put:newColor
1952
73a141744891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3585
    "a color changed to a new color"
73a141744891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3586
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  3587
    |index list oldColor image newImage oldSel|
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3588
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3589
    list  := self listOfColors.
1951
9ad40a628278 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1949
diff changeset
  3590
    index := list identityIndexOf:anOldColor.
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3591
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  3592
    oldSel := self selectionOfColor value.
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3593
    index ~~ 0 ifTrue:[
1928
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3594
        oldColor := list at:index.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3595
        list at:index put:newColor
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3596
    ] ifFalse:[
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  3597
        self error:'internal error' mayProceed:true.
1928
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3598
        list add:newColor
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3599
    ].
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3600
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3601
    image := self image.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3602
    (image colorMap isNil 
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3603
    and:[drawingColormap isNil]) ifTrue:[
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3604
        oldColor notNil ifTrue:[
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3605
            imageEditView makeUndo.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3606
            newImage := image copy.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3607
            newImage
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3608
                colorsFromX:0 y:0 toX:(image width-1) y:(image height-1) 
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3609
                do:[:x :y :clr |
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3610
                    |newClr|
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3611
1951
9ad40a628278 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1949
diff changeset
  3612
                    newClr := (clr = oldColor) ifTrue:[newColor] ifFalse:[clr].
1928
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3613
                    newImage colorAtX:x y:y put:newClr
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3614
                ].
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3615
            imageEditView image:newImage.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3616
            imageEditView setModified.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3617
            self updateImage.
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3618
            self updateImagePreView.
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  3619
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  3620
            self selectionOfColor value:oldSel.
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  3621
            imageEditView selectedColorIndex:oldSel.
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  3622
            imageEditView selectedColor:(self listOfColors at:oldSel).
1928
06c3681a79b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3623
        ]
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3624
    ].
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3625
!
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3626
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3627
blueAtColor:aColor put:newBlue
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3628
    "helper used to return a new row element, when blue is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3629
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3630
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3631
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3632
    aColor isNil ifTrue:[^ self].       "/ mask cannot be changed
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3633
    byte := newBlue clampBetween:0 and:255.
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3634
    byte = aColor blueByte ifTrue:[^ self ].
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3635
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3636
    self atColor:aColor
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3637
             put:(Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte).
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3638
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3639
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3640
blueFromColor:aColor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3641
    "helper used to access a color as a row in the dataSet view"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3642
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3643
    aColor isNil ifTrue:[^ 'none'].
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3644
    ^ aColor blueByte ? 'mask'
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3645
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3646
    "Created: / 26.7.1998 / 12:30:35 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3647
    "Modified: / 31.7.1998 / 01:11:18 / cg"
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3648
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3649
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3650
canSelectBlueInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3651
    ^ aColor blueByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3652
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3653
    "Created: / 7.8.1998 / 22:50:34 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3654
    "Modified: / 7.8.1998 / 22:52:57 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3655
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3656
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3657
canSelectGreenInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3658
    ^ aColor greenByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3659
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3660
    "Created: / 7.8.1998 / 22:50:22 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3661
    "Modified: / 7.8.1998 / 22:52:46 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3662
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3663
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3664
canSelectRedInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3665
    ^ aColor redByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3666
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3667
    "Created: / 7.8.1998 / 22:50:00 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3668
    "Modified: / 7.8.1998 / 22:51:03 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3669
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  3670
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3671
greenAtColor:aColor put:newGreen
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3672
    "helper used to return a new row element, when green is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3673
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3674
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3675
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3676
    aColor isNil ifTrue:[^ self].       "/ mask cannot be changed
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3677
    byte := newGreen clampBetween:0 and:255.
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3678
    byte = aColor greenByte ifTrue:[^ self].
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3679
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3680
    self atColor:aColor
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3681
             put:(Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)).
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3682
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3683
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3684
greenFromColor:aColor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3685
    "helper used to access a color as a row in the dataSet view"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3686
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3687
    aColor isNil ifTrue:[^ 'none'].
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3688
    ^ aColor greenByte ? 'mask'
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3689
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3690
    "Created: / 26.7.1998 / 12:30:29 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3691
    "Modified: / 31.7.1998 / 01:11:31 / cg"
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3692
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3693
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3694
redAtColor:aColor put:newRed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3695
    "helper used to return a new row element, when red is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3696
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3697
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3698
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3699
    aColor isNil ifTrue:[^ self].       "/ mask cannot be changed
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3700
    byte := newRed clampBetween:0 and:255.
1611
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3701
    byte = aColor redByte ifTrue:[^ self].
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3702
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3703
    self atColor:aColor
2f23751929d6 behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents: 1603
diff changeset
  3704
             put:(Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)).
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3705
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  3706
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3707
redFromColor:aColor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3708
    "helper used to access a color as a row in the dataSet view"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3709
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3710
    aColor isNil ifTrue:[^ 'none'].
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3711
    ^ aColor redByte ? 'mask'
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3712
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3713
    "Modified: / 31.7.1998 / 01:11:35 / cg"
1449
49ad9f552d64 oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents: 1446
diff changeset
  3714
!
49ad9f552d64 oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents: 1446
diff changeset
  3715
2712
cddda688a9f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3716
theColorItself:aColor
cddda688a9f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3717
    "an accessor for the table-column"
cddda688a9f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  3718
1449
49ad9f552d64 oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents: 1446
diff changeset
  3719
    ^ aColor
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3720
! !
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  3721
2663
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3722
!ImageEditor methodsFor:'defaults'!
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3723
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3724
aboutIcon
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3725
    ^ self class defaultIcon
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3726
! !
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  3727
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3728
!ImageEditor methodsFor:'drag & drop'!
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3729
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3730
canDropObjects:aCollectionOfDropObjects in:aWidget
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3731
    ^ (aCollectionOfDropObjects size == 1) 
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3732
      and:[ aCollectionOfDropObjects 
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3733
                contains:[:dropObject | dropObject isFileObject]]
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3734
!
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3735
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3736
dropObjects:aCollectionOfDropObjects in:aWidget at:position
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3737
    |dropObject|
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3738
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3739
    dropObject := aCollectionOfDropObjects first.
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3740
    dropObject isFileObject ifTrue:[
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3741
        self loadFromFile:dropObject asFilename.
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3742
    ]
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3743
! !
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3744
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3745
!ImageEditor methodsFor:'event handling'!
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3746
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3747
processEvent:anEvent
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3748
    "Return true, if I have eaten the event"
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3749
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3750
    |p|
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3751
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3752
    anEvent view == self imagePreView ifTrue:[
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3753
        ((anEvent isButtonPressEvent and:[ anEvent button == 1 ])
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3754
        or:[ anEvent isButtonMotionEvent and:[ anEvent hasButton1 ]])  ifTrue:[
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3755
            p := anEvent x @ anEvent y.
2546
b69247f503b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2539
diff changeset
  3756
            anEvent view transformation notNil ifTrue:[
b69247f503b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2539
diff changeset
  3757
                p := anEvent view transformation applyInverseTo:p.
b69247f503b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2539
diff changeset
  3758
            ].
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3759
            self imageEditView scrollToMakeVisible:p.    
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3760
            ^ true.
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3761
        ].
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3762
    ].
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3763
    ^ false.
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3764
! !
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3765
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3766
!ImageEditor methodsFor:'help'!
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3767
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3768
defaultInfoLabel
1969
f1763f6f4500 stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents: 1967
diff changeset
  3769
    "returns the text shown in the info label, when the mouse is NOT over
f1763f6f4500 stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents: 1967
diff changeset
  3770
     some widget with a help text."
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3771
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3772
    |resourceClass resourceSelector|
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3773
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3774
    resourceClass := imageEditView resourceClass.
1965
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  3775
    resourceClass notNil ifTrue:[
1969
f1763f6f4500 stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents: 1967
diff changeset
  3776
        resourceSelector := imageEditView resourceSelector.
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3777
        resourceSelector notNil ifTrue:[
1969
f1763f6f4500 stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents: 1967
diff changeset
  3778
            ^ resourceClass name, ' >> ', resourceSelector
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3779
        ].
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3780
    ].
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3781
    ^ 'No class and selector defined.'
674
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  3782
!
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  3783
702
c9de7a9bc416 docu call changed
tz
parents: 694
diff changeset
  3784
openDocumentation
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3785
    "opens the documentation file of the Image Editor"
674
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  3786
763
19b3e479e0b8 docu call
tz
parents: 756
diff changeset
  3787
    self openHTMLDocument: 'tools/uipainter/ImageEditor.html'
19b3e479e0b8 docu call
tz
parents: 756
diff changeset
  3788
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3789
! !
738210a2fa06 revised version
tz
parents: 651
diff changeset
  3790
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3791
!ImageEditor methodsFor:'loading'!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3792
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3793
loadFromClass:aClass andSelector:aSelector
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3794
    "loads an image from the method specified by class and selector"
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3795
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3796
    self assert:(aClass isNil or:[aClass isClass]).
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3797
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3798
    (aClass isNil or:[aSelector]) isNil ifTrue:[
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3799
        imageEditView resourceClass:aClass.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3800
        imageEditView resourceSelector:aSelector.
1969
f1763f6f4500 stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents: 1967
diff changeset
  3801
        imageEditView image:nil.
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3802
        self clearModified.
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3803
        ^ self.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3804
    ].
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3805
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3806
"/    (imageEditView resourceClass == aClass
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3807
"/    and:[ imageEditView resourceSelector == aSelector ]) ifTrue:[
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3808
"/        imageEditView modified ifFalse:[
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3809
"/            ^ self.
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3810
"/        ].
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3811
"/    ].
1969
f1763f6f4500 stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents: 1967
diff changeset
  3812
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3813
    (imageEditView loadFromClass:aClass andSelector:aSelector) notNil ifTrue:[
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3814
        self updateAfterImageChange.
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  3815
        self clearModified.
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3816
    ]
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3817
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3818
    "Modified: / 16.3.1999 / 21:44:41 / cg"
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3819
!
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3820
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  3821
loadFromFile:aFileName
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3822
    "loads an image from aFileName and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3823
980
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  3824
    self withCursor:Cursor wait do:[
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  3825
        (imageEditView loadFromFile: aFileName) notNil ifTrue:[
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3826
            self updateAfterImageChange
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3827
        ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3828
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3829
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  3830
    "Modified: / 16.3.1999 / 21:44:26 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3831
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3832
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3833
loadFromImage:anImage
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3834
    "loads an image from anImage and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3835
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3836
    |img|
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3837
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  3838
    anImage notNil ifTrue:[    
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3839
        img := anImage onDevice:device.
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3840
    ].
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3841
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3842
    imageEditView image:img.
1799
e605f0af928a clear modified flag when an image is loaded
Claus Gittinger <cg@exept.de>
parents: 1796
diff changeset
  3843
    imageEditView clearModified.
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3844
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3845
    self updateAfterImageChange.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3846
"/    img notNil ifTrue:[    
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3847
"/        self updateColorsFromImage:img.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3848
"/        self findColorMapMode.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3849
"/        self updateLabelsAndHistory.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3850
"/    ] ifFalse:[
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3851
"/        self updateForNoImage
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3852
"/    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3853
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  3854
    "Modified: / 16.3.1999 / 21:43:56 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3855
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3856
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3857
loadFromOrPrepareForClass: aClass andSelector: aSelector
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3858
    "loads an image by evaluating aMessage;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3859
     if no image could extract from aMessage; do set the class and the selector from 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3860
     the aMessage for a saving at the end of editing"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3861
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3862
    (imageEditView loadFromClass:aClass andSelector:aSelector) notNil ifTrue: [
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  3863
        self updateColorsFromImage:self image.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3864
        self findColorMapMode.
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3865
    ] ifFalse: [
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3866
        imageEditView resourceClass: aClass.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3867
        imageEditView resourceSelector:aSelector.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3868
    ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3869
    self updateLabelsAndHistory.
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  3870
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  3871
    "Modified: / 16.3.1999 / 21:45:07 / cg"
1966
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3872
!
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3873
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3874
updateAfterImageChange
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3875
    |img|
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3876
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3877
    (img := self image) notNil ifTrue:[
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3878
        img := img onDevice:device.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3879
        self updateColorsFromImage:img.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3880
        self findColorMapMode.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3881
        self updateLabelsAndHistory.
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3882
    ] ifFalse:[
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3883
        self updateForNoImage
274324851cfd some code cleanup
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3884
    ]
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3885
! !
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  3886
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3887
!ImageEditor methodsFor:'menu modes'!
228524287573 intitial checkin
tz
parents:
diff changeset
  3888
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3889
colorMapMode
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3890
    "returns the colorMapMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3891
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3892
    colorMapMode isNil ifTrue: [colorMapMode := '' asValue].
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3893
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3894
    ^colorMapMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3895
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3896
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3897
editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3898
    "returns editMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3899
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  3900
    editMode isNil ifTrue: [
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3901
        editMode := #point asValue.
1329
a38c2e29d1fb use onChangeEvaluate:
Claus Gittinger <cg@exept.de>
parents: 1309
diff changeset
  3902
        editMode onChangeEvaluate:[imageEditView editMode:(editMode value)]
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3903
    ].
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3904
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3905
    ^editMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3906
!
228524287573 intitial checkin
tz
parents:
diff changeset
  3907
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3908
mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3909
    "returns mouseKeyColorMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3910
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3911
    mouseKeyColorMode isNil ifTrue:[
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3912
        mouseKeyColorMode := 1 asValue.
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3913
        mouseKeyColorMode onChangeEvaluate: [
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3914
            imageEditView mouseKeyColorMode:mouseKeyColorMode value. 
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3915
            self selectionOfColor value: (self listOfColors indexOf:imageEditView selectedColor).
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3916
        ]
956
dc4df8952e82 check whether imageEditView is nil
ca
parents: 951
diff changeset
  3917
    ].
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3918
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  3919
    ^mouseKeyColorMode
1345
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3920
218b7fcff239 de-uglified
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3921
    "Modified: / 10.2.2000 / 23:16:42 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  3922
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  3923
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3924
!ImageEditor methodsFor:'private'!
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3925
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3926
checkModified
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3927
    imageEditView modified value ifTrue:[
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3928
        (Dialog
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3929
            confirm:(resources string:'Image was not saved. Proceed anyway ?')
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3930
            yesLabel:(resources string:'Proceed')
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3931
            noLabel:(resources string:'Cancel')
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3932
            initialAnswer:false
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3933
        ) ifFalse: [^false].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3934
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3935
        imageEditView clearModified.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3936
    ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3937
    ^ true
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3938
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3939
    "Modified: / 29.7.1998 / 18:55:24 / cg"
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3940
!
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  3941
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3942
pointFromString:aString
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3943
    |p s x y|
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3944
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3945
    p := Object readFromString:aString onError:nil.
1962
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  3946
    p isPoint ifTrue:[^ p].
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3947
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3948
    s := aString readStream.
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3949
    x := Number readFrom:s onError:nil.
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3950
    x notNil ifTrue:[
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3951
        s skipSeparators.
1962
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  3952
        [s atEnd not and:[s peek isDigit not]] whileTrue:[s next].
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3953
        y := Number readFrom:s onError:nil.
1961
d9082e597adb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1960
diff changeset
  3954
        ^ x @ (y ? x)
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3955
    ].
1962
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  3956
    ^ nil
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3957
!
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  3958
1939
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3959
sortBlockForColors
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3960
    ^ [:a :b |
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3961
            a redByte == b redByte ifTrue:[
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3962
                a greenByte == b greenByte ifTrue:[
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3963
                    a blueByte < b blueByte
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3964
                ] ifFalse:[
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3965
                    a greenByte < b greenByte 
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3966
                ]
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3967
            ] ifFalse:[
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3968
                a redByte < b redByte 
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3969
            ]
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3970
      ]
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3971
!
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3972
1598
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3973
updateImage
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3974
    |img|
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3975
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3976
    img := imageEditView image.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3977
    imageEditView image:img.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3978
    self fetchImageData.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3979
!
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  3980
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3981
updateImagePreView
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3982
    self tileModeHolder value ifTrue:[
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3983
        self imagePreView tileMode:true tileOffset:(self image extent).
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  3984
    ].
2546
b69247f503b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2539
diff changeset
  3985
    self imagePreView setImage:(self image) scroll:false invalidate:true.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3986
! !
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  3987
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  3988
!ImageEditor methodsFor:'queries'!
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  3989
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  3990
hasLastGrabScreenArea
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  3991
    ^ [ lastGrabbedScreenArea notNil ]
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  3992
!
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  3993
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3994
hasMask
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3995
    ^ colorMapMode value notNil and:[colorMapMode value startsWith:'mask']
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3996
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3997
    "Created: / 18.8.1998 / 17:17:38 / cg"
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3998
!
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  3999
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4000
modified
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4001
    ^ imageEditView modified
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4002
!
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4003
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  4004
modified:aBoolean
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  4005
    super modified:aBoolean.
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  4006
    imageEditView modified:aBoolean
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  4007
!
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  4008
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  4009
preferredExtent
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4010
    "returns the preferred extent"
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  4011
2423
0c5ac1daf0e4 changed #preferredExtent - formating
Stefan Vogel <sv@exept.de>
parents: 2420
diff changeset
  4012
    ^ super preferredExtent max: (Screen current width//3)@(Screen current height//3.5)
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  4013
! !
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  4014
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4015
!ImageEditor methodsFor:'selection'!
228524287573 intitial checkin
tz
parents:
diff changeset
  4016
228524287573 intitial checkin
tz
parents:
diff changeset
  4017
magnification
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4018
    "returns the magnification of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4019
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  4020
    self imageEditView isNil ifTrue: [^1].
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  4021
    ^imageEditView magnification x
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4022
!
228524287573 intitial checkin
tz
parents:
diff changeset
  4023
228524287573 intitial checkin
tz
parents:
diff changeset
  4024
magnification: aValue
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4025
    "sets the magnification of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4026
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  4027
    |magnification|        
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  4028
    magnification := (aValue ? 1) asPoint.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  4029
    (magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil].
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  4030
    imageEditView magnification: magnification
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4031
!
228524287573 intitial checkin
tz
parents:
diff changeset
  4032
228524287573 intitial checkin
tz
parents:
diff changeset
  4033
selectedColorIndex
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4034
    "returns the index of the selected color"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4035
228524287573 intitial checkin
tz
parents:
diff changeset
  4036
    ^selectedColorIndex
228524287573 intitial checkin
tz
parents:
diff changeset
  4037
!
228524287573 intitial checkin
tz
parents:
diff changeset
  4038
228524287573 intitial checkin
tz
parents:
diff changeset
  4039
selectedColorIndex: anIndex
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4040
    "sets the index of the selected color"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4041
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4042
    |clr pixel|
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4043
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4044
    selectedColorIndex := anIndex.
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  4045
    anIndex isNil ifTrue:[^ self].
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4046
    clr := self listOfColors at:anIndex ifAbsent:nil.
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4047
    clr isNil ifTrue:[^ self].
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4048
1075
74795d3e647d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1057
diff changeset
  4049
    pixel := anIndex - 1.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4050
    (self listOfColors at:1) = Color noColor ifTrue:[
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4051
        anIndex == 1 ifTrue:[
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4052
            pixel := nil.       "/ mask
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4053
        ] ifFalse:[
1075
74795d3e647d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1057
diff changeset
  4054
            pixel := pixel - 1
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4055
        ]
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4056
    ].
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4057
    imageEditView selectedColorIndex:pixel.
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4058
    imageEditView selectedColor:clr.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4059
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  4060
1716
5ae373f6fef0 method category rename
Claus Gittinger <cg@exept.de>
parents: 1715
diff changeset
  4061
!ImageEditor methodsFor:'startup & release'!
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4062
1640
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4063
closeDownViews
1644
df1f5a97b8e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1643
diff changeset
  4064
    builder notNil ifTrue:[
df1f5a97b8e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1643
diff changeset
  4065
        DefaultRelativeSizes :=
df1f5a97b8e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1643
diff changeset
  4066
            Array 
1998
efd9be2585e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
  4067
                with:(builder componentAt:#mainPanel) relativeCorners    
1644
df1f5a97b8e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1643
diff changeset
  4068
                with:(builder componentAt:#verticalPanel) relativeCorners.
df1f5a97b8e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1643
diff changeset
  4069
    ].
1640
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4070
    super closeDownViews
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4071
!
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4072
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4073
closeRequest
2016
62843f7d07b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  4074
    "asks for permission before closing"
62843f7d07b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  4075
62843f7d07b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  4076
    imageEditView checkModified ifTrue:[
62843f7d07b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  4077
        super closeRequest
62843f7d07b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
  4078
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4079
!
228524287573 intitial checkin
tz
parents:
diff changeset
  4080
1980
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4081
commonPostBuild
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4082
    imageEditView undoImages addDependent:self.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4083
    imageEditView imageInfoHolder:(self imageInfoHolder).
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4084
    imageEditView activityInfoHolder:(self activityInfoHolder).
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4085
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4086
    imageEditView clickInfoCallBack:[:button :point | 
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4087
                        |mouseButtonColorToolBar|
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4088
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4089
                        mouseButtonColorToolBar := self componentAt:#MouseButtonColorToolBar.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4090
                        (mouseButtonColorToolBar itemAt:button) toggleIndication.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4091
                        mouseButtonColorToolBar do: [:i| i updateIndicators].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4092
                  ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4093
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4094
    imageEditView addDependent:self.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4095
    imageEditView modifiedHolder addDependent:self.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  4096
1640
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4097
    DefaultRelativeSizes notNil ifTrue:[
1998
efd9be2585e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
  4098
        (builder componentAt:#mainPanel) relativeCorners:DefaultRelativeSizes first.
1980
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4099
        (builder componentAt:#verticalPanel) relativeCorners:DefaultRelativeSizes second.
1640
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4100
    ].
1995
ad11533a39e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1993
diff changeset
  4101
1996
d18588052ade infoHolder handling
Claus Gittinger <cg@exept.de>
parents: 1995
diff changeset
  4102
    "/ using masters infoHolder ?
d18588052ade infoHolder handling
Claus Gittinger <cg@exept.de>
parents: 1995
diff changeset
  4103
    (builder aspectAt:#useAlienInfoLabelHolder) == true ifTrue:[
1998
efd9be2585e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
  4104
        (builder componentAt:#mainPanel) layout bottomOffset:0.
1995
ad11533a39e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1993
diff changeset
  4105
        (builder componentAt:#infoBarSubSpec) beInvisible
ad11533a39e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1993
diff changeset
  4106
    ]
1640
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4107
!
87ce36f48fbc remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents: 1639
diff changeset
  4108
1980
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4109
open
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4110
    "after opening, sets the masterApplication of the imageEditView to self"
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4111
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4112
    super open.
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4113
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4114
    imageEditView := (self componentAt: #imageEditView) subViews first.
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4115
!
862d4036cebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  4116
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4117
postOpenWith:aBuilder
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4118
    "after opening, sets the masterApplication of the imageEditView to self;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  4119
     evaluate the postOpenAction"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4120
1921
699dca2ebb51 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1916
diff changeset
  4121
    postOpenAction value.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4122
1250
644ed357b524 reset menuBar in keyProcessor
ca
parents: 1196
diff changeset
  4123
    super postOpenWith:aBuilder.
644ed357b524 reset menuBar in keyProcessor
ca
parents: 1196
diff changeset
  4124
644ed357b524 reset menuBar in keyProcessor
ca
parents: 1196
diff changeset
  4125
    aBuilder keyboardProcessor menuBar:nil.
2339
a06d19fe7b32 click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents: 2308
diff changeset
  4126
    self windowGroup addPreEventHook:self.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  4127
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  4128
1715
9eebdb3802aa method category rename
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  4129
!ImageEditor methodsFor:'user actions-colormap'!
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4130
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4131
addColorToColormap
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4132
    self addColorToColormap:(Color black)
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4133
!
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4134
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4135
addColorToColormap:newColor
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4136
    |depth img cMap newColorMap newImage oldCListSize newMode listOfColors|
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4137
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4138
    img := self image.
1499
0c57ab09156b about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
  4139
    img isNil ifTrue:[
0c57ab09156b about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
  4140
        self warn:'No Image.'.
0c57ab09156b about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
  4141
        ^ self
0c57ab09156b about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
  4142
    ].
0c57ab09156b about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents: 1496
diff changeset
  4143
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4144
    depth := img depth.
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4145
    cMap := img colorMap.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4146
    cMap isNil ifTrue:[
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4147
        drawingColormap isNil ifTrue:[
1916
c91c39976bef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
  4148
            self information:(resources stringWithCRs:'Image has no colormap.\The shown colorMap is for drawing only.').
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4149
            drawingColormap := OrderedCollection new.
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4150
        ].
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4151
        drawingColormap add:newColor.
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4152
        self listOfColors contents:drawingColormap.
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4153
        self selectionOfColor value:(drawingColormap size).
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4154
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4155
        "/ self warn:'Image has no colormap.\Change colorMap mode first.' withCRs.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4156
        ^ self
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4157
    ].
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4158
1583
c21cb650b2a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1579
diff changeset
  4159
    ("(depth == 1)" false
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4160
    or:[cMap size == (1 bitShift:depth)]) ifTrue:[
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4161
        depth >= 8 ifTrue:[
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4162
            self warn:'No space for more colors in colormap.'.
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4163
            ^ self
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4164
        ].
1916
c91c39976bef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
  4165
        (self confirm:(resources stringWithCRs:'No space for more colors in colormap.\Change depth ?'))
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4166
        ifFalse:[
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4167
            ^ self
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4168
        ].
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4169
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4170
        imageEditView makeUndo.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4171
        img mask notNil ifTrue:[
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4172
            newMode := 'masked' , (depth*2) printString.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4173
        ] ifFalse:[
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4174
            newMode := 'depth' , (depth*2) printString.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4175
        ].
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4176
        self colorMapMode:newMode.
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4177
    ] ifFalse:[
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4178
        imageEditView makeUndo.
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4179
    ].
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4180
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4181
    cMap := cMap asArray.
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4182
    listOfColors := self listOfColors.
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4183
    oldCListSize := listOfColors size.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4184
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4185
    newColorMap := cMap copyWith:newColor.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4186
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4187
    newImage := img species new
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4188
                    width:img width
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4189
                    height:img height
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4190
                    depth:depth
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4191
                    fromArray:img bits.
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4192
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4193
    newImage colorMap:newColorMap.  
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4194
    newImage fileName:img fileName.
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4195
    newImage mask:(img mask copy).
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4196
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4197
    (imageEditView image:newImage) notNil ifTrue:[
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4198
        listOfColors contents: newImage colorMap.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4199
        self findColorMapMode.
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4200
        "/ mhmh - somehow, we get two colors added ... (sigh findColorMapMode adds another one ...)
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4201
        listOfColors size > (oldCListSize + 1) ifTrue:[
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4202
            listOfColors removeLast
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4203
        ].
1643
91b7ea254a3b some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents: 1640
diff changeset
  4204
        self selectionOfColor value:(listOfColors size).
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4205
        self updateLabelsAndHistory.
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4206
    ]
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4207
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4208
    "Created: / 12.3.1999 / 00:20:28 / cg"
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4209
    "Modified: / 16.3.1999 / 21:57:26 / cg"
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4210
!
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4211
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4212
changeHLS
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4213
    "interactive Hue/Light/Saturation editing"
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4214
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4215
    |bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel 
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4216
     shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4217
     originalPixels p previewImage previewImageHolder originalPreviewColormap originalPreviewPixels
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4218
     anyChange |
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4219
1741
5f515a0c10c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
  4220
    "/ compute the averageColor in the background (while asking user)
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4221
    avgColorHolder := nil asValue.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4222
    previewImageHolder := nil asValue.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4223
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4224
    readySema := Semaphore new.
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4225
    [
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4226
        |image|
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4227
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4228
        image := imageEditView image.
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4229
        originalColormap := image colorMap copy.
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4230
        originalPixels := image bits.
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4231
        avgColor := image averageColor.
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4232
        avgColorHolder value:avgColor.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4233
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4234
        previewImage := self image magnifiedPreservingRatioTo:100@100.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4235
        previewImageHolder value: previewImage.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4236
        originalPreviewColormap := previewImage colorMap copy.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4237
        originalPreviewPixels := previewImage bits.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4238
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4239
        readySema signal.
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4240
    ] forkAt:7.
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4241
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4242
    acceptChannel := TriggerValue new.
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4243
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4244
    firstChange := true.
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4245
    anyChange := false.
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4246
1651
577ddbd9fb26 better hls color display
Claus Gittinger <cg@exept.de>
parents: 1650
diff changeset
  4247
    shiftedColor := [:clr :hShift :lFactor :sFactor |
577ddbd9fb26 better hls color display
Claus Gittinger <cg@exept.de>
parents: 1650
diff changeset
  4248
                        Color 
577ddbd9fb26 better hls color display
Claus Gittinger <cg@exept.de>
parents: 1650
diff changeset
  4249
                                hue:((clr hue) ? 0 + hShift) 
1925
c307194083ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  4250
                                light:((clr light * lFactor / 100) "min:100")
c307194083ec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  4251
                                saturation:((clr saturation * sFactor / 100) "min:100")].
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4252
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4253
    shiftAction := 
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4254
        [
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4255
            |hShift lFactor sFactor|
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4256
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4257
            acceptChannel value:true.
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4258
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4259
            firstChange ifTrue:[
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4260
                imageEditView makeUndo.
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4261
                firstChange := false.
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4262
                anyChange := true.
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4263
            ].
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4264
            readySema notNil ifTrue:[readySema wait. readySema := nil].
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4265
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4266
            hShift := hueShift value.
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4267
            lFactor := lightValue value.
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4268
            sFactor := saturationValue value.
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4269
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4270
            avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor).
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4271
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4272
            previewImage
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4273
                colorMap:originalPreviewColormap copy;
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4274
                bits:originalPreviewPixels copy;
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4275
                release;
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4276
                colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor].
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4277
            previewImageHolder value:nil; value:previewImage.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4278
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4279
            shiftProcess notNil ifTrue:[
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4280
                shiftProcess terminate.
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4281
                shiftProcess waitUntilTerminated.
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4282
                shiftProcess := nil.
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4283
            ].
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4284
            shiftProcess := 
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4285
                [
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4286
                    [
1656
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  4287
                        imageEditView image 
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  4288
                            colorMap:originalColormap copy;
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4289
                            bits:originalPixels copy;
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4290
                            release;
1656
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  4291
                            colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor].
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4292
                        self updateImage.
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4293
                        self updateInfoLabel.
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4294
                        self updateImagePreView.
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4295
                    ] ensure:[ shiftProcess := nil ].    
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4296
                ] forkAt:7.
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4297
        ].
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4298
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4299
    bindings := IdentityDictionary new.
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4300
    bindings at:#hueShiftAmount put:(hueShift := 0 asValue).
1656
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  4301
    hueShift onChangeEvaluate:shiftAction.
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4302
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4303
    bindings at:#lightAmount put:(lightValue := 100 asValue).
1656
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  4304
    lightValue onChangeEvaluate:shiftAction.
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4305
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4306
    bindings at:#saturationAmount put:(saturationValue := 100 asValue).
1656
f5c0716efd78 menu labels
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  4307
    saturationValue onChangeEvaluate:shiftAction.
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4308
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4309
    bindings at:#acceptChannel put:acceptChannel.
1652
d6d40619e21a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  4310
    bindings at:#hlsColor put:avgColorHolder.
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4311
    bindings at:#previewImageHolder put:previewImageHolder.
1650
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4312
Claus Gittinger <cg@exept.de>
parents: 1649
diff changeset
  4313
    (self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) 
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4314
    ifFalse:[ 
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4315
        anyChange ifTrue:[
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4316
            imageEditView undo
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4317
        ]
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4318
    ].
1923
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4319
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4320
    (p := shiftProcess) notNil ifTrue:[
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4321
        p waitUntilTerminated.
b73340bcc215 changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents: 1922
diff changeset
  4322
    ].
2438
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4323
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4324
    anyChange ifTrue:[
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4325
        self updateImage.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4326
        self updateImagePreView.
bbe9cdf5dac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4327
    ].
1649
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4328
!
80586cf27eb8 added changeHue
Claus Gittinger <cg@exept.de>
parents: 1644
diff changeset
  4329
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4330
clearColormapEntry0AndMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4331
    "ensure that there is a colorMap entry with 0/0/0 at position
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4332
     0 and then clear all masked pixels (to pixelValue 0).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4333
     This is required for windows icons to be really transparent"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4334
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4335
    |index colorMap| 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4336
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4337
    self compressColorMap.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4338
    colorMap := self image colorMap.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4339
    (colorMap includes:(Color black)) ifFalse:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4340
        self addColorToColormap:(Color black).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4341
        colorMap := self image colorMap.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4342
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4343
    index := colorMap indexOf:(Color black).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4344
    index == 1 ifFalse:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4345
        self sortColorMap.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4346
        colorMap := self image colorMap.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4347
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4348
    self clearMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4349
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4350
1403
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4351
clearMaskedPixels
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4352
    "clear all masked pixels (to pixelValue 0)"
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4353
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4354
    |newImage| 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4355
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4356
    newImage := self image clearMaskedPixels.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4357
    0 to:newImage height - 1 do:[:y |
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4358
        0 to:newImage width - 1 do:[:x |
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4359
            (newImage maskAtX:x y:y) == 0 ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4360
                newImage pixelAtX:x y:y put:0
1460
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4361
            ]
1403
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4362
        ]
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4363
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4364
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4365
    (imageEditView image:newImage) notNil ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4366
        self fetchImageData.
1403
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4367
    ]
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4368
!
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4369
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4370
colorMapChanged
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4371
    |img|
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4372
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4373
    img := self image.
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4374
    img release.
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4375
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4376
    self imageEditView invalidate.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4377
    self imagePreView invalidate.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4378
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4379
"/    (imageEditView image:img) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4380
"/        self updateLabelsAndHistory.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4381
"/        self imagePreView image:img
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4382
"/    ]
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4383
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4384
    "Created: / 7.8.1998 / 22:26:10 / cg"
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  4385
    "Modified: / 18.8.1998 / 17:08:55 / cg"
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4386
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  4387
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  4388
colorMapMode:aMode
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4389
    "calculates a new color map for the image from aMode"
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4390
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4391
    |depth numColors newColorMap newImage 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4392
     oldImage image newColors realColorMap oldFileName
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4393
     usedColors useNearest usageCounts tmpBits tmpMap quest
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4394
     prevMode maskThreshold maskImage| 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4395
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4396
    self withExecuteCursorDo:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4397
        oldImage := self image.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4398
1053
31097504a15a fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  4399
        prevMode := colorMapMode value.
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4400
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4401
        newColorMap := self class listOfColorMaps at:aMode.
2572
1c09be361688 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2571
diff changeset
  4402
        aMode == #depth32 ifTrue:[
1c09be361688 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2571
diff changeset
  4403
            depth := 32. 
1c09be361688 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2571
diff changeset
  4404
        ] ifFalse:[
1c09be361688 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2571
diff changeset
  4405
            depth := (newColorMap size log:2) asInteger. 
1c09be361688 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2571
diff changeset
  4406
        ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4407
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4408
        useNearest := false.
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  4409
        depth == 1 ifTrue:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  4410
            quest := 'Keep colormap (or use standard B&W)'
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  4411
        ] ifFalse:[
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4412
            prevMode isNil ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4413
                quest := 'Compute colormap (or use standard)'
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4414
            ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4415
                quest := 'Keep colormap (or use standard)'
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4416
            ]
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  4417
        ].
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4418
        ((prevMode = aMode)
1057
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4419
        or:[depth > oldImage depth
36f9d47e1249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
  4420
        or:[self confirm:(resources string:quest)]]) ifTrue:[
1937
73fb270a4da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1936
diff changeset
  4421
            (newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4422
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4423
                "/ keep the colormap
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4424
                newColorMap atAllPut:Color black.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4425
                depth > oldImage depth ifTrue:[
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4426
                    "/ easy - simply copy the part
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4427
                    numColors := 1 bitShift:oldImage depth.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4428
                    0 to:numColors-1 do:[:pixel |
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4429
                        newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel)
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4430
                    ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4431
                ] ifFalse:[
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4432
                    "/ see if all used color fit the new colormap
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4433
                    usedColors := oldImage usedColorsMax:(1 bitShift:depth).
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4434
                    (usedColors notNil and:[usedColors size > (1 bitShift:depth)]) ifTrue:[
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4435
                        usedColors := oldImage realUsedColors
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4436
                    ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4437
                    (usedColors notNil and:[usedColors size <= (1 bitShift:depth)]) ifTrue:[
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4438
                        "/ yea - just install them
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4439
                        usedColors asArray keysAndValuesDo:[:idx :clr |
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4440
                            newColorMap at:idx put:clr
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4441
                        ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4442
                    ] ifFalse:[
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4443
                        "/ copy over those that are most often used.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4444
                        oldImage depth < 8 ifTrue:[
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4445
                            tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height).
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4446
                            oldImage bits
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4447
                                expandPixels:(oldImage depth)
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4448
                                width:oldImage width
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4449
                                height:oldImage height 
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4450
                                into:tmpBits
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4451
                                mapping:nil.
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  4452
                        ] ifFalse:[
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4453
                            oldImage depth == 8 ifTrue:[
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4454
                                tmpBits := oldImage bits
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4455
                            ] ifFalse:[
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4456
                                colorMapMode value:prevMode.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4457
                                self findColorMapMode.    
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4458
                                self warn:('Too many used colors in image (', oldImage usedColors size printString , ').').
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4459
                                ^ self
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4460
    "/                            (self confirm:('Too many used colors in image (', oldImage usedColors size printString , ').\\Dither ?' withCRs))
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4461
    "/                            ifFalse:[.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4462
    "/                                ^ self
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4463
    "/                            ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4464
    "/                            self image: (Image newForDepth:depth) fromImage:oldImage.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4465
    "/                            ^ self.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4466
                            ]
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4467
                        ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4468
                        usageCounts := tmpBits usageCounts.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4469
                        tmpMap := Array new:usageCounts size.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4470
                        oldImage colorMap asArray keysAndValuesDo:[:i :clr |
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4471
                            tmpMap at:i put:clr
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4472
                        ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4473
                        usageCounts sort:[:a :b | a > b] with:tmpMap.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4474
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4475
                        1 to:(1 bitShift:depth) do:[:idx |
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4476
                            newColorMap at:idx put:(tmpMap at:idx)
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4477
                        ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4478
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4479
                        useNearest := Dialog 
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4480
                                            confirmWithCancel:(resources 
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4481
                                                                  stringWithCRs:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?'
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4482
                                                                  with:usedColors size
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4483
                                                                  with:(1 bitShift:depth))
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4484
                                            labels:(resources array:#('Cancel' 'First' 'Nearest')).
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4485
                        useNearest isNil ifTrue:[
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  4486
                            colorMapMode value:prevMode.
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4487
                            ^ self   "/ cancel
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4488
                        ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4489
                    ]
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4490
                ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4491
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4492
        ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4493
            "/ standard colormap
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4494
            usedColors := oldImage usedColors.
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4495
            (usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4496
                useNearest := Dialog 
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  4497
                                    confirmWithCancel:(resources 
1916
c91c39976bef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
  4498
                                                           stringWithCRs:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?'
c91c39976bef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
  4499
                                                       ) 
1542
76c2549d878f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1537
diff changeset
  4500
                                    labels:(resources string:#('Cancel' 'First' 'Nearest')).
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4501
                useNearest isNil ifTrue:[
1542
76c2549d878f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1537
diff changeset
  4502
                    colorMapMode value:prevMode.
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4503
                    ^ self   "/ cancel
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4504
                ].
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  4505
            ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4506
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4507
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4508
        imageEditView makeUndo.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4509
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  4510
        newImage := Image newForDepth:depth.
1424
d7367ae7f85e fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  4511
        newImage depth:depth.
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  4512
        newImage photometric:oldImage photometric.
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  4513
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4514
        oldFileName := oldImage fileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4515
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4516
        Image imageErrorSignal handle:[:ex|
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4517
            Color colorErrorSignal handle:[:ex|
1542
76c2549d878f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1537
diff changeset
  4518
                colorMapMode value:prevMode.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4519
                imageEditView undo.
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4520
                ^ self warn:(resources string:'Conversion failed !!')
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4521
            ] do:[
1393
c4a11a7d407f use Image>>newForDepth:
Claus Gittinger <cg@exept.de>
parents: 1392
diff changeset
  4522
                newImage := Image newForDepth:depth.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4523
                newImage width:oldImage width height:oldImage height depth:depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4524
                newImage colorMap:newColorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4525
                newImage photometric:#palette.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4526
                newImage bits:(ByteArray new:(newImage bytesPerRow * newImage height)).
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  4527
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4528
                oldImage colorsFromX:0 y:0 toX:(oldImage width-1) y:(oldImage height-1) do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4529
                [:x :y :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4530
                    |newColor|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4531
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4532
                    (newColorMap includes:clr)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4533
                        ifTrue: [newColor := clr]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4534
                        ifFalse: [
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4535
                            newColor := clr nearestIn:newColorMap.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4536
                            useNearest ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4537
                                (newColor deltaFrom:clr) > 0.5 ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4538
                                    newColor := oldImage colorFromValue:0
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4539
                                ]
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4540
                            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4541
                        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4542
                    newImage colorAtX:x y:y put:newColor.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4543
                ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4544
                image := newImage
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4545
            ].
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4546
        ] do:[ 
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  4547
            image := newImage fromImage:oldImage.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4548
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4549
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4550
        (aMode asString startsWith:'mask') ifTrue:[
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4551
            image mask isNil ifTrue:[
1949
00defdb89630 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1943
diff changeset
  4552
                false "(Dialog confirm:'Generate mask from black ?' default:false)" ifTrue:[
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4553
                    maskThreshold := 0.1.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4554
                    maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4555
                ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4556
                    maskImage := Depth1Image extent:image extent.
1770
9000adb21f79 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1769
diff changeset
  4557
                    maskImage bits:(ByteArray 
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4558
                                        new:(maskImage bytesPerRow * maskImage height)
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4559
                                        withAll:16rFF).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4560
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4561
"/                    maskImage fillRectangle:(image bounds) withColor:(Color colorId:1).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4562
                ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4563
                image mask:maskImage.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4564
            ].
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4565
        ] ifFalse:[ 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4566
            image mask: nil.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4567
        ]. 
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4568
1937
73fb270a4da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1936
diff changeset
  4569
        (newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[
1935
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4570
            realColorMap := OrderedCollection new.
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4571
            image realColorMap do:[:clr|
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4572
                (realColorMap includes: clr) ifFalse: [realColorMap add: clr]
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4573
            ].
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4574
            newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size).
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4575
            newColorMap do:[:clr|
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4576
                ((newColors size < newColorMap size) and: [(newColors includes: clr) not]) 
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4577
                ifTrue:[      
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4578
                    newColors add: clr
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4579
                ]
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4580
            ].                  
27b19cd0274b more 24-bit image editing
Claus Gittinger <cg@exept.de>
parents: 1934
diff changeset
  4581
            image colorMap: newColors.   
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4582
        ].
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4583
        image fileName: oldFileName.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4584
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  4585
        (imageEditView image: image) notNil ifTrue:[
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4586
            self fetchImageData.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4587
        ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4588
    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4589
2174
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4590
    "Modified: / 20-07-2007 / 09:18:59 / cg"
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4591
!
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4592
2192
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4593
colorize
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4594
    "interactive Hue editing"
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4595
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4596
    |bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4597
     shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4598
     originalPixels p|
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4599
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4600
    "/ compute the averageColor in the background (while asking user)
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4601
    readySema := Semaphore new.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4602
    [
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4603
        |image|
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4604
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4605
        image := imageEditView image.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4606
        originalColormap := image colorMap copy.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4607
        avgColor := image averageColor.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4608
        originalPixels := image bits.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4609
        readySema signal.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4610
    ] forkAt:7.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4611
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4612
    acceptChannel := TriggerValue new.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4613
    avgColorHolder := avgColor asValue.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4614
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4615
    firstChange := true.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4616
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4617
    shiftedColor := [:clr :hShift :lFactor :sFactor |
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4618
                        Color 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4619
                                hue:((clr hue) ? 0 + hShift) 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4620
                                light:((clr light * lFactor / 100) "min:100")
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4621
                                saturation:(((clr saturation max:20) * sFactor / 100) "min:100")].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4622
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4623
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4624
    shiftAction := 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4625
        [
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4626
            |hShift lFactor sFactor|
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4627
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4628
            acceptChannel value:true.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4629
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4630
            firstChange ifTrue:[
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4631
                imageEditView makeUndo.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4632
                firstChange := false.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4633
            ].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4634
            readySema notNil ifTrue:[readySema wait. readySema := nil].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4635
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4636
            hShift := hueShift value.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4637
            lFactor := lightValue value.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4638
            sFactor := saturationValue value.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4639
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4640
            avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor).
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4641
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4642
            shiftProcess notNil ifTrue:[
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4643
                shiftProcess terminate.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4644
                shiftProcess waitUntilTerminated.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4645
                shiftProcess := nil.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4646
            ].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4647
            shiftProcess := 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4648
                [
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4649
                    [
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4650
                        imageEditView image 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4651
                            colorMap:originalColormap copy;
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4652
                            bits:originalPixels copy;
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4653
                            release;
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4654
                            colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4655
                        self updateImage.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4656
                        self updateInfoLabel.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4657
                        self updateImagePreView.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4658
                    ] ensure:[ shiftProcess := nil ].    
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4659
                ] forkAt:7.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4660
        ].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4661
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4662
    bindings := IdentityDictionary new.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4663
    bindings at:#hueShiftAmount put:(hueShift := 0 asValue).
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4664
    hueShift onChangeEvaluate:shiftAction.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4665
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4666
    bindings at:#lightAmount put:(lightValue := 100 asValue).
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4667
    lightValue onChangeEvaluate:shiftAction.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4668
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4669
    bindings at:#saturationAmount put:(saturationValue := 100 asValue).
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4670
    saturationValue onChangeEvaluate:shiftAction.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4671
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4672
    bindings at:#acceptChannel put:acceptChannel.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4673
    bindings at:#hlsColor put:avgColorHolder.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4674
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4675
    (self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4676
    ifFalse:[ 
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4677
        firstChange ~~ true ifTrue:[
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4678
            imageEditView undo
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4679
        ]
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4680
    ].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4681
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4682
    (p := shiftProcess) notNil ifTrue:[
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4683
        p waitUntilTerminated.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4684
    ].
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4685
    self updateImage.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4686
    self updateImagePreView.
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4687
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4688
    "Created: / 01-11-2007 / 23:27:37 / cg"
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4689
!
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  4690
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4691
compressColorMap
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4692
    "calculates a new color map for the image, using only used colors"
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4693
927
74a71f2c5ef8 obsolete locals removed
tz
parents: 926
diff changeset
  4694
    |depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4695
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4696
    oldImage := self image.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4697
    depth := oldImage depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4698
1403
26707fae4b93 compressColorMap
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  4699
    usedColors := oldImage realUsedColors.
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4700
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4701
    "/ translation table
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4702
    oldToNew := ByteArray new:(1 bitShift:depth).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4703
    newColorMap := usedColors asArray.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4704
    newColorMap sort:self sortBlockForColors.
2718
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4705
    oldImage colorMap notNil ifTrue:[
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4706
        oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr |
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4707
            |newPixel|
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4708
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4709
            (usedColors includes:clr) ifTrue:[
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4710
                newPixel := newColorMap indexOf:clr.
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4711
                oldToNew at:oldIdx put:newPixel-1.
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4712
            ]
5e6bbceb68c1 changed: #compressColorMap
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
  4713
        ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4714
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4715
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4716
    oldBits := oldImage bits.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4717
    newBits := ByteArray new:(oldBits size).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4718
    depth ~~ 8 ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4719
        "/ expand/compress can only handle 8bits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4720
        tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4721
        oldBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4722
            expandPixels:depth
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4723
            width:oldImage width
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4724
            height:oldImage height 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4725
            into:tmpBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4726
            mapping:oldToNew.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4727
        tmpBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4728
            compressPixels:depth 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4729
            width:oldImage width 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4730
            height:oldImage height 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4731
            into:newBits 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4732
            mapping:nil
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4733
    ] ifFalse:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4734
        oldBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4735
            expandPixels:depth
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4736
            width:oldImage width
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4737
            height:oldImage height 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4738
            into:newBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4739
            mapping:oldToNew.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4740
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4741
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4742
    newImage := oldImage species new
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4743
                    width:oldImage width
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4744
                    height:oldImage height
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4745
                    depth:depth
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4746
                    fromArray:newBits.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4747
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4748
    newImage colorMap:newColorMap.  
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4749
    newImage fileName:oldImage fileName.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4750
    newImage mask:(oldImage mask copy).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4751
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4752
    (imageEditView image:newImage) notNil ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4753
        self fetchImageData.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4754
    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4755
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  4756
    "Created: / 28.7.1998 / 20:03:11 / cg"
996
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  4757
    "Modified: / 15.9.1998 / 17:53:32 / cg"
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4758
!
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  4759
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  4760
copyColorFromColormap
1871
42729969c032 set selection interface changed
ca
parents: 1859
diff changeset
  4761
    imageEditView setClipboardObject:(self selectedColorOrNil)
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  4762
!
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  4763
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4764
ditherToDepth
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4765
    |depth|
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4766
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4767
    depth := Dialog request:'New depth ?'.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4768
    depth isEmptyOrNil ifTrue:[^ self].
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4769
    depth := Number readFrom:depth onError:nil.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4770
    depth isNil ifTrue:[^ self].
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4771
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4772
    self ditherToDepth:depth
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4773
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4774
    "Created: / 07-07-2006 / 13:22:10 / cg"
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4775
!
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4776
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4777
ditherToDepth:depth
2576
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4778
    |ditherColors newImage useStandardColors nGrey greyColorsAlready additionalGreyColors moreColors d|
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4779
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4780
    useStandardColors := true.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4781
"/    useStandardColors := Dialog confirmWithCancel:'Dither in standard colors or use a new (optimized) colormap ?'.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4782
"/    useStandardColors isNil ifTrue:[^ self].
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4783
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4784
    useStandardColors ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4785
        depth = 1 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4786
            ditherColors := Array with:(Color black) with:(Color white).
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4787
        ] ifFalse:[ depth = 2 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4788
            ditherColors := Array 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4789
                                with:(Color black) 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4790
                                with:(Color darkGrey)
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4791
                                with:(Color lightGrey)
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4792
                                with:(Color white).
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4793
        ] ifFalse:[ depth = 3 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4794
            ditherColors := Color colorCubeWithRed:2 green:2 blue:2. 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4795
        ] ifFalse:[ depth = 4 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4796
            ditherColors := Color vgaColors. 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4797
        ] ifFalse:[ depth = 5 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4798
            ditherColors := Color colorCubeWithRed:4 green:4 blue:2. 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4799
        ] ifFalse:[ depth = 6 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4800
            ditherColors := Color colorCubeWithRed:4 green:4 blue:3.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4801
        ] ifFalse:[ depth <= 8 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4802
            ditherColors := Color colorCubeWithRed:6 green:6 blue:5. 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4803
        ] ifFalse:[ 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4804
            self error:'unsupported depth'.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4805
        ]]]]]]].
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4806
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4807
        nGrey := (2 raisedTo:depth) - ditherColors size.  
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4808
        nGrey > 0 ifTrue:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4809
            nGrey := nGrey min:128.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4810
            greyColorsAlready := ditherColors select:[:clr | clr isGreyColor].
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4811
            d := 1 / nGrey.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4812
            moreColors := (1 to:nGrey-1) 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4813
                            collect:[:i | Color brightness:(d * i)] 
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4814
                            thenReject:[:clr | greyColorsAlready includes:clr ].
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4815
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4816
            ditherColors := ditherColors , moreColors.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4817
        ].
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4818
    ] ifFalse:[
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4819
self halt.
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4820
    ].
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4821
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4822
    self withExecuteCursorDo:[
2576
9e8d63aadb11 more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents: 2575
diff changeset
  4823
        "/ newImage := self image asDitheredImageUsing:ditherColors depth:depth.
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4824
        newImage := self image asDitheredImageUsing:ditherColors depth:8.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4825
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4826
        imageEditView makeUndo.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4827
        imageEditView image:newImage.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4828
        imageEditView setModified.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4829
        self updateImage.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4830
        self updateImagePreView.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4831
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4832
        self fetchImageData.
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4833
    ].
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4834
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4835
    "Created: / 07-07-2006 / 13:20:56 / cg"
2073
df9bd2816495 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
  4836
    "Modified: / 05-09-2006 / 16:13:25 / cg"
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4837
!
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  4838
2174
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4839
doubleClickOnColor:aColorIndex
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4840
    self editSelectedColor.
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4841
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4842
    "Created: / 22-07-2007 / 13:14:37 / cg"
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4843
!
7beca4d9c93a color-double-click
Claus Gittinger <cg@exept.de>
parents: 2155
diff changeset
  4844
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4845
editSelectedColor
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4846
    self processSelectedColorWith:[:clr | 
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4847
        |editor|
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4848
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4849
        editor := ColorEditDialog new.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4850
        editor color:clr.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4851
        editor open.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4852
        editor accepted ifFalse:[
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4853
            AbortOperationRequest raise.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4854
        ].
2575
43e98f6d71d2 ColorEditDialog was grazy - adapted to changed protocol
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
  4855
        editor colorNameOrColor
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4856
    ]
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4857
!
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  4858
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4859
fetchImageData
1460
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4860
    |image|
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4861
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4862
    (image := imageEditView image) notNil ifTrue:[
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4863
        self findColorMapMode.
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4864
        self updateLabelsAndHistory.
89549732a2c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  4865
    ]
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4866
!
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4867
1544
1048b548abfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
  4868
inspectColor
2573
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4869
    |clrIndex clr|
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4870
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4871
    self hasColormap ifFalse:[
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4872
        clr := self selectedColorOrNil
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4873
    ] ifTrue:[
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4874
        clrIndex := self selectedColorIndexOrNil.
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4875
        clrIndex isNil ifTrue:[
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4876
            ^ self
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4877
        ].
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4878
        clr := self image colorFromValue:clrIndex-1
1544
1048b548abfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
  4879
    ].
2573
c18db441c6ab changed #inspectColor
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  4880
    clr inspect
1544
1048b548abfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
  4881
!
1048b548abfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1542
diff changeset
  4882
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  4883
inspectColormap
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  4884
    self hasColormap ifTrue:[
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  4885
        self image colorMap inspect
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  4886
    ].
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  4887
!
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  4888
1598
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4889
makeBrighter
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4890
    | anyChange|
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4891
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4892
    self withExecuteCursorDo:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4893
        anyChange := imageEditView makeBrighter.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4894
        anyChange ifFalse:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4895
            Dialog warn:'Image unchanged'.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4896
        ] ifTrue:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4897
            self updateImage.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4898
        ]
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4899
    ].
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4900
!
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4901
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4902
makeDarker
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4903
    | anyChange|
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4904
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4905
    self withExecuteCursorDo:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4906
        anyChange := imageEditView makeDarker.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4907
        anyChange ifFalse:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4908
            Dialog warn:'Image unchanged'.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4909
        ] ifTrue:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4910
            self updateImage.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4911
        ]
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4912
    ].
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4913
!
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4914
1926
b3d2dab90f9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
  4915
makeGrayScaleImage
1598
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4916
    |anyChange|
1436
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4917
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4918
    self withExecuteCursorDo:[
1926
b3d2dab90f9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1925
diff changeset
  4919
        anyChange := imageEditView makeGrayScaleImage.
1436
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4920
        anyChange ifFalse:[
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4921
            Dialog warn:'Image unchanged'.
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4922
        ] ifTrue:[
1598
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4923
            self updateImage.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4924
        ]
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4925
    ].
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4926
!
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4927
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4928
makeInverse
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4929
    | anyChange|
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4930
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4931
    self withExecuteCursorDo:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4932
        anyChange := imageEditView makeInverse.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4933
        anyChange ifFalse:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4934
            Dialog warn:'Image unchanged'.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4935
        ] ifTrue:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  4936
            self updateImage.
1436
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4937
        ]
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4938
    ].
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4939
!
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  4940
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4941
makeSelectedColorBrighter
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4942
    self processSelectedColorWith:[:clr | clr lightened]
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4943
!
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4944
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4945
makeSelectedColorDarker
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  4946
    self processSelectedColorWith:[:clr | clr darkened]
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4947
!
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  4948
1884
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4949
makeSelectedColorGray
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4950
    self processSelectedColorWith:[:clr | Color brightness:(clr brightness)]
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4951
!
2c4d13ecd7ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  4952
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4953
menu_clearColormapEntry0AndMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4954
    "ensure that there is a colorMap entry with 0/0/0 at position
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4955
     0 and then clear all masked pixels (to pixelValue 0)"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4956
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4957
    imageEditView makeUndo.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4958
    self withExecuteCursorDo:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4959
        self clearColormapEntry0AndMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4960
    ]
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4961
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4962
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4963
menu_clearMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4964
    "clear all masked pixels (to pixelValue 0)"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4965
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4966
    imageEditView makeUndo.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4967
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4968
    self withExecuteCursorDo:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4969
        self clearMaskedPixels
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4970
    ]
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4971
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4972
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4973
menu_compressColorMap
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4974
    "calculates a new color map for the image, using only used colors"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4975
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4976
    |depth oldImage usedColors| 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4977
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4978
    oldImage := self image.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4979
    depth := oldImage depth.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4980
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4981
    oldImage photometric ~~ #palette ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4982
        self information:'Compress colorMap: Only palette images have colormaps.'.
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  4983
        ^ self
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  4984
    ].
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4985
    usedColors := oldImage realUsedColors.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4986
    usedColors size == (1 bitShift:depth) ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4987
        self information:'Compress colorMap: All colors are used - no compression.'.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4988
        ^ self
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4989
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4990
    usedColors size == oldImage colorMap size ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4991
        self information:'Compress colorMap: Colormap already compressed - no compression.'.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4992
        ^ self
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4993
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4994
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4995
    imageEditView makeUndo.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4996
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4997
    self withExecuteCursorDo:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  4998
        self compressColorMap
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  4999
    ]
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5000
!
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5001
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5002
menu_copyMask
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5003
    |mask|
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5004
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5005
    mask := self image mask.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5006
    MaskClipboard := mask subImageIn: (0@0 extent:mask extent).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5007
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5008
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5009
menu_pasteMask
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5010
    |img mask|
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5011
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5012
    imageEditView makeUndo.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5013
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5014
    img := self image.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5015
    mask := img mask.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5016
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5017
    mask 
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5018
         copyFrom:MaskClipboard
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5019
         x:0 y:0
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5020
         toX:0 y:0 
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5021
         width:(mask width min:MaskClipboard width)
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5022
         height:(mask height min:MaskClipboard height).
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5023
    img mask:mask.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5024
    (imageEditView image:img copy) notNil ifTrue:[
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5025
        self fetchImageData.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5026
    ]
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5027
!
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5028
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5029
menu_sortColorMap
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5030
    "calculates a new color map for the image, sorting colors"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5031
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5032
    self menu_sortColorMapWith:self sortBlockForColors
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5033
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5034
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5035
menu_sortColorMapWith:sortBlock
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5036
    "calculates a new color map for the image, sorting colors"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5037
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5038
    self image photometric ~~ #palette ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5039
        self information:'Compress colorMap: Only palette images have colormaps.'.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5040
        ^ self
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5041
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5042
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5043
    imageEditView makeUndo.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5044
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5045
    self withExecuteCursorDo:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5046
        self sortColorMapWith:sortBlock
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5047
    ]
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5048
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5049
    "Modified: / 15.9.1998 / 17:53:32 / cg"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5050
    "Created: / 30.9.1998 / 23:51:23 / cg"
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5051
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5052
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5053
pasteColorIntoColormap
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5054
    |copyBufferColor|
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5055
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5056
    copyBufferColor := imageEditView getClipboardObject.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5057
    copyBufferColor isColor ifFalse:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5058
        UserPreferences current beepInEditor ifTrue:[                
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5059
            self window beep.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5060
        ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5061
        ^ self
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5062
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5063
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5064
    self processSelectedColorWith:[:clr |
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5065
        copyBufferColor
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5066
    ]
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5067
!
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5068
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5069
pickAndAddColorToColormap
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5070
    self addColorToColormap:(Color fromUser)
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5071
!
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5072
1933
2fe701f721ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
  5073
pickAndPasteColor
2fe701f721ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
  5074
    self pickColor.
2fe701f721ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
  5075
    self pasteColorIntoColormap.
2fe701f721ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
  5076
!
2fe701f721ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
  5077
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5078
pickColor
1871
42729969c032 set selection interface changed
ca
parents: 1859
diff changeset
  5079
    imageEditView setClipboardObject:(Color fromUser)
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5080
!
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5081
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5082
processSelectedColorWith:aBlock
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5083
    "undoable color processing: the selected color will be replaced by the
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5084
     value of aBlock"
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5085
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5086
    |img cMap modifiedColormap oldColor newImage selectedColorIndex oldSelection newColor|
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5087
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5088
    selectedColorIndex := self selectedColorIndexOrNil.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5089
    selectedColorIndex isNil ifTrue:[^ self].
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5090
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5091
    img := self image.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5092
    cMap := img colorMap.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5093
    cMap isNil ifTrue:[
1916
c91c39976bef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
  5094
        self warn:(resources stringWithCRs:'Image has no colormap.\Please change the colorMap mode first.').
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5095
        ^ self
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5096
    ].
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5097
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5098
    oldColor := cMap at:selectedColorIndex.
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5099
    imageEditView makeUndo.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5100
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5101
    modifiedColormap := cMap asArray copy.
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5102
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5103
    newColor := aBlock value:oldColor.
1859
254fc0e37550 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  5104
    modifiedColormap at:selectedColorIndex put:newColor.
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5105
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5106
    newImage := img species new
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5107
                    width:img width
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5108
                    height:img height
1843
771731481a20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  5109
                    depth:img depth
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5110
                    fromArray:img bits.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5111
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5112
    newImage colorMap:modifiedColormap.  
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5113
    newImage fileName:img fileName.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5114
    newImage mask:(img mask copy).
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5115
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5116
    oldSelection := self selectionOfColor value.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5117
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5118
    (imageEditView image:newImage) notNil ifTrue:[
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5119
        self fetchImageData.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5120
    ].
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5121
    self selectionOfColor value:oldSelection.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5122
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5123
    "Created: / 12.3.1999 / 00:20:28 / cg"
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5124
    "Modified: / 16.3.1999 / 21:57:26 / cg"
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5125
!
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5126
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5127
reduceNumberOfColors
1727
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5128
    |s n anyChange img usedColors|
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5129
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5130
    s := Dialog request:'Number of color bits to strip (1-7) ?'.
1435
f39893848245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1433
diff changeset
  5131
    s size == 0 ifTrue:[^ self].
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5132
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5133
    n := Integer readFrom:s onError:0.
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5134
    (n between:1 and:7) ifFalse:[
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5135
        Dialog warn:'Image unchanged'.
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5136
        ^ self
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5137
    ].
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5138
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5139
    self withExecuteCursorDo:[
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5140
        anyChange := imageEditView reduceColorResolutionBy:n.
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5141
        anyChange ifFalse:[
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5142
            Dialog warn:'Image unchanged'.
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5143
        ] ifTrue:[
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5144
            img := imageEditView image.
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5145
            imageEditView image:img.
1446
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  5146
6f2344ca1e92 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1443
diff changeset
  5147
            self fetchImageData.
1727
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5148
            usedColors := img usedColorsMax:10000.
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5149
            usedColors size == 10000 ifTrue:[
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5150
                Dialog information:('>= ' , usedColors size printString , ' colors used.')
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5151
            ] ifFalse:[
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5152
                Dialog information:(usedColors size printString , ' colors used.')
8c626d784494 color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents: 1716
diff changeset
  5153
            ]
1124
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5154
        ]
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5155
    ].
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5156
!
2392df0934bc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  5157
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5158
reduceNumberOfColors2
1938
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5159
    |s rndR rndG rndB usedColors image newImage|
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5160
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5161
    s := Dialog request:'Rounding Interval red (2..) ?' initialAnswer:4.
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5162
    s size == 0 ifTrue:[^ self].
1938
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5163
    rndR := Integer readFrom:s onError:0.
1939
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5164
1938
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5165
    s := Dialog request:'Rounding Interval green (2..) ?' initialAnswer:2.
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5166
    s size == 0 ifTrue:[^ self].
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5167
    rndG := Integer readFrom:s onError:0.
1939
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5168
1938
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5169
    s := Dialog request:'Rounding Interval blue (2..) ?' initialAnswer:10.
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5170
    s size == 0 ifTrue:[^ self].
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5171
    rndB := Integer readFrom:s onError:0.
1939
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5172
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5173
    ((rndR > 1) or:[(rndG > 1) or:[(rndB > 1)]]) ifFalse:[
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5174
        Dialog warn:'Image unchanged'.
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5175
        ^ self
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5176
    ].
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5177
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5178
    self withExecuteCursorDo:[
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5179
        image := self image.
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  5180
        "/ usedColors := image usedColorsMax:4096.
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5181
        imageEditView makeUndo.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5182
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5183
        newImage := image copy.
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5184
        newImage photometric == #palette ifTrue:[
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5185
            newImage colorMap:(OrderedCollection new).
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5186
        ].
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5187
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5188
        image
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5189
            colorsFromX:0 y:0 toX:(image width-1) y:(image height-1) 
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5190
            do:[:x :y :clr |
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5191
                |r g b nr ng nb newClr|
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5192
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5193
                r := clr redByte.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5194
                g := clr greenByte.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5195
                b := clr blueByte. 
1938
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5196
                nr := (r roundTo:rndR) min:255.
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5197
                ng := (g roundTo:rndG) min:255.
99d611caf3bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1937
diff changeset
  5198
                nb := (b roundTo:rndB) min:255. 
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5199
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5200
                newClr := Color redByte:nr greenByte:ng blueByte:nb.
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5201
                newImage photometric == #palette ifTrue:[
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5202
                    (newImage colorMap includes:newClr) ifFalse:[
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5203
                        newImage colorMap add:newClr
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5204
                    ].
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5205
                ].
1934
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5206
                newImage colorAtX:x y:y put:newClr
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5207
            ].
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5208
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5209
        imageEditView image:newImage.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5210
        imageEditView setModified.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5211
        self updateImage.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5212
        self updateImagePreView.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5213
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5214
        self fetchImageData.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5215
        usedColors := newImage usedColorsMax:10000.
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5216
        usedColors size == 10000 ifTrue:[
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5217
            Dialog information:('>= ' , usedColors size printString , ' colors used.')
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5218
        ] ifFalse:[
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5219
            Dialog information:(usedColors size printString , ' colors used.')
294d0e102881 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  5220
        ]
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5221
    ].
2054
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  5222
56352366d94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2044
diff changeset
  5223
    "Modified: / 07-07-2006 / 13:10:42 / cg"
1930
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5224
!
7b5ec69e6526 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1929
diff changeset
  5225
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5226
selectColor:aColor
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5227
    |idx img cMap|
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5228
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5229
    aColor isNil ifTrue:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5230
        idx := nil.
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5231
    ] ifFalse:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5232
        aColor == Color noColor ifTrue:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5233
            img mask notNil ifTrue:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5234
                idx := 1.
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5235
            ]
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5236
        ] ifFalse:[
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5237
            (img := self image) notNil ifTrue:[
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5238
                (cMap := self listOfColors) notNil ifTrue:[
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5239
                    idx := cMap indexOf:aColor ifAbsent:nil.
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5240
                ].
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5241
                idx isNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5242
                    "/ should not happen...
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5243
                    (cMap := img colorMap) notNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5244
                        idx := cMap indexOf:aColor ifAbsent:nil.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5245
                        idx notNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5246
                            img mask notNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5247
                                idx := idx + 1.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5248
                            ].
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5249
                        ]
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5250
                    ].
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5251
                ].
2446
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5252
            ].
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5253
        ].
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5254
    ].
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5255
    self selectionOfColor value:idx.
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5256
!
862717a7ca0f color selection when undoing
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  5257
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5258
selectedColorIndexOrNil
2651
270672891645 changed: #colorMapMenu
Claus Gittinger <cg@exept.de>
parents: 2595
diff changeset
  5259
    |img clrIndex|
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5260
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5261
    img := self image.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5262
    img isNil ifTrue:[
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5263
        self warn:'No Image.'.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5264
        ^ nil
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5265
    ].
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5266
    clrIndex := self selectionOfColor value.
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5267
    self hasMask "img mask notNil" ifTrue: [ 
2449
5ef668d71314 changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
  5268
        (clrIndex isInteger and:[clrIndex > 1]) ifTrue:[
5ef668d71314 changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
  5269
            ^ clrIndex - 1 
5ef668d71314 changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
  5270
        ].
5ef668d71314 changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
  5271
        ^ nil
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5272
    ].
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5273
    ^ clrIndex
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5274
!
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5275
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5276
selectedColorOrNil
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5277
    |cmapIndex img cMap colorList|
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5278
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5279
    cmapIndex := self selectedColorIndexOrNil.
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  5280
    cmapIndex isNil ifTrue:[^ nil].
2556
736533777318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  5281
    cmapIndex == 0 ifTrue:[^ nil].
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5282
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5283
    img := self image.
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5284
    cMap := img colorMap.
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5285
    cMap isNil ifTrue:[
2447
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5286
        "/ self warn:(resources stringWithCRs:'Image has no colormap.\Please change the colorMap mode first.').
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5287
        colorList := self listOfColors.
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5288
        colorList notNil ifTrue:[
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5289
            ^ colorList at:cmapIndex ifAbsent:nil
017ac2e500f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  5290
        ].
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  5291
        ^ nil
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5292
    ].
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5293
    ^ cMap at:cmapIndex.
1852
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5294
!
c40abf408dc4 pick, copy & paste color
Claus Gittinger <cg@exept.de>
parents: 1847
diff changeset
  5295
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5296
sortColorMap
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5297
    "calculates a new color map for the image, sorting colors"
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5298
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5299
    self sortColorMapWith:self sortBlockForColors
1939
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5300
!
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5301
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5302
sortColorMapWith:sortBlock
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5303
    "calculates a new color map for the image, sorting colors"
1ea7c8639468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5304
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5305
    |depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5306
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5307
    oldImage := self image.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5308
    depth := oldImage depth.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5309
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5310
    usedColors := oldImage realColorMap.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5311
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5312
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5313
    "/ translation table
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5314
    oldToNew := ByteArray new:(1 bitShift:depth).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5315
    newColorMap := usedColors asArray.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5316
    newColorMap sort:sortBlock.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5317
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5318
    oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr |
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5319
        |newPixel|
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5320
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5321
        (usedColors includes:clr) ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5322
            newPixel := newColorMap indexOf:clr.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5323
            oldToNew at:oldIdx put:newPixel-1.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5324
        ]
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5325
    ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5326
2652
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5327
    oldBits := oldImage bits.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5328
    newBits := ByteArray new:(oldBits size).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5329
    depth ~~ 8 ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5330
        "/ expand/compress can only handle 8bits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5331
        tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5332
        oldBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5333
            expandPixels:depth
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5334
            width:oldImage width
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5335
            height:oldImage height 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5336
            into:tmpBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5337
            mapping:oldToNew.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5338
        tmpBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5339
            compressPixels:depth 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5340
            width:oldImage width 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5341
            height:oldImage height 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5342
            into:newBits 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5343
            mapping:nil
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5344
    ] ifFalse:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5345
        oldBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5346
            expandPixels:depth
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5347
            width:oldImage width
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5348
            height:oldImage height 
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5349
            into:newBits
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5350
            mapping:oldToNew.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5351
    ].
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5352
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5353
    newImage := oldImage species new
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5354
                    width:oldImage width
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5355
                    height:oldImage height
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5356
                    depth:depth
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5357
                    fromArray:newBits.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5358
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5359
    newImage colorMap:newColorMap.  
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5360
    newImage fileName:oldImage fileName.
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5361
    newImage mask:(oldImage mask copy).
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5362
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5363
    (imageEditView image:newImage) notNil ifTrue:[
1583e5525196 menu order
Claus Gittinger <cg@exept.de>
parents: 2651
diff changeset
  5364
        self fetchImageData.
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5365
    ]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5366
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5367
    "Modified: / 15.9.1998 / 17:53:32 / cg"
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  5368
    "Created: / 30.9.1998 / 23:51:23 / cg"
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  5369
! !
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  5370
1715
9eebdb3802aa method category rename
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  5371
!ImageEditor methodsFor:'user actions-editing'!
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5372
2354
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5373
do3DProjection
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5374
    |box dx1 dx2 image|
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5375
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5376
    image := imageEditView image.
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5377
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5378
    box := EnterBox new.
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5379
    box title:(resources string:'dX1 (0 < dx < 0.5):').
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5380
    box okText:(resources string:'OK').
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5381
    box abortText:(resources string:'Cancel').
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5382
    box initialText:'0.1'.
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5383
    box showAtPointer.
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5384
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5385
    (box accepted 
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5386
    and: [(dx1 := Number readFrom:(box contents) onError:nil) notNil])
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5387
    ifTrue:[
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5388
        box title:(resources string:'dX2 (0 < dx < 0.5):').
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5389
        box initialText:(dx1 printString).
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5390
        box showAtPointer.
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5391
        (box accepted 
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5392
        and: [(dx2 := Number readFrom:(box contents) onError:nil) notNil])
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5393
        ifTrue:[
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5394
            imageEditView threeDProjection:dx1 and:dx2.
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5395
        ]
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5396
    ].
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5397
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5398
    self updateInfoLabel
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5399
!
15be12f5e320 3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents: 2339
diff changeset
  5400
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5401
doBrightenImage
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5402
    imageEditView brightenImage.
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5403
    self listOfColors removeAll.
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5404
    self findColorMapMode.     
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  5405
    "/ imageEditView removelastUndo
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5406
!
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5407
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5408
doBrowseClass
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5409
    "opens a System Browser on the resourceClass and the resourceSelector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5410
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5411
    |cls|
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5412
1965
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  5413
    cls := imageEditView resourceClass.
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5414
    cls isNil ifTrue:[^ self warn:'No Class specified'].
1965
1d2b7893ae89 some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  5415
1488
cb1867473e3e UserPreference access
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  5416
    UserPreferences systemBrowserClass
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5417
        openInClass:cls class 
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5418
        selector:(imageEditView resourceSelector)
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5419
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  5420
    "Modified: / 31.7.1998 / 02:01:15 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5421
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5422
1703
7cf51b5b6ac5 added copyToClipboard
Claus Gittinger <cg@exept.de>
parents: 1690
diff changeset
  5423
doCopyImageToClipboard
7cf51b5b6ac5 added copyToClipboard
Claus Gittinger <cg@exept.de>
parents: 1690
diff changeset
  5424
    imageEditView copyImageToClipboard.
7cf51b5b6ac5 added copyToClipboard
Claus Gittinger <cg@exept.de>
parents: 1690
diff changeset
  5425
!
7cf51b5b6ac5 added copyToClipboard
Claus Gittinger <cg@exept.de>
parents: 1690
diff changeset
  5426
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5427
doCropAll
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5428
    "find all borders and cut them off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5429
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5430
    imageEditView cropLeft:true right:true top:true bottom:true.   
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5431
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5432
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5433
    "Modified: / 7.9.1998 / 14:26:23 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5434
    "Created: / 7.9.1998 / 16:33:43 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5435
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5436
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5437
doCropBottom
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5438
    "find a bottom border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5439
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5440
    imageEditView cropLeft:false right:false top:false bottom:true.   
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5441
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5442
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5443
    "Created: / 7.9.1998 / 13:00:20 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5444
    "Modified: / 7.9.1998 / 14:26:23 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5445
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5446
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5447
doCropLeft
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5448
    "find a left border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5449
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5450
    imageEditView cropLeft:true right:false top:false bottom:false.   
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5451
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5452
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5453
    "Created: / 7.9.1998 / 13:00:14 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5454
    "Modified: / 7.9.1998 / 14:26:34 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5455
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5456
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5457
doCropManual
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5458
    "let user specify borders and cut them off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5459
1502
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5460
    |bindings left top right bottom img firstChange gropAction acceptChannel|
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5461
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5462
    acceptChannel := TriggerValue new.
1490
08f46b59ef9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1489
diff changeset
  5463
08f46b59ef9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1489
diff changeset
  5464
    firstChange := true.
08f46b59ef9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1489
diff changeset
  5465
1502
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5466
    gropAction := 
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5467
        [:lV :rV :tV :bV | |l r t b|
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5468
            acceptChannel value:true.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5469
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5470
            l := lV value.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5471
            r := rV value.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5472
            t := tV value.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5473
            b := bV value.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5474
            (l + r + t + b) == 0 ifTrue:[
2520
8ee06c8f3f9f beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 2449
diff changeset
  5475
                UserPreferences current beepInEditor ifTrue:[                
8ee06c8f3f9f beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 2449
diff changeset
  5476
                    self window beep
8ee06c8f3f9f beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 2449
diff changeset
  5477
                ]
1502
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5478
            ] ifFalse:[
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5479
                img := imageEditView image.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5480
                firstChange ifTrue:[
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5481
                    imageEditView makeUndo.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5482
                    firstChange := false.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5483
                ].
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5484
                imageEditView
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5485
                    makeSubImageX:l y:t 
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5486
                    width:(img width - l - r)
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5487
                    height:(img height - t - b).
2546
b69247f503b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2539
diff changeset
  5488
b69247f503b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2539
diff changeset
  5489
                self updateImagePreView.
1502
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5490
                self updateInfoLabel
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5491
            ].
1490
08f46b59ef9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1489
diff changeset
  5492
        ].
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5493
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5494
    bindings := IdentityDictionary new.
1507
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5495
    bindings at:#left put:(left := 1 asValue).
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5496
    bindings at:#right put:(right := 1 asValue).
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5497
    bindings at:#top put:(top := 1 asValue).
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5498
    bindings at:#bottom put:(bottom := 1 asValue).
1502
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5499
    bindings at:#acceptChannel put:acceptChannel.
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5500
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5501
    bindings at:#gropLeftNow   put:[ gropAction value:left value:0 value:0 value:0 ].
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5502
    bindings at:#gropRightNow  put:[ gropAction value:0 value:right value:0 value:0 ].
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5503
    bindings at:#gropTopNow    put:[ gropAction value:0 value:0 value:top value:0 ].
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5504
    bindings at:#gropBottomNow put:[ gropAction value:0 value:0 value:0 value:bottom ].
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5505
f5baa791b8cb better crop
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  5506
    bindings at:#applyAction   put:[ gropAction value:left value:right value:top value:bottom ].
1490
08f46b59ef9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1489
diff changeset
  5507
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  5508
    (self openDialogInterface:#cropDialogSpec withBindings:bindings) 
1507
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5509
    ifFalse:[ 
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5510
        firstChange ~~ true ifTrue:[
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  5511
            imageEditView undo.
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  5512
            self updateImagePreView.
1507
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5513
        ]
e65674cad5e5 tabable crobDialog
Claus Gittinger <cg@exept.de>
parents: 1502
diff changeset
  5514
    ].
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5515
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5516
    "Created: / 7.9.1998 / 18:16:07 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5517
    "Modified: / 7.9.1998 / 18:20:42 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5518
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5519
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5520
doCropRight
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5521
    "find a right border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5522
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5523
    imageEditView cropLeft:false right:true top:false bottom:false.   
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5524
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5525
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5526
    "Created: / 7.9.1998 / 13:00:14 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5527
    "Modified: / 7.9.1998 / 14:26:44 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5528
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5529
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5530
doCropTop
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5531
    "find a top border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5532
1045
c387bcacdf37 renamed - crob -> crop
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  5533
    imageEditView cropLeft:false right:false top:true bottom:false.   
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5534
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5535
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5536
    "Created: / 7.9.1998 / 13:00:19 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5537
    "Modified: / 7.9.1998 / 14:26:52 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5538
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  5539
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5540
doDarkenImage
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5541
    imageEditView darkenImage.
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5542
    self listOfColors removeAll.
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5543
    self findColorMapMode.     
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  5544
    "/ imageEditView removelastUndo
1882
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5545
!
80845a794f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1880
diff changeset
  5546
1433
df38b2a5d335 checkin from browser
martin
parents: 1424
diff changeset
  5547
doEditMask
df38b2a5d335 checkin from browser
martin
parents: 1424
diff changeset
  5548
    self image mask edit
df38b2a5d335 checkin from browser
martin
parents: 1424
diff changeset
  5549
!
df38b2a5d335 checkin from browser
martin
parents: 1424
diff changeset
  5550
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5551
doFlipHorizontal
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5552
    "flips horizontally current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5553
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  5554
    imageEditView flipHorizontal
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5555
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5556
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5557
doFlipVertical
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5558
    "flips vertically current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5559
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  5560
    imageEditView flipVertical
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5561
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5562
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5563
doInsertTextFromUser
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5564
    |text tempForm tempImage maskImage font w h|
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5565
2424
12831cc181ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2423
diff changeset
  5566
    text := Dialog request:'Text to be inserted (placed as bitmap into clipboard for paste):'.
12831cc181ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2423
diff changeset
  5567
    text isEmptyOrNil ifTrue:[^ self ].
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5568
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5569
    font := Font family:'arial' size:20.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5570
    font := font onDevice:Screen current.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5571
    w := font widthOf:text.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5572
    h := font heightOf:text.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5573
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5574
    tempForm := Form extent:(w@h) depth:1 onDevice:(Screen current).
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5575
    tempForm clear.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5576
    tempForm font:font.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5577
    tempForm paint:(Color colorId:1).
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5578
    tempForm displayString:text at:(0@font ascent).
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5579
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5580
    tempImage := tempForm asImage.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5581
    maskImage := tempForm asImage.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5582
    tempImage   
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5583
        photometric:#palette;
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5584
        colorMap:(Array with:Color white with:imageEditView selectedColor);
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5585
        mask:maskImage.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5586
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5587
    ImageEditView copyImageToClipboard:tempImage.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5588
    self editMode value:#paste.
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5589
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5590
    "Modified: / 11-11-2007 / 12:32:55 / cg"
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5591
!
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5592
1896
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5593
doInspectImage
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5594
    "opens a System Browser on the resourceClass and the resourceSelector"
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5595
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5596
    self image inspect
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5597
!
ab2b45d8ccc8 colorMap fixes
penk
parents: 1889
diff changeset
  5598
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5599
doMagnifyDown
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  5600
    "magnifies the current image one step down"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5601
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5602
    |magHolder mag|
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5603
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  5604
    magHolder := self magnificationHolder.
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5605
    (mag := magHolder value) > 1 ifTrue: [
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5606
        magHolder value: mag - 1
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5607
    ]
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5608
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5609
    "Modified: / 26.7.1998 / 20:24:08 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5610
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5611
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5612
doMagnifyImage
1479
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5613
    "magnifies the current image to a new size"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5614
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5615
    |box newSize image|
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5616
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5617
    image := imageEditView image.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5618
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5619
    box := EnterBox new.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5620
    box title:(resources string:'Images new size:').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5621
    box okText:(resources string:'OK').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5622
    box abortText:(resources string:'Cancel').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5623
    box initialText:image extent printString.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5624
    box showAtPointer.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5625
    (box accepted 
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5626
    and: [(newSize := self pointFromString:(box contents)) notNil])
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5627
    ifTrue:[
1479
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5628
        newSize isPoint ifFalse:[
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5629
            self warn:'please enter the new size as ''x @ y''.'.
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5630
            ^ self.    
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5631
        ].
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5632
        imageEditView magnifyImageTo:newSize.
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5633
    ].
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5634
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5635
    self updateInfoLabel
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5636
!
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5637
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5638
doMagnifyImageBy
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5639
    "magnifies the current image (by a scale)"
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5640
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5641
    |box oldSize newSize scaleString scale image|
1479
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5642
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5643
    image := imageEditView image.
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5644
    oldSize := image extent.
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5645
2260
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5646
    scaleString := Dialog 
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5647
                   request:(resources string:'Scale factor (<1 to shrink; >1 to magnify):') 
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5648
                   initialAnswer:'1'
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5649
                   list:#('0.25' '0.5' '2' '4').     
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5650
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5651
"/    box := EnterBox new.
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5652
"/    box title:(resources string:'Scale factor (<1 to shrink; >1 to magnify):').
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5653
"/    box okText:(resources string:'OK').
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5654
"/    box abortText:(resources string:'Cancel').
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5655
"/    box initialText:1 printString.
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5656
"/    box showAtPointer.
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5657
"/    box accepted ifTrue:[
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5658
"/        scaleString := box contents.
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5659
"/    ].
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5660
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5661
    scale := Object readFromString:scaleString onError:nil.
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5662
9a6345ae1c56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  5663
    scale notNil ifTrue:[
1479
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5664
        scale isNumber ifFalse:[
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5665
            self warn:'please enter a scale factor (<1 to shrink; >1 to magnify).'.
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5666
            ^ self.    
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5667
        ].
18f7b6cc2514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  5668
        newSize := oldSize * scale.
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5669
        imageEditView magnifyImageTo:newSize.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5670
    ].
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5671
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5672
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  5673
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5674
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5675
doMagnifyUp
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  5676
    "magnifies the current image one step up"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5677
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5678
    |magHolder mag|
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5679
1987
3889bd6912fb valueOf* methods renamed
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  5680
    magHolder := self magnificationHolder.
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5681
    (mag := magHolder value) < 99 ifTrue: [
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5682
        magHolder value: mag + 1
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5683
    ]
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5684
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  5685
    "Modified: / 26.7.1998 / 20:23:52 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5686
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5687
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5688
doNegativeImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5689
    "negates current image by negating the color map"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5690
1598
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  5691
    self image depth ~~ 1 ifTrue:[
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  5692
        Dialog warn:'Only useful for depth 1 images'.
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  5693
        ^ self
d748419672a3 more colormap operations
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  5694
    ].
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  5695
    imageEditView negativeImage.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5696
    self listOfColors removeAll.
901
ce482227787d several undos
tz
parents: 900
diff changeset
  5697
    self findColorMapMode.     
2585
c6150678bc9f menu reorg
Claus Gittinger <cg@exept.de>
parents: 2576
diff changeset
  5698
    "/ imageEditView removelastUndo
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5699
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5700
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5701
doResizeImage
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5702
    "resizes the current image"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5703
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5704
    |box newSize image|
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5705
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5706
    image := imageEditView image.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5707
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5708
    box := EnterBox new.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5709
    box title:(resources string:'Images new size:').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5710
    box okText:(resources string:'OK').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5711
    box abortText:(resources string:'Cancel').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5712
    box initialText:image extent printString.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5713
    box showAtPointer.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5714
    (box accepted 
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5715
    and: [(newSize := self pointFromString:(box contents)) notNil])
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5716
    ifTrue:[
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5717
        imageEditView resizeImageTo:newSize.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5718
    ].
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5719
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5720
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5721
doRotateImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5722
    "rotates current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5723
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5724
    |box rotation|
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5725
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5726
    box := EnterBox new.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5727
    box title:(resources string:'Rotate by (degrees, clockwise):').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5728
    box okText:(resources string:'OK').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5729
    box abortText:(resources string:'Cancel').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5730
    box initialText: '0'.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5731
    box showAtPointer.
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5732
    (box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil])
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5733
    ifTrue:[
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5734
        imageEditView rotateImageBy:rotation.
1558
3848cbaaf6d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1557
diff changeset
  5735
        self updateInfoLabel.
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5736
    ].
2196
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5737
7e4e066ca7f5 rotation; text input
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
  5738
    "Modified: / 11-11-2007 / 13:21:11 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5739
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5740
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5741
doShiftManual
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5742
    "let user specify amount and shift"
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5743
1713
088ff38c03a5 shift + wrap
Claus Gittinger <cg@exept.de>
parents: 1708
diff changeset
  5744
    |bindings amount img firstChange shiftAction acceptChannel wrapHolder|
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5745
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5746
    acceptChannel := TriggerValue new.
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5747
    wrapHolder := (lastShiftUsedWrap ? true) asValue.
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5748
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5749
    firstChange := true.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5750
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5751
    shiftAction := 
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5752
        [:shiftH :shiftV | 
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5753
            acceptChannel value:true.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5754
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5755
            img := imageEditView image.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5756
            firstChange ifTrue:[
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5757
                imageEditView makeUndo.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5758
                firstChange := false.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5759
            ].
1713
088ff38c03a5 shift + wrap
Claus Gittinger <cg@exept.de>
parents: 1708
diff changeset
  5760
            imageEditView shiftImageHorizontal:(shiftH value) vertical:(shiftV value) wrap:(wrapHolder value).
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5761
            self updateInfoLabel
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5762
        ].
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5763
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5764
    bindings := IdentityDictionary new.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5765
    bindings at:#shiftAmount put:(amount := 1 asValue).
1713
088ff38c03a5 shift + wrap
Claus Gittinger <cg@exept.de>
parents: 1708
diff changeset
  5766
    bindings at:#wrap put:wrapHolder.
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5767
    bindings at:#acceptChannel put:acceptChannel.
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5768
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5769
    bindings at:#shiftLeftNow   put:[ shiftAction value:(-1*amount value) value:0 ].
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5770
    bindings at:#shiftRightNow  put:[ shiftAction value:amount value value:0 ].
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5771
    bindings at:#shiftUpNow     put:[ shiftAction value:0 value:(-1*amount value) ].
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5772
    bindings at:#shiftDownNow   put:[ shiftAction value:0 value:amount value ].
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5773
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5774
    (self openDialogInterface:#shiftDialogSpec withBindings:bindings) 
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5775
    ifFalse:[ 
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5776
        firstChange ~~ true ifTrue:[
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5777
          imageEditView undo
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5778
        ]
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5779
    ].
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5780
    lastShiftUsedWrap := wrapHolder value.
1557
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5781
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5782
    "Created: / 7.9.1998 / 18:16:07 / cg"
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5783
    "Modified: / 7.9.1998 / 18:20:42 / cg"
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5784
!
78409b670c85 added shift operation
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  5785
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5786
doUnCropManual
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5787
    "let user specify borders and add them"
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5788
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5789
    |bindings left top right bottom img|
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5790
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5791
    bindings := IdentityDictionary new.
1704
3e0e31541f2e doUngropManual -> default, border 1
tm
parents: 1703
diff changeset
  5792
    bindings at:#left put:(left := 1 asValue).
3e0e31541f2e doUngropManual -> default, border 1
tm
parents: 1703
diff changeset
  5793
    bindings at:#right put:(right := 1 asValue).
3e0e31541f2e doUngropManual -> default, border 1
tm
parents: 1703
diff changeset
  5794
    bindings at:#top put:(top := 1 asValue).
3e0e31541f2e doUngropManual -> default, border 1
tm
parents: 1703
diff changeset
  5795
    bindings at:#bottom put:(bottom := 1 asValue).
1740
5c0b60e76676 Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents: 1734
diff changeset
  5796
    (self openDialogInterface:#uncropDialogSpec withBindings:bindings)
1480
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5797
    ifTrue:[
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5798
        left := left value.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5799
        right := right value.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5800
        top := top value.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5801
        bottom := bottom value.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5802
        img := imageEditView image.
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5803
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5804
        imageEditView
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5805
            makeBorderedImageX:left y:top 
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5806
            width:(img width + left + right)
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5807
            height:(img height + top + bottom).
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5808
        self updateInfoLabel
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5809
    ].
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5810
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5811
    "Created: / 7.9.1998 / 18:16:07 / cg"
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5812
    "Modified: / 7.9.1998 / 18:20:42 / cg"
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5813
!
43c18932d2e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  5814
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5815
doUndo
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5816
    "reverses last edit action"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5817
1436
180804d7c28f added make grayScale
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  5818
    imageEditView undo.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5819
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  5820
1715
9eebdb3802aa method category rename
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  5821
!ImageEditor methodsFor:'user actions-loading'!
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5822
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5823
doLoadFromClass
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5824
    "opens a dialog for loading an image from class and a (resource-) selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5825
1122
66e895f34b9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1121
diff changeset
  5826
    |img|
66e895f34b9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1121
diff changeset
  5827
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5828
    self checkModified ifFalse:[ ^ self ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5829
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  5830
    (imageEditView loadFromClass) notNil ifTrue:[
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  5831
        imageSeqNr := nil.
1122
66e895f34b9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1121
diff changeset
  5832
        (img := self image) notNil ifTrue: [
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  5833
            self updateColorsFromImage:img.
574
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  5834
            self findColorMapMode.
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  5835
            self updateLabelsAndHistory.
1054
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  5836
        ] ifFalse: [
ef98bc11d1fd addColor
Claus Gittinger <cg@exept.de>
parents: 1053
diff changeset
  5837
            self updateForNoImage
1376
ce3cf26e201e change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  5838
        ].
449
dac8dc1f9dc8 if none image found for loading clear all
tz
parents: 444
diff changeset
  5839
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5840
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5841
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5842
doLoadFromFile
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5843
    "opens a dialog for loading an image from a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5844
1922
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  5845
    |img file filters|
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5846
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5847
    self checkModified ifFalse:[ ^ self ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5848
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  5849
    imageSeqNr := nil.
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5850
    img := self image.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5851
    img notNil ifTrue: [
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5852
        file := img fileName
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5853
    ].
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5854
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5855
    filters := FileSelectionBrowser loadImageFileNameFilters.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5856
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5857
    file notNil ifTrue:[
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5858
        file := FileSelectionBrowser
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5859
                    request:'Load Image From'
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5860
                    fileName:file
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5861
                    withFileFilters:filters.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5862
    ] ifFalse:[
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5863
        file := FileSelectionBrowser
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5864
                    request:'Load Image From'
1922
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  5865
                    inDirectory:LastDirectory
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5866
                    withFileFilters:filters.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5867
    ].
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5868
    file notNil ifTrue:[
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5869
        LastDirectory := file asFilename directoryName.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5870
        self loadFromFile:file
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  5871
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5872
!
228524287573 intitial checkin
tz
parents:
diff changeset
  5873
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5874
doNewImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5875
    "opens a dialog with choices of size and color map for creating a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5876
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5877
    |dialogAspects width height cMapString cMapMode cMap imageClass image szString defaultSize ext|
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5878
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5879
    self checkModified ifFalse:[ ^ self ].
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5880
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5881
    defaultSize := (self class listOfDefaultSizes includes:'32x32') 
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5882
                        ifTrue:['32x32'] 
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5883
                        ifFalse:[self class listOfDefaultSizes first].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5884
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5885
    dialogAspects  := IdentityDictionary new
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5886
        at:#listOfSizes         put: self class listOfDefaultSizes asValue;
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5887
        at:#listOfColorMaps     put: self class namesOfColorMaps values asSortedCollection asValue;
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5888
        at:#selectionOfSize     put: (LastSizeString ? defaultSize) asValue;
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5889
        at:#selectionOfColorMap put: (LastColormapMode ? self class namesOfColorMaps values asSortedCollection first) asValue;
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5890
        yourself.
228524287573 intitial checkin
tz
parents:
diff changeset
  5891
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5892
    (self openDialogInterface:#dialogSpecForNewImage withBindings:dialogAspects)
1383
179597c2abed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
  5893
    ifTrue:[
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5894
        szString := (dialogAspects at:#selectionOfSize) value.
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5895
        ext := self pointFromString:szString.
1962
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  5896
        ext isNil ifTrue:[
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  5897
            width := height := 32
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  5898
        ] ifFalse:[
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  5899
            width := ext x.
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  5900
            height := ext y.
9166ba3ce7c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  5901
        ].
1960
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5902
"/        width  := "128 min: "(Integer readFromString: (szString upTo: $x) onError:[32]).
62c7258f3c31 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  5903
"/        height := "128 min: " (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[32]).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5904
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5905
        cMapString := (dialogAspects at:#selectionOfColorMap) value.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5906
        cMapMode   := self class namesOfColorMaps keyAtEqualValue:cMapString.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5907
        cMap       := self class listOfColorMaps at:cMapMode.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5908
        imageClass := Image implementorForDepth:(cMap size highBit-1).
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5909
        image      := imageClass width: width height: height.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5910
        image bits:(ByteArray new:(image bytesPerRow*height)).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5911
1637
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  5912
        LastSizeString := szString.
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  5913
        LastColormapMode := cMapString.
2b0f24d74f8e new ui-layout
Claus Gittinger <cg@exept.de>
parents: 1613
diff changeset
  5914
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5915
        (cMapMode startsWith: 'mask') ifTrue:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5916
            image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5917
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  5918
        image colorMap: cMap.
1847
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5919
        (imageEditView image: image) notNil ifTrue:[
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5920
            self updateListOfColorsAndColormapMode.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5921
            self updateLabelsAndHistory.
d7e8ec4f3696 partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  5922
        ].
400
228524287573 intitial checkin
tz
parents:
diff changeset
  5923
        image fillRectangleX:0 y:0 width:width height:height with:Color white.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  5924
    ]
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  5925
!
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  5926
2058
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5927
doNewImageEditor
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5928
    "opens a new image editor"
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5929
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5930
    ImageEditor open
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5931
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5932
    "Created: / 17-08-2006 / 09:03:14 / cg"
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5933
!
584f6f6bb171 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  5934
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5935
doNewImageFromClipboard
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5936
    |image|
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5937
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5938
    self checkModified ifFalse:[ ^ self ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5939
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5940
    image := imageEditView clipBoard.
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5941
    imageEditView image:image.
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5942
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5943
    image notNil ifTrue:[
1900
41ba86fb1087 cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
  5944
        self updateColorsFromImage:image.
1682
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5945
        self findColorMapMode.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5946
        self updateLabelsAndHistory.
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5947
    ]
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5948
!
f1b2491c9dc2 color: make darker/brighter
Claus Gittinger <cg@exept.de>
parents: 1656
diff changeset
  5949
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  5950
grabScreenImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  5951
    "let user choose an area and grab that are for editing"
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  5952
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5953
    self grabScreenImageUsing:[ 
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5954
        |r|
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5955
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5956
        [Screen current leftButtonPressed] whileTrue:[Delay waitForSeconds:0.05].
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5957
        r := Rectangle fromUser.
2708
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5958
        (r width == 0 or:[r height == 0]) ifTrue:[
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5959
            nil
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5960
        ] ifFalse:[
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5961
            lastGrabbedScreenArea := r.
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5962
            Image fromScreen:r
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5963
        ]
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5964
    ].
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5965
!
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5966
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5967
grabScreenImageFromLastArea
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5968
    "grab again from the previous area for editing"
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5969
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5970
    self grabScreenImageUsing:[ 
2708
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5971
        Image fromScreen:lastGrabbedScreenArea
2707
6610854318eb remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents: 2704
diff changeset
  5972
    ].
2701
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  5973
!
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  5974
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  5975
grabScreenImageUsing:aBlock
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  5976
    "let user choose an area and grab that are for editing"
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  5977
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5978
    self checkModified ifFalse:[ ^ self ].
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  5979
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5980
    Processor 
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5981
        addTimedBlock:[
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  5982
            |image d8image img|
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  5983
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  5984
            imageSeqNr := nil.
2701
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  5985
            image := aBlock value.
2708
c180af16b1b3 changed:
Claus Gittinger <cg@exept.de>
parents: 2707
diff changeset
  5986
            image notNil ifTrue:[
1121
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5987
                image depth > 8 ifTrue:[
2420
14678b9fea60 grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents: 2375
diff changeset
  5988
false ifTrue:[
1687
f4543a556b89 Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 1682
diff changeset
  5989
                    Error handle:[:ex | |sig|
1537
e86a686eeba2 class based exceptions - no longer need to send #haltSígnal
Claus Gittinger <cg@exept.de>
parents: 1507
diff changeset
  5990
                        (sig := ex signal) == HaltInterrupt ifTrue:[ex reject].
1122
66e895f34b9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1121
diff changeset
  5991
                        sig == Signal noHandlerSignal ifTrue:[ex reject].
1121
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5992
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5993
                        self warn:'Could not convert to depth8 image (too many colors)'.
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5994
                        d8image := nil.
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5995
                    ] do:[
2420
14678b9fea60 grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents: 2375
diff changeset
  5996
                        d8image := Depth8Image fromImage:image photometric:#palette.
1121
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5997
                    ].
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5998
                    d8image notNil ifTrue:[
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  5999
                        image := d8image
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6000
                    ]
2420
14678b9fea60 grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents: 2375
diff changeset
  6001
].
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  6002
                ].
1121
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6003
                (imageEditView image:image) notNil ifTrue:[
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6004
                    self listOfColors contents:(image colorMap).
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6005
                    self findColorMapMode.
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6006
                    self updateLabelsAndHistory.
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  6007
                ]
1121
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6008
             ] 
9ceac76e1c8d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
  6009
        ] 
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  6010
        afterSeconds:1
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  6011
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  6012
    "Created: / 29.7.1998 / 21:24:42 / cg"
1537
e86a686eeba2 class based exceptions - no longer need to send #haltSígnal
Claus Gittinger <cg@exept.de>
parents: 1507
diff changeset
  6013
    "Modified: / 16.11.2001 / 16:21:19 / cg"
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6014
!
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6015
2701
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6016
grabWindowImage
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6017
    "let user choose an area and grab that are for editing"
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6018
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6019
    self grabScreenImageUsing:[
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6020
        |v|
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6021
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6022
        (v := Screen current viewFromUser) notNil ifTrue:[
2704
0791984eef02 changed: #grabWindowImage
Claus Gittinger <cg@exept.de>
parents: 2701
diff changeset
  6023
            v topView raise.
0791984eef02 changed: #grabWindowImage
Claus Gittinger <cg@exept.de>
parents: 2701
diff changeset
  6024
            v topView makeFullyVisible.
0791984eef02 changed: #grabWindowImage
Claus Gittinger <cg@exept.de>
parents: 2701
diff changeset
  6025
            Delay waitForSeconds:0.5.   "/ give view a chance to redraw itself.
2701
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6026
            Image fromView:(v topView)
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6027
        ].
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6028
    ].
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6029
!
5abe05ebb370 added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents: 2663
diff changeset
  6030
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6031
nextImageInSequence
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6032
    "display the next image in the image sequence"
1383
179597c2abed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
  6033
    |img seq frame listOfColors|
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6034
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6035
    imageEditView releaseUndos.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6036
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6037
    seq := self image imageSequence.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6038
    imageSeqNr isNil ifTrue:[
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6039
        imageSeqNr := 1.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6040
    ].
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6041
    imageSeqNr := imageSeqNr + 1.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6042
    imageSeqNr > seq size ifTrue:[
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6043
        self information:'Back to first image in sequence'.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6044
        imageSeqNr := 1.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6045
    ].
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6046
    frame := seq at:imageSeqNr.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6047
    imageEditView image:(frame image).
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6048
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6049
    (img := self image) notNil ifTrue:[          
1383
179597c2abed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
  6050
        listOfColors := self listOfColors.
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6051
        img colorMap notNil ifTrue:[
1383
179597c2abed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
  6052
            listOfColors contents:(img usedColors asSet asOrderedCollection).
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6053
        ] ifFalse:[
1383
179597c2abed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
  6054
            listOfColors removeAll.
1380
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6055
        ].
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6056
        self findColorMapMode.     
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6057
        self updateLabelsAndHistory.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6058
        img := img onDevice:device.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6059
        imageEditView image:img.
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6060
    ] ifFalse:[
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6061
        self updateForNoImage
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6062
    ].
9787c42843c2 allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
  6063
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6064
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  6065
1715
9eebdb3802aa method category rename
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  6066
!ImageEditor methodsFor:'user actions-saving'!
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6067
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6068
doPrint
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6069
    "prints current image on the current printer"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6070
1734
98ebea4111f9 waitCursor while printing
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  6071
    self withWaitCursorDo:[
98ebea4111f9 waitCursor while printing
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  6072
        imageEditView print
98ebea4111f9 waitCursor while printing
Claus Gittinger <cg@exept.de>
parents: 1728
diff changeset
  6073
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6074
!
228524287573 intitial checkin
tz
parents:
diff changeset
  6075
1613
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6076
doSaveButtonImageToFileAs
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6077
    "opens a dialog for saving current image to a file"
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6078
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6079
    imageEditView saveButtonImageToFileAs.
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6080
    self updateLabelsAndHistory.
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6081
!
1d4f11252d3b saveAsButtonImage added
ca
parents: 1611
diff changeset
  6082
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6083
doSaveImageFile
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6084
    "saves current image to current file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6085
1481
32f1fd9d0f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  6086
    imageEditView save.
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  6087
    self clearModified.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6088
!
228524287573 intitial checkin
tz
parents:
diff changeset
  6089
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6090
doSaveImageFileAs
1922
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6091
    "opens a dialog for saving an image to a file"
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6092
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6093
    |img file filters|
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6094
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6095
    img := self image.
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6096
    img notNil ifTrue: [
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6097
        file := img fileName
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6098
    ].
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6099
2595
e1eeda9d1639 changed: #doSaveImageFileAs
Claus Gittinger <cg@exept.de>
parents: 2592
diff changeset
  6100
    filters := FileSelectionBrowser saveImageFileNameFilters.
1922
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6101
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6102
    file notNil ifTrue:[
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6103
        file := FileSelectionBrowser
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6104
                    request:'Save Image To'
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6105
                    fileName:file
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6106
                    withFileFilters:filters.
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6107
    ] ifFalse:[
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6108
        file := FileSelectionBrowser
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6109
                    request:'Save Image To'
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6110
                    inDirectory:LastDirectory
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6111
                    withFileFilters:filters.
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6112
    ].
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6113
    file notNil ifTrue:[
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6114
        imageEditView saveImageFileAs:file.
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6115
        LastDirectory := file asFilename directoryName.
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6116
        self updateLabelsAndHistory.
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  6117
        self clearModified.
1922
a693dc9af82f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1921
diff changeset
  6118
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6119
!
228524287573 intitial checkin
tz
parents:
diff changeset
  6120
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6121
doSaveImageMaskFileAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6122
    "opens a dialog for saving mask of current image to a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6123
1481
32f1fd9d0f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  6124
    imageEditView saveImageMaskFileAs.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6125
!
228524287573 intitial checkin
tz
parents:
diff changeset
  6126
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6127
doSaveMethod
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6128
    "saves the image in current class and selector"
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6129
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6130
    imageEditView saveMethod ifTrue:[
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  6131
        self updateLabelsAndHistory.
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  6132
        self clearModified.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6133
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  6134
!
228524287573 intitial checkin
tz
parents:
diff changeset
  6135
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6136
doSaveMethodAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  6137
    "opens a dialog for saving current image on a class and a selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6138
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6139
    imageEditView saveMethodAs ifTrue:[
2006
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  6140
        self updateLabelsAndHistory.
ae6fe65e9f33 embedding as special editors
Claus Gittinger <cg@exept.de>
parents: 1998
diff changeset
  6141
        self clearModified.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6142
    ]
1309
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6143
!
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6144
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6145
doShowStoreString
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6146
    "opens a dialog showing the storeString
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6147
     (sometimes useful to embed an image into source code)"
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6148
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6149
    |img|
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6150
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6151
    img := imageEditView image.
0a45ef81b47e added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  6152
    TextBox openOn:img storeString
1975
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6153
!
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6154
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6155
save
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6156
    "saves current image on current class and selector"
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6157
14b7babca4f5 code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
  6158
    self doSaveMethod
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6159
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  6160
1715
9eebdb3802aa method category rename
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  6161
!ImageEditor methodsFor:'user actions-settings'!
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6162
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6163
doChangeGridMagnification
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6164
    "change grid magnification"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6165
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6166
    |box oldGridLimit newGridLimit|
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6167
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6168
    oldGridLimit := imageEditView class gridMagnificationLimit asPoint.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6169
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6170
    box := EnterBox new.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6171
    box title:(resources string:'Grid Magnification Limit:').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6172
    box okText:(resources string:'OK').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6173
    box abortText:(resources string:'Cancel').
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6174
    box initialText:(oldGridLimit x printString).
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6175
    box showAtPointer.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6176
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6177
    (box accepted 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6178
    and: [(newGridLimit := Number readFromString:(box contents) onError:[2]) notNil]
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6179
    ) ifTrue:[
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6180
        newGridLimit := (99 min: (2 max:newGridLimit)) asPoint.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6181
        imageEditView class gridMagnificationLimit:newGridLimit.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6182
        imageEditView invalidate
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6183
    ]
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6184
2192
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  6185
!
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  6186
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  6187
penWidth:n
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  6188
    imageEditView penWidth:n
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  6189
398c9aba6588 pen width
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
  6190
    "Created: / 01-11-2007 / 23:47:48 / cg"
2375
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  6191
!
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  6192
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  6193
spraySpot:n
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  6194
    imageEditView spraySpot:n
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  6195
c775c95566b9 +spray and circle
Claus Gittinger <cg@exept.de>
parents: 2354
diff changeset
  6196
    "Created: / 01-11-2007 / 23:47:48 / cg"
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6197
! !
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1345
diff changeset
  6198
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6199
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
  6200
228524287573 intitial checkin
tz
parents:
diff changeset
  6201
version
228524287573 intitial checkin
tz
parents:
diff changeset
  6202
    ^ '$Header$'
2590
9f2cb061d07f changed: #menuToolbar
Claus Gittinger <cg@exept.de>
parents: 2585
diff changeset
  6203
!
9f2cb061d07f changed: #menuToolbar
Claus Gittinger <cg@exept.de>
parents: 2585
diff changeset
  6204
9f2cb061d07f changed: #menuToolbar
Claus Gittinger <cg@exept.de>
parents: 2585
diff changeset
  6205
version_CVS
9f2cb061d07f changed: #menuToolbar
Claus Gittinger <cg@exept.de>
parents: 2585
diff changeset
  6206
    ^ '$Header$'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  6207
! !