ImageEditor.st
changeset 1124 2392df0934bc
parent 1123 7979a71001d0
child 1146 5645240fdc25
equal deleted inserted replaced
1123:7979a71001d0 1124:2392df0934bc
   859      (Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp
   859      (Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp
   860     "
   860     "
   861 
   861 
   862     <resource: #menu>
   862     <resource: #menu>
   863 
   863 
   864     ^
   864     ^ 
   865      
   865      #(#Menu
   866        #(#Menu
   866         #(
   867           
   867          #(#MenuItem
   868            #(
   868             #label: 'About'
   869              #(#MenuItem
   869             #translateLabel: true
   870                 #label: 'About'
   870             #activeHelpKey: #about
   871                 #translateLabel: true
   871             #labelImage: #(#ResourceRetriever nil #menuIcon)
   872                 #activeHelpKey: #about
   872             #submenuChannel: #menuAbout
   873                 #labelImage: #(#ResourceRetriever nil #menuIcon)
   873           )
   874                 #submenuChannel: #menuAbout
   874          #(#MenuItem
       
   875             #label: 'File'
       
   876             #translateLabel: true
       
   877             #activeHelpKey: #file
       
   878             #submenu: 
       
   879            #(#Menu
       
   880               #(
       
   881                #(#MenuItem
       
   882                   #label: 'New...'
       
   883                   #translateLabel: true
       
   884                   #value: #doNewImage
       
   885                   #activeHelpKey: #fileNewImage
       
   886                 )
       
   887                #(#MenuItem
       
   888                   #label: '-'
       
   889                 )
       
   890                #(#MenuItem
       
   891                   #label: 'Load...'
       
   892                   #translateLabel: true
       
   893                   #value: #doLoadFromClass
       
   894                   #activeHelpKey: #fileLoadFromClass
       
   895                 )
       
   896                #(#MenuItem
       
   897                   #label: 'Load From File...'
       
   898                   #translateLabel: true
       
   899                   #value: #doLoadFromFile
       
   900                   #activeHelpKey: #fileLoadFromFile
       
   901                 )
       
   902                #(#MenuItem
       
   903                   #label: 'Grab From Screen'
       
   904                   #translateLabel: true
       
   905                   #value: #grabScreenImage
       
   906                   #activeHelpKey: #fileGrabImage
       
   907                 )
       
   908                #(#MenuItem
       
   909                   #label: '-'
       
   910                 )
       
   911                #(#MenuItem
       
   912                   #label: 'Save'
       
   913                   #translateLabel: true
       
   914                   #value: #doSaveMethod
       
   915                   #activeHelpKey: #fileSaveMethod
       
   916                   #enabled: #imageIsLoadedAndClassDefined
       
   917                 )
       
   918                #(#MenuItem
       
   919                   #label: 'Save As...'
       
   920                   #translateLabel: true
       
   921                   #value: #doSaveMethodAs
       
   922                   #activeHelpKey: #fileSaveMethodAs
       
   923                   #enabled: #imageIsLoaded
       
   924                 )
       
   925                #(#MenuItem
       
   926                   #label: '-'
       
   927                 )
       
   928                #(#MenuItem
       
   929                   #label: 'Save To File...'
       
   930                   #translateLabel: true
       
   931                   #value: #doSaveImageFileAs
       
   932                   #activeHelpKey: #fileSaveAs
       
   933                   #enabled: #imageIsLoaded
       
   934                 )
       
   935                #(#MenuItem
       
   936                   #label: 'Save Mask To File...'
       
   937                   #translateLabel: true
       
   938                   #value: #doSaveImageMaskFileAs
       
   939                   #activeHelpKey: #fileSaveMaskAs
       
   940                   #enabled: #imageIsLoaded
       
   941                 )
       
   942                #(#MenuItem
       
   943                   #label: '-'
       
   944                 )
       
   945                #(#MenuItem
       
   946                   #label: 'Print'
       
   947                   #translateLabel: true
       
   948                   #value: #doPrint
       
   949                   #activeHelpKey: #filePrint
       
   950                   #enabled: #imageIsLoaded
       
   951                 )
       
   952                #(#MenuItem
       
   953                   #label: '-'
       
   954                 )
       
   955                #(#MenuItem
       
   956                   #label: 'Browse Class'
       
   957                   #translateLabel: true
       
   958                   #value: #doBrowseClass
       
   959                   #activeHelpKey: #fileBrowseClass
       
   960                   #enabled: #hasClassDefined
       
   961                 )
       
   962                #(#MenuItem
       
   963                   #label: '-'
       
   964                 )
       
   965                #(#MenuItem
       
   966                   #label: 'Exit'
       
   967                   #translateLabel: true
       
   968                   #value: #closeRequest
       
   969                   #activeHelpKey: #fileExit
       
   970                 )
       
   971                )
       
   972               nil
       
   973               nil
   875             )
   974             )
   876              #(#MenuItem
   975           )
   877                 #label: 'File'
   976          #(#MenuItem
   878                 #translateLabel: true
   977             #label: 'Edit'
   879                 #activeHelpKey: #file
   978             #translateLabel: true
   880                 #submenu: 
   979             #activeHelpKey: #edit
       
   980             #enabled: #imageIsLoaded
       
   981             #submenu: 
       
   982            #(#Menu
       
   983               #(
       
   984                #(#MenuItem
       
   985                   #label: 'Undo'
       
   986                   #translateLabel: true
       
   987                   #value: #doUndo
       
   988                   #activeHelpKey: #editUndo
       
   989                   #enabled: #valueOfCanUndo
       
   990                 )
       
   991                #(#MenuItem
       
   992                   #label: '-'
       
   993                 )
       
   994                #(#MenuItem
       
   995                   #label: 'Flip - Vertical'
       
   996                   #translateLabel: true
       
   997                   #value: #doFlipVertical
       
   998                   #activeHelpKey: #editFlipVertical
       
   999                 )
       
  1000                #(#MenuItem
       
  1001                   #label: 'Flip - Horizontal'
       
  1002                   #translateLabel: true
       
  1003                   #value: #doFlipHorizontal
       
  1004                   #activeHelpKey: #editFlipHorizontal
       
  1005                 )
       
  1006                #(#MenuItem
       
  1007                   #label: '-'
       
  1008                 )
       
  1009                #(#MenuItem
       
  1010                   #label: 'Resize...'
       
  1011                   #translateLabel: true
       
  1012                   #value: #doResizeImage
       
  1013                   #activeHelpKey: #editResize
       
  1014                 )
       
  1015                #(#MenuItem
       
  1016                   #label: 'Magnify...'
       
  1017                   #translateLabel: true
       
  1018                   #value: #doMagnifyImage
       
  1019                   #activeHelpKey: #editMagnifyImage
       
  1020                 )
       
  1021                #(#MenuItem
       
  1022                   #label: 'Rotate...'
       
  1023                   #translateLabel: true
       
  1024                   #value: #doRotateImage
       
  1025                   #activeHelpKey: #editRotate
       
  1026                 )
       
  1027                #(#MenuItem
       
  1028                   #label: '-'
       
  1029                 )
       
  1030                #(#MenuItem
       
  1031                   #label: 'Crop'
       
  1032                   #translateLabel: true
       
  1033                   #submenu: 
   881                  #(#Menu
  1034                  #(#Menu
   882                     
  1035                     #(
   883                      #(
  1036                      #(#MenuItem
   884                        #(#MenuItem
  1037                         #label: 'All'
   885                           #label: 'New...'
  1038                         #translateLabel: true
   886                           #translateLabel: true
  1039                         #value: #doCropAll
   887                           #value: #doNewImage
  1040                         #activeHelpKey: #cropAll
   888                           #activeHelpKey: #fileNewImage
       
   889                       )
  1041                       )
   890                        #(#MenuItem
  1042                      #(#MenuItem
   891                           #label: '-'
  1043                         #label: '-'
   892                       )
  1044                       )
   893                        #(#MenuItem
  1045                      #(#MenuItem
   894                           #label: 'Load...'
  1046                         #label: 'Left'
   895                           #translateLabel: true
  1047                         #translateLabel: true
   896                           #value: #doLoadFromClass
  1048                         #value: #doCropLeft
   897                           #activeHelpKey: #fileLoadFromClass
  1049                         #activeHelpKey: #cropLeft
   898                       )
  1050                       )
   899                        #(#MenuItem
  1051                      #(#MenuItem
   900                           #label: 'Load From File...'
  1052                         #label: 'Right'
   901                           #translateLabel: true
  1053                         #translateLabel: true
   902                           #value: #doLoadFromFile
  1054                         #value: #doCropRight
   903                           #activeHelpKey: #fileLoadFromFile
  1055                         #activeHelpKey: #cropRight
   904                       )
  1056                       )
   905                        #(#MenuItem
  1057                      #(#MenuItem
   906                           #label: 'Grab From Screen'
  1058                         #label: 'Top'
   907                           #translateLabel: true
  1059                         #translateLabel: true
   908                           #value: #grabScreenImage
  1060                         #value: #doCropTop
   909                           #activeHelpKey: #fileGrabImage
  1061                         #activeHelpKey: #cropTop
   910                       )
  1062                       )
   911                        #(#MenuItem
  1063                      #(#MenuItem
   912                           #label: '-'
  1064                         #label: 'Bottom'
       
  1065                         #translateLabel: true
       
  1066                         #value: #doCropBottom
       
  1067                         #activeHelpKey: #cropBottom
   913                       )
  1068                       )
   914                        #(#MenuItem
  1069                      #(#MenuItem
   915                           #label: 'Save'
  1070                         #label: '-'
   916                           #translateLabel: true
       
   917                           #value: #doSaveMethod
       
   918                           #activeHelpKey: #fileSaveMethod
       
   919                           #enabled: #imageIsLoadedAndClassDefined
       
   920                       )
  1071                       )
   921                        #(#MenuItem
  1072                      #(#MenuItem
   922                           #label: 'Save As...'
  1073                         #label: 'Manual...'
   923                           #translateLabel: true
  1074                         #translateLabel: true
   924                           #value: #doSaveMethodAs
  1075                         #value: #doCropManual
   925                           #activeHelpKey: #fileSaveMethodAs
  1076                         #activeHelpKey: #cropManual
   926                           #enabled: #imageIsLoaded
       
   927                       )
  1077                       )
   928                        #(#MenuItem
  1078                      )
   929                           #label: '-'
       
   930                       )
       
   931                        #(#MenuItem
       
   932                           #label: 'Save To File...'
       
   933                           #translateLabel: true
       
   934                           #value: #doSaveImageFileAs
       
   935                           #activeHelpKey: #fileSaveAs
       
   936                           #enabled: #imageIsLoaded
       
   937                       )
       
   938                        #(#MenuItem
       
   939                           #label: 'Save Mask To File...'
       
   940                           #translateLabel: true
       
   941                           #value: #doSaveImageMaskFileAs
       
   942                           #activeHelpKey: #fileSaveMaskAs
       
   943                           #enabled: #imageIsLoaded
       
   944                       )
       
   945                        #(#MenuItem
       
   946                           #label: '-'
       
   947                       )
       
   948                        #(#MenuItem
       
   949                           #label: 'Print'
       
   950                           #translateLabel: true
       
   951                           #value: #doPrint
       
   952                           #activeHelpKey: #filePrint
       
   953                           #enabled: #imageIsLoaded
       
   954                       )
       
   955                        #(#MenuItem
       
   956                           #label: '-'
       
   957                       )
       
   958                        #(#MenuItem
       
   959                           #label: 'Browse Class'
       
   960                           #translateLabel: true
       
   961                           #value: #doBrowseClass
       
   962                           #activeHelpKey: #fileBrowseClass
       
   963                           #enabled: #hasClassDefined
       
   964                       )
       
   965                        #(#MenuItem
       
   966                           #label: '-'
       
   967                       )
       
   968                        #(#MenuItem
       
   969                           #label: 'Exit'
       
   970                           #translateLabel: true
       
   971                           #value: #closeRequest
       
   972                           #activeHelpKey: #fileExit
       
   973                       )
       
   974                     ) nil
       
   975                     nil
  1079                     nil
   976                 )
  1080                     nil
       
  1081                   )
       
  1082                 )
       
  1083                )
       
  1084               nil
       
  1085               nil
   977             )
  1086             )
   978              #(#MenuItem
  1087           )
   979                 #label: 'Edit'
  1088          #(#MenuItem
   980                 #translateLabel: true
  1089             #label: 'ColorMap'
   981                 #activeHelpKey: #edit
  1090             #translateLabel: true
   982                 #enabled: #imageIsLoaded
  1091             #activeHelpKey: #colorMap
   983                 #submenu: 
  1092             #enabled: #imageIsLoaded
   984                  #(#Menu
  1093             #submenu: 
   985                     
  1094            #(#Menu
   986                      #(
  1095               #(
   987                        #(#MenuItem
  1096                #(#MenuItem
   988                           #label: 'Undo'
  1097                   #label: '8-Plane'
   989                           #translateLabel: true
  1098                   #translateLabel: true
   990                           #value: #doUndo
  1099                   #value: #colorMapMode:
   991                           #activeHelpKey: #editUndo
  1100                   #activeHelpKey: #colorMap8
   992                           #enabled: #valueOfCanUndo
  1101                   #argument: '8-plane'
   993                       )
  1102                   #choice: #colorMapMode
   994                        #(#MenuItem
  1103                   #choiceValue: '8-plane'
   995                           #label: '-'
  1104                 )
   996                       )
  1105                #(#MenuItem
   997                        #(#MenuItem
  1106                   #label: '4-Plane'
   998                           #label: 'Flip - Vertical'
  1107                   #translateLabel: true
   999                           #translateLabel: true
  1108                   #value: #colorMapMode:
  1000                           #value: #doFlipVertical
  1109                   #activeHelpKey: #colorMap4
  1001                           #activeHelpKey: #editFlipVertical
  1110                   #argument: '4-plane'
  1002                       )
  1111                   #choice: #colorMapMode
  1003                        #(#MenuItem
  1112                   #choiceValue: '4-plane'
  1004                           #label: 'Flip - Horizontal'
  1113                 )
  1005                           #translateLabel: true
  1114                #(#MenuItem
  1006                           #value: #doFlipHorizontal
  1115                   #label: '2-Plane'
  1007                           #activeHelpKey: #editFlipHorizontal
  1116                   #translateLabel: true
  1008                       )
  1117                   #value: #colorMapMode:
  1009                        #(#MenuItem
  1118                   #activeHelpKey: #colorMap2
  1010                           #label: '-'
  1119                   #argument: '2-plane'
  1011                       )
  1120                   #choice: #colorMapMode
  1012                        #(#MenuItem
  1121                   #choiceValue: '2-plane'
  1013                           #label: 'Resize...'
  1122                 )
  1014                           #translateLabel: true
  1123                #(#MenuItem
  1015                           #value: #doResizeImage
  1124                   #label: '1-Plane'
  1016                           #activeHelpKey: #editResize
  1125                   #translateLabel: true
  1017                       )
  1126                   #value: #colorMapMode:
  1018                        #(#MenuItem
  1127                   #activeHelpKey: #colorMap1
  1019                           #label: 'Magnify...'
  1128                   #argument: '1-plane'
  1020                           #translateLabel: true
  1129                   #choice: #colorMapMode
  1021                           #value: #doMagnifyImage
  1130                   #choiceValue: '1-plane'
  1022                           #activeHelpKey: #editMagnifyImage
  1131                 )
  1023                       )
  1132                #(#MenuItem
  1024                        #(#MenuItem
  1133                   #label: '-'
  1025                           #label: 'Rotate...'
  1134                 )
  1026                           #translateLabel: true
  1135                #(#MenuItem
  1027                           #value: #doRotateImage
  1136                   #label: '8-Plane + Mask'
  1028                           #activeHelpKey: #editRotate
  1137                   #translateLabel: true
  1029                       )
  1138                   #value: #colorMapMode:
  1030                        #(#MenuItem
  1139                   #activeHelpKey: #colorMap8M
  1031                           #label: '-'
  1140                   #argument: '8-plane + mask'
  1032                       )
  1141                   #choice: #colorMapMode
  1033                        #(#MenuItem
  1142                   #choiceValue: '8-plane + mask'
  1034                           #label: 'Crop'
  1143                 )
  1035                           #translateLabel: true
  1144                #(#MenuItem
  1036                           #submenu: 
  1145                   #label: '4-Plane + Mask'
  1037                            #(#Menu
  1146                   #translateLabel: true
  1038                               
  1147                   #value: #colorMapMode:
  1039                                #(
  1148                   #activeHelpKey: #colorMap4M
  1040                                  #(#MenuItem
  1149                   #argument: '4-plane + mask'
  1041                                     #label: 'All'
  1150                   #choice: #colorMapMode
  1042                                     #translateLabel: true
  1151                   #choiceValue: '4-plane + mask'
  1043                                     #value: #doCropAll
  1152                 )
  1044                                     #activeHelpKey: #cropAll
  1153                #(#MenuItem
  1045                                 )
  1154                   #label: '2-Plane + Mask'
  1046                                  #(#MenuItem
  1155                   #translateLabel: true
  1047                                     #label: '-'
  1156                   #value: #colorMapMode:
  1048                                 )
  1157                   #activeHelpKey: #colorMap2M
  1049                                  #(#MenuItem
  1158                   #argument: '2-plane + mask'
  1050                                     #label: 'Left'
  1159                   #choice: #colorMapMode
  1051                                     #translateLabel: true
  1160                   #choiceValue: '2-plane + mask'
  1052                                     #value: #doCropLeft
  1161                 )
  1053                                     #activeHelpKey: #cropLeft
  1162                #(#MenuItem
  1054                                 )
  1163                   #label: '1-Plane + Mask'
  1055                                  #(#MenuItem
  1164                   #translateLabel: true
  1056                                     #label: 'Right'
  1165                   #value: #colorMapMode:
  1057                                     #translateLabel: true
  1166                   #activeHelpKey: #colorMap1M
  1058                                     #value: #doCropRight
  1167                   #argument: '1-plane + mask'
  1059                                     #activeHelpKey: #cropRight
  1168                   #choice: #colorMapMode
  1060                                 )
  1169                   #choiceValue: '1-plane + mask'
  1061                                  #(#MenuItem
  1170                 )
  1062                                     #label: 'Top'
  1171                #(#MenuItem
  1063                                     #translateLabel: true
  1172                   #label: '-'
  1064                                     #value: #doCropTop
  1173                 )
  1065                                     #activeHelpKey: #cropTop
  1174                #(#MenuItem
  1066                                 )
  1175                   #label: 'Compress colormap'
  1067                                  #(#MenuItem
  1176                   #translateLabel: true
  1068                                     #label: 'Bottom'
  1177                   #value: #compressColorMap
  1069                                     #translateLabel: true
  1178                   #activeHelpKey: #compressColormap
  1070                                     #value: #doCropBottom
  1179                   #enabled: #hasColormap
  1071                                     #activeHelpKey: #cropBottom
  1180                 )
  1072                                 )
  1181                #(#MenuItem
  1073                                  #(#MenuItem
  1182                   #label: 'Sort colormap'
  1074                                     #label: '-'
  1183                   #translateLabel: true
  1075                                 )
  1184                   #value: #sortColorMap
  1076                                  #(#MenuItem
  1185                   #enabled: #hasColormap
  1077                                     #label: 'Manual...'
  1186                 )
  1078                                     #translateLabel: true
  1187                #(#MenuItem
  1079                                     #value: #doCropManual
  1188                   #label: '-'
  1080                                     #activeHelpKey: #cropManual
  1189                 )
  1081                                 )
  1190                #(#MenuItem
  1082                               ) nil
  1191                   #label: 'Reduce number of colors...'
  1083                               nil
  1192                   #translateLabel: true
  1084                           )
  1193                   #value: #reduceNumberOfColors
  1085                       )
  1194                 )
  1086                     ) nil
  1195                )
  1087                     nil
  1196               nil
  1088                 )
  1197               nil
  1089             )
  1198             )
  1090              #(#MenuItem
  1199           )
  1091                 #label: 'ColorMap'
  1200          #(#MenuItem
  1092                 #translateLabel: true
  1201             #label: 'Settings'
  1093                 #activeHelpKey: #colorMap
  1202             #translateLabel: true
  1094                 #enabled: #imageIsLoaded
  1203             #submenu: 
  1095                 #submenu: 
  1204            #(#Menu
  1096                  #(#Menu
  1205               #(
  1097                     
  1206                #(#MenuItem
  1098                      #(
  1207                   #label: 'Grid Magnification...'
  1099                        #(#MenuItem
  1208                   #translateLabel: true
  1100                           #label: '8-Plane'
  1209                   #value: #doChangeGridMagnification
  1101                           #translateLabel: true
  1210                   #activeHelpKey: #settingsGridMagnification
  1102                           #value: #colorMapMode:
  1211                 )
  1103                           #activeHelpKey: #colorMap8
  1212                )
  1104                           #argument: '8-plane'
  1213               nil
  1105                           #choice: #colorMapMode
  1214               nil
  1106                           #choiceValue: '8-plane'
       
  1107                       )
       
  1108                        #(#MenuItem
       
  1109                           #label: '4-Plane'
       
  1110                           #translateLabel: true
       
  1111                           #value: #colorMapMode:
       
  1112                           #activeHelpKey: #colorMap4
       
  1113                           #argument: '4-plane'
       
  1114                           #choice: #colorMapMode
       
  1115                           #choiceValue: '4-plane'
       
  1116                       )
       
  1117                        #(#MenuItem
       
  1118                           #label: '2-Plane'
       
  1119                           #translateLabel: true
       
  1120                           #value: #colorMapMode:
       
  1121                           #activeHelpKey: #colorMap2
       
  1122                           #argument: '2-plane'
       
  1123                           #choice: #colorMapMode
       
  1124                           #choiceValue: '2-plane'
       
  1125                       )
       
  1126                        #(#MenuItem
       
  1127                           #label: '1-Plane'
       
  1128                           #translateLabel: true
       
  1129                           #value: #colorMapMode:
       
  1130                           #activeHelpKey: #colorMap1
       
  1131                           #argument: '1-plane'
       
  1132                           #choice: #colorMapMode
       
  1133                           #choiceValue: '1-plane'
       
  1134                       )
       
  1135                        #(#MenuItem
       
  1136                           #label: '-'
       
  1137                       )
       
  1138                        #(#MenuItem
       
  1139                           #label: '8-Plane + Mask'
       
  1140                           #translateLabel: true
       
  1141                           #value: #colorMapMode:
       
  1142                           #activeHelpKey: #colorMap8M
       
  1143                           #argument: '8-plane + mask'
       
  1144                           #choice: #colorMapMode
       
  1145                           #choiceValue: '8-plane + mask'
       
  1146                       )
       
  1147                        #(#MenuItem
       
  1148                           #label: '4-Plane + Mask'
       
  1149                           #translateLabel: true
       
  1150                           #value: #colorMapMode:
       
  1151                           #activeHelpKey: #colorMap4M
       
  1152                           #argument: '4-plane + mask'
       
  1153                           #choice: #colorMapMode
       
  1154                           #choiceValue: '4-plane + mask'
       
  1155                       )
       
  1156                        #(#MenuItem
       
  1157                           #label: '2-Plane + Mask'
       
  1158                           #translateLabel: true
       
  1159                           #value: #colorMapMode:
       
  1160                           #activeHelpKey: #colorMap2M
       
  1161                           #argument: '2-plane + mask'
       
  1162                           #choice: #colorMapMode
       
  1163                           #choiceValue: '2-plane + mask'
       
  1164                       )
       
  1165                        #(#MenuItem
       
  1166                           #label: '1-Plane + Mask'
       
  1167                           #translateLabel: true
       
  1168                           #value: #colorMapMode:
       
  1169                           #activeHelpKey: #colorMap1M
       
  1170                           #argument: '1-plane + mask'
       
  1171                           #choice: #colorMapMode
       
  1172                           #choiceValue: '1-plane + mask'
       
  1173                       )
       
  1174                        #(#MenuItem
       
  1175                           #label: '-'
       
  1176                       )
       
  1177                        #(#MenuItem
       
  1178                           #label: 'Compress colormap'
       
  1179                           #translateLabel: true
       
  1180                           #value: #compressColorMap
       
  1181                           #activeHelpKey: #compressColormap
       
  1182                           #enabled: #hasColormap
       
  1183                       )
       
  1184                        #(#MenuItem
       
  1185                           #label: 'Sort colormap'
       
  1186                           #translateLabel: true
       
  1187                           #value: #sortColorMap
       
  1188                           #enabled: #hasColormap
       
  1189                       )
       
  1190                     ) nil
       
  1191                     nil
       
  1192                 )
       
  1193             )
  1215             )
  1194              #(#MenuItem
  1216           )
  1195                 #label: 'Settings'
  1217          #(#MenuItem
  1196                 #translateLabel: true
  1218             #label: 'History'
  1197                 #submenu: 
  1219             #translateLabel: true
  1198                  #(#Menu
  1220             #activeHelpKey: #history
  1199                     
  1221             #submenuChannel: #menuHistory
  1200                      #(
  1222           )
  1201                        #(#MenuItem
  1223          #(#MenuItem
  1202                           #label: 'Grid Magnification...'
  1224             #label: 'Help'
  1203                           #translateLabel: true
  1225             #translateLabel: true
  1204                           #value: #doChangeGridMagnification
  1226             #startGroup: #right
  1205                           #activeHelpKey: #settingsGridMagnification
  1227             #activeHelpKey: #help
  1206                       )
  1228             #submenuChannel: #menuHelp
  1207 "/                       #(#MenuItem
  1229           )
  1208 "/                          #label: '-'
  1230          )
  1209 "/                      )
  1231         nil
  1210 "/                       #(#MenuItem
  1232         nil
  1211 "/                          #label: 'Fonts'
       
  1212 "/                          #translateLabel: true
       
  1213 "/                          #submenuChannel: #menuFont
       
  1214 "/                      )
       
  1215                     ) nil
       
  1216                     nil
       
  1217                 )
       
  1218             )
       
  1219              #(#MenuItem
       
  1220                 #label: 'History'
       
  1221                 #translateLabel: true
       
  1222                 #activeHelpKey: #history
       
  1223                 #submenuChannel: #menuHistory
       
  1224             )
       
  1225              #(#MenuItem
       
  1226                 #label: 'Help'
       
  1227                 #translateLabel: true
       
  1228                 #startGroup: #right
       
  1229                 #activeHelpKey: #help
       
  1230                 #submenuChannel: #menuHelp
       
  1231             )
       
  1232           ) nil
       
  1233           nil
       
  1234       )
  1233       )
  1235 
       
  1236     "Modified: / 30.9.1998 / 23:53:12 / cg"
       
  1237 !
  1234 !
  1238 
  1235 
  1239 menuMouseButtonColors
  1236 menuMouseButtonColors
  1240     "This resource specification was automatically generated
  1237     "This resource specification was automatically generated
  1241      by the MenuEditor of ST/X."
  1238      by the MenuEditor of ST/X."
  1588             self image colorMap at:clrIndex put:(changedObject at:aParameter).
  1585             self image colorMap at:clrIndex put:(changedObject at:aParameter).
  1589             self colorMapChanged.
  1586             self colorMapChanged.
  1590             ^ self
  1587             ^ self
  1591         ].
  1588         ].
  1592     ].
  1589     ].
       
  1590 
       
  1591     changedObject == imageEditView undoImages ifTrue:[
       
  1592         self valueOfCanUndo value:(changedObject notEmpty).
       
  1593         ^ self.
       
  1594     ].
       
  1595 
  1593     super update:something with:aParameter from:changedObject
  1596     super update:something with:aParameter from:changedObject
  1594 
  1597 
  1595     "Modified: / 18.8.1998 / 17:18:42 / cg"
  1598     "Modified: / 18.8.1998 / 17:18:42 / cg"
  1596 !
  1599 !
  1597 
  1600 
  1944 postOpenWith:aBuilder
  1947 postOpenWith:aBuilder
  1945     "after opening, sets the masterApplication of the imageEditView to self;
  1948     "after opening, sets the masterApplication of the imageEditView to self;
  1946      evaluate the postOpenAction"
  1949      evaluate the postOpenAction"
  1947 
  1950 
  1948     imageEditView masterApplication: self.
  1951     imageEditView masterApplication: self.
       
  1952     imageEditView undoImages addDependent:self.
  1949     imageEditView imageInfoHolder:(self imageInfoHolder).
  1953     imageEditView imageInfoHolder:(self imageInfoHolder).
  1950     imageEditView activityInfoHolder:(self activityInfoHolder).
  1954     imageEditView activityInfoHolder:(self activityInfoHolder).
  1951 
  1955 
  1952     postOpenAction notNil ifTrue: [postOpenAction value].
  1956     postOpenAction notNil ifTrue: [postOpenAction value].
  1953 
  1957 
  2106                             mapping:nil.
  2110                             mapping:nil.
  2107                     ] ifFalse:[
  2111                     ] ifFalse:[
  2108                         oldImage depth == 8 ifTrue:[
  2112                         oldImage depth == 8 ifTrue:[
  2109                             tmpBits := oldImage bits
  2113                             tmpBits := oldImage bits
  2110                         ] ifFalse:[
  2114                         ] ifFalse:[
       
  2115                             colorMapMode value:prevMode.
  2111                             self warn:('Too many colors in image ( ', oldImage usedColors size printString , ').').
  2116                             self warn:('Too many colors in image ( ', oldImage usedColors size printString , ').').
  2112                             ^ self
  2117                             ^ self
  2113                         ]
  2118                         ]
  2114                     ].
  2119                     ].
  2115                     usageCounts := tmpBits usageCounts.
  2120                     usageCounts := tmpBits usageCounts.
  2329 
  2334 
  2330     "Created: / 28.7.1998 / 20:03:11 / cg"
  2335     "Created: / 28.7.1998 / 20:03:11 / cg"
  2331     "Modified: / 15.9.1998 / 17:53:32 / cg"
  2336     "Modified: / 15.9.1998 / 17:53:32 / cg"
  2332 !
  2337 !
  2333 
  2338 
       
  2339 reduceNumberOfColors
       
  2340     |s n anyChange img|
       
  2341 
       
  2342     s := Dialog request:'Number of color bits to strip (1-7) ?'.
       
  2343     s isNil ifTrue:[^ self].
       
  2344     n := Integer readFrom:s onError:0.
       
  2345     (n between:1 and:7) ifFalse:[
       
  2346         Dialog warn:'Image unchanged'.
       
  2347         ^ self
       
  2348     ].
       
  2349 
       
  2350     imageEditView makeUndo.
       
  2351     self withExecuteCursorDo:[
       
  2352         anyChange := imageEditView reduceColorResolutionBy:n.
       
  2353         anyChange ifFalse:[
       
  2354             Dialog warn:'Image unchanged'.
       
  2355         ] ifTrue:[
       
  2356             img := imageEditView image.
       
  2357             imageEditView image:img.
       
  2358             self listOfColors contents:(img colorMap).
       
  2359             self findColorMapMode.
       
  2360             self updateLabelsAndHistory.
       
  2361             Dialog information:(img usedColors size printString , ' colors used.')
       
  2362         ]
       
  2363     ].
       
  2364 !
       
  2365 
  2334 sortColorMap
  2366 sortColorMap
  2335     "calculates a new color map for the image, sorting colors"
  2367     "calculates a new color map for the image, sorting colors"
  2336 
  2368 
  2337     |depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| 
  2369     |depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| 
  2338 
  2370