Skip to content

Commit

Permalink
close #55, deletion works, yay.
Browse files Browse the repository at this point in the history
  • Loading branch information
MkuuWaUjinga committed Jul 10, 2017
1 parent 7336731 commit a93005b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ closeWindow

self selectNextWindow.

(self pageDict at: self currentPage) remove: thumbnail.

self currentPage < self numberPages ifTrue: [self windowFromNextPage: self currentPage + 1. self addMorphBack: (self pageDict at: self currentPage) last].

self selectedWindow == thumbnail
ifTrue: [self delete. ^ self].
ifTrue: [self numberPages = 1 ifTrue: [self delete. ^ self]
ifFalse: [self pageDict removeKey: self currentPage. self previousPage. ^self]].

thumbnail delete.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ initialize

self
changeTableLayout;
layoutInset: 10@10;
layoutInset: 50;
cellInset: 15@35;
listDirection: #leftToRight;
wrapDirection: #topToBottom;
cellPositioning: #topCenter.

self numberOfWindowsOnPage: 16.
self numberOfWindowsOnPage: 8.
self pageDict: Dictionary new.
self initializeSelectionRectangle.
self initializeThumbnails.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
as yet unclassified
nextPage

self thumbnailsOnPage do: [:thmb|thmb delete].

self currentPage: self currentPage + 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
as yet unclassified
updateLayout


self layoutInset: 50.

self topLeft: self world topLeft.
self extent: self world extent.

Expand All @@ -9,18 +11,17 @@ updateLayout
arrowUp delete.

self fullBounds.

self submorphBounds in: [:r |
self layoutInset: (self width - r width // 2) @ (self height - r height // 2)].

Transcript show: self submorphBounds; cr.
Transcript show: self layoutInset; cr.
self addMorphBack: selectionRectangle.

self fullBounds.

self currentPage < self numberPages ifTrue: [self addMorphFront: arrowDown].
self currentPage > 1 ifTrue: [self addMorphFront: arrowUp].

self selectWindow: self selectedWindow.

self comeToFront.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
as yet unclassified
windowFromNextPage: aNumber

aNumber > self numberPages ifTrue: [(self pageDict at: aNumber - 1) isEmpty ifTrue: [self pageDict removeKey: aNumber - 1]]
ifFalse: [| wnd | wnd := (self pageDict at: aNumber) removeFirst. (self pageDict at: aNumber - 1) addLast: wnd. ^ self windowFromNextPage: aNumber + 1 ].

Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@
"instance" : {
"activateWindow" : "adz 6/15/2017 20:23",
"activateWindowFromEvent:thumbnail:" : "adz 6/16/2017 20:30",
"closeWindow" : "jh 5/16/2017 12:13",
"closeWindow" : "adz 7/11/2017 01:38",
"currentPage" : "adz 7/6/2017 15:16",
"currentPage:" : "adz 7/6/2017 15:16",
"delete" : "adz 6/21/2017 17:20",
"drawOn:" : "adz 6/8/2017 11:14",
"getWindowsInCurrentSpace" : "adz 6/22/2017 10:05",
"initialize" : "adz 7/10/2017 23:03",
"initialize" : "adz 7/11/2017 01:47",
"initializeDownButton" : "adz 7/10/2017 21:53",
"initializeSelectionRectangle" : "adz 7/6/2017 16:08",
"initializeThumbnails" : "adz 7/10/2017 21:50",
"initializeUpButton" : "adz 7/10/2017 21:53",
"intoWorld:" : "adz 7/10/2017 22:22",
"nextPage" : "adz 7/10/2017 21:51",
"nextPage" : "adz 7/11/2017 01:44",
"numberOfWindowsOnPage" : "adz 7/10/2017 21:33",
"numberOfWindowsOnPage:" : "adz 7/10/2017 21:33",
"numberPages" : "adz 7/6/2017 15:22",
"pageDict" : "adz 7/6/2017 12:04",
"pageDict:" : "adz 7/6/2017 12:04",
"previousPage" : "adz 7/10/2017 21:17",
"previousPage" : "adz 7/11/2017 01:44",
"selectNextWindow" : "adz 7/6/2017 14:14",
"selectPreviousWindow" : "adz 7/6/2017 14:13",
"selectWindow:" : "adz 7/6/2017 14:15",
"selectWindowFromEvent:thumbnail:" : "jh 5/16/2017 12:13",
"selectedWindow" : "jh 5/16/2017 12:13",
"thumbnailsOnPage" : "adz 7/6/2017 15:47",
"updateLayout" : "adz 7/10/2017 23:06" } }
"updateLayout" : "adz 7/11/2017 01:43",
"windowFromNextPage:" : "adz 7/11/2017 01:41" } }

0 comments on commit a93005b

Please sign in to comment.