Skip to content

Commit

Permalink
Merge origin/tmm-dev into tmm-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo Zilkenat committed May 19, 2024
2 parents 4e215a4 + fdcae42 commit 8d8c5b0
Showing 1 changed file with 123 additions and 0 deletions.
123 changes: 123 additions & 0 deletions source/GM-TE/GMTEEditor.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
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' : '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
]

{
#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' : 'JS 5/19/2024 17:21'
}
GMTEEditor class >> new [

|builder spec morph submorph|
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.

submorph := RectangleMorph new.

(morph submorphNamed: 'Tile Viewer') addMorph: submorph.

submorph
position: (submorph owner position);
hResizing: #spaceFill;
vResizing: #spaceFill.

"test"

morph openInWorld
]

0 comments on commit 8d8c5b0

Please sign in to comment.