From 961aca248b23131235aa0355936738c60ca0e317 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 19 May 2024 17:07:44 +0200 Subject: [PATCH 1/3] wip gui class added --- source/GM-TE/GMTEEditor.class.st | 110 +++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 source/GM-TE/GMTEEditor.class.st diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st new file mode 100644 index 00000000..c082e94d --- /dev/null +++ b/source/GM-TE/GMTEEditor.class.st @@ -0,0 +1,110 @@ +Class { + #name : #GMTEEditor, + #superclass : #Morph, + #category : #'GM-TE' +} + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/19/2024 16:22' +} +GMTEEditor class >> createCommandBarWithBuilder: aBuilder [ + ^aBuilder pluggablePanelSpec new + name: 'Command Bar'; + children: {aBuilder pluggableButtonSpec new + label: 'Export'; + frame: (LayoutFrame fractions: (0 @ 0 corner: 0.3 @ 1) offsets: nil). + aBuilder pluggableButtonSpec new + frame: (LayoutFrame fractions: (0.3 @ 0 corner: 0.6 @ 1) offsets: nil); + label: 'Import'. + aBuilder pluggableButtonSpec new + frame: (LayoutFrame fractions: (0.6 @ 0 corner: 0.9 @ 1) offsets: nil); + label: 'Open in World'}; + frame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0.1) offsets: nil); + yourself +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/19/2024 16:22' +} +GMTEEditor class >> createLayersWithBuilder: aBuilder [ + ^aBuilder pluggablePanelSpec new + name: 'Layers'; + frame: (LayoutFrame fractions: (0.8 @ 0.1 corner: 1 @ 1) offsets: nil); + yourself +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/19/2024 16:34' +} +GMTEEditor class >> createTileViewerWithBuilder: aBuilder [ + ^aBuilder pluggablePanelSpec new + name: 'Tile Viewer'; + frame: (LayoutFrame fractions: (0.2 @ 0.1 corner: 0.8 @ 0.8) offsets: nil); + yourself +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/19/2024 17:07' +} +GMTEEditor class >> createTilestoreWithBuilder: aBuilder [ + | redMorph blueMorph| + + redMorph := Morph new + color: Color red; + yourself. + + blueMorph := Morph new. + + + ^SquotGUIUtilities buildEvenGrid: { + aBuilder pluggableButtonSpec new + label: 'test1'; + color: Color red. + aBuilder pluggableButtonSpec new + label: 'test2'; + color: Color blue } ofSize: 1@2 with: aBuilder + +"^aBuilder pluggablePanelSpec new + name: 'Tilestore'; + frame: (LayoutFrame fractions: (0 @ 0.1 corner: 0.2 @ 1) offsets: nil); + children: {redMorph . blueMorph} + yourself" +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/19/2024 16:22' +} +GMTEEditor class >> createTrayWithBuilder: aBuilder [ + ^aBuilder pluggablePanelSpec new + name: 'Tray'; + frame: (LayoutFrame fractions: (0.2 @ 0.8 corner: 0.8 @ 1) offsets: nil); + yourself +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/19/2024 16:20' +} +GMTEEditor class >> new [ + + |builder spec morph| + super new. + builder := ToolBuilder default. + spec := builder pluggableWindowSpec new + model: Model new; + label: 'GM Tile Editor'; + children: { + self createCommandBarWithBuilder: builder. + self createTileViewerWithBuilder: builder. + self createTilestoreWithBuilder: builder. + self createTrayWithBuilder: builder. + self createLayersWithBuilder: builder}; + yourself. + morph := builder build: spec. + morph openInWorld +] From c20b406fd4a9cf23772ffc198aaf2db9acab0afd Mon Sep 17 00:00:00 2001 From: Joshua Storost Date: Sun, 19 May 2024 17:15:16 +0200 Subject: [PATCH 2/3] scalable Morph --- source/GM-TE/GMTEEditor.class.st | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index c082e94d..b2c55748 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -37,11 +37,12 @@ GMTEEditor class >> createLayersWithBuilder: aBuilder [ { #category : #'as yet unclassified', - #'squeak_changestamp' : 'TW 5/19/2024 16:34' + #'squeak_changestamp' : 'JS 5/19/2024 17:12' } GMTEEditor class >> createTileViewerWithBuilder: aBuilder [ ^aBuilder pluggablePanelSpec new name: 'Tile Viewer'; + layout: #horizontal; frame: (LayoutFrame fractions: (0.2 @ 0.1 corner: 0.8 @ 0.8) offsets: nil); yourself ] @@ -88,11 +89,11 @@ GMTEEditor class >> createTrayWithBuilder: aBuilder [ { #category : #'as yet unclassified', - #'squeak_changestamp' : 'TW 5/19/2024 16:20' + #'squeak_changestamp' : 'JS 5/19/2024 17:12' } GMTEEditor class >> new [ - |builder spec morph| + |builder spec morph submorph| super new. builder := ToolBuilder default. spec := builder pluggableWindowSpec new @@ -106,5 +107,15 @@ GMTEEditor class >> new [ self createLayersWithBuilder: builder}; yourself. morph := builder build: spec. + + submorph := RectangleMorph new. + + (morph submorphNamed: 'Tile Viewer') addMorph: submorph. + + submorph + position: (submorph owner position); + hResizing: #spaceFill; + vResizing: #spaceFill. + morph openInWorld ] From fdcae429969787c163825b540723281649427ce8 Mon Sep 17 00:00:00 2001 From: Joshua Storost Date: Sun, 19 May 2024 17:21:50 +0200 Subject: [PATCH 3/3] test --- source/GM-TE/GMTEEditor.class.st | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index b2c55748..ae619003 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -89,7 +89,7 @@ GMTEEditor class >> createTrayWithBuilder: aBuilder [ { #category : #'as yet unclassified', - #'squeak_changestamp' : 'JS 5/19/2024 17:12' + #'squeak_changestamp' : 'JS 5/19/2024 17:21' } GMTEEditor class >> new [ @@ -117,5 +117,7 @@ GMTEEditor class >> new [ hResizing: #spaceFill; vResizing: #spaceFill. + "test" + morph openInWorld ]