Skip to content

Commit 6d50938

Browse files
committed
Update presentation slides and README & Improved code for some exercises
1 parent d0381f4 commit 6d50938

File tree

54 files changed

+474
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+474
-381
lines changed

README.md

+459-1
Large diffs are not rendered by default.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

section-01-gui-basics/exercise-10/hello_layout_form.rb

+9-11
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
content_size 50, 20
77
margined true
88

9-
vertical_box {
10-
form {
11-
entry {
12-
label 'Full Name'
13-
text 'John Smith'
14-
}
15-
16-
date_picker {
17-
label 'DOB'
18-
time year: 2004, mon: 11, mday: 17
19-
}
9+
form {
10+
entry {
11+
label 'Full Name'
12+
text 'John Smith'
13+
}
14+
15+
date_picker {
16+
label 'DOB'
17+
time year: 2004, mon: 11, mday: 17
2018
}
2119
}
2220
}.show

section-01-gui-basics/exercise-11/option_selector.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
margined true
88

99
vertical_box {
10-
selected_options_label = label('None')
10+
@selected_options_label = label('None')
1111

1212
horizontal_box {
1313
@checkboxes = 3.times.map do |n|
@@ -16,9 +16,9 @@
1616
puts "Checkbox '#{@checkboxes[n].text}' checked property changed to: #{@checkboxes[n].checked?}"
1717
checked_checkboxes = @checkboxes.select(&:checked?)
1818
if checked_checkboxes.empty?
19-
selected_options_label.text = 'None'
19+
@selected_options_label.text = 'None'
2020
else
21-
selected_options_label.text = checked_checkboxes.map(&:text).join(', ')
21+
@selected_options_label.text = checked_checkboxes.map(&:text).join(', ')
2222
end
2323
end
2424
}

section-02-mvc-software-architecture/exercise-01/option_selector_mvc_explicit_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def create_gui_body
5555
@selected_options_label = label('None')
5656

5757
horizontal_box {
58-
checkboxes = 3.times.map do |n|
58+
3.times.map do |n|
5959
option_number = n + 1
6060
checkbox("Option #{option_number}") {
6161
on_toggled do

section-02-mvc-software-architecture/exercise-02/option_selector_mvc_implicit_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def create_gui_body
4242
@selected_options_label = label('None')
4343

4444
horizontal_box {
45-
checkboxes = 3.times.map do |n|
45+
3.times.map do |n|
4646
option_number = n + 1
4747
checkbox("Option #{option_number}") {
4848
on_toggled do

section-02-mvc-software-architecture/test-01/address_form_mvc.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def create_gui_body
6868

6969
@billing_and_shipping_checkbox = checkbox('Billing & Shipping') {
7070
on_toggled do
71-
@address.billing_and_shipping = @billing_and_shipping_checkbox.checked
71+
@address.billing_and_shipping = @billing_and_shipping_checkbox.checked?
7272
end
7373
}
7474

section-03-mvp-data-binding/exercise-03/option_selector_mvp_and_data_binding_with_computed_by.rb

-6
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ def create_gui_body
3939
}
4040
end
4141
}
42-
43-
button('Reset') {
44-
on_clicked do
45-
@option_selector_model.reset
46-
end
47-
}
4842
}
4943
}
5044
end

section-03-mvp-data-binding/exercise-05/form_table.rb

-10
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,6 @@ def launch
122122

123123
editable true
124124
cell_rows <=> [@presenter, :contacts] # explicit data-binding to @presenter.contacts Model Array, auto-inferring model attribute names from underscored table column names by convention
125-
126-
on_changed do |row, type, row_data|
127-
puts "Row #{row} #{type}: #{row_data}"
128-
$stdout.flush # for Windows
129-
end
130-
131-
on_edited do |row, row_data| # only fires on direct table editing
132-
puts "Row #{row} edited: #{row_data}"
133-
$stdout.flush # for Windows
134-
end
135125
}
136126
}
137127
}.show

section-03-mvp-data-binding/exercise-07/dynamic_address_forms.rb

-99
This file was deleted.

section-04-advanced-data-binding/exercise-17/option_selector_data_binding_converters_and_hooks.rb

-79
This file was deleted.

section-04-advanced-data-binding/exercise-18/option_selector_with_computed_data_binding.rb

-84
This file was deleted.

0 commit comments

Comments
 (0)