[squeak-dev] [Please Test] Refactoring for BorderedMorph to use BorderStyle

Marcel Taeumel marcel.taeumel at hpi.de
Sun May 6 11:47:49 UTC 2018


Hi Karl,

how many scroll panes w/o hScrollBar do you have in your image? They shouldn't be nil only invisible. Try this:

ScrollPane allSubInstances count: [:ea | ea hScrollBar isNil].

Should be zero. Is this related to project loading? This might fix those instances:

ScrollPane allSubInstancesDo: [:ea |
ea hScrollBar ifNil: [
ea instVarNamed: #hScrollBar put:
((ScrollBar on: ea getValue: nil setValue: #hScrollBarValue:)
menuSelector: #hScrollBarMenuButtonPressed:;
orientation: #horizontal;
extent: 1 at 1)]].

Yet, is there a place to put such code for project loading? I would like to avoid messing up the ScrollPane implementation again... ;-)

Anyway, this is not related to the refactoring of BorderedMorph and BorderStyle.

Best,
Marcel
Am 04.05.2018 17:33:46 schrieb karl ramberg <karlramberg at gmail.com>:
Filing the change set into a a project with all flaps added I get this error.
Best,
Karl


4 May 2018 5:29:43.636227 pm

VM: Win32 - Smalltalk
Image: Squeak6.0alpha [latest update: #17953]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir C:\Users\Karl\Downloads\Squeak6.0alpha-17873-64bit-\Squeak6.0alpha-17873-64bit-201712221331-Windows
Trusted Dir C:\Users\Karl\Downloads\Squeak6.0alpha-17873-64bit-\Squeak6.0alpha-17873-64bit-201712221331-Windows\Karl
Untrusted Dir C:\Users\Karl\Documents\My Squeak

UndefinedObject(Object)>>doesNotUnderstand: #owner
Receiver: nil
Arguments and temporary variables: 
aMessage: owner
exception: MessageNotUnderstood: UndefinedObject>>owner
resumeValue: nil
Receiver's instance variables: 
nil

GeeMailMorph(ScrollPane)>>hIsScrollbarShowing
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>hShowScrollBar
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>hHideOrShowScrollBar
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>hideOrShowScrollBars
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>setScrollDeltas
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>borderStyle:
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 
aBorderStyle: a SimpleBorder
Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>setDefaultParameters
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

GeeMailMorph(ScrollPane)>>applyUserInterfaceTheme
Receiver: a GeeMailMorph(2549753)
Arguments and temporary variables: 

Receiver's instance variables: 
bounds: 19 at 16 corner: 497 at 660
owner: a PasteUpMorph(3307392) [world]
submorphs: {a ScrollBar(1492571) . a TransformMorph(3447211)}
fullBounds: nil
color: Color white
extension: a MorphExtension (4130764) [sticky]  [eventHandler = an EventHandler...etc...
borderWidth: 0
borderColor: Color transparent
model: nil
slotName: nil
open: false
scrollBar: a ScrollBar(1492571)
scroller: a TransformMorph(3447211)
retractableScrollBar: false
scrollBarOnLeft: true
getMenuSelector: nil
getMenuTitleSelector: nil
hasFocus: false
hScrollBar: nil
hScrollBarPolicy: nil
vScrollBarPolicy: nil
scrollBarThickness: nil
theTextMorph: nil
thePasteUp: a TextPlusPasteUpMorph(1346736)

[] in [] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
Receiver: a SqueakTheme 'Squeak'
Arguments and temporary variables: 
cc: a GeeMailMorph(2549753)
o: an IdentitySet(BottomRightGripMorph NetworkTerminalMorph UpdatingTextMorph QuickGuideMorph...etc...
Receiver's instance variables: 
properties: a Dictionary(size 330)
name: 'Squeak'
next: nil
ignoreApply: false
lastScaleFactor: 1.0

Array(SequenceableCollection)>>do:
Receiver: {nil . false . true . {Character null . Character value: 1 . Character value: 2 . Character...etc...
Arguments and temporary variables: 
aBlock: [closure] in [] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
index: 482773
indexLimiT: 643356
Receiver's instance variables: 
{nil . false . true . {Character null . Character value: 1 . Character value: 2 . Character...etc...

SystemNavigation>>allObjectsDo:
Receiver: a SystemNavigation
Arguments and temporary variables: 
aBlock: [closure] in [] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
object: nil
lastObject: nil
allObjects: {nil . false . true . {Character null . Character value: 1 . Character...etc...
Receiver's instance variables: 
browserClass: Browser
hierarchyBrowserClass: nil
environment: Smalltalk

[] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
Receiver: a SqueakTheme 'Squeak'
Arguments and temporary variables: 
cc: an IdentitySet(BottomRightGripMorph NetworkTerminalMorph UpdatingTextMorph QuickGuideMorph...etc...
Receiver's instance variables: 
properties: a Dictionary(size 330)
name: 'Squeak'
next: nil
ignoreApply: false
lastScaleFactor: 1.0

BlockClosure>>ensure:
Receiver: [closure] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
Arguments and temporary variables: 
aBlock: [closure] in CursorWithMask(Cursor)>>showWhile:
complete: nil
returnValue: nil
Receiver's instance variables: 
outerContext: [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
startpc: 215
numArgs: 0

CursorWithMask(Cursor)>>showWhile:
Receiver: ((CursorWithMask
extent: 16 at 16
depth: 1
fromArray: #(
2r0
2r11111111111111000000000...etc...
Arguments and temporary variables: 
aBlock: [closure] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
oldcursor: ((CursorWithMask
extent: 16 at 16
depth: 1
fromArray: #(
2r0
2r1...etc...
Receiver's instance variables: 
bits: a Bitmap of length 16
width: 16
height: 16
depth: 1
offset: -1@ -1
maskForm: Form(16x16x1)

[] in [] in SqueakTheme(UserInterfaceTheme)>>apply
Receiver: a SqueakTheme 'Squeak'
Arguments and temporary variables: 
cc: an IdentitySet(BottomRightGripMorph NetworkTerminalMorph UpdatingTextMorph QuickGuideMorph...etc...
Receiver's instance variables: 
properties: a Dictionary(size 330)
name: 'Squeak'
next: nil
ignoreApply: false
lastScaleFactor: 1.0

IdentitySet(Object)>>in:
Receiver: an IdentitySet(BottomRightGripMorph NetworkTerminalMorph UpdatingTextMorph QuickGuideMorph...etc...
Arguments and temporary variables: 
aBlock: [closure] in [] in SqueakTheme(UserInterfaceTheme)>>apply
Receiver's instance variables: 
tally: 672
array: {nil . BottomRightGripMorph . nil . NetworkTerminalMorph . UpdatingTextMorph...etc...

[] in SqueakTheme(UserInterfaceTheme)>>apply
Receiver: a SqueakTheme 'Squeak'
Arguments and temporary variables: 

Receiver's instance variables: 
properties: a Dictionary(size 330)
name: 'Squeak'
next: nil
ignoreApply: false
lastScaleFactor: 1.0

SqueakTheme(UserInterfaceTheme)>>fixFontsAndScaleAround:
Receiver: a SqueakTheme 'Squeak'
Arguments and temporary variables: 
block: [closure] in SqueakTheme(UserInterfaceTheme)>>apply
scale: nil
Receiver's instance variables: 
properties: a Dictionary(size 330)
name: 'Squeak'
next: nil
ignoreApply: false
lastScaleFactor: 1.0


--- The full stack ---
UndefinedObject(Object)>>doesNotUnderstand: #owner
GeeMailMorph(ScrollPane)>>hIsScrollbarShowing
GeeMailMorph(ScrollPane)>>hShowScrollBar
GeeMailMorph(ScrollPane)>>hHideOrShowScrollBar
GeeMailMorph(ScrollPane)>>hideOrShowScrollBars
GeeMailMorph(ScrollPane)>>setScrollDeltas
GeeMailMorph(ScrollPane)>>borderStyle:
GeeMailMorph(ScrollPane)>>setDefaultParameters
GeeMailMorph(ScrollPane)>>applyUserInterfaceTheme
[] in [] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
Array(SequenceableCollection)>>do:
SystemNavigation>>allObjectsDo:
[] in [] in [] in SqueakTheme(UserInterfaceTheme)>>apply
BlockClosure>>ensure:
CursorWithMask(Cursor)>>showWhile:
[] in [] in SqueakTheme(UserInterfaceTheme)>>apply
IdentitySet(Object)>>in:
[] in SqueakTheme(UserInterfaceTheme)>>apply
SqueakTheme(UserInterfaceTheme)>>fixFontsAndScaleAround:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqueakTheme(UserInterfaceTheme)>>apply
UndefinedObject>>DoIt
Compiler>>evaluateCue:ifFail:
Compiler>>evaluateCue:ifFail:logged:
Compiler>>evaluate:in:to:notifying:ifFail:logged:
Compiler class>>evaluate:for:notifying:logged:
Compiler class>>evaluate:for:logged:
Compiler class>>evaluate:logged:
[] in [] in MultiByteFileStream(PositionableStream)>>fileInAnnouncing:
BlockClosure>>on:do:
[] in MultiByteFileStream(PositionableStream)>>fileInAnnouncing:
[] in [] in MorphicUIManager>>displayProgress:at:from:to:during:
BlockClosure>>on:do:
[] in MorphicUIManager>>displayProgress:at:from:to:during:
BlockClosure>>ensure:
MorphicUIManager>>displayProgress:at:from:to:during:
ProgressInitiationException>>defaultResumeValue
ProgressInitiationException(Exception)>>resume
ProgressInitiationException>>defaultAction
UndefinedObject>>handleSignal:
ProgressInitiationException(Exception)>>signal
ProgressInitiationException>>display:at:from:to:during:
ProgressInitiationException class>>display:at:from:to:during:
ByteString(String)>>displayProgressAt:from:to:during:
ByteString(String)>>displayProgressFrom:to:during:
MultiByteFileStream(PositionableStream)>>fileInAnnouncing:
[] in ChangeSet class>>newChangesFromStream:named:
BlockClosure>>ensure:
ChangeSet class>>newChangesFromStream:named:
ChangeSet class>>fileIntoNewChangeSet:
SimpleServiceEntry>>performServiceFor:
FileList>>executeService:
MessageSend>>value
PluggableButtonMorphPlus>>performAction
[] in PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp:
Array(SequenceableCollection)>>do:
PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp:
PluggableButtonMorphPlus(Morph)>>handleMouseUp:
MouseButtonEvent>>sentTo:
PluggableButtonMorphPlus(Morph)>>handleEvent:
PluggableButtonMorphPlus(Morph)>>handleFocusEvent:
MorphicEventDispatcher>>doHandlingForFocusEvent:with:
-- and more not shown --

On Fri, May 4, 2018 at 4:49 PM, Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]> wrote:

Well, I did more changes than expected. Please find attached the current version of that refactoring and test again. Note that we have, at the moment, no support for rounded corners in inset/raised borders.

Best,
Marcel
Am 04.05.2018 10:34:20 schrieb Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]>:
I will merge that refactoring during the next hours. Please report any issues here and not as a response to the commit e-mails.

Best,
Marel
Am 11.04.2018 12:01:47 schrieb Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]>:
Hi, there.

Please find attached a refactoring of BorderedMorph to make use of BorderStyle like regular morphs do. Maybe, in the future, we can get rid of BorderedMorph.

It includes:
- No instVar access to borderColor and borderWidth but message sends.
- No #inset or #raised anymore when asking a morph for its #borderColor. Just colors.
- Copying the prototypical border styles from the UI theme when used in morphs.
- A post-load script that updates all your morphs in the image. Not that important but good for keeping your current tools opened.

After a few days of no complaints, I will merge it into Trunk.

Best,
Marcel




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180506/6629a7c7/attachment-0001.html>


More information about the Squeak-dev mailing list