Skip to content

Commit

Permalink
Merge pull request #79 from hpi-swa-teaching/master
Browse files Browse the repository at this point in the history
PowerSqueak v.1.0
  • Loading branch information
LeonMatthes authored Jul 25, 2018
2 parents f57f6f3 + ba24306 commit 314cec9
Show file tree
Hide file tree
Showing 547 changed files with 2,314 additions and 1,371 deletions.
90 changes: 65 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PowerSqueak [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=release)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09)[![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=release)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=release)
# **PowerSqueak** [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=release)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09)[![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=release)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=release)

A presentation tool for the Squeak development platform

Expand All @@ -10,17 +10,19 @@ Please check [Travis-ci](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09

Squeak 5.0 is officially unsupported (see [Travis-ci](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09)).

## Overview
## **Overview**
* [Overview](https://github.com/hpi-swa-teaching/SWT18-Project-09#overview)
* [Installation Instructions](https://github.com/hpi-swa-teaching/SWT18-Project-09#installation-instructions)
* [Build status](https://github.com/hpi-swa-teaching/SWT18-Project-09#build-status)
* [Using PowerSqueak](https://github.com/hpi-swa-teaching/SWT18-Project-09#using-powersqueak)
* [Edit mode](https://github.com/hpi-swa-teaching/SWT18-Project-09#edit-mode)
* [Magnetic Raster](https://github.com/hpi-swa-teaching/SWT18-Project-09#magnetic-raster)
* [Presentation mode](https://github.com/hpi-swa-teaching/SWT18-Project-09#presentation-mode)
* [Interactive/Non-Interactive mode](https://github.com/hpi-swa-teaching/SWT18-Project-09#interactivenon-interactive-mode)
* [saving and loading](https://github.com/hpi-swa-teaching/SWT18-Project-09#saving-and-loading)
* [list of shortcuts](https://github.com/hpi-swa-teaching/SWT18-Project-09#list-of-shortcuts)

## Installation Instructions
## **Installation Instructions**
For easy installation, please first install [Metacello](https://github.com/Metacello/metacello).

Then run the following code in your Squeak 5.1/6.0(trunk) image:
Expand All @@ -31,51 +33,89 @@ Metacello new
load.
```

## Build status
Alternatively, download the .sar file from the [latest release](https://github.com/hpi-swa-teaching/SWT18-Project-09/releases/latest) and install it into your Squeak image via drag and drop.

## **Build status**
| [Release](https://github.com/hpi-swa-teaching/SWT18-Project-09/releases/latest) | master
| ------------------------- | ------------------- |
| [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=release)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09) | [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=master)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09) |
| [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=release)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=release) | [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=master)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=master) |

## Using PowerSqueak
## **Using PowerSqueak**
To open PowerSqueak either
* run: ``` PSPresentationTool open. ```
* click PowerSqueak in the "Apps" drop-down-menu<br><img src="/pictures/apps-drawer.png" alt="Open PowerSqueak in the Apps menu" width="250">

### Edit mode
During edit mode, you can use the buttons at the top to create, delete and navigate slides and to create different slide elements (like text boxes, and images) and drop them onto the slide.
You may also drop in other Morphs, but be aware, that some features of those Morphs might not work as expected.

For advanced features like deleting morphs or resizing text, right-click the morph.
<br><img src="/pictures/right-click.png" alt="Right-click example" width="400">

### Presentation mode
* run: ``` PSPresentationTool open. ```
* click PowerSqueak in the "Apps" drop-down-menu\
<img src="pictures/apps-drawer.png" alt="Open PowerSqueak in the Apps menu" width="250">

### **Edit mode**
During edit mode, you can use the buttons at the top to create and navigate slides.
To create slides from templates or delete slides, use the "Slide" menu in the menu bar.
To add slide elements like text or images, use the "Insert" menu to create a textfield/image in hand.
You may also drop other Morphs onto slides, but be aware, that some features of those Morphs might not work as expected (scaling most of the time does not work correctly).

For advanced features like deleting morphs or resizing text, right-click the Morph.\
<img src="pictures/right-click.png" alt="Right-click example" width="400">

#### **Magnetic Raster**
PowerSqueak supports a magnetic raster for easy layouting.
If the magnetic raster is active, resizing a Morph will automatically smap the corners of the Morph to an imaginary raster.\
To enable the magnetic raster click:\
<img src="pictures/magnetic-raster.png" alt="How to enable magnetic raster" width=250>\
The button will change color, to indicate, that the raster is active\
<img src="pictures/magnetic-raster-active.png" alt="Magnetic raster is enabled" width=250>

### **Presentation mode**
To enter presentation mode, click the "Present" button.

To control your presentation during presentation mode, use:

| Key | Action |
| ------- | ------- |
| Esc | Leave presentation mode |
| right arrow/page down | next slide |
| left arrow/page up | previous slide |
| Number keys | Jump to a slide number |
| right arrow/arrow down/page down | next slide |
| left arrow/arrow up/page up | previous slide |
| Number keys | Jump to a slide number (0 = last slide) |
| i | (de-)activate interactivity and (un-)hide cursor |
#### Interactive/Non-Interactive mode

Because PowerSqueak supports slide selection with both arrow and page keys, most wireless presenters will work correctly with PowerSqueak, but pressing the present button on your presenter will not work, as the Squeak VM does not support function keys.

#### **Interactive/Non-Interactive mode**
By pressing "i" during presentation mode, you can disable/enable interactivity and hide/unhide the cursor.
This mode is added to avoid the visual clutter of the cursor and to keep text on slides from grabbing the keyboard input, which prevents you from changing slides.

Leaving presentation mode also enables interactivity and unhides the cursor.
Leaving the presentation mode also enables interactivity and unhides the cursor.

### Saving and loading
### **Saving and loading**
PowerSqueak can save and load presentations to/from the file system.

Use the corresponding save/load buttons to save/load the presentation.
If you want to view the saved files, go to the PSPresentation folder in your Squeak VMs folder.
You can share presentations by copying any presentation in the PSPresentation folder into the PSPresentations folder of another image.
Use the corresponding save/load buttons in the "File" menu to save/load the presentation.
If you want to view the saved files, go to the ```PSPresentation``` directory in your Squeak VMs directory.
You can share presentations by copying any presentation in the ```PSPresentation``` directory into the ```PSPresentation``` directory of another image.
In the other image you can then load the presentation as usual in PowerSqueak.

``` diff
- Warning: some morphs may crash your image if they are saved/loaded!
- It is recommended, that you save your image before every save/load operation in PowerSqueak
```

You may also export your presentation to a list of .png files, which will get exported into the ```PSPresentationsExports``` folder in your Squeak VMS directory

### **List of shortcuts**
#### **Global schortcuts**
| Key | Action|
| ---- | ---- |
| right arrow/arrow down/page down | next slide |
| left arrow/arrow up/page up | previous slide |
| Number keys | Jump to a slide number (0 = last slide) |
| Cmd + t | Create a text field in hand |

### **Edit mode shortcuts**
| Key | Action |
| --- | --- |
| Cmd + i | Create an image |

### **Presentation mode shortcuts**
| Key | Action |
| --- | --- |
| i | (de-)activate interactivity and (un-)hide cursor |
| Esc | Leave presentation mode |
17 changes: 17 additions & 0 deletions packages/Presenter-Core.package/PSContentContainer.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
A PSContentContainer is a container for a single morph put on a slide.
It manages resizing and the context menu for its morph.
Resizing is done with "handles", small rectangles, which can be dragged to resize the child morph.

Instance Variables
content: <Morph>
hasHandles: <Boolean>
resizeHandles: <Dictionary>

content
- The morph the container contains

hasHandles
- Shows whether the container's handles exist

resizeHandles
- Dictionary containing the resizeHandles at the container's corners
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resizing
actionForCorner: aSymbol

^ ('drag', aSymbol capitalized, 'Event:fromHandle:') asSymbol
^ ('drag', aSymbol capitalized, 'Event:') asSymbol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
context menu
addContentMenuItemsTo: aMenu

aMenu defaultTarget: self content.
(self content hasProperty: #wantsCustomContextMenu)
ifTrue: [aMenu addList: self content customContextMenuContent]
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ handles
addResizeHandles

self hasHandles ifFalse: [
self addHandleAt: #topLeft.
self addHandleAt: #topRight.
self addHandleAt: #bottomRight.
self addHandleAt: #bottomLeft.
self placeHandles.
self hasHandles: true]
self
addHandleAt: #topLeft;
addHandleAt: #topRight;
addHandleAt: #bottomRight;
addHandleAt: #bottomLeft;
placeHandles;
hasHandles: true]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
content: aMorph

content := aMorph
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
content

^ content
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ context menu
copyChildToHand

| copy |
copy := self child copy.
copy := self content copy.
copy center: ActiveHand center.
ActiveHand grabMorph: copy.
ActiveHand grabMorph: copy.
^ copy
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ context menu
createContextMenu

| menu |
menu := MenuMorph new defaultTarget: self.
menu
addList: self defaultContextMenuContent;
defaultTarget: self child.
(self child hasProperty: #wantsCustomContextMenu) ifTrue: [
menu addList: self child customContextMenuContent].
menu setInvokingView: self.
menu popUpEvent: self activeHand lastEvent in: self world.
^ menu "just for testing reasons"
menu := MenuMorph new
defaultTarget: self;
yourself.
menu addList: self defaultContextMenuContent.
^ menu
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ createHandleOnMove: aSymbol
| handle |
handle := RectangleMorph new
extent: self resizeHandleSize;
color: Color black.
handle
on: #mouseMove
send: aSymbol
to: self.
color: self handleColor.
handle on: #mouseMove send: aSymbol to: self.
^ handle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
accessing
defaultContextMenuContent

^ #(
('grab' grabChild)
^ #(('grab' grabChild)
-
('delete' abandon)
-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resizing
dragBottomLeftEvent: evt fromHandle: handle
dragBottomLeftEvent: evt

self extentBottomLeft: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resizing
dragBottomRightEvent: evt fromHandle: handle
dragBottomRightEvent: evt

self extentBottomRight: (self resizeFractionsOf: evt)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resizing
dragTopLeftEvent: evt fromHandle: handle
dragTopLeftEvent: evt

self extentTopLeft: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resizing
dragTopRightEvent: evt fromHandle: handle
dragTopRightEvent: evt

self extentTopRight: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extent: aPoint

(self extent closeTo: aPoint) ifTrue: [^ self].
super extent: aPoint.
self resizeChild.
self placeHandles
self
resizeChild;
placeHandles

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ filterEvent: evt for: aMorphOrNil
(self containsPoint: evt position) ifTrue: [
evt isMouseDown ifTrue: [
evt yellowButtonPressed ifTrue: [
self createContextMenu.
self invokeContextMenu.
evt ignore]]].
^ evt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
context menu
grabChild

self child center: ActiveHand position.
ActiveHand grabMorph: self child
self content center: self world activeHand position.
self world activeHand grabMorph: self content
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
handleColor

^ Color black
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
context menu
invokeContextMenu

| menu |
menu := self createContextMenu.
self
addContentMenuItemsTo: menu;
openMenu: menu.
^ menu "just for testing reasons"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
magnetic raster
magnetizeLayoutFractions: aPoint

^ aPoint roundTo: self rasterResolution
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ mouseDown: evt

self ifAnyHandleContains: evt position
do: [:handle | ^ evt hand newMouseFocus: handle].
evt hand grabMorph: self child
evt hand grabMorph: self content
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scaling
notifySlideRescale: newExtent

(self child hasProperty: #acceptRescale)
ifTrue: [self child rescale: newExtent]
(self content hasProperty: #acceptRescale)
ifTrue: [self content rescale: newExtent]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
context menu
openMenu: aMenu

aMenu
setInvokingView: self;
popUpEvent: self activeHand lastEvent in: self world
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
magnetic raster
rasterResolution

^ (0.04@0.03)
^ 0.04 @ 0.03
Loading

0 comments on commit 314cec9

Please sign in to comment.