Skip to content

Commit

Permalink
Minor fixes in memo editor for Squeak 5.3 compatibility. For a script…
Browse files Browse the repository at this point in the history
…'s simple window title, use #nextLabel instead of #label, which is like the object service.
  • Loading branch information
marceltaeumel committed Mar 3, 2020
1 parent 8223401 commit 5eceae1
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 54 deletions.
5 changes: 3 additions & 2 deletions repository/Vivide.package/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SquotTrackedObjectMetadata {
#serializer : #SquotCypressCodeSerializer,
#objectClassName : #PackageInfo
#objectClassName : #PackageInfo,
#objectsReplacedByNames : true,
#serializer : #SquotCypressCodeSerializer
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ addSelectionAttribute: attr
from: self selection first
to: self selection last.

self textMorph paragraph composeAll.
self textMorph editor recomputeSelection.
self textMorph changed.
self textMorph
releaseParagraph;
layoutChanged.
25 changes: 11 additions & 14 deletions repository/Vivide.package/ViMemoEdit.class/instance/drawOn..st
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
as yet unclassified
drawOn: aCanvas

| b |
b := self bounds insetBy: (8@3 corner: 10@3).

"Draw paper-like background."
aCanvas
frameRectangle: b
color: (Color gray: 0.7).
| b o c |
o := self margins origin.
c := self margins corner.
b := self bounds insetBy: ((o / 2) rounded corner: (c / 2) rounded).

UiPlatform current
canvas: aCanvas
"Draw fancy shadow."
aCanvas
frameAndFillRoundRect: (b outsetBy: 2)
radius: 3
fillStyle: (SolidFillStyle color: (Color gray: 0.87))
borderWidth: 1 borderColor: (Color gray: 0.95).

fillStyle: (SolidFillStyle color: self color darker)
borderWidth: 1 borderColor: self color.

aCanvas
fillRectangle: b
color: (Color gray: 0.95).
color: self color.

aCanvas
frameRectangle: b
color: (Color gray: 0.7).
width: self borderWidth
color: self borderColor.

self hasUnacceptedChanges ifTrue: [
aCanvas
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
as yet unclassified
hasUnacceptedChanges

^ self originalText ~= self theText
or: [self originalText runs ~= self theText runs]
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ as yet unclassified
initialize

super initialize.

self textMorph contextMenu: [:menu :editor |
menu
addIcon: UiFugueIcons editBoldIcon text: 'Bold' receiver: self selector: #makeSelectionBold;
addIcon: UiFugueIcons editItalicIcon text: 'Italic' receiver: self selector: #makeSelectionItalic;
addIcon: UiFugueIcons editUnderlineIcon text: 'Underline' receiver: self selector: #makeSelectionUnderlined;
addSeparator;
addText: 'Normal' receiver: self selector: #setFont: argument: UiPlatform current standardDefaultTextFont;
addText: 'Mono' receiver: self selector: #setFont: argument: UiPlatform current standardCodeFont;
addText: 'Normal' receiver: self selector: #setFont: argument: TextStyle defaultFont;
addText: 'Mono' receiver: self selector: #setFont: argument: TextStyle defaultFixedFont;
addSeparator.

#(black blue '#00AA00' '#DD0000') do: [:symbol |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
as yet unclassified
setFontSize: anInteger

self addSelectionAttribute: (TextFontReference toFont: (StrikeFont
familyName: self currentFont familyName
pointSize: anInteger)).
3 changes: 3 additions & 0 deletions repository/Vivide.package/ViMemoEdit.class/instance/styler.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
styler
^ nil
11 changes: 7 additions & 4 deletions repository/Vivide.package/ViMemoEdit.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"class" : {
},
"instance" : {
"addSelectionAttribute:" : "mt 1/30/2014 11:45:33.54",
"addSelectionAttribute:" : "mt 2/27/2020 15:19",
"compile" : "mt 11/12/2014 10:31:54.488",
"currentFont" : "mt 1/29/2014 17:37:04.72",
"currentFontSize" : "mt 1/29/2014 17:37:20.563",
"drawOn:" : "mt 1/29/2014 16:56:13.117",
"initialize" : "mt 1/30/2014 12:59:31.585",
"drawOn:" : "mt 2/27/2020 18:37",
"hasUnacceptedChanges" : "mt 2/27/2020 18:18",
"initialize" : "mt 2/27/2020 15:24",
"makeSelectionBold" : "mt 1/30/2014 11:45:47.163",
"makeSelectionItalic" : "mt 1/30/2014 11:45:52.878",
"makeSelectionUnderlined" : "mt 1/30/2014 11:45:58.577",
"parse" : "mt 11/12/2014 10:31:50.315",
"setColor:" : "mt 1/30/2014 12:59:44.839",
"setFont:" : "mt 1/30/2014 11:57:34.836" } }
"setFont:" : "mt 1/30/2014 11:57:34.836",
"setFontSize:" : "mt 2/27/2020 15:15",
"styler" : "mt 2/28/2020 11:23" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ initializeArtifact
memoEdit := ViMemoEdit new
outerBorderWidth: 0;
margins: (15@10 corner: 15@10);
color: (Color gray: 0.95);
borderColor: (Color gray: 0.7);
borderWidth: 1;
scrollingMode: #never.

memoEdit textMorph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ initializeToolbarOperations
addGroup: #font
icon: UiSilkIcons fontIcon
contents: [:editor | {
{#setFont:. 'Text Font'. nil. UiPlatform current standardDefaultTextFont}.
{#setFont:. 'Code Font'. nil. UiPlatform current standardCodeFont}}].
{#setFont:. 'Normal Font'. nil. TextStyle defaultFont}.
{#setFont:. 'Mono Font'. nil. TextStyle defaultFixedFont}}].

self toolbar rightPanel
addGroup: #size
icon: UiFugueIcons editSizeIcon
contents: [:editor | #(8 9 10 11 12 14 16) collect: [:sz |
contents: [:editor | #(8 12 16 24 32) collect: [:sz |
{#setPointSize:. sz asString. nil. sz}]].

self toolbar rightPanel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
actions
setFont: aFont

self artifact theText
addAttribute: (TextFontReference toFont: (StrikeFont
familyName: aFont familyName
pointSize: self currentFontSize))
from: self artifact selection first
to: self artifact selection last.

self flag: #informationHiding.
self artifact textMorph stylerStyled: self artifact theText.
self artifact setFont: aFont.
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
actions
setPointSize: anInteger

self artifact theText
addAttribute: (TextFontReference toFont: (StrikeFont
familyName: self currentFontFamilyName
pointSize: anInteger))
from: self artifact selection first
to: self artifact selection last.

self flag: #informationHiding.
self artifact textMorph stylerStyled: self artifact theText.
self artifact setFontSize: anInteger.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"defaultMemo" : "mt 9/5/2012 13:59:33.665",
"group" : "mt 1/29/2014 15:46:31.066",
"hasUnacceptedChanges" : "mt 9/6/2012 11:21:29.656",
"initializeArtifact" : "mt 1/19/2016 11:42:03.38",
"initializeArtifact" : "mt 2/27/2020 15:50",
"initializeResizeHandle" : "mt 1/29/2014 15:50:18.327",
"initializeToolbarOperations" : "mt 7/8/2013 16:37:02.993",
"initializeToolbarOperations" : "mt 2/27/2020 15:59",
"object" : "mt 9/5/2012 13:22:19.061",
"object:" : "mt 2/8/2015 12:29",
"optimalWidth" : "mt 9/4/2012 12:06:04.941",
"setFont:" : "mt 9/4/2012 10:37:33.593",
"setPointSize:" : "mt 9/4/2012 10:38:56.642",
"setFont:" : "mt 2/27/2020 15:20",
"setPointSize:" : "mt 2/27/2020 15:15",
"updateText:" : "mt 9/6/2012 16:00:47.896" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updateLabel
self script ifNil: [^ self].
self owner ifNil: [^ self].

newLabel := self script label.
newLabel := self script nextLabel.

"If we are (deeply) embedded in a tool, set the label as tooltip."
self owner class == ViSinglePaneEditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"updateFromChangedCode:" : "mt 7/25/2019 15:53",
"updateFromChangedObject:" : "mt 6/9/2014 13:40:40.148",
"updateFromChangedScript:" : "mt 7/25/2019 15:53",
"updateLabel" : "mt 7/25/2019 15:53",
"updateLabel" : "mt 2/28/2020 16:28",
"updateResults" : "mt 7/19/2019 15:54",
"updateView" : "mt 7/25/2019 15:44",
"useSimpleWindowTitle" : "mt 7/25/2019 15:53",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateHeaderText

"Simplify visual appearance for try-outs."
(self pane isExperimentalTool or: [self pane useSimpleWindowTitle])
ifTrue: [^ self headerText: (self pane script ifNil: [''] ifNotNil: [:q | q label ifNil: ['']])].
ifTrue: [^ self headerText: (self pane script ifNil: [''] ifNotNil: [:q | q nextLabel ifNil: ['']])].
"Make script editor more explicit."
self pane isScriptEditor
ifTrue: [^ self headerText: 'Script Editor'].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"saveState:" : "mt 12/19/2014 10:47:39.262",
"uiClass" : "mt 2/5/2015 10:48",
"unwrapPaneFromMultiPaneWidget" : "mt 7/25/2019 15:55",
"updateHeaderText" : "mt 7/25/2019 15:55",
"updateHeaderText" : "mt 2/28/2020 16:30",
"wantsDroppedMorph:event:" : "mt 10/26/2015 14:20:01.694",
"wantsHaloFromClick" : "mt 1/27/2016 09:39:11.334",
"windowColorToUse" : "mt 9/1/2016 12:03",
Expand Down

0 comments on commit 5eceae1

Please sign in to comment.