Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing Page done #28

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions src/SqueakKara-Core/SKLandingPage.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
Class {
#name : #SKLandingPage,
#superclass : #SystemWindow,
#category : #'SqueakKara-Core'
}

{
#category : #actions,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
}
SKLandingPage >> actionExample1 [

SKEnvironment basicNew initializeWithChallenge1.
self delete
]

{
#category : #actions,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
}
SKLandingPage >> actionExample2 [

SKEnvironment basicNew initializeWithChallenge1.
self delete
]

{
#category : #actions,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
}
SKLandingPage >> actionExample3 [

SKEnvironment basicNew initializeWithChallenge1.
self delete
]

{
#category : #actions,
#'squeak_changestamp' : 'LK 6/21/2024 23:01'
}
SKLandingPage >> actionNew [

SKEnvironment newWithKaraAt: 1@1.
self delete
]

{
#category : #buttons,
#'squeak_changestamp' : 'LK 6/21/2024 22:55'
}
SKLandingPage >> addAllButtons [

self addButton: self buildButtonNew atIndex: 0.

self addButton: self buildButtonExample1 atIndex: 1.
self addButton: self buildButtonExample2 atIndex: 2.
self addButton: self buildButtonExample3 atIndex: 3.
]

{
#category : #buttons,
#'squeak_changestamp' : 'LK 6/21/2024 22:52'
}
SKLandingPage >> addButton: aButton atIndex: anInteger [

| anOffset |

self addMorph: aButton.

anOffset := 2 * aButton height * anInteger.

aButton position: self center - (aButton width / 2) + (0 @ anOffset).
]

{
#category : #buttons,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
}
SKLandingPage >> buildButtonExample1 [

^ SimpleButtonMorph new
label: self buttonExample1Label;
target: self;
actionSelector: #actionExample1;
color: Color lightGray
]

{
#category : #buttons,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
}
SKLandingPage >> buildButtonExample2 [

^ SimpleButtonMorph new
label: self buttonExample2Label;
target: self;
actionSelector: #actionExample2;
color: Color lightGray
]

{
#category : #buttons,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
}
SKLandingPage >> buildButtonExample3 [

^ SimpleButtonMorph new
label: self buttonExample3Label;
target: self;
actionSelector: #actionExample3;
color: Color lightGray
]

{
#category : #buttons,
#'squeak_changestamp' : 'LK 6/21/2024 23:01'
}
SKLandingPage >> buildButtonNew [

^ SimpleButtonMorph new
label: self buttonNewLabel;
target: self;
actionSelector: #actionNew.
]

{
#category : #labels,
#'squeak_changestamp' : 'LK 6/21/2024 22:53'
}
SKLandingPage >> buttonExample1Label [

^ 'Example Project 1'
]

{
#category : #labels,
#'squeak_changestamp' : 'LK 6/21/2024 22:53'
}
SKLandingPage >> buttonExample2Label [

^ 'Example Project 2'
]

{
#category : #labels,
#'squeak_changestamp' : 'LK 6/21/2024 22:53'
}
SKLandingPage >> buttonExample3Label [

^ 'Example Project 3'
]

{
#category : #labels,
#'squeak_changestamp' : 'LK 6/21/2024 22:52'
}
SKLandingPage >> buttonNewLabel [

^ 'New Blank Project'
]

{
#category : #initialization,
#'squeak_changestamp' : 'LK 6/21/2024 22:53'
}
SKLandingPage >> defaultExtent [

^ 200 px @ 200 px
]

{
#category : #initialization,
#'squeak_changestamp' : 'LK 6/21/2024 22:53'
}
SKLandingPage >> initialize [

super initialize.

self setLabel: self windowTitle;
openInHand;
extent: self defaultExtent;
addAllButtons
]

{
#category : #labels,
#'squeak_changestamp' : 'LK 6/21/2024 22:44'
}
SKLandingPage >> windowTitle [

^ 'SqueakKara'
]
Loading