502 #(#FullSpec |
502 #(#FullSpec |
503 #name: #gropDialogSpec |
503 #name: #gropDialogSpec |
504 #window: |
504 #window: |
505 #(#WindowSpec |
505 #(#WindowSpec |
506 #label: 'Crop Border(s)' |
506 #label: 'Crop Border(s)' |
507 #name: 'Crop Borders' |
507 #name: 'Crop Border(s)' |
508 #min: #(#Point 10 10) |
508 #min: #(#Point 10 10) |
509 #max: #(#Point 800 478) |
509 #max: #(#Point 800 478) |
510 #bounds: #(#Rectangle 16 46 261 229) |
510 #bounds: #(#Rectangle 16 46 261 229) |
511 ) |
511 ) |
512 #component: |
512 #component: |
565 #name: 'EntryField4' |
568 #name: 'EntryField4' |
566 #layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
569 #layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
567 #model: #bottom |
570 #model: #bottom |
568 #type: #number |
571 #type: #number |
569 #acceptOnPointerLeave: false |
572 #acceptOnPointerLeave: false |
|
573 #acceptChannel: #acceptChannel |
570 ) |
574 ) |
571 #(#HorizontalPanelViewSpec |
575 #(#HorizontalPanelViewSpec |
572 #name: 'HorizontalPanel1' |
576 #name: 'HorizontalPanel1' |
573 #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
577 #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
574 #horizontalLayout: #fitSpace |
578 #horizontalLayout: #fitSpace |
2951 ! |
2962 ! |
2952 |
2963 |
2953 doCropManual |
2964 doCropManual |
2954 "let user specify borders and cut them off" |
2965 "let user specify borders and cut them off" |
2955 |
2966 |
2956 |bindings left top right bottom img| |
2967 |bindings left top right bottom img firstChange applyAction acceptChannel| |
|
2968 |
|
2969 firstChange := true. |
|
2970 |
|
2971 applyAction := [ |
|
2972 |l r t b| |
|
2973 |
|
2974 acceptChannel value:true. |
|
2975 l := left value. |
|
2976 r := right value. |
|
2977 t := top value. |
|
2978 b := bottom value. |
|
2979 img := imageEditView image. |
|
2980 firstChange ifTrue:[ |
|
2981 imageEditView makeUndo. |
|
2982 firstChange := false. |
|
2983 ]. |
|
2984 imageEditView |
|
2985 makeSubImageX:l y:t |
|
2986 width:(img width - l - r) |
|
2987 height:(img height - t - b). |
|
2988 self updateInfoLabel |
|
2989 ]. |
2957 |
2990 |
2958 bindings := IdentityDictionary new. |
2991 bindings := IdentityDictionary new. |
2959 bindings at:#left put:(left := 0 asValue). |
2992 bindings at:#left put:(left := 0 asValue). |
2960 bindings at:#right put:(right := 0 asValue). |
2993 bindings at:#right put:(right := 0 asValue). |
2961 bindings at:#top put:(top := 0 asValue). |
2994 bindings at:#top put:(top := 0 asValue). |
2962 bindings at:#bottom put:(bottom := 0 asValue). |
2995 bindings at:#bottom put:(bottom := 0 asValue). |
2963 (self openDialogInterface:#gropDialogSpec withBindings:bindings) |
2996 bindings at:#acceptChannel put:(acceptChannel := TriggerValue new). |
2964 ifTrue:[ |
2997 |
2965 left := left value. |
2998 bindings at:#applyAction put:applyAction. |
2966 right := right value. |
2999 |
2967 top := top value. |
3000 (self openDialogInterface:#gropDialogSpec withBindings:bindings) |
2968 bottom := bottom value. |
3001 ifFalse:[ imageEditView undo ]. |
2969 img := imageEditView image. |
|
2970 imageEditView |
|
2971 makeSubImageX:left y:top |
|
2972 width:(img width - left - right) |
|
2973 height:(img height - top - bottom). |
|
2974 self updateInfoLabel |
|
2975 ]. |
|
2976 |
3002 |
2977 "Created: / 7.9.1998 / 18:16:07 / cg" |
3003 "Created: / 7.9.1998 / 18:16:07 / cg" |
2978 "Modified: / 7.9.1998 / 18:20:42 / cg" |
3004 "Modified: / 7.9.1998 / 18:20:42 / cg" |
2979 ! |
3005 ! |
2980 |
3006 |