# HG changeset patch # User Claus Gittinger # Date 851080763 -3600 # Node ID 167651794a77ed397292bead99e0393bf8a30367 # Parent 978db6396b49cfd6af00d02e2be5749113cb5f40 use Image instead of Form diff -r 978db6396b49 -r 167651794a77 ComboView.st --- a/ComboView.st Mon Dec 16 23:11:54 1996 +0100 +++ b/ComboView.st Fri Dec 20 12:19:23 1996 +0100 @@ -18,7 +18,7 @@ examples " - [exBegin] + [exBegin] |top b| top := StandardSystemView new. @@ -30,12 +30,12 @@ b list:#('hello' 'world' 'this' 'is' 'st/x'). top open. - [exEnd] + [exEnd] model operation: - [exBegin] + [exBegin] |model top b| model := 'foo' asValue. @@ -52,11 +52,11 @@ top openModal. Transcript showCR:('comboBox''s value: ' , model value). - [exEnd] + [exEnd] in a dialog: - [exBegin] + [exBegin] |model1 model2 dialog b| model1 := 'foo' asValue. @@ -80,22 +80,22 @@ Transcript showCR:('1st comboBox''s value: ' , model1 value). Transcript showCR:('2nd comboBox''s value: ' , model2 value). - [exEnd] + [exEnd] a hook on the menu pull operation: - [exBegin] + [exBegin] |b| b := ComboBoxView new. b menuButton - action:[ - Transcript showCR:'hi there'. - b list:#('foo' 'bar'). - b pullMenu - ]. + action:[ + Transcript showCR:'hi there'. + b list:#('foo' 'bar'). + b pullMenu + ]. b list:#('hello' 'world' 'this' 'is' 'st/x'). b open - [exEnd] + [exEnd] " ! ! @@ -104,7 +104,7 @@ buttonForm |form| - form := Form fromFile:'ComboDn_win.xbm'. + form := Image fromFile:'bitmaps/ComboDn_win.xbm'. ^ form on:Display ! ! @@ -131,7 +131,7 @@ |m| (m := field model) notNil ifTrue:[ - m value:something + m value:something ] "Created: 14.5.1996 / 13:05:33 / cg" @@ -141,9 +141,9 @@ list:aList list := aList. (list notNil and:[list notEmpty]) ifTrue:[ - pullDownButton controller enable + pullDownButton controller enable ] ifFalse:[ - pullDownButton controller disable + pullDownButton controller disable ]. "Modified: 9.2.1996 / 00:51:56 / cg" @@ -163,8 +163,8 @@ update:something with:aParameter from:changedObject changedObject == model ifTrue:[ - self getListFromModel. - self getValueFromModel. + self getListFromModel. + self getValueFromModel. ]. super update:something with:aParameter from:changedObject @@ -185,16 +185,16 @@ pullDownButton label:(self class buttonForm). pullDownButton showLamp:false. pullDownButton activeLevel == pullDownButton passiveLevel ifTrue:[ - pullDownButton activeLevel:0. + pullDownButton activeLevel:0. ]. ext := pullDownButton preferredExtent. pullDownButton origin:1.0@0.0 corner:1.0@1.0. styleSheet is3D ifTrue:[ - pullDownButton leftInset:(ext x "+ (ViewSpacing//2)") negated. - field rightInset:(ext x + (ViewSpacing//2)). + pullDownButton leftInset:(ext x "+ (ViewSpacing//2)") negated. + field rightInset:(ext x + (ViewSpacing//2)). ] ifFalse:[ - pullDownButton leftInset:(ext x + pullDownButton borderWidth) negated. - field rightInset:(ext x). + pullDownButton leftInset:(ext x + pullDownButton borderWidth) negated. + field rightInset:(ext x). ]. pullDownButton disable. @@ -218,7 +218,7 @@ doesNotUnderstand:aMessage (field respondsTo:aMessage selector) ifTrue:[ - ^ aMessage sendTo:field + ^ aMessage sendTo:field ]. ^ super doesNotUnderstand:aMessage @@ -236,9 +236,9 @@ getListFromModel model notNil ifTrue:[ - (model respondsTo:#list) ifTrue:[ - self list:(model list) - ] + (model respondsTo:#list) ifTrue:[ + self list:(model list) + ] ]. "Created: 15.7.1996 / 12:22:56 / cg" @@ -256,10 +256,10 @@ |pref1 pref2 m mPrefX| list isNil ifTrue:[ - mPrefX := 0 + mPrefX := 0 ] ifFalse:[ - m := MenuView labels:list. - mPrefX := m preferredExtent x. + m := MenuView labels:list. + mPrefX := m preferredExtent x. ]. pref1 := field preferredExtent. @@ -289,22 +289,22 @@ self getListFromModel. (list notNil and:[list notEmpty]) ifTrue:[ - m := PopUpMenu - labels:list - selectors:#entryChanged: - args:(1 to:list size) - receiver:self. + m := PopUpMenu + labels:list + selectors:#entryChanged: + args:(1 to:list size) + receiver:self. - m menuView resize. - m menuView width:(self width). - m menuView sizeFixed:true. - m hideOnRelease:false. + m menuView resize. + m menuView width:(self width). + m menuView sizeFixed:true. + m hideOnRelease:false. - org := device translatePoint:(0 @ self height) - from:(self id) - to:(device rootView id). + org := device translatePoint:(0 @ self height) + from:(self id) + to:(device rootView id). - m showAt:org. + m showAt:org. ]. pullDownButton turnOff. @@ -316,5 +316,5 @@ !ComboView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.9 1996-11-13 17:43:35 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.10 1996-12-20 11:19:18 cg Exp $' ! ! diff -r 978db6396b49 -r 167651794a77 ImageView.st --- a/ImageView.st Mon Dec 16 23:11:54 1996 +0100 +++ b/ImageView.st Fri Dec 20 12:19:23 1996 +0100 @@ -51,7 +51,7 @@ ImageView openOn:'bitmaps/SBrowser.xbm' ImageView openOnImage:(Image fromFile:'bitmaps/garfield.gif') - ImageView openOnImage:(Form fromFile:'SBrowser.xbm') + ImageView openOnImage:(Image fromFile:'bitmaps/SBrowser.xbm') " ! ! @@ -155,7 +155,6 @@ " ImageView openOnImage:(Image fromFile:'bitmaps/garfield.gif') ImageView openOnImage:(Image fromFile:'bitmaps/SBrowser.xbm') - ImageView openOnImage:(Form fromFile:'bitmaps/SBrowser.xbm') " ! ! @@ -179,12 +178,12 @@ image := anImage. anImage notNil ifTrue:[ - self cursor:Cursor wait. - shown ifTrue:[ - self invalidate - ]. - self contentsChanged. - self cursor:(Cursor normal). + self cursor:Cursor wait. + shown ifTrue:[ + self invalidate + ]. + self contentsChanged. + self cursor:(Cursor normal). ]. " @@ -205,31 +204,31 @@ |xI yI depth ext| image notNil ifTrue:[ - image device ~~ device ifTrue:[ - self withWaitCursorDo:[ - image := image on:device. - ] - ]. + image device ~~ device ifTrue:[ + self withWaitCursorDo:[ + image := image on:device. + ] + ]. - ((depth := image depth) == 1) ifTrue:[ - self paint:(image colorFromValue:1) - on:(image colorFromValue:0). - ]. - adjust == #center ifTrue:[ - ext := image extent. - xI := (width - (margin * 2) - (ext x)) // 2. - yI := (height - (margin * 2) - (ext y)) // 2. - ] ifFalse:[ - xI := yI := margin - ]. + ((depth := image depth) == 1) ifTrue:[ + self paint:(image colorFromValue:1) + on:(image colorFromValue:0). + ]. + adjust == #center ifTrue:[ + ext := image extent. + xI := (width - (margin * 2) - (ext x)) // 2. + yI := (height - (margin * 2) - (ext y)) // 2. + ] ifFalse:[ + xI := yI := margin + ]. - (depth ~~ 1 - and:[image mask notNil]) ifTrue:[ - self clearRectangleX:x y:y width:w height:h. - self displayForm:image x:xI y:yI - ] ifFalse:[ - self displayOpaqueForm:image x:xI y:yI - ] + (depth ~~ 1 + and:[image mask notNil]) ifTrue:[ + self clearRectangleX:x y:y width:w height:h. + self displayForm:image x:xI y:yI + ] ifFalse:[ + self displayOpaqueForm:image x:xI y:yI + ] ] "Created: 11.7.1996 / 21:02:12 / cg" @@ -262,5 +261,5 @@ !ImageView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.24 1996-10-22 15:58:43 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.25 1996-12-20 11:19:20 cg Exp $' ! ! diff -r 978db6396b49 -r 167651794a77 TextRuler.st --- a/TextRuler.st Mon Dec 16 23:11:54 1996 +0100 +++ b/TextRuler.st Fri Dec 20 12:19:23 1996 +0100 @@ -49,7 +49,7 @@ ! version - ^ '$Header: /cvs/stx/stx/libwidg2/TextRuler.st,v 1.13 1995-11-11 16:29:32 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/TextRuler.st,v 1.14 1996-12-20 11:19:23 cg Exp $' ! ! !TextRuler class methodsFor:'defaults'! @@ -58,7 +58,7 @@ "return the form displayed for the right margin marker" RightMarginForm isNil ifTrue:[ - RightMarginForm := Form fromFile:'rightMarg.xbm' resolution:100 + RightMarginForm := Image fromFile:'bitmaps/rightMarg.xbm' resolution:100 ]. ^ RightMarginForm ! @@ -67,7 +67,7 @@ "return the form displayed for the left margin marker" LeftMarginForm isNil ifTrue:[ - LeftMarginForm := Form fromFile:'leftMargin.xbm' resolution:100 + LeftMarginForm := Image fromFile:'bitmaps/leftMargin.xbm' resolution:100 ]. ^ LeftMarginForm ! @@ -76,7 +76,7 @@ "return the form displayed in the rightAlign-button" RightAlignForm isNil ifTrue:[ - RightAlignForm := Form fromFile:'rightAlign.xbm' resolution:100 + RightAlignForm := Image fromFile:'bitmaps/rightAlign.xbm' resolution:100 ]. ^ RightAlignForm ! @@ -85,7 +85,7 @@ "return the form displayed in the leftTab-button" LeftTabForm isNil ifTrue:[ - LeftTabForm := Form fromFile:'leftTab.xbm' resolution:100 + LeftTabForm := Image fromFile:'bitmaps/leftTab.xbm' resolution:100 ]. ^ LeftTabForm ! @@ -94,7 +94,7 @@ "return the form displayed in the center-button" CenterForm isNil ifTrue:[ - CenterForm := Form fromFile:'center.xbm' resolution:100 + CenterForm := Image fromFile:'bitmaps/center.xbm' resolution:100 ]. ^ CenterForm ! @@ -103,7 +103,7 @@ "return the form displayed in the align-button" AlignForm isNil ifTrue:[ - AlignForm := Form fromFile:'align.xbm' resolution:100 + AlignForm := Image fromFile:'bitmaps/align.xbm' resolution:100 ]. ^ AlignForm ! @@ -112,7 +112,7 @@ "return the form displayed in the rightTab-button" RightTabForm isNil ifTrue:[ - RightTabForm := Form fromFile:'rightTab.xbm' resolution:100 + RightTabForm := Image fromFile:'bitmaps/rightTab.xbm' resolution:100 ]. ^ RightTabForm ! @@ -121,7 +121,7 @@ "return the form displayed in the leftAlign-button" LeftAlignForm isNil ifTrue:[ - LeftAlignForm := Form fromFile:'leftAlign.xbm' resolution:100 + LeftAlignForm := Image fromFile:'bitmaps/leftAlign.xbm' resolution:100 ]. ^ LeftAlignForm ! @@ -130,7 +130,7 @@ "return the form displayed in the decimalTab-button" DecimalTabForm isNil ifTrue:[ - DecimalTabForm := Form fromFile:'decimalTab.xbm' resolution:100 + DecimalTabForm := Image fromFile:'bitmaps/decimalTab.xbm' resolution:100 ]. ^ DecimalTabForm ! @@ -139,7 +139,7 @@ "return the form displayed in the centerTab-button" CenterTabForm isNil ifTrue:[ - CenterTabForm := Form fromFile:'centerTab.xbm' resolution:100 + CenterTabForm := Image fromFile:'bitmaps/centerTab.xbm' resolution:100 ]. ^ CenterTabForm ! !