diff --git a/src/SqueakWhiteboard-Core/WBArrowhead.class.st b/src/SqueakWhiteboard-Core/WBArrowhead.class.st index 59f5e2b..60978e3 100644 --- a/src/SqueakWhiteboard-Core/WBArrowhead.class.st +++ b/src/SqueakWhiteboard-Core/WBArrowhead.class.st @@ -13,11 +13,11 @@ Class { { #category : #defaults, - #'squeak_changestamp' : 'is 6/23/2024 01:28' + #'squeak_changestamp' : 'ACL 7/12/2024 11:55' } WBArrowhead class >> defaultVertices [ - ^ {0@0. 20@10. 0@20} + ^ {0 @ 0. 20 @ 10. 0 @ 20} ] { diff --git a/src/SqueakWhiteboard-Core/WBButton.class.st b/src/SqueakWhiteboard-Core/WBButton.class.st index 0a68101..684be4c 100644 --- a/src/SqueakWhiteboard-Core/WBButton.class.st +++ b/src/SqueakWhiteboard-Core/WBButton.class.st @@ -129,6 +129,16 @@ WBButton >> currentMouseEvent: anEvent [ currentMouseEvent := anEvent ] +{ + #category : #accessing, + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' +} +WBButton >> defaultMargin [ + + ^ margin + +] + { #category : #'event handling', #'squeak_changestamp' : 'is 5/19/2024 16:21' @@ -193,16 +203,6 @@ WBButton >> initialize [ self setLayout ] -{ - #category : #accessing, - #'squeak_changestamp' : 'si 6/14/2024 12:51' -} -WBButton >> margin [ - - ^ margin - -] - { #category : #accessing, #'squeak_changestamp' : 'is 6/23/2024 01:16' diff --git a/src/SqueakWhiteboard-Core/WBCanvas.class.st b/src/SqueakWhiteboard-Core/WBCanvas.class.st index 58a714e..2fcc13e 100644 --- a/src/SqueakWhiteboard-Core/WBCanvas.class.st +++ b/src/SqueakWhiteboard-Core/WBCanvas.class.st @@ -29,6 +29,15 @@ WBCanvas class >> defaultGlobalColor [ ^ Color cyan ] +{ + #category : #accessing, + #'squeak_changestamp' : 'ACL 7/12/2024 11:56' +} +WBCanvas class >> defaultPointSize [ + + ^ 25 +] + { #category : #accessing, #'squeak_changestamp' : 'si 7/11/2024 17:32' @@ -371,14 +380,14 @@ WBCanvas >> setLayout [ { #category : #'show text', - #'squeak_changestamp' : 'si 7/10/2024 17:30' + #'squeak_changestamp' : 'ACL 7/12/2024 11:56' } WBCanvas >> showText: aString [ self text ifNotNil: [self text abandon]. self text: (TextMorph new contents: aString; - fontName: #Calibri pointSize: 25; + fontName: #Calibri pointSize: self class defaultPointSize; lock; yourself). self addMorph: text. diff --git a/src/SqueakWhiteboard-Core/WBEdgeOfLine.class.st b/src/SqueakWhiteboard-Core/WBEdgeOfLine.class.st index 3ed5f27..351f070 100644 --- a/src/SqueakWhiteboard-Core/WBEdgeOfLine.class.st +++ b/src/SqueakWhiteboard-Core/WBEdgeOfLine.class.st @@ -11,6 +11,33 @@ Class { #'squeak_changestamp' : 'is 6/23/2024 02:19' } +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 11:57' +} +WBEdgeOfLine class >> defaultCornerRadius [ + + ^100 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 11:57' +} +WBEdgeOfLine class >> defaultHeight [ + + ^10 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 11:57' +} +WBEdgeOfLine class >> defaultWidth [ + + ^10 +] + { #category : #resize, #'squeak_changestamp' : 'ACL 7/10/2024 12:08' @@ -116,16 +143,16 @@ WBEdgeOfLine >> handlesMouseOver: anEvent [ { #category : #initialization, - #'squeak_changestamp' : 'si 6/20/2024 23:26' + #'squeak_changestamp' : 'ACL 7/12/2024 11:58' } WBEdgeOfLine >> initialize [ super initialize. self cornerStyle: #rounded; - cornerRadius: 100; - width: 10; - height: 10; + cornerRadius: self class defaultCornerRadius; + width: self class defaultWidth; + height: self class defaultHeight; color: Color black; supportsText: false ] @@ -232,12 +259,12 @@ WBEdgeOfLine >> setupEventHandling [ { #category : #geometry, - #'squeak_changestamp' : 'si 6/21/2024 00:24' + #'squeak_changestamp' : 'ACL 7/12/2024 11:58' } WBEdgeOfLine >> switchDirection [ self line switchDirection. self canvas deactivateElement. - (self line edges at: 2) showPopUp. - self canvas activeElement: (self line edges at: 2) + (self line edges second) showPopUp. + self canvas activeElement: (self line edges second) ] diff --git a/src/SqueakWhiteboard-Core/WBElement.class.st b/src/SqueakWhiteboard-Core/WBElement.class.st index d25f873..2de9f93 100644 --- a/src/SqueakWhiteboard-Core/WBElement.class.st +++ b/src/SqueakWhiteboard-Core/WBElement.class.st @@ -26,16 +26,43 @@ Class { } { - #category : #layout, - #'squeak_changestamp' : 'is 6/18/2024 22:28' + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:03' +} +WBElement class >> defaultBorderWidth [ + + ^ 3 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:00' +} +WBElement class >> defaultButtonColumns [ + + ^ 3 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:21' +} +WBElement class >> defaultImageSizeFactor [ + + ^ 0.75 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:04' } WBElement class >> defaultSize [ - ^ 100@100 + ^ 100 @ 100 ] { - #category : #layout, + #category : #defaults, #'squeak_changestamp' : 'si 7/10/2024 13:36' } WBElement class >> defaultTextBorderOffset [ @@ -208,11 +235,11 @@ WBElement >> buttonFunctionalityForBorderColor [ { #category : #'button functionalities', - #'squeak_changestamp' : 'si 7/10/2024 17:04' + #'squeak_changestamp' : 'ACL 7/12/2024 12:00' } WBElement >> buttonFunctionalityForBorderColorPalette [ - ^ [:aButton | self popUp tryToMakePopUpAt: aButton topCenter - (0 @ (self class sizeOfPopUpForStandardElement / 2)) with: self makeBorderColorButtons columns: 3] + ^ [:aButton | self popUp tryToMakePopUpAt: aButton topCenter - (0 @ (self class sizeOfPopUpForStandardElement / 2)) with: self makeBorderColorButtons columns: self class defaultButtonColumns] ] { @@ -227,11 +254,11 @@ WBElement >> buttonFunctionalityForColor [ { #category : #'button functionalities', - #'squeak_changestamp' : 'si 7/10/2024 17:04' + #'squeak_changestamp' : 'ACL 7/12/2024 12:00' } WBElement >> buttonFunctionalityForColorPalette [ - ^ [:aButton | self popUp tryToMakePopUpAt: aButton topCenter - (0 @ (self class sizeOfPopUpForStandardElement / 2)) with: self makeColorButtons columns: 3] + ^ [:aButton | self popUp tryToMakePopUpAt: aButton topCenter - (0 @ (self class sizeOfPopUpForStandardElement / 2)) with: self makeColorButtons columns: self class defaultButtonColumns] ] { @@ -506,11 +533,11 @@ WBElement >> height: aHeight [ { #category : #appearance, - #'squeak_changestamp' : 'si 7/10/2024 11:57' + #'squeak_changestamp' : 'ACL 7/12/2024 12:21' } WBElement >> imageSize [ - ^ (self class sizeOfPopUpForStandardElement @ self class sizeOfPopUpForStandardElement) * 0.75 + ^ (self class sizeOfPopUpForStandardElement @ self class sizeOfPopUpForStandardElement) * self class defaultImageSizeFactor ] { @@ -897,13 +924,13 @@ WBElement >> right [ { #category : #layout, - #'squeak_changestamp' : 'si 7/12/2024 11:38' + #'squeak_changestamp' : 'ACL 7/12/2024 12:30' } WBElement >> setLayout [ self extent: self class defaultSize; - borderWidth: 3; + borderWidth: self class defaultBorderWidth; borderColor: self canvas globalColor. self canvas globalColor = Color transparent ifTrue: diff --git a/src/SqueakWhiteboard-Core/WBLine.class.st b/src/SqueakWhiteboard-Core/WBLine.class.st index cb14fb2..b74aa57 100644 --- a/src/SqueakWhiteboard-Core/WBLine.class.st +++ b/src/SqueakWhiteboard-Core/WBLine.class.st @@ -14,9 +14,18 @@ Class { #'squeak_changestamp' : 'is 6/23/2024 02:19' } +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:05' +} +WBLine class >> defaultBorderWidth [ + + ^ 2 +] + { #category : #'event handeling', - #'squeak_changestamp' : 'si 7/11/2024 15:10' + #'squeak_changestamp' : 'ACL 7/12/2024 12:05' } WBLine >> activateElement: anEvent [ @@ -25,8 +34,8 @@ WBLine >> activateElement: anEvent [ deactivateElement; deactivateTextbox. self dragStart: anEvent. - (self edges at: 2) showPopUp. - self canvas activeElement: (self edges at: 2)] + (self edges second) showPopUp. + self canvas activeElement: (self edges second)] ] { @@ -238,12 +247,12 @@ WBLine >> mouseUp: anEvent [ { #category : #layout, - #'squeak_changestamp' : 'si 7/11/2024 15:20' + #'squeak_changestamp' : 'ACL 7/12/2024 12:05' } WBLine >> setCreatedLayout [ self - borderWidth: 2; + borderWidth: self class defaultBorderWidth; color: Color black; checkForArrowHead. ] diff --git a/src/SqueakWhiteboard-Core/WBNote.class.st b/src/SqueakWhiteboard-Core/WBNote.class.st index 208d0dc..d692bca 100644 --- a/src/SqueakWhiteboard-Core/WBNote.class.st +++ b/src/SqueakWhiteboard-Core/WBNote.class.st @@ -14,11 +14,11 @@ Class { { #category : #accessing, - #'squeak_changestamp' : 'is 6/23/2024 01:46' + #'squeak_changestamp' : 'ACL 7/12/2024 12:08' } WBNote class >> defaultSizeOfCorner [ - ^ 20@20 + ^ 20 @ 20 ] { @@ -33,14 +33,14 @@ WBNote >> color: aColor [ { #category : #initialization, - #'squeak_changestamp' : 'is 6/23/2024 01:42' + #'squeak_changestamp' : 'ACL 7/12/2024 12:07' } WBNote >> createVertecies [ self edges removeAll. self edges add: self center - (self sizeOfNote/2); - add: self center + (((self sizeOfNote x / 2) - self sizeOfCorner y) @ (-1* (self sizeOfNote y/ 2))); + add: self center + (((self sizeOfNote x / 2) - self sizeOfCorner y) @ (-1* (self sizeOfNote y / 2))); add: self center + ((self sizeOfNote x / 2) @ (-1 * ((self sizeOfNote y / 2) - self sizeOfCorner y))); add: self center + (((self sizeOfNote x / 2) - self sizeOfCorner x) @ (-1 * ((self sizeOfNote y / 2) - self sizeOfCorner y))); add: self center + (((self sizeOfNote x / 2) - self sizeOfCorner x) @ (-1* (self sizeOfNote y / 2))); diff --git a/src/SqueakWhiteboard-Core/WBPopUp.class.st b/src/SqueakWhiteboard-Core/WBPopUp.class.st index 0ea8d06..91b74fb 100644 --- a/src/SqueakWhiteboard-Core/WBPopUp.class.st +++ b/src/SqueakWhiteboard-Core/WBPopUp.class.st @@ -26,20 +26,20 @@ WBPopUp class >> cornerRadius [ { #category : #size, - #'squeak_changestamp' : 'si 7/11/2024 14:55' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } -WBPopUp class >> defaultSizeOfPopUp [ +WBPopUp class >> defaultMargin [ - ^ 20 + ^ 5 ] { #category : #size, - #'squeak_changestamp' : 'si 7/10/2024 12:10' + #'squeak_changestamp' : 'si 7/11/2024 14:55' } -WBPopUp class >> margin [ +WBPopUp class >> defaultSizeOfPopUp [ - ^ 5 + ^ 20 ] { @@ -211,11 +211,11 @@ WBPopUp >> setLayout [ { #category : #accessing, - #'squeak_changestamp' : 'si 7/10/2024 11:40' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBPopUp >> sizeOfButton [ - ^ (self sizeOfPopUp - self class margin) @ (self sizeOfPopUp - self class margin) + ^ (self sizeOfPopUp - self class defaultMargin) @ (self sizeOfPopUp - self class defaultMargin) ] { diff --git a/src/SqueakWhiteboard-Core/WBResizeBar.class.st b/src/SqueakWhiteboard-Core/WBResizeBar.class.st index 7f9cdb2..d42fbf2 100644 --- a/src/SqueakWhiteboard-Core/WBResizeBar.class.st +++ b/src/SqueakWhiteboard-Core/WBResizeBar.class.st @@ -12,6 +12,16 @@ Class { #'squeak_changestamp' : 'is 6/23/2024 02:24' } +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:08' +} +WBResizeBar class >> defaultExtent [ + + ^ 20 @ 20 + +] + { #category : #'instance creation', #'squeak_changestamp' : 'is 6/23/2024 01:50' @@ -69,13 +79,13 @@ WBResizeBar >> handlesMouseOver: aEvent [ { #category : #initialization, - #'squeak_changestamp' : 'is 6/23/2024 01:53' + #'squeak_changestamp' : 'ACL 7/12/2024 12:09' } WBResizeBar >> initializeWithParent: aMorph [ super initialize. self - extent: 20@20; + extent: self class defaultExtent; frame: aMorph; setLayout; color: Color transparent. diff --git a/src/SqueakWhiteboard-Core/WBResizeHandle.class.st b/src/SqueakWhiteboard-Core/WBResizeHandle.class.st index a263498..0119d92 100644 --- a/src/SqueakWhiteboard-Core/WBResizeHandle.class.st +++ b/src/SqueakWhiteboard-Core/WBResizeHandle.class.st @@ -12,6 +12,15 @@ Class { #'squeak_changestamp' : 'is 6/23/2024 02:25' } +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:09' +} +WBResizeHandle class >> defaultBorderWidth [ + + ^ 2 +] + { #category : #'instance creation', #'squeak_changestamp' : 'is 6/23/2024 01:57' @@ -69,7 +78,7 @@ WBResizeHandle >> handlesMouseOver: anEvent [ { #category : #initialization, - #'squeak_changestamp' : 'is 6/23/2024 01:59' + #'squeak_changestamp' : 'ACL 7/12/2024 12:09' } WBResizeHandle >> initializeWithParent: aMorph [ @@ -79,7 +88,7 @@ WBResizeHandle >> initializeWithParent: aMorph [ frame: aMorph; setLayout; color: Color white; - borderWidth: 2; + borderWidth: self class defaultBorderWidth; borderColor: Color gray. aMorph addMorph: self diff --git a/src/SqueakWhiteboard-Core/WBTextbox.class.st b/src/SqueakWhiteboard-Core/WBTextbox.class.st index 332e739..2bf214c 100644 --- a/src/SqueakWhiteboard-Core/WBTextbox.class.st +++ b/src/SqueakWhiteboard-Core/WBTextbox.class.st @@ -10,11 +10,11 @@ Class { { #category : #'instance creation', - #'squeak_changestamp' : 'is 7/1/2024 00:29' + #'squeak_changestamp' : 'ACL 7/12/2024 12:10' } WBTextbox class >> defaultSize [ - ^ 15@35 + ^ 15 @ 35 ] { diff --git a/src/SqueakWhiteboard-Core/WBToolbar.class.st b/src/SqueakWhiteboard-Core/WBToolbar.class.st index acbea95..4d653b7 100644 --- a/src/SqueakWhiteboard-Core/WBToolbar.class.st +++ b/src/SqueakWhiteboard-Core/WBToolbar.class.st @@ -15,10 +15,28 @@ Class { } { - #category : #layout, - #'squeak_changestamp' : 'is 6/23/2024 02:03' + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:17' } -WBToolbar class >> margin [ +WBToolbar class >> defaultCanvasSizeFactor [ + + ^ 0.075 @ 0.75 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:20' +} +WBToolbar class >> defaultImageSizeFactor [ + + ^ 0.8 +] + +{ + #category : #defaults, + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' +} +WBToolbar class >> defaultMargin [ ^ 20 ] @@ -61,21 +79,21 @@ WBToolbar >> buttonFunctionalityForCircle [ { #category : #'button functionalities', - #'squeak_changestamp' : 'si 6/25/2024 14:40' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBToolbar >> buttonFunctionalityForColorPalette [ - ^ [:aButton | self makePopUpAt: aButton rightCenter + (self class margin + (self buttonSize x * (3 / 2)) @ 0) with: self createColorButtons columns: 3] + ^ [:aButton | self makePopUpAt: aButton rightCenter + (self class defaultMargin + (self buttonSize x * (3 / 2)) @ 0) with: self createColorButtons columns: 3] ] { #category : #'button functionalities', - #'squeak_changestamp' : 'si 6/25/2024 14:46' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBToolbar >> buttonFunctionalityForDeleteAll [ ^ [:aButton | self canvas showText: self class textForDeleteAll. - self makePopUpAt: self canvas text bottomCenter + (0 @ (self class margin + self buttonSize x)) with: self createDeleteConfirmButtons columns: nil] + self makePopUpAt: self canvas text bottomCenter + (0 @ (self class defaultMargin + self buttonSize x)) with: self createDeleteConfirmButtons columns: nil] ] { @@ -121,11 +139,11 @@ WBToolbar >> buttonFunctionalityForLine [ { #category : #'button functionalities', - #'squeak_changestamp' : 'si 6/25/2024 14:39' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBToolbar >> buttonFunctionalityForLineChoosing [ - ^ [:aButton | self makePopUpAt: aButton rightCenter + (self class margin + (self buttonSize x / 2) @ 0) with: self createLineChoosingButtons columns: 1] + ^ [:aButton | self makePopUpAt: aButton rightCenter + (self class defaultMargin + (self buttonSize x / 2) @ 0) with: self createLineChoosingButtons columns: 1] ] { @@ -148,11 +166,11 @@ WBToolbar >> buttonFunctionalityForRectangle [ { #category : #'button functionalities', - #'squeak_changestamp' : 'si 6/25/2024 14:39' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBToolbar >> buttonFunctionalityForShapeChoosing [ - ^ [:aButton | self makePopUpAt: aButton rightCenter + (self class margin + (self buttonSize x / 2) @ 0) with: self createShapeChoosingButtons columns: 1] + ^ [:aButton | self makePopUpAt: aButton rightCenter + (self class defaultMargin + (self buttonSize x / 2) @ 0) with: self createShapeChoosingButtons columns: 1] ] { @@ -176,11 +194,11 @@ WBToolbar >> buttonFunctionalityForTransparentColor [ { #category : #appearance, - #'squeak_changestamp' : 'si 7/11/2024 15:38' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBToolbar >> buttonSize [ - ^ ((self width min: self height) - self class margin) @ ((self width min: self height) - self class margin) + ^ ((self width min: self height) - self class defaultMargin) @ ((self width min: self height) - self class defaultMargin) ] { @@ -498,11 +516,11 @@ WBToolbar >> getTransparentColorButton [ { #category : #appearance, - #'squeak_changestamp' : 'is 6/23/2024 02:09' + #'squeak_changestamp' : 'ACL 7/12/2024 12:20' } WBToolbar >> imageSize [ - ^ self buttonSize * 0.8 + ^ self buttonSize * self class defaultImageSizeFactor ] { @@ -538,15 +556,15 @@ WBToolbar >> makePopUpAt: aPoint with: aCollection columns: aNumber [ { #category : #initialization, - #'squeak_changestamp' : 'si 7/11/2024 15:39' + #'squeak_changestamp' : 'ACL 7/12/2024 12:12' } WBToolbar >> placeButtons: someButtons [ someButtons doWithIndex: [:aButton :anIndex| aButton - margin: WBToolbar margin; + margin: WBToolbar defaultMargin; extent: self buttonSize; - center: (self bounds origin x + self width / 2) @ (self bounds origin y + ((self buttonSize y + WBToolbar margin) * anIndex) ) - (0 @ self buttonSize y / 2); + center: (self bounds origin x + self width / 2) @ (self bounds origin y + ((self buttonSize y + WBToolbar defaultMargin) * anIndex) ) - (0 @ self buttonSize y / 2); addImage. self addMorph: aButton]. self buttons: someButtons @@ -573,23 +591,14 @@ WBToolbar >> popUp: aPopUp [ { #category : #appearance, - #'squeak_changestamp' : 'is 7/11/2024 22:35' + #'squeak_changestamp' : 'ACL 7/12/2024 12:18' } WBToolbar >> setLayout [ self - height: self canvas extent y * self toolbarCanvasSizeFactor y; - width: self canvas extent x * self toolbarCanvasSizeFactor x; - center: (self canvas bounds origin x + self extent x / 2) @ (self canvas bounds origin y + ((self canvas bounds corner y - self canvas bounds origin y))/2); + height: self canvas extent y * self class defaultCanvasSizeFactor y; + width: self canvas extent x * self class defaultCanvasSizeFactor x; + center: (self canvas bounds origin x + self extent x / 2) @ (self canvas bounds origin y + ((self canvas bounds corner y - self canvas bounds origin y)) / 2); color: Color gray ] - -{ - #category : #appearance, - #'squeak_changestamp' : 'is 6/23/2024 02:07' -} -WBToolbar >> toolbarCanvasSizeFactor [ - - ^ 0.075 @ 0.75 -]