From a93005b3791300c600e6b00bd305be4391cda02c Mon Sep 17 00:00:00 2001 From: MkuuWaUjinga Date: Tue, 11 Jul 2017 01:49:46 +0200 Subject: [PATCH] close #55, deletion works, yay. --- .../WAExpose.class/instance/closeWindow.st | 7 ++++++- .../WAExpose.class/instance/initialize.st | 4 ++-- .../WAExpose.class/instance/nextPage.st | 2 +- .../WAExpose.class/instance/updateLayout.st | 9 +++++---- .../WAExpose.class/instance/windowFromNextPage..st | 6 ++++++ .../WAExpose.class/methodProperties.json | 11 ++++++----- 6 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 packages/WindowAcrobatics-Core.package/WAExpose.class/instance/windowFromNextPage..st diff --git a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/closeWindow.st b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/closeWindow.st index 1993780..33e908a 100644 --- a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/closeWindow.st +++ b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/closeWindow.st @@ -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. diff --git a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/initialize.st b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/initialize.st index 0956c6a..fc06a1a 100644 --- a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/initialize.st +++ b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/initialize.st @@ -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. diff --git a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/nextPage.st b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/nextPage.st index a9b4efb..f2d1793 100644 --- a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/nextPage.st +++ b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/nextPage.st @@ -1,6 +1,6 @@ as yet unclassified nextPage - + self thumbnailsOnPage do: [:thmb|thmb delete]. self currentPage: self currentPage + 1. diff --git a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/updateLayout.st b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/updateLayout.st index 1e9ac8a..d28f8f7 100644 --- a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/updateLayout.st +++ b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/updateLayout.st @@ -1,6 +1,8 @@ as yet unclassified updateLayout - + + self layoutInset: 50. + self topLeft: self world topLeft. self extent: self world extent. @@ -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. diff --git a/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/windowFromNextPage..st b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/windowFromNextPage..st new file mode 100644 index 0000000..bcbdfd0 --- /dev/null +++ b/packages/WindowAcrobatics-Core.package/WAExpose.class/instance/windowFromNextPage..st @@ -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 ]. + \ No newline at end of file diff --git a/packages/WindowAcrobatics-Core.package/WAExpose.class/methodProperties.json b/packages/WindowAcrobatics-Core.package/WAExpose.class/methodProperties.json index ba4ba4a..ea00269 100644 --- a/packages/WindowAcrobatics-Core.package/WAExpose.class/methodProperties.json +++ b/packages/WindowAcrobatics-Core.package/WAExpose.class/methodProperties.json @@ -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" } }