-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from hpi-swa-teaching/master
PowerSqueak Version 0.4
- Loading branch information
Showing
56 changed files
with
338 additions
and
69 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/barFrameFrom.height..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
toolbuilder | ||
barFrameFrom: fromNumber height: heightNumber | ||
|
||
^ LayoutFrame new | ||
leftFraction: 0 offset: 0; | ||
topFraction: 0 offset: fromNumber; | ||
rightFraction: 1 offset: 0; | ||
bottomFraction: 0 offset: fromNumber + heightNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/buttonHeight.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
toolbuilder | ||
buttonHeight | ||
|
||
^ Preferences standardButtonFont height * 3 |
6 changes: 6 additions & 0 deletions
6
packages/Presenter-Core.package/PSPresentationTool.class/instance/clampSlideNumber..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
as yet unclassified | ||
clampSlideNumber: aNumber | ||
|
||
^ aNumber | ||
clampLow: self minimumSlideCount | ||
high: self slideCount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/Presenter-Core.package/PSPresentationTool.class/instance/createMenuBarSpec..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
toolbuilder | ||
createMenuBarSpec: aBuilder | ||
| panelSpec | | ||
panelSpec := aBuilder pluggablePanelSpec new. | ||
panelSpec | ||
model: self; | ||
frame: (self barFrameFrom: 0 height: self buttonHeight); | ||
name: #MenuBar; | ||
children: OrderedCollection new. | ||
|
||
self menuBarButtonData do: [:each | | ||
| button | | ||
button := self createButtonSpec: each with: aBuilder. | ||
panelSpec children add: button]. | ||
|
||
^ panelSpec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...s/Presenter-Core.package/PSPresentationTool.class/instance/createSlideNumberLabelSpec..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
toolbuilder | ||
createSlideNumberLabelSpec: aBuilder | ||
|
||
| labelSpec | | ||
labelSpec := aBuilder pluggableInputFieldSpec new. | ||
labelSpec | ||
model: self; | ||
name: #SlideNumberLabel; | ||
frame: (0.2@0.0 corner: 0.3@1.0); | ||
getText: #slideNumberString; | ||
setText: #slideNumberString:. | ||
^ labelSpec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ages/Presenter-Core.package/PSPresentationTool.class/instance/currentSlideNumberString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
currentSlideNumberString | ||
|
||
^ currentSlideNumber asString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/Presenter-Core.package/PSPresentationTool.class/instance/duplicateCurrentSlide.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
as yet unclassified | ||
duplicateCurrentSlide | ||
|
||
self slides | ||
add: self currentSlide copy | ||
afterIndex: self currentSlideNumber |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/fileButtonData.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
toolbuilder | ||
fileButtonData | ||
|
||
^ Dictionary withAll: { | ||
#frame -> (0.0@0.0 corner: 0.1@1.0). | ||
#name -> #FileButton. | ||
#label -> 'File'. | ||
#action -> #openFileMenu} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/insertButtonData.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
toolbuilder | ||
insertButtonData | ||
|
||
^ Dictionary withAll: { | ||
#frame -> (0.1@0.0 corner: 0.2@1.0). | ||
#name -> #InsertButton. | ||
#label -> 'Insert'. | ||
#action -> #openInsertMenu} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/Presenter-Core.package/PSPresentationTool.class/instance/menuBarButtonData.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
toolbuilder | ||
menuBarButtonData | ||
|
||
^ { | ||
self fileButtonData. | ||
self insertButtonData | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/Presenter-Core.package/PSPresentationTool.class/instance/moveCurrentSlideTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
slide management | ||
moveCurrentSlideTo: aNumber | ||
|
||
| position | | ||
position := (self clampSlideNumber: aNumber) . | ||
self slides | ||
add: (self slides removeAt: self currentSlideNumber) | ||
afterIndex: position - 1. "position needs to be 0 indexed for add:afterIndex" | ||
"self updateSlideNumbers." | ||
self selectSlide: position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/Presenter-Core.package/PSPresentationTool.class/instance/openFileMenu.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
menu bar | ||
openFileMenu | ||
|
||
| menu | | ||
menu := MenuMorph new. | ||
menu defaultTarget: self. | ||
menu add: 'Save' action: #savePresentation. | ||
menu add: 'Load' action: #loadPresentation. | ||
menu popUpInWorld |
9 changes: 9 additions & 0 deletions
9
packages/Presenter-Core.package/PSPresentationTool.class/instance/openInsertMenu.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
menu bar | ||
openInsertMenu | ||
|
||
| menu | | ||
menu := MenuMorph new. | ||
menu defaultTarget: self. | ||
menu add: 'Text field' action: #newTextField. | ||
menu add: 'Image' action: #newImageField. | ||
menu popUpInWorld |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/openSlideMoveDialog.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
slide management | ||
openSlideMoveDialog | ||
|
||
| userInput | | ||
userInput := UIManager default request: 'Where should I move the current slide???'. | ||
[self moveCurrentSlideTo: userInput asNumber] | ||
on: Error | ||
do: [UIManager inform: 'Not a valid number'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/Presenter-Core.package/PSPresentationTool.class/instance/riskyOperationMessage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
notifications | ||
riskyOperationMessage | ||
|
||
^ 'This operation is risky as it might crash your image.', Character cr, 'Do you want me to proceed?' | ||
^ 'Warning!', Character cr, 'This operation is risky as it might crash your image.', Character cr, 'Do you want me to proceed?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 1 addition & 12 deletions
13
packages/Presenter-Core.package/PSPresentationTool.class/instance/savePresentation.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,4 @@ | ||
presentation saving | ||
savePresentation | ||
|
||
| directory | | ||
directory := self defaultDirectory. | ||
|
||
directory := self getValidPresentationName: directory. | ||
directory ifNil: [^ self]. | ||
directory := self createDirectory: 'slides' in: directory. | ||
|
||
self slides doWithIndex: [:each :index | | ||
| directoryName | | ||
directoryName := 'slide', index asString. | ||
directory createDirectory: directoryName. | ||
each saveInDirectory: directory / directoryName ] | ||
self warn: self riskyOperationMessage trueChoice: [self savePresentationConfirmed] |
15 changes: 15 additions & 0 deletions
15
...ges/Presenter-Core.package/PSPresentationTool.class/instance/savePresentationConfirmed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
presentation saving | ||
savePresentationConfirmed | ||
|
||
| directory | | ||
directory := self defaultDirectory. | ||
|
||
directory := self getValidPresentationName: directory. | ||
directory ifNil: [^ self]. | ||
directory := self createDirectory: 'slides' in: directory. | ||
|
||
self slides doWithIndex: [:each :index | | ||
| directoryName | | ||
directoryName := 'slide', index asString. | ||
directory createDirectory: directoryName. | ||
each saveInDirectory: directory / directoryName ] |
4 changes: 0 additions & 4 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/savingConfirmation.st
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/selectSlide..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
slide management | ||
selectSlide: aNumber | ||
|
||
self currentSlideNumber: | ||
(aNumber | ||
clampLow: self minimumSlideCount | ||
high: self slideCount). | ||
self slideContainer showSlide: self currentSlide | ||
self currentSlideNumber: (self clampSlideNumber: aNumber). | ||
self slideContainer showSlide: self currentSlide. | ||
self changed: #slideNumberString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/slideNumberString..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
accessing | ||
slideNumberString: aText | ||
|
||
| number prefix | | ||
prefix := (aText asString subStrings: '/') at: 1 ifAbsent:['']. | ||
number := prefix asInteger. | ||
number ifNotNil: [self selectSlide: number]. | ||
self changed: #slideNumberString |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationTool.class/instance/slideNumberString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
slideNumberString | ||
|
||
^ self currentSlideNumber asString, '/' , self slideCount asString |
8 changes: 8 additions & 0 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/switchButtonData.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
toolbuilder | ||
switchButtonData | ||
|
||
^ Dictionary withAll: { | ||
#frame -> (0.35@0.0 corner: 0.45@1.0). | ||
#name -> #moveButton. | ||
#label -> 'Move'. | ||
#action -> #openSlideMoveDialog} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.