ImageEditor.st
changeset 3401 9f2865200e2f
parent 3400 3cd67963333d
child 3404 cd90f4aece50
equal deleted inserted replaced
3400:3cd67963333d 3401:9f2865200e2f
  1623           (InputFieldSpec
  1623           (InputFieldSpec
  1624              name: 'GropLeftEntryField'
  1624              name: 'GropLeftEntryField'
  1625              layout: (LayoutFrame 95 0 24 0 132 0 46 0)
  1625              layout: (LayoutFrame 95 0 24 0 132 0 46 0)
  1626              activeHelpKey: gropLeft
  1626              activeHelpKey: gropLeft
  1627              tabable: true
  1627              tabable: true
  1628              model: left
  1628              model: gropLeftAmount
  1629              type: number
  1629              type: number
  1630              acceptChannel: acceptChannel
  1630              acceptChannel: acceptChannel
  1631              acceptOnPointerLeave: false
  1631              acceptOnPointerLeave: false
  1632            )
  1632            )
  1633           (ActionButtonSpec
  1633           (ActionButtonSpec
  1653           (InputFieldSpec
  1653           (InputFieldSpec
  1654              name: 'GropRightEntryField'
  1654              name: 'GropRightEntryField'
  1655              layout: (LayoutFrame 95 0 55 0 132 0 77 0)
  1655              layout: (LayoutFrame 95 0 55 0 132 0 77 0)
  1656              activeHelpKey: gropRight
  1656              activeHelpKey: gropRight
  1657              tabable: true
  1657              tabable: true
  1658              model: right
  1658              model: gropRightAmount
  1659              type: number
  1659              type: number
  1660              acceptChannel: acceptChannel
  1660              acceptChannel: acceptChannel
  1661              acceptOnPointerLeave: false
  1661              acceptOnPointerLeave: false
  1662            )
  1662            )
  1663           (ActionButtonSpec
  1663           (ActionButtonSpec
  1683           (InputFieldSpec
  1683           (InputFieldSpec
  1684              name: 'GropTopEntryField'
  1684              name: 'GropTopEntryField'
  1685              layout: (LayoutFrame 95 0 85 0 132 0 107 0)
  1685              layout: (LayoutFrame 95 0 85 0 132 0 107 0)
  1686              activeHelpKey: gropTop
  1686              activeHelpKey: gropTop
  1687              tabable: true
  1687              tabable: true
  1688              model: top
  1688              model: gropTopAmount
  1689              type: number
  1689              type: number
  1690              acceptChannel: acceptChannel
  1690              acceptChannel: acceptChannel
  1691              acceptOnPointerLeave: false
  1691              acceptOnPointerLeave: false
  1692            )
  1692            )
  1693           (ActionButtonSpec
  1693           (ActionButtonSpec
  1713           (InputFieldSpec
  1713           (InputFieldSpec
  1714              name: 'GropBottomEntryField'
  1714              name: 'GropBottomEntryField'
  1715              layout: (LayoutFrame 95 0 115 0 132 0 137 0)
  1715              layout: (LayoutFrame 95 0 115 0 132 0 137 0)
  1716              activeHelpKey: gropBottom
  1716              activeHelpKey: gropBottom
  1717              tabable: true
  1717              tabable: true
  1718              model: bottom
  1718              model: gropBottomAmount
  1719              type: number
  1719              type: number
  1720              acceptChannel: acceptChannel
  1720              acceptChannel: acceptChannel
  1721              acceptOnPointerLeave: false
  1721              acceptOnPointerLeave: false
  1722            )
  1722            )
  1723           (ActionButtonSpec
  1723           (ActionButtonSpec
  1780            )
  1780            )
  1781           )
  1781           )
  1782         
  1782         
  1783        )
  1783        )
  1784      )
  1784      )
       
  1785 
       
  1786     "Modified: / 13-02-2017 / 14:52:25 / cg"
  1785 !
  1787 !
  1786 
  1788 
  1787 dialogSpecForNewImage
  1789 dialogSpecForNewImage
  1788     "This resource specification was automatically generated
  1790     "This resource specification was automatically generated
  1789      by the UIPainter of ST/X."
  1791      by the UIPainter of ST/X."
  2037               adjust: right
  2039               adjust: right
  2038             )
  2040             )
  2039            (InputFieldSpec
  2041            (InputFieldSpec
  2040               name: 'EntryField1'
  2042               name: 'EntryField1'
  2041               layout: (LayoutFrame 95 0 21 0 132 0 43 0)
  2043               layout: (LayoutFrame 95 0 21 0 132 0 43 0)
  2042               model: left
  2044               model: gropLeftAmount
  2043               type: number
  2045               type: number
  2044               acceptOnPointerLeave: false
  2046               acceptOnPointerLeave: false
  2045             )
  2047             )
  2046            (LabelSpec
  2048            (LabelSpec
  2047               label: 'Right:'
  2049               label: 'Right:'
  2051               adjust: right
  2053               adjust: right
  2052             )
  2054             )
  2053            (InputFieldSpec
  2055            (InputFieldSpec
  2054               name: 'EntryField2'
  2056               name: 'EntryField2'
  2055               layout: (LayoutFrame 95 0 51 0 132 0 73 0)
  2057               layout: (LayoutFrame 95 0 51 0 132 0 73 0)
  2056               model: right
  2058               model: gropRightAmount
  2057               type: number
  2059               type: number
  2058               acceptOnPointerLeave: false
  2060               acceptOnPointerLeave: false
  2059             )
  2061             )
  2060            (LabelSpec
  2062            (LabelSpec
  2061               label: 'Top:'
  2063               label: 'Top:'
  2065               adjust: right
  2067               adjust: right
  2066             )
  2068             )
  2067            (InputFieldSpec
  2069            (InputFieldSpec
  2068               name: 'EntryField3'
  2070               name: 'EntryField3'
  2069               layout: (LayoutFrame 95 0 81 0 132 0 103 0)
  2071               layout: (LayoutFrame 95 0 81 0 132 0 103 0)
  2070               model: top
  2072               model: gropTopAmount
  2071               type: number
  2073               type: number
  2072               acceptOnPointerLeave: false
  2074               acceptOnPointerLeave: false
  2073             )
  2075             )
  2074            (LabelSpec
  2076            (LabelSpec
  2075               label: 'Bottom:'
  2077               label: 'Bottom:'
  2079               adjust: right
  2081               adjust: right
  2080             )
  2082             )
  2081            (InputFieldSpec
  2083            (InputFieldSpec
  2082               name: 'EntryField4'
  2084               name: 'EntryField4'
  2083               layout: (LayoutFrame 95 0 111 0 132 0 133 0)
  2085               layout: (LayoutFrame 95 0 111 0 132 0 133 0)
  2084               model: bottom
  2086               model: gropBottomAmount
  2085               type: number
  2087               type: number
  2086               acceptOnPointerLeave: false
  2088               acceptOnPointerLeave: false
  2087             )
  2089             )
  2088            (HorizontalPanelViewSpec
  2090            (HorizontalPanelViewSpec
  2089               name: 'HorizontalPanel1'
  2091               name: 'HorizontalPanel1'
  2116             )
  2118             )
  2117            )
  2119            )
  2118          
  2120          
  2119         )
  2121         )
  2120       )
  2122       )
       
  2123 
       
  2124     "Modified: / 13-02-2017 / 14:53:08 / cg"
  2121 !
  2125 !
  2122 
  2126 
  2123 windowSpec
  2127 windowSpec
  2124     "This resource specification was automatically generated
  2128     "This resource specification was automatically generated
  2125      by the UIPainter of ST/X."
  2129      by the UIPainter of ST/X."
  6839                 self updateInfoLabel
  6843                 self updateInfoLabel
  6840             ].
  6844             ].
  6841         ].
  6845         ].
  6842 
  6846 
  6843     bindings := IdentityDictionary new.
  6847     bindings := IdentityDictionary new.
  6844     bindings at:#left put:(left := 1 asValue).
  6848     bindings at:#gropLeftAmount put:(left := 1 asValue).
  6845     bindings at:#right put:(right := 1 asValue).
  6849     bindings at:#gropRightAmount put:(right := 1 asValue).
  6846     bindings at:#top put:(top := 1 asValue).
  6850     bindings at:#gropTop put:(top := 1 asValue).
  6847     bindings at:#bottom put:(bottom := 1 asValue).
  6851     bindings at:#gropBottomAmount put:(bottom := 1 asValue).
  6848     bindings at:#acceptChannel put:acceptChannel.
  6852     bindings at:#acceptChannel put:acceptChannel.
  6849 
  6853 
  6850     bindings at:#gropLeftNow   put:[ gropAction value:left value:0 value:0 value:0 ].
  6854     bindings at:#gropLeftNow   put:[ gropAction value:left value:0 value:0 value:0 ].
  6851     bindings at:#gropRightNow  put:[ gropAction value:0 value:right value:0 value:0 ].
  6855     bindings at:#gropRightNow  put:[ gropAction value:0 value:right value:0 value:0 ].
  6852     bindings at:#gropTopNow    put:[ gropAction value:0 value:0 value:top value:0 ].
  6856     bindings at:#gropTopNow    put:[ gropAction value:0 value:0 value:top value:0 ].
  6860             imageEditView undo.
  6864             imageEditView undo.
  6861             self updateImagePreView.
  6865             self updateImagePreView.
  6862         ]
  6866         ]
  6863     ].
  6867     ].
  6864 
  6868 
  6865     "Created: / 7.9.1998 / 18:16:07 / cg"
  6869     "Created: / 07-09-1998 / 18:16:07 / cg"
  6866     "Modified: / 7.9.1998 / 18:20:42 / cg"
  6870     "Modified: / 13-02-2017 / 14:51:10 / cg"
  6867 !
  6871 !
  6868 
  6872 
  6869 doCropRight
  6873 doCropRight
  6870     "find a right border and cut it off"
  6874     "find a right border and cut it off"
  6871 
  6875 
  7169     "let user specify borders and add them"
  7173     "let user specify borders and add them"
  7170 
  7174 
  7171     |bindings left top right bottom img|
  7175     |bindings left top right bottom img|
  7172 
  7176 
  7173     bindings := IdentityDictionary new.
  7177     bindings := IdentityDictionary new.
  7174     bindings at:#left put:(left := 1 asValue).
  7178     bindings at:#gropLeftAmount put:(left := 1 asValue).
  7175     bindings at:#right put:(right := 1 asValue).
  7179     bindings at:#gropRightAmount put:(right := 1 asValue).
  7176     bindings at:#top put:(top := 1 asValue).
  7180     bindings at:#gropTopAmount put:(top := 1 asValue).
  7177     bindings at:#bottom put:(bottom := 1 asValue).
  7181     bindings at:#gropBottomAmount put:(bottom := 1 asValue).
  7178     (self openDialogInterface:#uncropDialogSpec withBindings:bindings)
  7182     (self openDialogInterface:#uncropDialogSpec withBindings:bindings)
  7179     ifTrue:[
  7183     ifTrue:[
  7180         left := left value.
  7184         left := left value.
  7181         right := right value.
  7185         right := right value.
  7182         top := top value.
  7186         top := top value.
  7188             width:(img width + left + right)
  7192             width:(img width + left + right)
  7189             height:(img height + top + bottom).
  7193             height:(img height + top + bottom).
  7190         self updateInfoLabel
  7194         self updateInfoLabel
  7191     ].
  7195     ].
  7192 
  7196 
  7193     "Created: / 7.9.1998 / 18:16:07 / cg"
  7197     "Created: / 07-09-1998 / 18:16:07 / cg"
  7194     "Modified: / 7.9.1998 / 18:20:42 / cg"
  7198     "Modified: / 13-02-2017 / 14:51:35 / cg"
  7195 !
  7199 !
  7196 
  7200 
  7197 doUndo
  7201 doUndo
  7198     "reverses last edit action"
  7202     "reverses last edit action"
  7199 
  7203