From a7ec3744f236e02d82ffb42ee06f556f3f9d5f24 Mon Sep 17 00:00:00 2001 From: Laura Meister Date: Sun, 4 Jul 2021 22:15:53 +0200 Subject: [PATCH 01/22] tests accessibility of world submenu entries and the functionality of checkboxes there --- .../instance/testOpenSubmenuEntries.st | 12 ++++++++++++ .../instance/testSubmenuCheckBoxes.st | 15 +++++++++++++++ .../instance/testSubmenuCheckBoxesAfterTab.st | 19 +++++++++++++++++++ .../instance/testTabIntoSubmenus.st | 13 +++++++++++++ .../testWindowOpeningWorldMenuItem..st | 8 ++++---- .../ALGTestTypes.class/methodProperties.json | 6 +++++- 6 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st create mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st create mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st create mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st new file mode 100644 index 00000000..afc4f8c6 --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st @@ -0,0 +1,12 @@ +testing world menu types +testOpenSubmenuEntries + + |flatWidgetLookName englishLanguageName| + + flatWidgetLookName := 'Flat Widget Look'. + self runQuery: flatWidgetLookName. + self assert: (self resultsIncludeName: flatWidgetLookName). + + englishLanguageName := 'English (UNITED STATES)'. + self runQuery: englishLanguageName. + self assert: (self resultsIncludeName: englishLanguageName). \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st new file mode 100644 index 00000000..7d0b2a7d --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st @@ -0,0 +1,15 @@ +testing world menu types +testSubmenuCheckBoxes + + | colorfulWindowsName colorfulWindowsInitialValue| + + colorfulWindowsName := 'Colorful windows'. + colorfulWindowsInitialValue := Model useColorfulWindows. + self runQuery: colorfulWindowsName. + self assert: (self resultsIncludeName: colorfulWindowsName). + self doActionForItem: (self items first). + self deny: colorfulWindowsInitialValue equals: Model useColorfulWindows. + + Model useColorfulWindows: colorfulWindowsInitialValue + + \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st new file mode 100644 index 00000000..8558f46e --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st @@ -0,0 +1,19 @@ +testing world menu types +testSubmenuCheckBoxesAfterTab + + |themesAndColorName tab colorfulWindowsName colorfulWindowsInitialValue| + + themesAndColorName := 'Themes & Colors'. + tab := ALGFakeKeyboardEvent new keyString: ''. + colorfulWindowsName := 'Colorful windows'. + self runQuery: themesAndColorName. + self algInstance keyStroke: tab. + self assert: (self resultsIncludeName: colorfulWindowsName). + colorfulWindowsInitialValue := Model useColorfulWindows. + self runQuery: colorfulWindowsName. + self doActionForItem: (self items first). + self deny: colorfulWindowsInitialValue equals: Model useColorfulWindows. + + Model useColorfulWindows: colorfulWindowsInitialValue + + \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st new file mode 100644 index 00000000..4eafac2c --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st @@ -0,0 +1,13 @@ +testing world menu types +testTabIntoSubmenus + + |themesAndColorName tab randomCheckBoxName randomEntryName| + + themesAndColorName := 'Themes & Colors'. + tab := ALGFakeKeyboardEvent new keyString: ''. + randomCheckBoxName := 'Squeak (duller)'. + randomEntryName := 'Set High-DPI Mode'. + self runQuery: themesAndColorName. + self algInstance keyStroke: tab. + self assert: (self resultsIncludeName: randomCheckBoxName). + self assert: (self resultsIncludeName: randomEntryName). \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWindowOpeningWorldMenuItem..st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWindowOpeningWorldMenuItem..st index d67de036..cb4667cb 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWindowOpeningWorldMenuItem..st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWindowOpeningWorldMenuItem..st @@ -1,11 +1,11 @@ testing world menu types testWindowOpeningWorldMenuItem: menuEntry - | results newBrowser oldBrowsers | + | results newWindows oldWindows | self runQuery: 'open ' , menuEntry. results := self items select: [:each | each name = menuEntry and: [each algerType typeName = 'World Menu Item']]. self assert: results notEmpty. - oldBrowsers := self findSystemWindowsByLabel: menuEntry. + oldWindows := self findSystemWindowsByLabel: menuEntry. self doActionForItem: results first. - newBrowser := self findNewSystemWindowsByLabel: menuEntry old: oldBrowsers. - self assert: newBrowser notEmpty \ No newline at end of file + newWindows := self findNewSystemWindowsByLabel: menuEntry old: oldWindows. + self assert: newWindows notEmpty \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json index 55789fac..3c4845b3 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json @@ -40,6 +40,7 @@ "testMethodTypeOpenMethodInBrowser" : "beb 5/12/2020 12:12", "testOpenApps" : "b 6/4/2021 18:18", "testOpenInExistingBrowser" : "jRo 5/28/2020 20:32", + "testOpenSubmenuEntries" : "lm 7/4/2021 21:35", "testOpenTools" : "b 6/4/2021 18:18", "testOpenWindowEntry:withAction:" : "lm 5/26/2021 20:26", "testPackageAction" : "rk 8/5/2020 22:20", @@ -56,13 +57,16 @@ "testSaveAndQuit" : "OH 5/20/2021 13:52", "testSettingsNotEmpty" : "rk 8/6/2020 10:51", "testStaticWorldMenuTypeNotEmpty" : "OH 5/20/2021 13:34", + "testSubmenuCheckBoxes" : "lm 7/4/2021 22:12", + "testSubmenuCheckBoxesAfterTab" : "lm 7/4/2021 22:10", + "testTabIntoSubmenus" : "lm 7/4/2021 21:52", "testTestNotEmpty" : "rk 8/6/2020 10:51", "testWindowBringToFront" : "lm 5/26/2021 20:39", "testWindowClose" : "lm 5/26/2021 20:18", "testWindowCollapse" : "b 5/29/2021 09:35", "testWindowContract" : "lm 5/26/2021 20:42", "testWindowExpand" : "lm 5/26/2021 20:38", - "testWindowOpeningWorldMenuItem:" : "b 6/4/2021 18:18", + "testWindowOpeningWorldMenuItem:" : "lm 7/4/2021 21:28", "testWindowTypeNotEmpty" : "lm 5/26/2021 20:19", "testWorldMenuDefaultAction" : "b 6/4/2021 18:05", "testWorldMenuDefaultIcon" : "b 6/4/2021 18:05", From 08f4dce4b061a8a1b1d1ddab2d9d2d369797077f Mon Sep 17 00:00:00 2001 From: Laura Meister Date: Sun, 4 Jul 2021 23:03:54 +0200 Subject: [PATCH 02/22] adds world submenus as items --- .../ALGDynamicWorldMenuType.class/methodProperties.json | 4 +--- .../instance/enabledMenuSubmorphs.st | 2 +- .../instance/subMenuSubmorphs.st | 9 +++++++++ .../ALGNamedWorldMenuEntry.class/methodProperties.json | 5 +++-- .../ALGTestTypes.class/instance/testSubmenuCheckBoxes.st | 2 +- .../ALGTestTypes.class/methodProperties.json | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json index 9205a575..b41c0139 100644 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json @@ -1,8 +1,6 @@ { "class" : { - "excludeDynamicWindows:" : "b 5/22/2021 20:46", "extractMenuEntriesFrom:" : "NL 6/29/2021 15:00", - "filterOutDuplicates:" : "NM 6/29/2021 17:28", - "menuEntries:" : "NL 6/4/2021 16:21" }, + "filterOutDuplicates:" : "NM 6/29/2021 17:28" }, "instance" : { } } diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/enabledMenuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/enabledMenuSubmorphs.st index a50ed5f7..fcf1b457 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/enabledMenuSubmorphs.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/enabledMenuSubmorphs.st @@ -2,4 +2,4 @@ accessing enabledMenuSubmorphs "Some submorphs can't be disabled (e.g. line, ...)" - ^ self menuSubmorphs select: [:menuItem | (menuItem class canUnderstand: #isEnabled) not or: [menuItem isEnabled]] \ No newline at end of file + ^ (self menuSubmorphs, self subMenuSubmorphs) select: [:menuItem | (menuItem class canUnderstand: #isEnabled) not or: [menuItem isEnabled]] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st new file mode 100644 index 00000000..471c92ef --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st @@ -0,0 +1,9 @@ +accessing +subMenuSubmorphs + + |submorphs| + submorphs := OrderedCollection new. + (self menuSubmorphs select: [:menuSubmorph | (menuSubmorph externalName = 'line') not]) + collect: [:menuSubmorph | menuSubmorph subMenu ifNotNil: + [submorphs addAll: menuSubmorph subMenu submorphs] ]. + ^ submorphs \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index c9619c09..9b57b1cf 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "newFrom:name:" : "NL 6/4/2021 16:16" }, "instance" : { - "enabledMenuSubmorphs" : "fsa 6/27/2021 11:29", + "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", "excludeDynamicWindows" : "fsa 6/27/2021 10:55", "isDynamic" : "fsa 6/27/2021 10:40", "isMenu" : "fsa 6/27/2021 10:40", @@ -11,4 +11,5 @@ "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", "name" : "NL 6/4/2021 16:15", - "name:" : "NL 6/4/2021 16:15" } } + "name:" : "NL 6/4/2021 16:15", + "subMenuSubmorphs" : "lm 7/4/2021 22:49" } } diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st index 7d0b2a7d..f4c65038 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxes.st @@ -3,7 +3,7 @@ testSubmenuCheckBoxes | colorfulWindowsName colorfulWindowsInitialValue| - colorfulWindowsName := 'Colorful windows'. + colorfulWindowsName := 'Colorful Windows'. colorfulWindowsInitialValue := Model useColorfulWindows. self runQuery: colorfulWindowsName. self assert: (self resultsIncludeName: colorfulWindowsName). diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json index 3c4845b3..819c34e4 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json @@ -57,7 +57,7 @@ "testSaveAndQuit" : "OH 5/20/2021 13:52", "testSettingsNotEmpty" : "rk 8/6/2020 10:51", "testStaticWorldMenuTypeNotEmpty" : "OH 5/20/2021 13:34", - "testSubmenuCheckBoxes" : "lm 7/4/2021 22:12", + "testSubmenuCheckBoxes" : "lm 7/4/2021 23:00", "testSubmenuCheckBoxesAfterTab" : "lm 7/4/2021 22:10", "testTabIntoSubmenus" : "lm 7/4/2021 21:52", "testTestNotEmpty" : "rk 8/6/2020 10:51", From e750f478b5b33c763b93f5f95f7a5c50044419e4 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 5 Jul 2021 17:59:37 +0200 Subject: [PATCH 03/22] Trolololol --- .../class/newFrom..st | 6 ++++++ .../class/newFrom.name..st | 7 ------- .../instance/excludeDynamicWindows.st | 7 ------- .../instance/isDynamic.st | 3 ++- .../instance/isEnabled.st | 4 ++++ .../instance/isMenu.st | 6 ++++-- .../instance/menuEntries.st | 6 +++--- .../instance/menuSubmorphs.st | 5 ++++- .../instance/name..st | 3 --- .../instance/name.st | 3 --- .../instance/selectEnabled..st | 5 +++++ .../instance/subMenuIfAbsent..st | 7 +++++++ .../instance/subMenuSubmorphs.st | 9 --------- .../instance/subMenus.st | 12 ++++++++++++ .../methodProperties.json | 18 +++++++++--------- .../class/menuEntries.st | 3 +-- .../class/menuEntriesNew.st | 5 +++++ .../ALGWorldMenuType.class/class/menus.st | 4 +++- .../methodProperties.json | 5 +++-- 19 files changed, 68 insertions(+), 50 deletions(-) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.name..st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/excludeDynamicWindows.st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isEnabled.st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name..st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st new file mode 100644 index 00000000..1fea76a2 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st @@ -0,0 +1,6 @@ +instance creation +newFrom: aMorph + + ^ self new + morph: aMorph; + yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.name..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.name..st deleted file mode 100644 index bd52aa9d..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.name..st +++ /dev/null @@ -1,7 +0,0 @@ -instance creation -newFrom: aMorph name: aString - - ^ (self new) - name: aString; - morph: aMorph; - yourself. \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/excludeDynamicWindows.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/excludeDynamicWindows.st deleted file mode 100644 index 0e77f63b..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/excludeDynamicWindows.st +++ /dev/null @@ -1,7 +0,0 @@ -helpers -excludeDynamicWindows - - |lineMorph| - - lineMorph := self menuSubmorphs detect: [:subMorph | subMorph externalName = 'line']. - ^ self menuSubmorphs copyAfter: lineMorph diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st index e22c3460..ffebe90a 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st @@ -1,4 +1,5 @@ accessing isDynamic - ^ self morph isKindOf: DockingBarUpdatingMenuMorph \ No newline at end of file + ^ (self subMenuIfAbsent: [ ^ false ]) + isKindOf: DockingBarUpdatingMenuMorph \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isEnabled.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isEnabled.st new file mode 100644 index 00000000..fd666468 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isEnabled.st @@ -0,0 +1,4 @@ +accessing +isEnabled + + ^ (self morph class canUnderstand: #isEnabled) not or: [self morph isEnabled] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isMenu.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isMenu.st index a9bac241..e8814c61 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isMenu.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isMenu.st @@ -1,4 +1,6 @@ accessing isMenu - "Some entries in the docking bar (project name) are not a real menu, but are only distinct by not having a menu morph" - ^ self morph isNil not \ No newline at end of file + + self subMenuIfAbsent: [ ^ false ]. + + ^ true \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st index 8a891efb..e0747c1e 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st @@ -2,6 +2,6 @@ accessing menuEntries (self isDynamic and: [self name = 'Windows']) - ifTrue: [^ self excludeDynamicWindows]. - - ^ self enabledMenuSubmorphs \ No newline at end of file + ifTrue: [^ OrderedCollection new ]. + + ^ self selectEnabled: self menuSubmorphs \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st index 47165907..a2fbb23a 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st @@ -1,4 +1,7 @@ accessing menuSubmorphs - ^ self morph submorphs \ No newline at end of file + ^ (self subMenuIfAbsent: [ ^ OrderedCollection new ]) submorphs + collect: [ :submorph | + ALGNamedWorldMenuEntry newFrom: submorph + ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name..st deleted file mode 100644 index e8cfe90d..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -name: aString - name := aString \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st deleted file mode 100644 index 22077c20..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -name - ^ name \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st new file mode 100644 index 00000000..71ccc871 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st @@ -0,0 +1,5 @@ +accessing +selectEnabled: aCollection + + "Some submorphs can't be disabled (e.g. line, ...)" + ^ aCollection select: [:menuItem | menuItem isEnabled] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st new file mode 100644 index 00000000..5be9b0a5 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st @@ -0,0 +1,7 @@ +accessing +subMenuIfAbsent: aBlock + + Transcript showln: (self morph). + ^ (self morph class canUnderstand: #subMenu) + ifTrue: [ self morph subMenu ] + ifFalse: [ aBlock value ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st deleted file mode 100644 index 471c92ef..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuSubmorphs.st +++ /dev/null @@ -1,9 +0,0 @@ -accessing -subMenuSubmorphs - - |submorphs| - submorphs := OrderedCollection new. - (self menuSubmorphs select: [:menuSubmorph | (menuSubmorph externalName = 'line') not]) - collect: [:menuSubmorph | menuSubmorph subMenu ifNotNil: - [submorphs addAll: menuSubmorph subMenu submorphs] ]. - ^ submorphs \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st new file mode 100644 index 00000000..795b0db9 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st @@ -0,0 +1,12 @@ +accessing +subMenus + | entries | + + entries := OrderedCollection new. + + entries addAll: self menuEntries. + + entries addAll: (self menuEntries inject: OrderedCollection new into: + [ :accumulator :entry | accumulator addAll: entry subMenus ]). + + ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 9b57b1cf..0f1420e8 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -1,15 +1,15 @@ { "class" : { - "newFrom:name:" : "NL 6/4/2021 16:16" }, + "newFrom:" : "NL 7/5/2021 17:53" }, "instance" : { "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", - "excludeDynamicWindows" : "fsa 6/27/2021 10:55", - "isDynamic" : "fsa 6/27/2021 10:40", - "isMenu" : "fsa 6/27/2021 10:40", - "menuEntries" : "fsa 6/27/2021 10:56", - "menuSubmorphs" : "fsa 6/27/2021 11:09", + "isDynamic" : "NL 7/5/2021 17:47", + "isEnabled" : "NL 7/5/2021 17:48", + "isMenu" : "NL 7/5/2021 17:54", + "menuEntries" : "NL 7/5/2021 17:55", + "menuSubmorphs" : "NL 7/5/2021 17:56", "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", - "name" : "NL 6/4/2021 16:15", - "name:" : "NL 6/4/2021 16:15", - "subMenuSubmorphs" : "lm 7/4/2021 22:49" } } + "selectEnabled:" : "NL 7/5/2021 17:43", + "subMenuIfAbsent:" : "NL 7/5/2021 17:57", + "subMenus" : "NL 7/5/2021 17:36" } } diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st index a0dd09e5..2fca3dcf 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st @@ -4,9 +4,8 @@ menuEntries entries := OrderedCollection new. - ((self menus + (self menus collect: [ :each | ALGNamedWorldMenuEntry newFrom: each subMenu name: each contents ]) - select: [ :each | each isMenu ]) do: [ :each | entries addAll: ( (self extractMenuEntriesFrom: each) diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st new file mode 100644 index 00000000..d86aa135 --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st @@ -0,0 +1,5 @@ +algertem lists +menuEntriesNew + + ^ (ALGNamedWorldMenuEntry newFrom: ActiveWorld mainDockingBars first) + subMenus \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st index be4131bd..7c50f583 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st @@ -1,3 +1,5 @@ algertem lists menus - ^ self dockingBar submorphs select: [:each | each isKindOf: MenuItemMorph] \ No newline at end of file + ^ self dockingBar submorphs + select: [:each | + (each isKindOf: MenuItemMorph) and: [ each isNil not ] ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 9dcd75d1..8880ee80 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -5,8 +5,9 @@ "extractMenuEntriesFrom:" : "NL 6/4/2021 16:23", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", - "menuEntries" : "fsa 6/27/2021 11:03", - "menus" : "OH 5/18/2021 11:28" }, + "menuEntries" : "NL 7/5/2021 17:28", + "menuEntriesNew" : "NL 7/5/2021 17:53", + "menus" : "NL 7/5/2021 17:09" }, "instance" : { "createAction" : "NL 6/4/2021 16:37", "createActionNamed:" : "NL 6/4/2021 16:30", From 1f020e9702f1654abc921ddf5499e6b265332f44 Mon Sep 17 00:00:00 2001 From: Benedikt Weber Date: Mon, 5 Jul 2021 19:09:19 +0200 Subject: [PATCH 04/22] Trololololol but works --- .../instance/{subMenus.st => allEntries.st} | 4 ++-- .../instance/ifDynamic.ifStatic..st | 4 ++++ .../instance/isValid.st | 4 ++++ .../instance/menuEntries.st | 10 ++++++---- .../instance/menuSubmorphs.st | 15 +++++++++++---- .../ALGNamedWorldMenuEntry.class/instance/name.st | 4 ++++ .../instance/selectEnabled..st | 5 ----- .../instance/subMenuIfAbsent..st | 3 +-- .../methodProperties.json | 12 +++++++----- .../ALGNamedWorldMenuEntry.class/properties.json | 1 - .../ALGWorldMenuType.class/class/algertemList.st | 2 +- .../ALGWorldMenuType.class/class/allEntries.st | 12 ++++++++++++ .../ALGWorldMenuType.class/class/entries.st | 14 ++++++++++++++ .../ALGWorldMenuType.class/class/menuEntries.st | 15 +++------------ .../class/menuEntriesNew.st | 13 +++++++++++-- .../ALGWorldMenuType.class/methodProperties.json | 8 +++++--- 16 files changed, 85 insertions(+), 41 deletions(-) rename packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/{subMenus.st => allEntries.st} (67%) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isValid.st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/entries.st diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st similarity index 67% rename from packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st rename to packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st index 795b0db9..94007bfb 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenus.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st @@ -1,5 +1,5 @@ accessing -subMenus +allEntries | entries | entries := OrderedCollection new. @@ -7,6 +7,6 @@ subMenus entries addAll: self menuEntries. entries addAll: (self menuEntries inject: OrderedCollection new into: - [ :accumulator :entry | accumulator addAll: entry subMenus ]). + [ :accumulator :entry | accumulator addAll: entry allEntries; yourself ]). ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st new file mode 100644 index 00000000..113dfa2e --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st @@ -0,0 +1,4 @@ +accessing +ifDynamic: dynamicBlock ifStatic: staticBlock + + ^ self isDynamic ifTrue: [dynamicBlock value] ifFalse: [staticBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isValid.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isValid.st new file mode 100644 index 00000000..8b47b373 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isValid.st @@ -0,0 +1,4 @@ +accessing +isValid + + ^ (self morph isKindOf: DockingBarItemMorph) or: [self morph isKindOf: MenuItemMorph] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st index e0747c1e..e25cbeff 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st @@ -1,7 +1,9 @@ accessing menuEntries - (self isDynamic and: [self name = 'Windows']) - ifTrue: [^ OrderedCollection new ]. - - ^ self selectEnabled: self menuSubmorphs \ No newline at end of file + self name = 'Windows' ifTrue: [^ OrderedCollection new ]. + + ^ ((self menuSubmorphs + collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) + select: [ :entry | entry isValid]) + select: [:entry | entry isEnabled] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st index a2fbb23a..9e68bd8b 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st @@ -1,7 +1,14 @@ accessing menuSubmorphs - ^ (self subMenuIfAbsent: [ ^ OrderedCollection new ]) submorphs - collect: [ :submorph | - ALGNamedWorldMenuEntry newFrom: submorph - ] \ No newline at end of file + | subMenu morphs | + + subMenu := self subMenuIfAbsent: [ ^ OrderedCollection new ]. + morphs := OrderedCollection new. + + self ifDynamic: [subMenu updateMenu. + morphs addAll: subMenu submorphs. + subMenu removeAllMorphs ] + ifStatic: [morphs addAll: subMenu submorphs]. + + ^ morphs \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st new file mode 100644 index 00000000..74ab42a2 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st @@ -0,0 +1,4 @@ +accessing +name + + ^ self morph contents \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st deleted file mode 100644 index 71ccc871..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selectEnabled..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -selectEnabled: aCollection - - "Some submorphs can't be disabled (e.g. line, ...)" - ^ aCollection select: [:menuItem | menuItem isEnabled] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st index 5be9b0a5..aafff9a7 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/subMenuIfAbsent..st @@ -1,7 +1,6 @@ accessing subMenuIfAbsent: aBlock - Transcript showln: (self morph). ^ (self morph class canUnderstand: #subMenu) - ifTrue: [ self morph subMenu ] + ifTrue: [ self morph subMenu ifNil: [^ aBlock value] ] ifFalse: [ aBlock value ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 0f1420e8..504bc2f9 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -2,14 +2,16 @@ "class" : { "newFrom:" : "NL 7/5/2021 17:53" }, "instance" : { + "allEntries" : "b 7/5/2021 19:03", "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", + "ifDynamic:ifStatic:" : "b 7/5/2021 18:32", "isDynamic" : "NL 7/5/2021 17:47", "isEnabled" : "NL 7/5/2021 17:48", "isMenu" : "NL 7/5/2021 17:54", - "menuEntries" : "NL 7/5/2021 17:55", - "menuSubmorphs" : "NL 7/5/2021 17:56", + "isValid" : "b 7/5/2021 18:43", + "menuEntries" : "b 7/5/2021 18:54", + "menuSubmorphs" : "b 7/5/2021 18:53", "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", - "selectEnabled:" : "NL 7/5/2021 17:43", - "subMenuIfAbsent:" : "NL 7/5/2021 17:57", - "subMenus" : "NL 7/5/2021 17:36" } } + "name" : "b 7/5/2021 18:50", + "subMenuIfAbsent:" : "b 7/5/2021 18:18" } } diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json index 649e49c5..e249a6b0 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json @@ -6,7 +6,6 @@ ], "commentStamp" : "fsa 6/27/2021 10:38", "instvars" : [ - "name", "morph" ], "name" : "ALGNamedWorldMenuEntry", "pools" : [ diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st index fe65fc9e..b8c36dc1 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st @@ -1,5 +1,5 @@ algertem lists algertemList - ^ self menuEntries + ^ self entries collect: [ :each | ALGWorldMenuItem withAlgertype: (self with: each) ] diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st new file mode 100644 index 00000000..3d1a790f --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st @@ -0,0 +1,12 @@ +algertem lists +allEntries + + |entries| + + entries := OrderedCollection new. + + entries addAll: self menuEntries. + entries addAll: (self menuEntries + inject: OrderedCollection new into: [:accumulator :entry | accumulator addAll: entry allEntries; yourself]). + + ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/entries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/entries.st new file mode 100644 index 00000000..83479766 --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/entries.st @@ -0,0 +1,14 @@ +algertem lists +entries + + "entries := OrderedCollection new. + + (self menus + collect: [ :each | ALGNamedWorldMenuEntry newFrom: each subMenu name: each contents ]) + do: [ :each | + entries addAll: ( + (self extractMenuEntriesFrom: each) + collect: [ :entry | ALGNamedWorldMenuEntry newFrom: entry name: each name]) ]. + + ^ entries select: [:each | each morph isKindOf: MenuItemMorph] + " \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st index 2fca3dcf..2ce7896b 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st @@ -1,15 +1,6 @@ algertem lists menuEntries - |entries| - - entries := OrderedCollection new. - (self menus - collect: [ :each | ALGNamedWorldMenuEntry newFrom: each subMenu name: each contents ]) - do: [ :each | - entries addAll: ( - (self extractMenuEntriesFrom: each) - collect: [ :entry | ALGNamedWorldMenuEntry newFrom: entry name: each name]) ]. - - ^ entries select: [:each | each morph isKindOf: MenuItemMorph] - \ No newline at end of file + ^ (self dockingBar submorphs + collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) + select: [:entry | entry isValid] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st index d86aa135..a616c1eb 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st @@ -1,5 +1,14 @@ algertem lists menuEntriesNew - ^ (ALGNamedWorldMenuEntry newFrom: ActiveWorld mainDockingBars first) - subMenus \ No newline at end of file + |menuEntries entries| + + entries := OrderedCollection new. + + menuEntries := (self dockingBar submorphs + collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) + select: [:entry | entry isValid]. + entries addAll: menuEntries. + + ^ menuEntries + inject: OrderedCollection new into: [:accumulator :entry | accumulator addAll: entry subEntries; yourself] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 8880ee80..b346203a 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -1,12 +1,14 @@ { "class" : { - "algertemList" : "NL 6/4/2021 16:39", + "algertemList" : "b 7/5/2021 18:13", + "allEntries" : "b 7/5/2021 19:03", "dockingBar" : "b 5/16/2021 19:30", + "entries" : "b 7/5/2021 18:34", "extractMenuEntriesFrom:" : "NL 6/4/2021 16:23", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", - "menuEntries" : "NL 7/5/2021 17:28", - "menuEntriesNew" : "NL 7/5/2021 17:53", + "menuEntries" : "b 7/5/2021 19:01", + "menuEntriesNew" : "b 7/5/2021 19:00", "menus" : "NL 7/5/2021 17:09" }, "instance" : { "createAction" : "NL 6/4/2021 16:37", From e6bc2f7d06fe0ee73d90676ba2c6982797940cd4 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 5 Jul 2021 20:22:51 +0200 Subject: [PATCH 05/22] Working copy --- .../class/initializeItems.st | 1 - .../instance/dynamicItems.st | 2 +- .../ALGItemProvider.class/methodProperties.json | 4 ++-- .../class/newFrom.inCategory..st | 7 +++++++ .../instance/category..st | 3 +++ .../instance/category.st | 3 +++ .../instance/hasEntries.st | 4 ++++ .../instance/menuEntries.st | 4 +--- .../methodProperties.json | 8 ++++++-- .../ALGNamedWorldMenuEntry.class/properties.json | 3 ++- .../ALGWorldMenuItem.class/instance/icon.st | 2 +- .../ALGWorldMenuItem.class/methodProperties.json | 2 +- .../ALGWorldMenuType.class/class/algertemList.st | 2 +- .../class/algertemListWith..st | 5 +++++ .../ALGWorldMenuType.class/class/allEntries.st | 2 ++ .../class/extractMenuEntriesFrom..st | 3 --- .../class/filterOutDuplicates..st | 5 +++++ .../ALGWorldMenuType.class/class/menuEntries.st | 6 ++++-- .../class/menuEntriesNew.st | 14 -------------- .../ALGWorldMenuType.class/class/menus.st | 5 ----- .../instance/algertemChildrenList.st | 4 ++++ .../instance/createAction.st | 4 +++- .../instance/hasChildren.st | 4 ++++ .../ALGWorldMenuType.class/methodProperties.json | 15 ++++++++------- 24 files changed, 67 insertions(+), 45 deletions(-) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st delete mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/extractMenuEntriesFrom..st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st delete mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st delete mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/menus.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st diff --git a/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st b/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st index ea7ef8e9..ca70a830 100644 --- a/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st +++ b/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st @@ -11,5 +11,4 @@ initializeItems addAll: ALGSettingsType algertemList; addAll: ALGClassType algertemList; addAll: ALGMethodType algertemList; - addAll: ALGStaticWorldMenuType algertemList; yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGItemProvider.class/instance/dynamicItems.st b/packages/Algernon.package/ALGItemProvider.class/instance/dynamicItems.st index ce6f9f41..441a63f5 100644 --- a/packages/Algernon.package/ALGItemProvider.class/instance/dynamicItems.st +++ b/packages/Algernon.package/ALGItemProvider.class/instance/dynamicItems.st @@ -1,5 +1,5 @@ accessing dynamicItems ^ (ALGExpressionType algertemList: self controller), - ALGDynamicWorldMenuType algertemList, + ALGWorldMenuType algertemList, ALGWindowType algertemList \ No newline at end of file diff --git a/packages/Algernon.package/ALGItemProvider.class/methodProperties.json b/packages/Algernon.package/ALGItemProvider.class/methodProperties.json index 264a1d95..09f18954 100644 --- a/packages/Algernon.package/ALGItemProvider.class/methodProperties.json +++ b/packages/Algernon.package/ALGItemProvider.class/methodProperties.json @@ -3,7 +3,7 @@ "defaultItems" : "J.J. 7/27/2015 17:37", "defaultSearchLevel" : "OH 5/20/2021 13:59", "filters" : "beb 5/20/2020 17:57", - "initializeItems" : "lm 5/19/2021 10:54", + "initializeItems" : "NL 7/5/2021 19:32", "maximumItemsToCompute" : "b 5/28/2021 15:43", "newIn:" : "J.J. 7/30/2015 22:00", "searchDelimeter" : "J.J. 7/28/2015 17:11" }, @@ -18,7 +18,7 @@ "controller:" : "beb 7/15/2020 16:47", "createCategoriesFor:" : "jRo 7/2/2020 01:01", "defaultItems" : "fsa 5/18/2021 17:37", - "dynamicItems" : "lm 5/25/2021 21:23", + "dynamicItems" : "NL 7/5/2021 19:32", "filterItems:for:" : "OH 5/20/2021 14:37", "filteredStaticItemsFor:" : "OH 5/20/2021 14:35", "getCachedStaticItemsFor:" : "OH 5/20/2021 14:37", diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st new file mode 100644 index 00000000..886ce636 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st @@ -0,0 +1,7 @@ +as yet unclassified +newFrom: aMorph inCategory: aString + + ^ self new + morph: aMorph; + category: aString; + yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st new file mode 100644 index 00000000..1f5cf82d --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st @@ -0,0 +1,3 @@ +as yet unclassified +category: aString + category := aString \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st new file mode 100644 index 00000000..bb6b5c7f --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st @@ -0,0 +1,3 @@ +as yet unclassified +category + ^ category \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st new file mode 100644 index 00000000..38667e80 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st @@ -0,0 +1,4 @@ +as yet unclassified +hasEntries + + ^ self menuEntries isEmpty not \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st index e25cbeff..0d5ecfc2 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st @@ -1,9 +1,7 @@ accessing menuEntries - self name = 'Windows' ifTrue: [^ OrderedCollection new ]. - ^ ((self menuSubmorphs - collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) + collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph inCategory: self category]) select: [ :entry | entry isValid]) select: [:entry | entry isEnabled] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 504bc2f9..88e438af 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -1,15 +1,19 @@ { "class" : { - "newFrom:" : "NL 7/5/2021 17:53" }, + "newFrom:" : "NL 7/5/2021 17:53", + "newFrom:inCategory:" : "NL 7/5/2021 19:21" }, "instance" : { "allEntries" : "b 7/5/2021 19:03", + "category" : "NL 7/5/2021 19:20", + "category:" : "NL 7/5/2021 19:21", "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", + "hasEntries" : "NL 7/5/2021 19:42", "ifDynamic:ifStatic:" : "b 7/5/2021 18:32", "isDynamic" : "NL 7/5/2021 17:47", "isEnabled" : "NL 7/5/2021 17:48", "isMenu" : "NL 7/5/2021 17:54", "isValid" : "b 7/5/2021 18:43", - "menuEntries" : "b 7/5/2021 18:54", + "menuEntries" : "NL 7/5/2021 19:45", "menuSubmorphs" : "b 7/5/2021 18:53", "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json index e249a6b0..972d2846 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json @@ -6,7 +6,8 @@ ], "commentStamp" : "fsa 6/27/2021 10:38", "instvars" : [ - "morph" ], + "morph", + "category" ], "name" : "ALGNamedWorldMenuEntry", "pools" : [ ], diff --git a/packages/Algernon.package/ALGWorldMenuItem.class/instance/icon.st b/packages/Algernon.package/ALGWorldMenuItem.class/instance/icon.st index d908f26c..ea086749 100644 --- a/packages/Algernon.package/ALGWorldMenuItem.class/instance/icon.st +++ b/packages/Algernon.package/ALGWorldMenuItem.class/instance/icon.st @@ -2,5 +2,5 @@ icon icon ^ self class mapping - at: self algerType typeObject name + at: self algerType typeObject category ifAbsent: [ #WorldMenu ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuItem.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuItem.class/methodProperties.json index 0ef2b75b..c1020eee 100644 --- a/packages/Algernon.package/ALGWorldMenuItem.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuItem.class/methodProperties.json @@ -2,4 +2,4 @@ "class" : { "mapping" : "NL 6/4/2021 15:42" }, "instance" : { - "icon" : "NL 6/4/2021 16:43" } } + "icon" : "NL 7/5/2021 19:26" } } diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st index b8c36dc1..74519a2e 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemList.st @@ -1,5 +1,5 @@ algertem lists algertemList - ^ self entries + ^ self allEntries collect: [ :each | ALGWorldMenuItem withAlgertype: (self with: each) ] diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st new file mode 100644 index 00000000..c281b129 --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st @@ -0,0 +1,5 @@ +as yet unclassified +algertemListWith: aNamedWorldMenuEntry + + ^ aNamedWorldMenuEntry menuEntries + collect: [ :each | ALGWorldMenuItem withAlgertype: (self with: each)] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st index 3d1a790f..a691d5c6 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st @@ -8,5 +8,7 @@ allEntries entries addAll: self menuEntries. entries addAll: (self menuEntries inject: OrderedCollection new into: [:accumulator :entry | accumulator addAll: entry allEntries; yourself]). + + entries := self filterOutDuplicates: entries. ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/extractMenuEntriesFrom..st b/packages/Algernon.package/ALGWorldMenuType.class/class/extractMenuEntriesFrom..st deleted file mode 100644 index 62270589..00000000 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/extractMenuEntriesFrom..st +++ /dev/null @@ -1,3 +0,0 @@ -algertem lists -extractMenuEntriesFrom: aNamedWorldMenuEntry - self subclassResponsibility \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st b/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st new file mode 100644 index 00000000..5518ba53 --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st @@ -0,0 +1,5 @@ +as yet unclassified +filterOutDuplicates: anOrderedCollection + + ^ (((anOrderedCollection collect: [ :entry | entry name]) asSet) collect: + [ :name | anOrderedCollection detect: [ :entry | entry name = name]]) asOrderedCollection diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st index 2ce7896b..815c32c1 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st @@ -1,6 +1,8 @@ algertem lists menuEntries - ^ (self dockingBar submorphs + ^ (((self dockingBar submorphs collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) - select: [:entry | entry isValid] \ No newline at end of file + select: [:entry | entry isValid]) + select: [:entry | entry name ~= 'Windows' ]) + collect: [:entry | entry category: entry name] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st deleted file mode 100644 index a616c1eb..00000000 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntriesNew.st +++ /dev/null @@ -1,14 +0,0 @@ -algertem lists -menuEntriesNew - - |menuEntries entries| - - entries := OrderedCollection new. - - menuEntries := (self dockingBar submorphs - collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) - select: [:entry | entry isValid]. - entries addAll: menuEntries. - - ^ menuEntries - inject: OrderedCollection new into: [:accumulator :entry | accumulator addAll: entry subEntries; yourself] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st deleted file mode 100644 index 7c50f583..00000000 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menus.st +++ /dev/null @@ -1,5 +0,0 @@ -algertem lists -menus - ^ self dockingBar submorphs - select: [:each | - (each isKindOf: MenuItemMorph) and: [ each isNil not ] ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st new file mode 100644 index 00000000..86127a3d --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st @@ -0,0 +1,4 @@ +as yet unclassified +algertemChildrenList + + ^ ALGWorldMenuType algertemListWith: self typeObject \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st index dd1c6065..d90c4cd8 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st @@ -1,7 +1,9 @@ actions createAction + self typeObject hasEntries ifTrue: [ ^ self createActionNamed: 'entries' ]. + ^ self createActionNamed: (self class menuActionMapping - at: self typeObject name + at: self typeObject category ifAbsent: [ 'open' ]) \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st new file mode 100644 index 00000000..1fc8444a --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st @@ -0,0 +1,4 @@ +as yet unclassified +hasChildren + + ^ self typeObject hasEntries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index b346203a..80c33809 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -1,19 +1,20 @@ { "class" : { - "algertemList" : "b 7/5/2021 18:13", - "allEntries" : "b 7/5/2021 19:03", + "algertemList" : "NL 7/5/2021 19:16", + "algertemListWith:" : "NL 7/5/2021 20:08", + "allEntries" : "NL 7/5/2021 20:09", "dockingBar" : "b 5/16/2021 19:30", "entries" : "b 7/5/2021 18:34", - "extractMenuEntriesFrom:" : "NL 6/4/2021 16:23", + "filterOutDuplicates:" : "NL 7/5/2021 20:09", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", - "menuEntries" : "b 7/5/2021 19:01", - "menuEntriesNew" : "b 7/5/2021 19:00", - "menus" : "NL 7/5/2021 17:09" }, + "menuEntries" : "NL 7/5/2021 19:46" }, "instance" : { - "createAction" : "NL 6/4/2021 16:37", + "algertemChildrenList" : "NL 7/5/2021 19:34", + "createAction" : "NL 7/5/2021 19:52", "createActionNamed:" : "NL 6/4/2021 16:30", "createListOfAlgeractions" : "NL 6/4/2021 16:37", + "hasChildren" : "NL 7/5/2021 19:42", "name" : "NL 6/4/2021 16:28", "openMenuItem" : "NL 6/4/2021 16:28", "rankBonus" : "NM 5/16/2021 21:14", From 887a401d08786974af71853512cee502f4f3f423 Mon Sep 17 00:00:00 2001 From: Laura Meister Date: Mon, 5 Jul 2021 22:58:42 +0200 Subject: [PATCH 06/22] deleted empty method and added ordered collection with names of all window actions :) --- .../ALGWindowType.class/class/allWindowActions.st | 8 ++++++++ .../ALGWindowType.class/methodProperties.json | 1 + .../ALGWorldMenuType.class/class/entries.st | 14 -------------- .../ALGWorldMenuType.class/methodProperties.json | 1 - 4 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st delete mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/entries.st diff --git a/packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st b/packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st new file mode 100644 index 00000000..7513b112 --- /dev/null +++ b/packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st @@ -0,0 +1,8 @@ +algertem lists +allWindowActions + + ^ {'Collapse all windows'. + 'Close all windows'. + 'Close all windows without changes'. + 'Close all windows but workspaces' + } asOrderedCollection \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowType.class/methodProperties.json b/packages/Algernon.package/ALGWindowType.class/methodProperties.json index 990d7d34..b9353a69 100644 --- a/packages/Algernon.package/ALGWindowType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWindowType.class/methodProperties.json @@ -1,6 +1,7 @@ { "class" : { "algertemList" : "lm 5/25/2021 21:19", + "allWindowActions" : "lm 7/5/2021 22:40", "icon" : "NL 6/4/2021 14:20", "visibleWindows" : "lm 5/25/2021 21:14" }, "instance" : { diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/entries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/entries.st deleted file mode 100644 index 83479766..00000000 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/entries.st +++ /dev/null @@ -1,14 +0,0 @@ -algertem lists -entries - - "entries := OrderedCollection new. - - (self menus - collect: [ :each | ALGNamedWorldMenuEntry newFrom: each subMenu name: each contents ]) - do: [ :each | - entries addAll: ( - (self extractMenuEntriesFrom: each) - collect: [ :entry | ALGNamedWorldMenuEntry newFrom: entry name: each name]) ]. - - ^ entries select: [:each | each morph isKindOf: MenuItemMorph] - " \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 80c33809..d4435197 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -4,7 +4,6 @@ "algertemListWith:" : "NL 7/5/2021 20:08", "allEntries" : "NL 7/5/2021 20:09", "dockingBar" : "b 5/16/2021 19:30", - "entries" : "b 7/5/2021 18:34", "filterOutDuplicates:" : "NL 7/5/2021 20:09", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", From 9658cdcf19f4bbee7fc3188ff24156b865a3eed2 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Tue, 6 Jul 2021 11:39:07 +0200 Subject: [PATCH 07/22] Remove Dynamic and Static world menu type for good --- .../ALGDynamicWorldMenuType.class/README.md | 1 - .../class/filterOutDuplicates..st | 7 ------- .../methodProperties.json | 6 ------ .../ALGDynamicWorldMenuType.class/properties.json | 14 -------------- .../class/extractMenuEntriesFrom..st | 0 .../methodProperties.json | 5 +++++ .../properties.json | 2 ++ .../ALGStaticWorldMenuType.class/README.md | 1 - .../class/extractMenuEntriesFrom..st | 5 ----- .../methodProperties.json | 5 ----- .../ALGStaticWorldMenuType.class/properties.json | 14 -------------- 11 files changed, 7 insertions(+), 53 deletions(-) delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.class/README.md delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.class/class/filterOutDuplicates..st delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.class/properties.json rename packages/Algernon.package/{ALGDynamicWorldMenuType.class => ALGDynamicWorldMenuType.extension}/class/extractMenuEntriesFrom..st (100%) create mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json create mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json delete mode 100644 packages/Algernon.package/ALGStaticWorldMenuType.class/README.md delete mode 100644 packages/Algernon.package/ALGStaticWorldMenuType.class/class/extractMenuEntriesFrom..st delete mode 100644 packages/Algernon.package/ALGStaticWorldMenuType.class/methodProperties.json delete mode 100644 packages/Algernon.package/ALGStaticWorldMenuType.class/properties.json diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.class/README.md b/packages/Algernon.package/ALGDynamicWorldMenuType.class/README.md deleted file mode 100644 index 8e70a160..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.class/README.md +++ /dev/null @@ -1 +0,0 @@ -An ALGDynamicWorldMenuType represents an updating World Menu Entry, e.g. stuff from the windows menu. \ No newline at end of file diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.class/class/filterOutDuplicates..st b/packages/Algernon.package/ALGDynamicWorldMenuType.class/class/filterOutDuplicates..st deleted file mode 100644 index 453d2a93..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.class/class/filterOutDuplicates..st +++ /dev/null @@ -1,7 +0,0 @@ -algertem lists -filterOutDuplicates: aCollection - - ^ aCollection reject: - [ :entry | entry isMenuItemMorph and: - [ ALGStaticWorldMenuType algertemList anySatisfy: - [ :staticEntry | staticEntry name = entry contents ] ] ] diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json deleted file mode 100644 index b41c0139..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.class/methodProperties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "class" : { - "extractMenuEntriesFrom:" : "NL 6/29/2021 15:00", - "filterOutDuplicates:" : "NM 6/29/2021 17:28" }, - "instance" : { - } } diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.class/properties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.class/properties.json deleted file mode 100644 index 8ef63cc7..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "Algernon", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "OH 5/20/2021 17:29", - "instvars" : [ - ], - "name" : "ALGDynamicWorldMenuType", - "pools" : [ - ], - "super" : "ALGWorldMenuType", - "type" : "normal" } diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.class/class/extractMenuEntriesFrom..st b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/class/extractMenuEntriesFrom..st similarity index 100% rename from packages/Algernon.package/ALGDynamicWorldMenuType.class/class/extractMenuEntriesFrom..st rename to packages/Algernon.package/ALGDynamicWorldMenuType.extension/class/extractMenuEntriesFrom..st diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json new file mode 100644 index 00000000..c07ccd26 --- /dev/null +++ b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json @@ -0,0 +1,5 @@ +{ + "class" : { + "extractMenuEntriesFrom:" : "NL 6/29/2021 15:00" }, + "instance" : { + } } diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json new file mode 100644 index 00000000..d148e950 --- /dev/null +++ b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "ALGDynamicWorldMenuType" } diff --git a/packages/Algernon.package/ALGStaticWorldMenuType.class/README.md b/packages/Algernon.package/ALGStaticWorldMenuType.class/README.md deleted file mode 100644 index 3644f1e7..00000000 --- a/packages/Algernon.package/ALGStaticWorldMenuType.class/README.md +++ /dev/null @@ -1 +0,0 @@ -An ALGStaticWorldMenuType represents a non-updating World Menu Entry, e.g. stuff from the tools or apps menu. diff --git a/packages/Algernon.package/ALGStaticWorldMenuType.class/class/extractMenuEntriesFrom..st b/packages/Algernon.package/ALGStaticWorldMenuType.class/class/extractMenuEntriesFrom..st deleted file mode 100644 index f329862c..00000000 --- a/packages/Algernon.package/ALGStaticWorldMenuType.class/class/extractMenuEntriesFrom..st +++ /dev/null @@ -1,5 +0,0 @@ -algertem lists -extractMenuEntriesFrom: aNamedWorldMenuEntry - ^ (aNamedWorldMenuEntry morph isKindOf: DockingBarUpdatingMenuMorph) - ifTrue: [ OrderedCollection new ] - ifFalse: [ OrderedCollection newFrom: aNamedWorldMenuEntry menuEntries ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGStaticWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGStaticWorldMenuType.class/methodProperties.json deleted file mode 100644 index eb8c6a9f..00000000 --- a/packages/Algernon.package/ALGStaticWorldMenuType.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - "extractMenuEntriesFrom:" : "fsa 6/27/2021 11:11" }, - "instance" : { - } } diff --git a/packages/Algernon.package/ALGStaticWorldMenuType.class/properties.json b/packages/Algernon.package/ALGStaticWorldMenuType.class/properties.json deleted file mode 100644 index 10002507..00000000 --- a/packages/Algernon.package/ALGStaticWorldMenuType.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "Algernon", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "OH 5/20/2021 17:29", - "instvars" : [ - ], - "name" : "ALGStaticWorldMenuType", - "pools" : [ - ], - "super" : "ALGWorldMenuType", - "type" : "normal" } From 2f1341954d9aebd9e75204f30cbec544639639d8 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Tue, 6 Jul 2021 12:08:04 +0200 Subject: [PATCH 08/22] Add WindowOperationsType --- .../class/initializeItems.st | 1 + .../ALGItemProvider.class/methodProperties.json | 2 +- .../ALGWindowOperationsType.class/README.md | 0 .../class/algertemList.st | 5 +++++ .../class/allWindowActions.st | 8 ++++++++ .../ALGWindowOperationsType.class/class/icon.st | 4 ++++ .../instance/closeAllButWorkspaces.st | 4 ++++ .../instance/closeAllWindows.st | 4 ++++ .../instance/closeWithoutChanges.st | 4 ++++ .../instance/collapseAllWindows.st | 4 ++++ .../instance/createAction.st | 9 +++++++++ .../instance/createListOfAlgeractions.st | 4 ++++ .../instance/name.st | 4 ++++ .../instance/rankBonus.st | 4 ++++ .../instance/typeName.st | 4 ++++ .../methodProperties.json | 15 +++++++++++++++ .../ALGWindowOperationsType.class/properties.json | 14 ++++++++++++++ .../ALGWindowType.class/class/allWindowActions.st | 8 -------- .../ALGWindowType.class/methodProperties.json | 1 - 19 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/README.md create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/class/algertemList.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/class/allWindowActions.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/class/icon.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllButWorkspaces.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllWindows.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/closeWithoutChanges.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/collapseAllWindows.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/createAction.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/createListOfAlgeractions.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/name.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/rankBonus.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/instance/typeName.st create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/methodProperties.json create mode 100644 packages/Algernon.package/ALGWindowOperationsType.class/properties.json delete mode 100644 packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st diff --git a/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st b/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st index ca70a830..4b8db963 100644 --- a/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st +++ b/packages/Algernon.package/ALGItemProvider.class/class/initializeItems.st @@ -11,4 +11,5 @@ initializeItems addAll: ALGSettingsType algertemList; addAll: ALGClassType algertemList; addAll: ALGMethodType algertemList; + addAll: ALGWindowOperationsType algertemList; yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGItemProvider.class/methodProperties.json b/packages/Algernon.package/ALGItemProvider.class/methodProperties.json index 09f18954..ef3149fe 100644 --- a/packages/Algernon.package/ALGItemProvider.class/methodProperties.json +++ b/packages/Algernon.package/ALGItemProvider.class/methodProperties.json @@ -3,7 +3,7 @@ "defaultItems" : "J.J. 7/27/2015 17:37", "defaultSearchLevel" : "OH 5/20/2021 13:59", "filters" : "beb 5/20/2020 17:57", - "initializeItems" : "NL 7/5/2021 19:32", + "initializeItems" : "NL 7/6/2021 11:59", "maximumItemsToCompute" : "b 5/28/2021 15:43", "newIn:" : "J.J. 7/30/2015 22:00", "searchDelimeter" : "J.J. 7/28/2015 17:11" }, diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/README.md b/packages/Algernon.package/ALGWindowOperationsType.class/README.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/class/algertemList.st b/packages/Algernon.package/ALGWindowOperationsType.class/class/algertemList.st new file mode 100644 index 00000000..2353b9b1 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/class/algertemList.st @@ -0,0 +1,5 @@ +algertem lists +algertemList + + ^ self allWindowActions + collect: [ :each | ALGItem withAlgertype: (self with: each) ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/class/allWindowActions.st b/packages/Algernon.package/ALGWindowOperationsType.class/class/allWindowActions.st new file mode 100644 index 00000000..d69b1bdc --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/class/allWindowActions.st @@ -0,0 +1,8 @@ +algertem lists +allWindowActions + + ^ {'Collapse all windows' -> #collapseAllWindows. + 'Close all windows' -> #closeAllWindows. + 'Close all windows without changes' -> #closeWithoutChanges. + 'Close all windows but workspaces' -> #closeAllButWorkspaces + } asOrderedCollection \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/class/icon.st b/packages/Algernon.package/ALGWindowOperationsType.class/class/icon.st new file mode 100644 index 00000000..107b4427 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/class/icon.st @@ -0,0 +1,4 @@ +algertem lists +icon + + ^ #Window \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllButWorkspaces.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllButWorkspaces.st new file mode 100644 index 00000000..ca53f2d2 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllButWorkspaces.st @@ -0,0 +1,4 @@ +action handlers +closeAllButWorkspaces + + TheWorldMainDockingBar instance closeAllWindowsButWorkspaces \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllWindows.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllWindows.st new file mode 100644 index 00000000..05813a6a --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeAllWindows.st @@ -0,0 +1,4 @@ +action handlers +closeAllWindows + + TheWorldMainDockingBar instance closeAllWindowsUnsafe \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeWithoutChanges.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeWithoutChanges.st new file mode 100644 index 00000000..a6186677 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/closeWithoutChanges.st @@ -0,0 +1,4 @@ +action handlers +closeWithoutChanges + + TheWorldMainDockingBar instance closeAllWindows \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/collapseAllWindows.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/collapseAllWindows.st new file mode 100644 index 00000000..1a64e803 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/collapseAllWindows.st @@ -0,0 +1,4 @@ +action handlers +collapseAllWindows + + Project current world collapseAllWindows \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/createAction.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/createAction.st new file mode 100644 index 00000000..7e952c01 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/createAction.st @@ -0,0 +1,9 @@ +actions +createAction + + ^ ALGAction + withName: 'do' + rank: 1 + target: self + selector: self typeObject value + args: #() \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/createListOfAlgeractions.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/createListOfAlgeractions.st new file mode 100644 index 00000000..b067ec1c --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/createListOfAlgeractions.st @@ -0,0 +1,4 @@ +actions +createListOfAlgeractions + + ^ self createSortedListFrom: { self createAction } \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/name.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/name.st new file mode 100644 index 00000000..7ecc80bc --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/name.st @@ -0,0 +1,4 @@ +accessing +name + + ^ self typeObject key \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/rankBonus.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/rankBonus.st new file mode 100644 index 00000000..988435db --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/rankBonus.st @@ -0,0 +1,4 @@ +relevance +rankBonus + + ^ 9 \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/instance/typeName.st b/packages/Algernon.package/ALGWindowOperationsType.class/instance/typeName.st new file mode 100644 index 00000000..f5a479e5 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/instance/typeName.st @@ -0,0 +1,4 @@ +accessing +typeName + + ^ 'Window operation' \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/methodProperties.json b/packages/Algernon.package/ALGWindowOperationsType.class/methodProperties.json new file mode 100644 index 00000000..6224b6a2 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/methodProperties.json @@ -0,0 +1,15 @@ +{ + "class" : { + "algertemList" : "NL 7/6/2021 11:54", + "allWindowActions" : "NL 7/6/2021 12:04", + "icon" : "NL 7/6/2021 11:55" }, + "instance" : { + "closeAllButWorkspaces" : "NL 7/6/2021 12:03", + "closeAllWindows" : "NL 7/6/2021 12:03", + "closeWithoutChanges" : "NL 7/6/2021 12:03", + "collapseAllWindows" : "NL 7/6/2021 12:01", + "createAction" : "NL 7/6/2021 11:59", + "createListOfAlgeractions" : "NL 7/6/2021 11:56", + "name" : "NL 7/6/2021 11:59", + "rankBonus" : "NL 7/6/2021 11:58", + "typeName" : "NL 7/6/2021 11:58" } } diff --git a/packages/Algernon.package/ALGWindowOperationsType.class/properties.json b/packages/Algernon.package/ALGWindowOperationsType.class/properties.json new file mode 100644 index 00000000..667c8728 --- /dev/null +++ b/packages/Algernon.package/ALGWindowOperationsType.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Algernon", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "ALGWindowOperationsType", + "pools" : [ + ], + "super" : "ALGType", + "type" : "normal" } diff --git a/packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st b/packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st deleted file mode 100644 index 7513b112..00000000 --- a/packages/Algernon.package/ALGWindowType.class/class/allWindowActions.st +++ /dev/null @@ -1,8 +0,0 @@ -algertem lists -allWindowActions - - ^ {'Collapse all windows'. - 'Close all windows'. - 'Close all windows without changes'. - 'Close all windows but workspaces' - } asOrderedCollection \ No newline at end of file diff --git a/packages/Algernon.package/ALGWindowType.class/methodProperties.json b/packages/Algernon.package/ALGWindowType.class/methodProperties.json index b9353a69..990d7d34 100644 --- a/packages/Algernon.package/ALGWindowType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWindowType.class/methodProperties.json @@ -1,7 +1,6 @@ { "class" : { "algertemList" : "lm 5/25/2021 21:19", - "allWindowActions" : "lm 7/5/2021 22:40", "icon" : "NL 6/4/2021 14:20", "visibleWindows" : "lm 5/25/2021 21:14" }, "instance" : { From ae51603546556dea76efeb42d628d71c20d461b5 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Tue, 6 Jul 2021 12:21:50 +0200 Subject: [PATCH 09/22] Don't show center eleement of docking bar --- .../ALGNamedWorldMenuEntry.class/instance/category..st | 2 +- .../ALGNamedWorldMenuEntry.class/instance/category.st | 2 +- .../ALGNamedWorldMenuEntry.class/instance/execute.st | 4 ++++ .../ALGNamedWorldMenuEntry.class/instance/hasEntries.st | 2 +- .../ALGNamedWorldMenuEntry.class/methodProperties.json | 1 + .../ALGWorldMenuType.class/class/menuEntries.st | 3 ++- .../ALGWorldMenuType.class/instance/name.st | 2 +- .../ALGWorldMenuType.class/instance/openMenuItem.st | 2 +- .../ALGWorldMenuType.class/methodProperties.json | 6 +++--- 9 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/execute.st diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st index 1f5cf82d..ff108064 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category..st @@ -1,3 +1,3 @@ -as yet unclassified +accessing category: aString category := aString \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st index bb6b5c7f..04be151a 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/category.st @@ -1,3 +1,3 @@ -as yet unclassified +accessing category ^ category \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/execute.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/execute.st new file mode 100644 index 00000000..c0b32be6 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/execute.st @@ -0,0 +1,4 @@ +action +execute + + self morph doButtonAction \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st index 38667e80..37612710 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/hasEntries.st @@ -1,4 +1,4 @@ -as yet unclassified +accessing hasEntries ^ self menuEntries isEmpty not \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 88e438af..f1308743 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -7,6 +7,7 @@ "category" : "NL 7/5/2021 19:20", "category:" : "NL 7/5/2021 19:21", "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", + "execute" : "NL 7/6/2021 12:16", "hasEntries" : "NL 7/5/2021 19:42", "ifDynamic:ifStatic:" : "b 7/5/2021 18:32", "isDynamic" : "NL 7/5/2021 17:47", diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st index 815c32c1..867f3a54 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st @@ -1,8 +1,9 @@ algertem lists menuEntries - ^ (((self dockingBar submorphs + ^ ((((self dockingBar submorphs collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) select: [:entry | entry isValid]) + select: [:entry | entry hasEntries]) select: [:entry | entry name ~= 'Windows' ]) collect: [:entry | entry category: entry name] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/name.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/name.st index a88b0832..91804de5 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/name.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/name.st @@ -1,3 +1,3 @@ accessing name - ^ self typeObject morph contents \ No newline at end of file + ^ self typeObject name \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/openMenuItem.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/openMenuItem.st index 5922493e..bae18fa9 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/openMenuItem.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/openMenuItem.st @@ -1,3 +1,3 @@ actions openMenuItem - self typeObject morph doButtonAction \ No newline at end of file + self typeObject execute \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index d4435197..9918cb9d 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -7,14 +7,14 @@ "filterOutDuplicates:" : "NL 7/5/2021 20:09", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", - "menuEntries" : "NL 7/5/2021 19:46" }, + "menuEntries" : "NL 7/6/2021 12:20" }, "instance" : { "algertemChildrenList" : "NL 7/5/2021 19:34", "createAction" : "NL 7/5/2021 19:52", "createActionNamed:" : "NL 6/4/2021 16:30", "createListOfAlgeractions" : "NL 6/4/2021 16:37", "hasChildren" : "NL 7/5/2021 19:42", - "name" : "NL 6/4/2021 16:28", - "openMenuItem" : "NL 6/4/2021 16:28", + "name" : "NL 7/6/2021 12:17", + "openMenuItem" : "NL 7/6/2021 12:15", "rankBonus" : "NM 5/16/2021 21:14", "typeName" : "NM 5/16/2021 20:48" } } From 2be561afa7c7a422d62f482b2994e2f7defb11e1 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Tue, 6 Jul 2021 12:30:37 +0200 Subject: [PATCH 10/22] Fix error --- .../ALGNamedWorldMenuEntry.class/instance/isDynamic.st | 7 +++++-- .../ALGNamedWorldMenuEntry.class/methodProperties.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st index ffebe90a..4d42454b 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st @@ -1,5 +1,8 @@ accessing isDynamic - ^ (self subMenuIfAbsent: [ ^ false ]) - isKindOf: DockingBarUpdatingMenuMorph \ No newline at end of file + | subMenu | + subMenu := self subMenuIfAbsent: [ ^ false ]. + + ^ (subMenu isKindOf: DockingBarUpdatingMenuMorph) + or: [subMenu isKindOf: UpdatingMenuMorph] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index f1308743..082ddc37 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -10,7 +10,7 @@ "execute" : "NL 7/6/2021 12:16", "hasEntries" : "NL 7/5/2021 19:42", "ifDynamic:ifStatic:" : "b 7/5/2021 18:32", - "isDynamic" : "NL 7/5/2021 17:47", + "isDynamic" : "NL 7/6/2021 12:29", "isEnabled" : "NL 7/5/2021 17:48", "isMenu" : "NL 7/5/2021 17:54", "isValid" : "b 7/5/2021 18:43", From b83fc13c0cdd55ea3ebc18a9b6b674c5119c6653 Mon Sep 17 00:00:00 2001 From: Niklas Mohrin Date: Tue, 6 Jul 2021 20:33:23 +0200 Subject: [PATCH 11/22] check this out --- .../class/extractMenuEntriesFrom..st | 10 ---------- .../methodProperties.json | 5 ----- .../ALGDynamicWorldMenuType.extension/properties.json | 2 -- 3 files changed, 17 deletions(-) delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.extension/class/extractMenuEntriesFrom..st delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json delete mode 100644 packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/class/extractMenuEntriesFrom..st b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/class/extractMenuEntriesFrom..st deleted file mode 100644 index 99ed7ee0..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/class/extractMenuEntriesFrom..st +++ /dev/null @@ -1,10 +0,0 @@ -algertem lists -extractMenuEntriesFrom: aNamedWorldMenuEntry - ^ aNamedWorldMenuEntry isDynamic - ifTrue: [ | entries | - aNamedWorldMenuEntry morph updateMenu. - entries := OrderedCollection newFrom: aNamedWorldMenuEntry menuEntries. - entries := self filterOutDuplicates: entries. - aNamedWorldMenuEntry morph removeAllMorphs. - entries ] - ifFalse: [ OrderedCollection new ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json deleted file mode 100644 index c07ccd26..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - "extractMenuEntriesFrom:" : "NL 6/29/2021 15:00" }, - "instance" : { - } } diff --git a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json b/packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json deleted file mode 100644 index d148e950..00000000 --- a/packages/Algernon.package/ALGDynamicWorldMenuType.extension/properties.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "name" : "ALGDynamicWorldMenuType" } From 94e4cdd1ae54f685da9af3a7ef4ceddb817909f2 Mon Sep 17 00:00:00 2001 From: Niklas Mohrin Date: Tue, 6 Jul 2021 23:52:32 +0200 Subject: [PATCH 12/22] two thingies: 1) better runtime 2) better code :^) --- .../ALGWorldMenuType.class/class/allEntries.st | 12 +++++------- .../class/filterOutDuplicates..st | 6 ++++-- .../ALGWorldMenuType.class/methodProperties.json | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st index a691d5c6..3ca5ec78 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st @@ -1,14 +1,12 @@ algertem lists allEntries - |entries| - + | entries | + entries := OrderedCollection new. - - entries addAll: self menuEntries. - entries addAll: (self menuEntries - inject: OrderedCollection new into: [:accumulator :entry | accumulator addAll: entry allEntries; yourself]). - + self menuEntries do: [ :entry | + entries add: entry. + entries addAll: entry allEntries ]. entries := self filterOutDuplicates: entries. ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st b/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st index 5518ba53..47a1bf28 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st @@ -1,5 +1,7 @@ as yet unclassified filterOutDuplicates: anOrderedCollection - ^ (((anOrderedCollection collect: [ :entry | entry name]) asSet) collect: - [ :name | anOrderedCollection detect: [ :entry | entry name = name]]) asOrderedCollection + | usedNames | + usedNames := Set new. + " note that ifAbsendAdd: returns whether or not the item was newly inserted " + ^ anOrderedCollection select: [ :each | usedNames ifAbsentAdd: each name ]. \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 9918cb9d..e68ea415 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -2,9 +2,9 @@ "class" : { "algertemList" : "NL 7/5/2021 19:16", "algertemListWith:" : "NL 7/5/2021 20:08", - "allEntries" : "NL 7/5/2021 20:09", + "allEntries" : "NM 7/6/2021 22:45", "dockingBar" : "b 5/16/2021 19:30", - "filterOutDuplicates:" : "NL 7/5/2021 20:09", + "filterOutDuplicates:" : "NM 7/6/2021 22:25", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", "menuEntries" : "NL 7/6/2021 12:20" }, From f244101b1b92bf8b191836bcfdeddf090516001a Mon Sep 17 00:00:00 2001 From: Laura Meister Date: Tue, 6 Jul 2021 23:40:26 +0200 Subject: [PATCH 13/22] detect special selector names of checkboxes in order to display better action names --- .../ALGActionVerbFilter.class/class/helpTexts.st | 1 - .../ALGActionVerbFilter.class/class/keywords.st | 2 +- .../methodProperties.json | 4 ++-- .../ALGNamedWorldMenuEntry.class/class/newFrom..st | 3 +++ .../class/newFrom.inCategory..st | 9 ++++----- .../instance/firstWordOfSelector.st | 13 +++++++++++++ .../instance/selector..st | 3 +++ .../instance/selector.st | 3 +++ .../methodProperties.json | 7 +++++-- .../ALGNamedWorldMenuEntry.class/properties.json | 3 ++- .../class/actionNameSelectors.st | 5 +++++ .../instance/createAction.st | 6 +----- .../instance/determineActionName.st | 14 ++++++++++++++ .../ALGWorldMenuType.class/methodProperties.json | 4 +++- 14 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/actionNameSelectors.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st diff --git a/packages/Algernon.package/ALGActionVerbFilter.class/class/helpTexts.st b/packages/Algernon.package/ALGActionVerbFilter.class/class/helpTexts.st index 5d157005..aa806aaf 100644 --- a/packages/Algernon.package/ALGActionVerbFilter.class/class/helpTexts.st +++ b/packages/Algernon.package/ALGActionVerbFilter.class/class/helpTexts.st @@ -7,7 +7,6 @@ helpTexts add: 'browse'->'Open a given class in the Browser.'; add: 'fileout'->'Generates a .st file in Resources of squeak image Folder'; add: 'open'->'Open an app, tool or morph'; - add: 'saverepo'->'Saves to Repository with a working copy'; add: 'inspect'->'Open Inspector for an object'; add: 'explore'-> 'Open Explorer for an object or all intances of a given class'; add: 'front'-> 'Bring a given window to the front'; diff --git a/packages/Algernon.package/ALGActionVerbFilter.class/class/keywords.st b/packages/Algernon.package/ALGActionVerbFilter.class/class/keywords.st index 11b03be9..c996fd79 100644 --- a/packages/Algernon.package/ALGActionVerbFilter.class/class/keywords.st +++ b/packages/Algernon.package/ALGActionVerbFilter.class/class/keywords.st @@ -1,7 +1,7 @@ filtering keywords ^ Set newFrom: {'run'. 'browse'. 'fileout'. - 'open'. 'saverepo'. 'do'. + 'open'. 'do'. 'inspect'. 'explore'. '='. 'front'. 'expand'. 'collapse'. 'contract'. 'close' } \ No newline at end of file diff --git a/packages/Algernon.package/ALGActionVerbFilter.class/methodProperties.json b/packages/Algernon.package/ALGActionVerbFilter.class/methodProperties.json index d17a6d2b..c8a621c1 100644 --- a/packages/Algernon.package/ALGActionVerbFilter.class/methodProperties.json +++ b/packages/Algernon.package/ALGActionVerbFilter.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "helpTexts" : "b 5/29/2021 09:18", - "keywords" : "lm 5/26/2021 19:46" }, + "helpTexts" : "lm 7/6/2021 20:54", + "keywords" : "lm 7/6/2021 20:53" }, "instance" : { "filter:given:" : "pw 8/4/2020 00:30" } } diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st index 1fea76a2..e035b4e5 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st @@ -3,4 +3,7 @@ newFrom: aMorph ^ self new morph: aMorph; + selector: + ((aMorph isKindOf: MenuItemMorph) + ifTrue: [aMorph selector]); yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st index 886ce636..ee08b6f2 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom.inCategory..st @@ -1,7 +1,6 @@ -as yet unclassified +instance creation newFrom: aMorph inCategory: aString - ^ self new - morph: aMorph; - category: aString; - yourself \ No newline at end of file + ^ (self newFrom: aMorph) + category: aString; + yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st new file mode 100644 index 00000000..1b86c273 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st @@ -0,0 +1,13 @@ +accessing +firstWordOfSelector + + self selector + ifNil: [ ^ String empty ] + ifNotNil: [ + | selectorString | + selectorString := self selector asString. + selectorString withIndexDo: + [ :letter :index | letter isUppercase + ifTrue: [ ^ selectorString wordBefore: index - 1 ]]. + ^ selectorString ] + \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st new file mode 100644 index 00000000..f3222a02 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st @@ -0,0 +1,3 @@ +accessing +selector: aSymbol + selector := aSymbol \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st new file mode 100644 index 00000000..b28282a1 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st @@ -0,0 +1,3 @@ +accessing +selector + ^ selector \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 082ddc37..ffad2fe9 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -1,13 +1,14 @@ { "class" : { - "newFrom:" : "NL 7/5/2021 17:53", - "newFrom:inCategory:" : "NL 7/5/2021 19:21" }, + "newFrom:" : "lm 7/6/2021 22:53", + "newFrom:inCategory:" : "lm 7/6/2021 22:54" }, "instance" : { "allEntries" : "b 7/5/2021 19:03", "category" : "NL 7/5/2021 19:20", "category:" : "NL 7/5/2021 19:21", "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", "execute" : "NL 7/6/2021 12:16", + "firstWordOfSelector" : "lm 7/6/2021 23:35", "hasEntries" : "NL 7/5/2021 19:42", "ifDynamic:ifStatic:" : "b 7/5/2021 18:32", "isDynamic" : "NL 7/6/2021 12:29", @@ -19,4 +20,6 @@ "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", "name" : "b 7/5/2021 18:50", + "selector" : "lm 7/6/2021 22:58", + "selector:" : "lm 7/6/2021 22:59", "subMenuIfAbsent:" : "b 7/5/2021 18:18" } } diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json index 972d2846..9fd45896 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json @@ -7,7 +7,8 @@ "commentStamp" : "fsa 6/27/2021 10:38", "instvars" : [ "morph", - "category" ], + "category", + "selector" ], "name" : "ALGNamedWorldMenuEntry", "pools" : [ ], diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/actionNameSelectors.st b/packages/Algernon.package/ALGWorldMenuType.class/class/actionNameSelectors.st new file mode 100644 index 00000000..c197b9cd --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/actionNameSelectors.st @@ -0,0 +1,5 @@ +algertem lists +actionNameSelectors + "If world menu items have selectors starting with these Strings, name the action name after the selector" + + ^ {'apply' . 'toggle'} \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st index d90c4cd8..0da78acc 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/createAction.st @@ -1,9 +1,5 @@ actions createAction - self typeObject hasEntries ifTrue: [ ^ self createActionNamed: 'entries' ]. - - ^ self createActionNamed: (self class menuActionMapping - at: self typeObject category - ifAbsent: [ 'open' ]) + ^ self createActionNamed: self determineActionName \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st new file mode 100644 index 00000000..6bcd3079 --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st @@ -0,0 +1,14 @@ +actions +determineActionName + + | firstWordOfSelector | + self typeObject hasEntries ifTrue: [ ^ 'entries' ]. + firstWordOfSelector := self typeObject firstWordOfSelector. + (self class actionNameSelectors includes: firstWordOfSelector) + ifTrue: [ ^ firstWordOfSelector ]. + self class menuActionMapping + at: self typeObject category + ifPresent: [ :name | ^ name ]. + + ^ 'open' + \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index e68ea415..1fbe09e2 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -1,5 +1,6 @@ { "class" : { + "actionNameSelectors" : "lm 7/6/2021 23:05", "algertemList" : "NL 7/5/2021 19:16", "algertemListWith:" : "NL 7/5/2021 20:08", "allEntries" : "NM 7/6/2021 22:45", @@ -10,9 +11,10 @@ "menuEntries" : "NL 7/6/2021 12:20" }, "instance" : { "algertemChildrenList" : "NL 7/5/2021 19:34", - "createAction" : "NL 7/5/2021 19:52", + "createAction" : "lm 7/6/2021 23:28", "createActionNamed:" : "NL 6/4/2021 16:30", "createListOfAlgeractions" : "NL 6/4/2021 16:37", + "determineActionName" : "lm 7/6/2021 23:27", "hasChildren" : "NL 7/5/2021 19:42", "name" : "NL 7/6/2021 12:17", "openMenuItem" : "NL 7/6/2021 12:15", From 37d1dc57aa46518f723f673027ab6c969c76d69d Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Wed, 7 Jul 2021 18:15:35 +0200 Subject: [PATCH 14/22] Spike to also show context menu items as world menu items --- .../instance/handleActivationKeyEvent..st | 1 + .../ALGCore.class/instance/lastFocus.st | 4 ++++ .../ALGCore.class/instance/saveLastFocus.st | 4 ++++ .../ALGCore.class/methodProperties.json | 4 +++- .../ALGCore.class/properties.json | 3 ++- .../class/allEntries.st | 3 +++ .../class/currentContextEntries.st | 21 +++++++++++++++++++ .../methodProperties.json | 3 ++- 8 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 packages/Algernon.package/ALGCore.class/instance/lastFocus.st create mode 100644 packages/Algernon.package/ALGCore.class/instance/saveLastFocus.st create mode 100644 packages/Algernon.package/ALGWorldMenuType.class/class/currentContextEntries.st diff --git a/packages/Algernon.package/ALGCore.class/instance/handleActivationKeyEvent..st b/packages/Algernon.package/ALGCore.class/instance/handleActivationKeyEvent..st index f2ff3cdd..00cfe553 100644 --- a/packages/Algernon.package/ALGCore.class/instance/handleActivationKeyEvent..st +++ b/packages/Algernon.package/ALGCore.class/instance/handleActivationKeyEvent..st @@ -9,6 +9,7 @@ handleActivationKeyEvent: anEvent isTrigger ifTrue: [ + self saveLastFocus. lastActivationKeyTimestamp := nil. self toggleVisibility: anEvent ] ifFalse: [ diff --git a/packages/Algernon.package/ALGCore.class/instance/lastFocus.st b/packages/Algernon.package/ALGCore.class/instance/lastFocus.st new file mode 100644 index 00000000..053f838d --- /dev/null +++ b/packages/Algernon.package/ALGCore.class/instance/lastFocus.st @@ -0,0 +1,4 @@ +accessing +lastFocus + + ^ lastFocus \ No newline at end of file diff --git a/packages/Algernon.package/ALGCore.class/instance/saveLastFocus.st b/packages/Algernon.package/ALGCore.class/instance/saveLastFocus.st new file mode 100644 index 00000000..1e22f8eb --- /dev/null +++ b/packages/Algernon.package/ALGCore.class/instance/saveLastFocus.st @@ -0,0 +1,4 @@ +updating +saveLastFocus + + lastFocus := ActiveHand keyboardFocus \ No newline at end of file diff --git a/packages/Algernon.package/ALGCore.class/methodProperties.json b/packages/Algernon.package/ALGCore.class/methodProperties.json index 167f08d8..a0b61ab5 100644 --- a/packages/Algernon.package/ALGCore.class/methodProperties.json +++ b/packages/Algernon.package/ALGCore.class/methodProperties.json @@ -67,7 +67,7 @@ "firstOnSearchStack" : "jRo 6/14/2020 18:21", "firstStep:" : "DS 5/21/2017 16:43", "grabFocus:" : "b 6/2/2021 00:59", - "handleActivationKeyEvent:" : "NM 6/30/2021 14:43", + "handleActivationKeyEvent:" : "NL 7/7/2021 18:14", "handleAsQuickAccess:" : "NM 6/7/2021 21:22", "handleListenEvent:" : "NM 6/30/2021 14:45", "handleTextEntered:" : "rk 8/3/2020 22:16", @@ -95,6 +95,7 @@ "keyStroke:" : "NL 6/7/2021 20:05", "lastActivationKeyTimestamp" : "fsa 6/16/2021 14:22", "lastActivationKeyTimestamp:" : "fsa 6/16/2021 14:22", + "lastFocus" : "NL 7/7/2021 18:14", "lastInputString" : "jRo 5/27/2020 17:35", "lastInputString:" : "jRo 5/27/2020 17:35", "moveCursorToEnd" : "beb 5/23/2020 15:58", @@ -113,6 +114,7 @@ "registeredWithSystem" : "LK 7/14/2016 15:04", "reset" : "beb 6/11/2020 15:13", "resetFilteringThreshold" : "DS 5/21/2017 16:55", + "saveLastFocus" : "NL 7/7/2021 18:14", "searchStack" : "J.J. 7/11/2015 21:40", "searchStack:" : "J.J. 7/11/2015 21:40", "selectNext" : "J.J. 7/27/2015 21:41", diff --git a/packages/Algernon.package/ALGCore.class/properties.json b/packages/Algernon.package/ALGCore.class/properties.json index f02cf1f2..8be2f7da 100644 --- a/packages/Algernon.package/ALGCore.class/properties.json +++ b/packages/Algernon.package/ALGCore.class/properties.json @@ -24,7 +24,8 @@ "textField", "firstStep", "lastInputString", - "lastActivationKeyTimestamp" ], + "lastActivationKeyTimestamp", + "lastFocus" ], "name" : "ALGCore", "pools" : [ ], diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st index 3ca5ec78..5fdb1eb3 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st @@ -7,6 +7,9 @@ allEntries self menuEntries do: [ :entry | entries add: entry. entries addAll: entry allEntries ]. + self currentContextEntries do: [ :entry | + entries add: entry. + entries addAll: entry allEntries ]. entries := self filterOutDuplicates: entries. ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/currentContextEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/currentContextEntries.st new file mode 100644 index 00000000..9de778fd --- /dev/null +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/currentContextEntries.st @@ -0,0 +1,21 @@ +algertem lists +currentContextEntries + | event menu menus items | + ALGCore currentInstance lastFocus ifNil: [ ^ {} ]. + event := MouseButtonEvent new. + "cursorPos := ALGCore currentInstance textField inputfield cursor. + Transcript showln: cursorPos." + event setType: 0 position: 0@0 buttons: 2 hand: ActiveHand. + ALGCore currentInstance lastFocus mouseDown: event. + menus := World submorphs select: [ :each | each isKindOf: MenuMorph ]. + menus ifEmpty: [^ {} ]. + menu := menus last. + items := menu items. + menu delete. + World doOneCycle. + ActiveHand newKeyboardFocus: ALGCore currentInstance textField. + ALGCore currentInstance moveCursorToEnd. + + ^ (items + collect: [ :each | ALGNamedWorldMenuEntry newFrom: each ]) + do: [ :each | each category: each name ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 1fbe09e2..0c581eeb 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -3,7 +3,8 @@ "actionNameSelectors" : "lm 7/6/2021 23:05", "algertemList" : "NL 7/5/2021 19:16", "algertemListWith:" : "NL 7/5/2021 20:08", - "allEntries" : "NM 7/6/2021 22:45", + "allEntries" : "NL 7/7/2021 18:13", + "currentContextEntries" : "NL 7/7/2021 18:13", "dockingBar" : "b 5/16/2021 19:30", "filterOutDuplicates:" : "NM 7/6/2021 22:25", "icon" : "NL 6/4/2021 14:21", From ac68af3b7bede81c6a9e3f1a6d8450b86b74e1b0 Mon Sep 17 00:00:00 2001 From: Benedikt Weber Date: Mon, 12 Jul 2021 15:19:33 +0200 Subject: [PATCH 15/22] Apply review (mostly) --- .../instance/allEntries.st | 4 +--- .../instance/menuEntries.st | 7 +++---- .../methodProperties.json | 4 ++-- .../ALGWorldMenuType.class/class/allEntries.st | 5 ++--- .../ALGWorldMenuType.class/class/menuEntries.st | 17 +++++++++++------ .../methodProperties.json | 4 ++-- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st index 94007bfb..d7ce5d0c 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/allEntries.st @@ -3,10 +3,8 @@ allEntries | entries | entries := OrderedCollection new. - - entries addAll: self menuEntries. entries addAll: (self menuEntries inject: OrderedCollection new into: - [ :accumulator :entry | accumulator addAll: entry allEntries; yourself ]). + [ :accumulator :entry | accumulator addAll: {entry}, entry allEntries; yourself ]). ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st index 0d5ecfc2..b7452370 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuEntries.st @@ -1,7 +1,6 @@ accessing menuEntries - ^ ((self menuSubmorphs - collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph inCategory: self category]) - select: [ :entry | entry isValid]) - select: [:entry | entry isEnabled] \ No newline at end of file + ^ self menuSubmorphs + collect: [ :morph | ALGNamedWorldMenuEntry newFrom: morph inCategory: self category ] + thenSelect: [ :entry | entry isValid and: [entry isEnabled] ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index ffad2fe9..238b793d 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -3,7 +3,7 @@ "newFrom:" : "lm 7/6/2021 22:53", "newFrom:inCategory:" : "lm 7/6/2021 22:54" }, "instance" : { - "allEntries" : "b 7/5/2021 19:03", + "allEntries" : "b 7/12/2021 15:15", "category" : "NL 7/5/2021 19:20", "category:" : "NL 7/5/2021 19:21", "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", @@ -15,7 +15,7 @@ "isEnabled" : "NL 7/5/2021 17:48", "isMenu" : "NL 7/5/2021 17:54", "isValid" : "b 7/5/2021 18:43", - "menuEntries" : "NL 7/5/2021 19:45", + "menuEntries" : "b 7/12/2021 15:04", "menuSubmorphs" : "b 7/5/2021 18:53", "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st index 3ca5ec78..f2d894cc 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/allEntries.st @@ -4,9 +4,8 @@ allEntries | entries | entries := OrderedCollection new. - self menuEntries do: [ :entry | - entries add: entry. - entries addAll: entry allEntries ]. + entries addAll: (self menuEntries inject: OrderedCollection new into: + [ :accumulator :entry | accumulator addAll: {entry}, entry allEntries; yourself]). entries := self filterOutDuplicates: entries. ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st index 867f3a54..b8223946 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/menuEntries.st @@ -1,9 +1,14 @@ algertem lists menuEntries - ^ ((((self dockingBar submorphs - collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph]) - select: [:entry | entry isValid]) - select: [:entry | entry hasEntries]) - select: [:entry | entry name ~= 'Windows' ]) - collect: [:entry | entry category: entry name] \ No newline at end of file + | entries | + + entries := self dockingBar submorphs + collect: [:morph | ALGNamedWorldMenuEntry newFrom: morph] + thenSelect: + [:entry | entry isValid + and: [entry hasEntries] + and: [entry name ~= 'Windows']]. + entries do: [:entry | entry category: entry name]. + + ^ entries \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 1fbe09e2..515612a3 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -3,12 +3,12 @@ "actionNameSelectors" : "lm 7/6/2021 23:05", "algertemList" : "NL 7/5/2021 19:16", "algertemListWith:" : "NL 7/5/2021 20:08", - "allEntries" : "NM 7/6/2021 22:45", + "allEntries" : "b 7/12/2021 15:15", "dockingBar" : "b 5/16/2021 19:30", "filterOutDuplicates:" : "NM 7/6/2021 22:25", "icon" : "NL 6/4/2021 14:21", "menuActionMapping" : "NL 6/4/2021 16:34", - "menuEntries" : "NL 7/6/2021 12:20" }, + "menuEntries" : "b 7/12/2021 15:10" }, "instance" : { "algertemChildrenList" : "NL 7/5/2021 19:34", "createAction" : "lm 7/6/2021 23:28", From 5f47ffd5ef18747dd46c6712ae6e05ac4da247c7 Mon Sep 17 00:00:00 2001 From: Benedikt Weber Date: Mon, 12 Jul 2021 19:54:35 +0200 Subject: [PATCH 16/22] Fix tests --- .../instance/ifDynamic.ifStatic..st | 4 ---- .../instance/ifDynamicItem.ifStatic..st | 4 ++++ .../instance/ifDynamicMenu.ifStatic..st | 4 ++++ .../instance/isDynamicItem.st | 4 ++++ .../instance/{isDynamic.st => isDynamicMenu.st} | 2 +- .../instance/menuSubmorphs.st | 2 +- .../ALGNamedWorldMenuEntry.class/instance/name.st | 5 ++++- .../methodProperties.json | 10 ++++++---- .../ALGWorldMenuType.class/class/algertemListWith..st | 2 +- .../class/filterOutDuplicates..st | 2 +- .../instance/algertemChildrenList.st | 2 +- .../ALGWorldMenuType.class/instance/hasChildren.st | 2 +- .../instance/testWindowTypeAlgertemListWith.st | 3 +++ .../testWindowTypeCreateListOfAlgeractions.st | 8 ++++++++ .../instance/testWorldMenuTypeAlgertemListWith.st | 3 +++ .../testWorldMenuTypeCreateListOfAlgeractions.st | 7 ++++++- .../ALGTestAction.class/methodProperties.json | 5 ++++- .../testDynamicItemsOnlyOnDefaultSearchLevel.st | 4 ++-- .../ALGTestGeneral.class/methodProperties.json | 2 +- .../instance/testDynamicWorldMenuTypeNotEmpty.st | 3 --- .../ALGTestTypes.class/instance/testHasChildren.st | 3 +-- .../instance/testStaticWorldMenuTypeNotEmpty.st | 3 --- .../instance/testSubmenuCheckBoxesAfterTab.st | 5 +++-- .../instance/testTabIntoSubmenus.st | 2 ++ .../instance/testWorldMenuTypeNotEmpty.st | 3 +++ .../ALGTestTypes.class/methodProperties.json | 11 +++++------ 26 files changed, 69 insertions(+), 36 deletions(-) delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicItem.st rename packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/{isDynamic.st => isDynamicMenu.st} (92%) create mode 100644 packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st create mode 100644 packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeCreateListOfAlgeractions.st create mode 100644 packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeAlgertemListWith.st delete mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testDynamicWorldMenuTypeNotEmpty.st delete mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testStaticWorldMenuTypeNotEmpty.st create mode 100644 packages/AlgernonTests.package/ALGTestTypes.class/instance/testWorldMenuTypeNotEmpty.st diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st deleted file mode 100644 index 113dfa2e..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamic.ifStatic..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -ifDynamic: dynamicBlock ifStatic: staticBlock - - ^ self isDynamic ifTrue: [dynamicBlock value] ifFalse: [staticBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st new file mode 100644 index 00000000..9a17e2cc --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st @@ -0,0 +1,4 @@ +accessing +ifDynamicItem: dynamicBlock ifStatic: staticBlock + + ^ self isDynamicItem ifTrue: [dynamicBlock value] ifFalse: [staticBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st new file mode 100644 index 00000000..8b38a907 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st @@ -0,0 +1,4 @@ +accessing +ifDynamicMenu: dynamicBlock ifStatic: staticBlock + + ^ self isDynamicMenu ifTrue: [dynamicBlock value] ifFalse: [staticBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicItem.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicItem.st new file mode 100644 index 00000000..b777da5e --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicItem.st @@ -0,0 +1,4 @@ +accessing +isDynamicItem + + ^ self morph isKindOf: UpdatingMenuItemMorph \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicMenu.st similarity index 92% rename from packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st rename to packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicMenu.st index 4d42454b..e76ddb76 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamic.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/isDynamicMenu.st @@ -1,5 +1,5 @@ accessing -isDynamic +isDynamicMenu | subMenu | subMenu := self subMenuIfAbsent: [ ^ false ]. diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st index 9e68bd8b..c506987f 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st @@ -6,7 +6,7 @@ menuSubmorphs subMenu := self subMenuIfAbsent: [ ^ OrderedCollection new ]. morphs := OrderedCollection new. - self ifDynamic: [subMenu updateMenu. + self ifDynamicMenu: [subMenu updateMenu. morphs addAll: subMenu submorphs. subMenu removeAllMorphs ] ifStatic: [morphs addAll: subMenu submorphs]. diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st index 74ab42a2..e41f7f6e 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st @@ -1,4 +1,7 @@ accessing name - ^ self morph contents \ No newline at end of file + ^ self ifDynamicItem: + [ [self morph updateContents] on: MessageNotUnderstood do: []. + self morph contents ] + ifStatic: [ self morph contents ] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 238b793d..f569ded3 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -10,16 +10,18 @@ "execute" : "NL 7/6/2021 12:16", "firstWordOfSelector" : "lm 7/6/2021 23:35", "hasEntries" : "NL 7/5/2021 19:42", - "ifDynamic:ifStatic:" : "b 7/5/2021 18:32", - "isDynamic" : "NL 7/6/2021 12:29", + "ifDynamicItem:ifStatic:" : "b 7/12/2021 18:42", + "ifDynamicMenu:ifStatic:" : "b 7/12/2021 18:42", + "isDynamicItem" : "b 7/12/2021 18:54", + "isDynamicMenu" : "b 7/12/2021 18:41", "isEnabled" : "NL 7/5/2021 17:48", "isMenu" : "NL 7/5/2021 17:54", "isValid" : "b 7/5/2021 18:43", "menuEntries" : "b 7/12/2021 15:04", - "menuSubmorphs" : "b 7/5/2021 18:53", + "menuSubmorphs" : "b 7/12/2021 18:42", "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", - "name" : "b 7/5/2021 18:50", + "name" : "b 7/12/2021 19:03", "selector" : "lm 7/6/2021 22:58", "selector:" : "lm 7/6/2021 22:59", "subMenuIfAbsent:" : "b 7/5/2021 18:18" } } diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st index c281b129..b718e5ba 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/algertemListWith..st @@ -1,4 +1,4 @@ -as yet unclassified +algertem lists algertemListWith: aNamedWorldMenuEntry ^ aNamedWorldMenuEntry menuEntries diff --git a/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st b/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st index 47a1bf28..1b16e0d9 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st +++ b/packages/Algernon.package/ALGWorldMenuType.class/class/filterOutDuplicates..st @@ -1,4 +1,4 @@ -as yet unclassified +helpers filterOutDuplicates: anOrderedCollection | usedNames | diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st index 86127a3d..71bc15ec 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/algertemChildrenList.st @@ -1,4 +1,4 @@ -as yet unclassified +children algertemChildrenList ^ ALGWorldMenuType algertemListWith: self typeObject \ No newline at end of file diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st index 1fc8444a..1a11bb5a 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/hasChildren.st @@ -1,4 +1,4 @@ -as yet unclassified +children hasChildren ^ self typeObject hasEntries \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st new file mode 100644 index 00000000..432a5e06 --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st @@ -0,0 +1,3 @@ +testing +testWindowTypeAlgertemListWith + self assert: ALGWindowType algertemList notEmpty \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeCreateListOfAlgeractions.st b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeCreateListOfAlgeractions.st new file mode 100644 index 00000000..3b2a885b --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeCreateListOfAlgeractions.st @@ -0,0 +1,8 @@ +testing +testWindowTypeCreateListOfAlgeractions + |windows| + + windows := ALGWindowType visibleWindows. + windows do: [ :each | + self assert: (ALGWindowType + with: each) createListOfAlgeractions notEmpty] \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeAlgertemListWith.st b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeAlgertemListWith.st new file mode 100644 index 00000000..7a496e27 --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeAlgertemListWith.st @@ -0,0 +1,3 @@ +testing +testWorldMenuTypeAlgertemListWith + self assert: (ALGWorldMenuType algertemListWith: ALGWorldMenuType allEntries first) notEmpty \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeCreateListOfAlgeractions.st b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeCreateListOfAlgeractions.st index 4653f2b4..971c8436 100644 --- a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeCreateListOfAlgeractions.st +++ b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWorldMenuTypeCreateListOfAlgeractions.st @@ -1,3 +1,8 @@ testing testWorldMenuTypeCreateListOfAlgeractions - self assertAlgeractionsNotEmptyForType: ALGWorldMenuType \ No newline at end of file + |entries| + + entries := ALGWorldMenuType allEntries. + entries do: [ :each | + self assert: (ALGWorldMenuType + with: each) createListOfAlgeractions notEmpty] \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json index 5a9558f5..04cbe996 100644 --- a/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json @@ -18,4 +18,7 @@ "testSelectionIncrement" : "rk 8/5/2020 19:49", "testSettingsTypeCreateListOfAlgeractions" : "rk 8/6/2020 10:51", "testTestTypeCreateListOfAlgeractions" : "rk 8/6/2020 10:51", - "testWorldMenuTypeCreateListOfAlgeractions" : "b 5/17/2021 14:12" } } + "testWindowTypeAlgertemListWith" : "b 7/12/2021 19:52", + "testWindowTypeCreateListOfAlgeractions" : "b 7/12/2021 19:51", + "testWorldMenuTypeAlgertemListWith" : "b 7/12/2021 19:42", + "testWorldMenuTypeCreateListOfAlgeractions" : "b 7/12/2021 19:49" } } diff --git a/packages/AlgernonTests.package/ALGTestGeneral.class/instance/testDynamicItemsOnlyOnDefaultSearchLevel.st b/packages/AlgernonTests.package/ALGTestGeneral.class/instance/testDynamicItemsOnlyOnDefaultSearchLevel.st index a5438a43..622b30d4 100644 --- a/packages/AlgernonTests.package/ALGTestGeneral.class/instance/testDynamicItemsOnlyOnDefaultSearchLevel.st +++ b/packages/AlgernonTests.package/ALGTestGeneral.class/instance/testDynamicItemsOnlyOnDefaultSearchLevel.st @@ -4,7 +4,7 @@ testDynamicItemsOnlyOnDefaultSearchLevel self runQuery: 'Transcript clear'. self assert: ((self itemMorphs reject: [:each | each item isNil]) - anySatisfy: [:each | each item algerType isKindOf: ALGDynamicWorldMenuType ]). + anySatisfy: [:each | each item algerType isKindOf: ALGWorldMenuType ]). "increase search level" self runQuery: 'Monticello' withCursorAt: 'Package'. @@ -12,4 +12,4 @@ testDynamicItemsOnlyOnDefaultSearchLevel self deny: ((self itemMorphs reject: [:each | each item isNil]) - anySatisfy: [:each | each item algerType isKindOf: ALGDynamicWorldMenuType ]). \ No newline at end of file + anySatisfy: [:each | each item algerType isKindOf: ALGWorldMenuType ]). \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestGeneral.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestGeneral.class/methodProperties.json index 79bc13ed..5877a9f4 100644 --- a/packages/AlgernonTests.package/ALGTestGeneral.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestGeneral.class/methodProperties.json @@ -6,7 +6,7 @@ "testBreadcrumbsListSize" : "rk 8/5/2020 16:44", "testClassAction" : "rk 8/5/2020 17:24", "testCloseWithEscape" : "b 6/2/2021 14:35", - "testDynamicItemsOnlyOnDefaultSearchLevel" : "OH 5/20/2021 14:26", + "testDynamicItemsOnlyOnDefaultSearchLevel" : "b 7/12/2021 16:45", "testKeyBindingsValid" : "jRo 8/1/2020 11:19", "testListContents" : "jRo 7/5/2020 22:15", "testMethodAction" : "rk 8/5/2020 17:26", diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testDynamicWorldMenuTypeNotEmpty.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testDynamicWorldMenuTypeNotEmpty.st deleted file mode 100644 index 2cc239e7..00000000 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testDynamicWorldMenuTypeNotEmpty.st +++ /dev/null @@ -1,3 +0,0 @@ -testing world menu types -testDynamicWorldMenuTypeNotEmpty - self denyEmptyAlgertemListForType: ALGDynamicWorldMenuType \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testHasChildren.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testHasChildren.st index 6e94c0c4..b3c560cd 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testHasChildren.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testHasChildren.st @@ -11,5 +11,4 @@ testHasChildren self assert: ALGPackageType algertemList first hasChildren. self assert: (ALGClassType new typeObject: ALGCore) hasChildren. self deny: ALGNullItem new hasChildren. - self deny: ALGStaticWorldMenuType algertemList first hasChildren. - self deny: ALGDynamicWorldMenuType algertemList first hasChildren. \ No newline at end of file + self assert: ALGWorldMenuType algertemList first hasChildren. \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testStaticWorldMenuTypeNotEmpty.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testStaticWorldMenuTypeNotEmpty.st deleted file mode 100644 index 1ac8f625..00000000 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testStaticWorldMenuTypeNotEmpty.st +++ /dev/null @@ -1,3 +0,0 @@ -testing world menu types -testStaticWorldMenuTypeNotEmpty - self denyEmptyAlgertemListForType: ALGStaticWorldMenuType \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st index 8558f46e..fcc126f0 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testSubmenuCheckBoxesAfterTab.st @@ -5,13 +5,14 @@ testSubmenuCheckBoxesAfterTab themesAndColorName := 'Themes & Colors'. tab := ALGFakeKeyboardEvent new keyString: ''. - colorfulWindowsName := 'Colorful windows'. + colorfulWindowsName := 'Colorful Windows'. self runQuery: themesAndColorName. self algInstance keyStroke: tab. + self runQuery: colorfulWindowsName. self assert: (self resultsIncludeName: colorfulWindowsName). colorfulWindowsInitialValue := Model useColorfulWindows. self runQuery: colorfulWindowsName. - self doActionForItem: (self items first). + self doActionForItem: self items first. self deny: colorfulWindowsInitialValue equals: Model useColorfulWindows. Model useColorfulWindows: colorfulWindowsInitialValue diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st index 4eafac2c..385b9dec 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testTabIntoSubmenus.st @@ -9,5 +9,7 @@ testTabIntoSubmenus randomEntryName := 'Set High-DPI Mode'. self runQuery: themesAndColorName. self algInstance keyStroke: tab. + self runQuery: randomCheckBoxName. self assert: (self resultsIncludeName: randomCheckBoxName). + self runQuery: randomEntryName. self assert: (self resultsIncludeName: randomEntryName). \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWorldMenuTypeNotEmpty.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWorldMenuTypeNotEmpty.st new file mode 100644 index 00000000..4a37c47e --- /dev/null +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testWorldMenuTypeNotEmpty.st @@ -0,0 +1,3 @@ +testing world menu types +testWorldMenuTypeNotEmpty + self denyEmptyAlgertemListForType: ALGWorldMenuType \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json index 819c34e4..83e0ffa6 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json @@ -18,7 +18,6 @@ "testClassNotEmpty" : "rk 8/6/2020 10:51", "testClassType" : "rk 8/6/2020 10:51", "testClassesForCategoryNotEmpty" : "rk 8/5/2020 19:17", - "testDynamicWorldMenuTypeNotEmpty" : "OH 5/20/2021 13:35", "testExploreAllInstancesOpensOneWindow" : "b 6/25/2021 17:34", "testExpressionDoIt1" : "kej 8/4/2020 20:11", "testExpressionDoIt2" : "kej 8/4/2020 20:10", @@ -32,7 +31,7 @@ "testExpressionWithChildren" : "jRo 8/1/2020 13:03", "testFindsNewDynamicWorldMenuEntries" : "b 6/4/2021 18:19", "testGlobalVariableNotEmpty" : "rk 8/6/2020 10:51", - "testHasChildren" : "fsa 5/18/2021 18:39", + "testHasChildren" : "b 7/12/2021 19:21", "testHelpAction" : "8/6/2020 11:41:26", "testHelpAlgerItems" : "rk 8/6/2020 10:51", "testItemActionName:equals:" : "b 6/4/2021 17:13", @@ -56,10 +55,9 @@ "testSave" : "OH 5/20/2021 13:48", "testSaveAndQuit" : "OH 5/20/2021 13:52", "testSettingsNotEmpty" : "rk 8/6/2020 10:51", - "testStaticWorldMenuTypeNotEmpty" : "OH 5/20/2021 13:34", "testSubmenuCheckBoxes" : "lm 7/4/2021 23:00", - "testSubmenuCheckBoxesAfterTab" : "lm 7/4/2021 22:10", - "testTabIntoSubmenus" : "lm 7/4/2021 21:52", + "testSubmenuCheckBoxesAfterTab" : "b 7/12/2021 19:32", + "testTabIntoSubmenus" : "b 7/12/2021 19:28", "testTestNotEmpty" : "rk 8/6/2020 10:51", "testWindowBringToFront" : "lm 5/26/2021 20:39", "testWindowClose" : "lm 5/26/2021 20:18", @@ -74,4 +72,5 @@ "testWorldMenuDifferentIconsForDifferentMenus" : "b 6/4/2021 17:18", "testWorldMenuDisabledAreExcluded" : "NL 6/29/2021 17:54", "testWorldMenuSameActionsForSameMenu" : "b 6/4/2021 17:13", - "testWorldMenuSameIconsForSameMenu" : "b 6/4/2021 17:17" } } + "testWorldMenuSameIconsForSameMenu" : "b 6/4/2021 17:17", + "testWorldMenuTypeNotEmpty" : "b 7/12/2021 19:19" } } From 71e5400cc4c8425f259ed63aba64a42a454d821e Mon Sep 17 00:00:00 2001 From: Benedikt Weber Date: Mon, 12 Jul 2021 20:32:04 +0200 Subject: [PATCH 17/22] Better handling of dynamic menus & items --- .../instance/ifDynamicItem..st | 4 ++++ .../instance/ifDynamicItem.ifStatic..st | 4 ---- .../instance/ifDynamicMenu..st | 4 ++++ .../instance/ifDynamicMenu.ifStatic..st | 4 ---- .../instance/menuSubmorphs.st | 11 +++-------- .../ALGNamedWorldMenuEntry.class/instance/name.st | 7 ++----- .../methodProperties.json | 8 ++++---- 7 files changed, 17 insertions(+), 25 deletions(-) create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st create mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st new file mode 100644 index 00000000..176a2c27 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st @@ -0,0 +1,4 @@ +accessing +ifDynamicItem: aBlock + + ^ self isDynamicItem ifTrue: [aBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st deleted file mode 100644 index 9a17e2cc..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem.ifStatic..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -ifDynamicItem: dynamicBlock ifStatic: staticBlock - - ^ self isDynamicItem ifTrue: [dynamicBlock value] ifFalse: [staticBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st new file mode 100644 index 00000000..cbe0ae94 --- /dev/null +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st @@ -0,0 +1,4 @@ +accessing +ifDynamicMenu: aBlock + + ^ self isDynamicMenu ifTrue: [aBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st deleted file mode 100644 index 8b38a907..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu.ifStatic..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -ifDynamicMenu: dynamicBlock ifStatic: staticBlock - - ^ self isDynamicMenu ifTrue: [dynamicBlock value] ifFalse: [staticBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st index c506987f..9f91037c 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/menuSubmorphs.st @@ -1,14 +1,9 @@ accessing menuSubmorphs - | subMenu morphs | + | subMenu | subMenu := self subMenuIfAbsent: [ ^ OrderedCollection new ]. - morphs := OrderedCollection new. - self ifDynamicMenu: [subMenu updateMenu. - morphs addAll: subMenu submorphs. - subMenu removeAllMorphs ] - ifStatic: [morphs addAll: subMenu submorphs]. - - ^ morphs \ No newline at end of file + self ifDynamicMenu: [subMenu updateMenu]. + ^ OrderedCollection newFrom: subMenu submorphs \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st index e41f7f6e..98825e1c 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/name.st @@ -1,7 +1,4 @@ accessing name - - ^ self ifDynamicItem: - [ [self morph updateContents] on: MessageNotUnderstood do: []. - self morph contents ] - ifStatic: [ self morph contents ] \ No newline at end of file + self ifDynamicItem: [self morph updateContents]. + ^ self morph contents \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index f569ded3..ddadbd8c 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -10,18 +10,18 @@ "execute" : "NL 7/6/2021 12:16", "firstWordOfSelector" : "lm 7/6/2021 23:35", "hasEntries" : "NL 7/5/2021 19:42", - "ifDynamicItem:ifStatic:" : "b 7/12/2021 18:42", - "ifDynamicMenu:ifStatic:" : "b 7/12/2021 18:42", + "ifDynamicItem:" : "b 7/12/2021 20:27", + "ifDynamicMenu:" : "b 7/12/2021 20:26", "isDynamicItem" : "b 7/12/2021 18:54", "isDynamicMenu" : "b 7/12/2021 18:41", "isEnabled" : "NL 7/5/2021 17:48", "isMenu" : "NL 7/5/2021 17:54", "isValid" : "b 7/5/2021 18:43", "menuEntries" : "b 7/12/2021 15:04", - "menuSubmorphs" : "b 7/12/2021 18:42", + "menuSubmorphs" : "b 7/12/2021 20:26", "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", - "name" : "b 7/12/2021 19:03", + "name" : "b 7/12/2021 20:28", "selector" : "lm 7/6/2021 22:58", "selector:" : "lm 7/6/2021 22:59", "subMenuIfAbsent:" : "b 7/5/2021 18:18" } } From 4319dcbb8872ac7f9ef34a02c364cefd1851fd81 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 12 Jul 2021 23:15:12 +0200 Subject: [PATCH 18/22] Try to fix CI this way --- .../ALGNamedWorldMenuEntry.class/class/newFrom..st | 3 --- .../instance/firstWordOfSelector.st | 13 ------------- .../instance/selector..st | 3 --- .../instance/selector.st | 3 ++- .../methodProperties.json | 6 ++---- .../ALGNamedWorldMenuEntry.class/properties.json | 3 +-- .../instance/determineActionName.st | 8 ++++---- .../ALGWorldMenuType.class/methodProperties.json | 2 +- 8 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st delete mode 100644 packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st index e035b4e5..1fea76a2 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/class/newFrom..st @@ -3,7 +3,4 @@ newFrom: aMorph ^ self new morph: aMorph; - selector: - ((aMorph isKindOf: MenuItemMorph) - ifTrue: [aMorph selector]); yourself \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st deleted file mode 100644 index 1b86c273..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/firstWordOfSelector.st +++ /dev/null @@ -1,13 +0,0 @@ -accessing -firstWordOfSelector - - self selector - ifNil: [ ^ String empty ] - ifNotNil: [ - | selectorString | - selectorString := self selector asString. - selectorString withIndexDo: - [ :letter :index | letter isUppercase - ifTrue: [ ^ selectorString wordBefore: index - 1 ]]. - ^ selectorString ] - \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st deleted file mode 100644 index f3222a02..00000000 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -selector: aSymbol - selector := aSymbol \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st index b28282a1..072f7ca0 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/selector.st @@ -1,3 +1,4 @@ accessing selector - ^ selector \ No newline at end of file + ^ (self morph selector + ifNil: [ String new.]) asString \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index ddadbd8c..67b863f0 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newFrom:" : "lm 7/6/2021 22:53", + "newFrom:" : "NL 7/12/2021 23:09", "newFrom:inCategory:" : "lm 7/6/2021 22:54" }, "instance" : { "allEntries" : "b 7/12/2021 15:15", @@ -8,7 +8,6 @@ "category:" : "NL 7/5/2021 19:21", "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", "execute" : "NL 7/6/2021 12:16", - "firstWordOfSelector" : "lm 7/6/2021 23:35", "hasEntries" : "NL 7/5/2021 19:42", "ifDynamicItem:" : "b 7/12/2021 20:27", "ifDynamicMenu:" : "b 7/12/2021 20:26", @@ -22,6 +21,5 @@ "morph" : "NL 6/4/2021 16:15", "morph:" : "NL 6/4/2021 16:15", "name" : "b 7/12/2021 20:28", - "selector" : "lm 7/6/2021 22:58", - "selector:" : "lm 7/6/2021 22:59", + "selector" : "NL 7/12/2021 23:12", "subMenuIfAbsent:" : "b 7/5/2021 18:18" } } diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json index 9fd45896..972d2846 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/properties.json @@ -7,8 +7,7 @@ "commentStamp" : "fsa 6/27/2021 10:38", "instvars" : [ "morph", - "category", - "selector" ], + "category" ], "name" : "ALGNamedWorldMenuEntry", "pools" : [ ], diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st index 6bcd3079..3f6274f7 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st @@ -1,11 +1,11 @@ actions determineActionName - | firstWordOfSelector | self typeObject hasEntries ifTrue: [ ^ 'entries' ]. - firstWordOfSelector := self typeObject firstWordOfSelector. - (self class actionNameSelectors includes: firstWordOfSelector) - ifTrue: [ ^ firstWordOfSelector ]. + self class actionNameSelectors do: [ :selectorString | + (self typeObject selector startsWith: selectorString) + ifTrue: [ ^ selectorString ] + ]. self class menuActionMapping at: self typeObject category ifPresent: [ :name | ^ name ]. diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 515612a3..cadfb991 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -14,7 +14,7 @@ "createAction" : "lm 7/6/2021 23:28", "createActionNamed:" : "NL 6/4/2021 16:30", "createListOfAlgeractions" : "NL 6/4/2021 16:37", - "determineActionName" : "lm 7/6/2021 23:27", + "determineActionName" : "NL 7/12/2021 23:14", "hasChildren" : "NL 7/5/2021 19:42", "name" : "NL 7/6/2021 12:17", "openMenuItem" : "NL 7/6/2021 12:15", From b0e01115c74bafbc8944630d779496066350c5f7 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 12 Jul 2021 23:25:44 +0200 Subject: [PATCH 19/22] Fix linting --- .../ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st | 2 +- .../ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st | 2 +- .../ALGNamedWorldMenuEntry.class/methodProperties.json | 4 ++-- .../ALGWorldMenuType.class/instance/determineActionName.st | 2 +- .../ALGWorldMenuType.class/methodProperties.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st index 176a2c27..d10fe4ec 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicItem..st @@ -1,4 +1,4 @@ accessing ifDynamicItem: aBlock - ^ self isDynamicItem ifTrue: [aBlock value] \ No newline at end of file + self isDynamicItem ifTrue: [aBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st index cbe0ae94..68e94bbe 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/instance/ifDynamicMenu..st @@ -1,4 +1,4 @@ accessing ifDynamicMenu: aBlock - ^ self isDynamicMenu ifTrue: [aBlock value] \ No newline at end of file + self isDynamicMenu ifTrue: [aBlock value] \ No newline at end of file diff --git a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json index 67b863f0..b5ce2a70 100644 --- a/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json +++ b/packages/Algernon.package/ALGNamedWorldMenuEntry.class/methodProperties.json @@ -9,8 +9,8 @@ "enabledMenuSubmorphs" : "lm 7/4/2021 22:36", "execute" : "NL 7/6/2021 12:16", "hasEntries" : "NL 7/5/2021 19:42", - "ifDynamicItem:" : "b 7/12/2021 20:27", - "ifDynamicMenu:" : "b 7/12/2021 20:26", + "ifDynamicItem:" : "NL 7/12/2021 23:24", + "ifDynamicMenu:" : "NL 7/12/2021 23:24", "isDynamicItem" : "b 7/12/2021 18:54", "isDynamicMenu" : "b 7/12/2021 18:41", "isEnabled" : "NL 7/5/2021 17:48", diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st index 3f6274f7..0d7c0f55 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st @@ -2,7 +2,7 @@ actions determineActionName self typeObject hasEntries ifTrue: [ ^ 'entries' ]. - self class actionNameSelectors do: [ :selectorString | + self class actionNameSelectors collect: [ :selectorString | (self typeObject selector startsWith: selectorString) ifTrue: [ ^ selectorString ] ]. diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index cadfb991..7f384a89 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -14,7 +14,7 @@ "createAction" : "lm 7/6/2021 23:28", "createActionNamed:" : "NL 6/4/2021 16:30", "createListOfAlgeractions" : "NL 6/4/2021 16:37", - "determineActionName" : "NL 7/12/2021 23:14", + "determineActionName" : "NL 7/12/2021 23:22", "hasChildren" : "NL 7/5/2021 19:42", "name" : "NL 7/6/2021 12:17", "openMenuItem" : "NL 7/6/2021 12:15", From e4a31461d4c72c90dbbff23a1a91d4d0714c78fc Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 12 Jul 2021 23:34:09 +0200 Subject: [PATCH 20/22] Remove a dumb test and try something --- .../instance/testWindowTypeAlgertemListWith.st | 3 --- .../ALGTestAction.class/methodProperties.json | 1 - .../ALGTestTypes.class/instance/testOpenSubmenuEntries.st | 4 ++-- .../ALGTestTypes.class/methodProperties.json | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st diff --git a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st b/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st deleted file mode 100644 index 432a5e06..00000000 --- a/packages/AlgernonTests.package/ALGTestAction.class/instance/testWindowTypeAlgertemListWith.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -testWindowTypeAlgertemListWith - self assert: ALGWindowType algertemList notEmpty \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json index 04cbe996..6addc491 100644 --- a/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestAction.class/methodProperties.json @@ -18,7 +18,6 @@ "testSelectionIncrement" : "rk 8/5/2020 19:49", "testSettingsTypeCreateListOfAlgeractions" : "rk 8/6/2020 10:51", "testTestTypeCreateListOfAlgeractions" : "rk 8/6/2020 10:51", - "testWindowTypeAlgertemListWith" : "b 7/12/2021 19:52", "testWindowTypeCreateListOfAlgeractions" : "b 7/12/2021 19:51", "testWorldMenuTypeAlgertemListWith" : "b 7/12/2021 19:42", "testWorldMenuTypeCreateListOfAlgeractions" : "b 7/12/2021 19:49" } } diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st index afc4f8c6..06dd7700 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st @@ -7,6 +7,6 @@ testOpenSubmenuEntries self runQuery: flatWidgetLookName. self assert: (self resultsIncludeName: flatWidgetLookName). - englishLanguageName := 'English (UNITED STATES)'. + "englishLanguageName := 'English (UNITED STATES)'. self runQuery: englishLanguageName. - self assert: (self resultsIncludeName: englishLanguageName). \ No newline at end of file + self assert: (self resultsIncludeName: englishLanguageName)." \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json index 83e0ffa6..3cdb0b9d 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json @@ -39,7 +39,7 @@ "testMethodTypeOpenMethodInBrowser" : "beb 5/12/2020 12:12", "testOpenApps" : "b 6/4/2021 18:18", "testOpenInExistingBrowser" : "jRo 5/28/2020 20:32", - "testOpenSubmenuEntries" : "lm 7/4/2021 21:35", + "testOpenSubmenuEntries" : "NL 7/12/2021 23:33", "testOpenTools" : "b 6/4/2021 18:18", "testOpenWindowEntry:withAction:" : "lm 5/26/2021 20:26", "testPackageAction" : "rk 8/5/2020 22:20", From f2a9f239230b15773fa82667c58b8d518ffe8b23 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 12 Jul 2021 23:39:52 +0200 Subject: [PATCH 21/22] Fix linting and try to look for English --- .../ALGWorldMenuType.class/instance/determineActionName.st | 7 +++---- .../ALGWorldMenuType.class/methodProperties.json | 2 +- .../ALGTestTypes.class/instance/testOpenSubmenuEntries.st | 4 ++-- .../ALGTestTypes.class/methodProperties.json | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st index 0d7c0f55..b443a660 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st +++ b/packages/Algernon.package/ALGWorldMenuType.class/instance/determineActionName.st @@ -2,10 +2,9 @@ actions determineActionName self typeObject hasEntries ifTrue: [ ^ 'entries' ]. - self class actionNameSelectors collect: [ :selectorString | - (self typeObject selector startsWith: selectorString) - ifTrue: [ ^ selectorString ] - ]. + self class actionNameSelectors + detect: [ :selectorString | self typeObject selector startsWith: selectorString] + ifFound: [ :element | ^ element ]. self class menuActionMapping at: self typeObject category ifPresent: [ :name | ^ name ]. diff --git a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json index 7f384a89..0c4552c0 100644 --- a/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json +++ b/packages/Algernon.package/ALGWorldMenuType.class/methodProperties.json @@ -14,7 +14,7 @@ "createAction" : "lm 7/6/2021 23:28", "createActionNamed:" : "NL 6/4/2021 16:30", "createListOfAlgeractions" : "NL 6/4/2021 16:37", - "determineActionName" : "NL 7/12/2021 23:22", + "determineActionName" : "NL 7/12/2021 23:38", "hasChildren" : "NL 7/5/2021 19:42", "name" : "NL 7/6/2021 12:17", "openMenuItem" : "NL 7/6/2021 12:15", diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st index 06dd7700..f6416cab 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st @@ -7,6 +7,6 @@ testOpenSubmenuEntries self runQuery: flatWidgetLookName. self assert: (self resultsIncludeName: flatWidgetLookName). - "englishLanguageName := 'English (UNITED STATES)'. + englishLanguageName := 'English'. self runQuery: englishLanguageName. - self assert: (self resultsIncludeName: englishLanguageName)." \ No newline at end of file + self assert: (self resultsIncludeName: englishLanguageName). \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json index 3cdb0b9d..a529ca3f 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json @@ -39,7 +39,7 @@ "testMethodTypeOpenMethodInBrowser" : "beb 5/12/2020 12:12", "testOpenApps" : "b 6/4/2021 18:18", "testOpenInExistingBrowser" : "jRo 5/28/2020 20:32", - "testOpenSubmenuEntries" : "NL 7/12/2021 23:33", + "testOpenSubmenuEntries" : "NL 7/12/2021 23:39", "testOpenTools" : "b 6/4/2021 18:18", "testOpenWindowEntry:withAction:" : "lm 5/26/2021 20:26", "testPackageAction" : "rk 8/5/2020 22:20", From 225b04dd12beb58800467f548e9a2669d219c8f7 Mon Sep 17 00:00:00 2001 From: Nils Lissner Date: Mon, 12 Jul 2021 23:44:56 +0200 Subject: [PATCH 22/22] Appearantly there is no language installed on the ci --- .../ALGTestTypes.class/instance/testOpenSubmenuEntries.st | 8 ++++---- .../ALGTestTypes.class/methodProperties.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st index f6416cab..928df06c 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st +++ b/packages/AlgernonTests.package/ALGTestTypes.class/instance/testOpenSubmenuEntries.st @@ -1,12 +1,12 @@ testing world menu types testOpenSubmenuEntries - |flatWidgetLookName englishLanguageName| + |flatWidgetLookName fontSizeName | flatWidgetLookName := 'Flat Widget Look'. self runQuery: flatWidgetLookName. self assert: (self resultsIncludeName: flatWidgetLookName). - englishLanguageName := 'English'. - self runQuery: englishLanguageName. - self assert: (self resultsIncludeName: englishLanguageName). \ No newline at end of file + fontSizeName := 'Increase Font Size'. + self runQuery: fontSizeName. + self assert: (self resultsIncludeName: fontSizeName). \ No newline at end of file diff --git a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json index a529ca3f..82bab2f1 100644 --- a/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json +++ b/packages/AlgernonTests.package/ALGTestTypes.class/methodProperties.json @@ -39,7 +39,7 @@ "testMethodTypeOpenMethodInBrowser" : "beb 5/12/2020 12:12", "testOpenApps" : "b 6/4/2021 18:18", "testOpenInExistingBrowser" : "jRo 5/28/2020 20:32", - "testOpenSubmenuEntries" : "NL 7/12/2021 23:39", + "testOpenSubmenuEntries" : "NL 7/12/2021 23:44", "testOpenTools" : "b 6/4/2021 18:18", "testOpenWindowEntry:withAction:" : "lm 5/26/2021 20:26", "testPackageAction" : "rk 8/5/2020 22:20",