Skip to content

Commit

Permalink
add drop down menu for calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
codingWhale13 committed Jun 1, 2022
1 parent 8faf211 commit 412434f
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ initialize
super initialize.

self
calendars: {SCMCalendar new}asOrderedCollection;
calendars: {SCMCalendar new name: 'Privat'; yourself . SCMCalendar new name: 'Uni'; yourself} asOrderedCollection;
dockingBar: (SCMDockingBar createWithApp: self);
addMorph: self dockingBar;
view: SCMAgenda new;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"calendars:" : "BZ 5/30/2022 14:01",
"dockingBar" : "BZ 5/29/2022 11:22",
"dockingBar:" : "BZ 5/29/2022 11:22",
"initialize" : "BZ 5/30/2022 14:38",
"initialize" : "NMK 6/1/2022 14:46",
"view" : "BZ 5/29/2022 11:24",
"view:" : "BZ 5/29/2022 11:24",
"window" : "BZ 5/29/2022 11:24",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
availableCalendarsAsStrings

^ availableCalendars collect: [:each | each name]
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,15 @@ createFields
self eventParticipants: (self createTextField: 'Participants').
self addMorphBack: self eventParticipants.

button := self createButtonWithLabel: 'Done' andTarget: self.
self eventCalendarDropDown: (DropDownChoiceMorph new
contents: 'Choose calendar!';
target: self;
actionSelector: nil;
arguments: Array empty;
getItemsSelector: #availableCalendarsAsStrings;
getItemsArgs: Array empty;
yourself).
self addMorphBack: self eventCalendarDropDown.

button := self createSaveButton.
self addMorphBack: button.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
initialization
createButtonWithLabel: aTitle andTarget: aTarget
"comment stating purpose of message"

"THIS BE DSTUPID"
createSaveButton

| buttonBox button |

Expand All @@ -12,20 +9,13 @@ createButtonWithLabel: aTitle andTarget: aTarget
listCentering: #center;
wrapCentering: #center;
hResizing: #spaceFill;
color: Color lightGray.
color: Color transparent.

button := SimpleButtonMorph new
label: aTitle;
target: aTarget;
label: 'Done';
target: self;
actionSelector: #saveEvent. "like abandon but this is what the little red x in systems windows do..."

buttonBox addMorph: button.

^buttonBox







^buttonBox
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
eventCalendarDropDown: anObject
eventCalendarDropDown := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
eventCalendarDropDown
^ eventCalendarDropDown
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ initialize

self
position: 10 @ 10;
extent: 750 @ 500;
extent: 300 @ 700;
openInWindowLabeled: 'Create Event';
layoutPolicy: TableLayout new;
listDirection: #topToBottom;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
saving
saveEvent

self eventCalendar: self availableCalendars first. "to do: generalize"
self eventCalendar: (self availableCalendars at: (eventCalendarDropDown getCurrentSelectionIndex)).

"TOdo: use better textfields or read input cleanly"
self eventCalendar addEvent: (SCMEvent new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"instance" : {
"availableCalendars" : "BZ 5/30/2022 14:19",
"availableCalendars:" : "BZ 5/30/2022 14:19",
"createButtonWithLabel:andTarget:" : "BZ 5/25/2022 15:14",
"createFields" : "NMK 6/1/2022 13:31",
"availableCalendarsAsStrings" : "NMK 6/1/2022 14:37",
"createFields" : "NMK 6/1/2022 14:56",
"createForm" : "BZ 5/25/2022 15:15",
"createSaveButton" : "NMK 6/1/2022 14:57",
"createTextField:" : "BZ 5/25/2022 14:47",
"eventBeginDay" : "BZ 5/29/2022 11:47",
"eventBeginDay:" : "BZ 5/29/2022 11:47",
Expand All @@ -20,6 +21,8 @@
"eventBeginYear:" : "NMK 6/1/2022 13:22",
"eventCalendar" : "BZ 5/30/2022 14:07",
"eventCalendar:" : "BZ 5/30/2022 14:07",
"eventCalendarDropDown" : "NMK 6/1/2022 14:25",
"eventCalendarDropDown:" : "NMK 6/1/2022 14:25",
"eventDescription" : "BZ 5/29/2022 11:47",
"eventDescription:" : "BZ 5/29/2022 11:47",
"eventEndDay" : "BZ 5/29/2022 11:47",
Expand All @@ -38,5 +41,5 @@
"eventParticipants:" : "BZ 5/29/2022 11:48",
"eventTitle" : "BZ 5/29/2022 11:48",
"eventTitle:" : "BZ 5/29/2022 11:48",
"initialize" : "NMK 6/1/2022 13:14",
"saveEvent" : "NMK 6/1/2022 13:38" } }
"initialize" : "NMK 6/1/2022 14:51",
"saveEvent" : "NMK 6/1/2022 14:43" } }
7 changes: 4 additions & 3 deletions packages/SCM-Core.package/SCMEventForm.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
],
"commentStamp" : "",
"instvars" : [
"availableCalendars",
"eventCalendar",
"eventTitle",
"eventBeginYear",
"eventBeginMonth",
Expand All @@ -21,7 +19,10 @@
"eventEndMinute",
"eventDescription",
"eventLocation",
"eventParticipants" ],
"eventParticipants",
"availableCalendars",
"eventCalendar",
"eventCalendarDropDown" ],
"name" : "SCMEventForm",
"pools" : [
],
Expand Down

0 comments on commit 412434f

Please sign in to comment.