equal
deleted
inserted
replaced
5066 fromClass:aClass selector:aSelector |
5066 fromClass:aClass selector:aSelector |
5067 |item| |
5067 |item| |
5068 |
5068 |
5069 item := self new. |
5069 item := self new. |
5070 item fromClass:aClass selector:aSelector. |
5070 item fromClass:aClass selector:aSelector. |
5071 ^ item |
5071 ^ item |
5072 ! ! |
5072 ! ! |
5073 |
5073 |
5074 !MenuEditor::ResourceEditorItem methodsFor:'accessing'! |
5074 !MenuEditor::ResourceEditorItem methodsFor:'accessing'! |
5075 |
5075 |
5076 icon |
5076 icon |
5117 |
5117 |
5118 fromClass:aClass selector:aSelector |
5118 fromClass:aClass selector:aSelector |
5119 |w h magnify| |
5119 |w h magnify| |
5120 |
5120 |
5121 selector := aSelector asSymbol. |
5121 selector := aSelector asSymbol. |
|
5122 selector numArgs == 0 ifFalse:[^ self]. |
|
5123 |
5122 icon := aClass perform:selector. |
5124 icon := aClass perform:selector. |
5123 |
5125 |
5124 w := icon width. |
5126 w := icon width. |
5125 h := icon height. |
5127 h := icon height. |
5126 |
5128 |
5127 w > 32 ifTrue:[ |
5129 w > 32 ifTrue:[ |
5128 magnify := 32 / w. |
5130 magnify := 32 / w. |
5129 h > 32 ifTrue:[ magnify := (32 / h) max:magnify ]. |
5131 h > 32 ifTrue:[ magnify := (32 / h) max:magnify ]. |
5130 ] ifFalse:[ |
5132 ] ifFalse:[ |
5131 h > 32 ifFalse:[^ self]. |
5133 h > 32 ifFalse:[^ self]. |
5132 magnify := 32 / h. |
5134 magnify := 32 / h. |
5133 ]. |
5135 ]. |
5134 icon := icon magnifiedBy: magnify. |
5136 icon := icon magnifiedBy: magnify. |
5135 ! |
5137 ! |
5136 |
5138 |
5137 initialize |
5139 initialize |