A5 - Extending kijj classes
Run the update to download assignment 5, and read through the code in a5.js.
You'll notice three new classes defined:
BlueButton- This is an extension ofKButton, but with a custom style and an internal click handler.LabelledField- This uses subcomponents, which essentially makesLabelledFielda collection of three components: A text prompt, a line break, and an input box.MyLayout- This is an extension of a Layout, and defines the zones within the class's constructor.
Of these three classes, you'll probably notice the most useful one is LabelledField.
It is quite common to have a text prompt followed by an input component,
and so it makes sense to have a class capable of creating both of these together.
Your Task
- Add a class for another custom button of your choice, similar to
BlueButton - Add a
LabelledSelectionclass that is similar to theLabelledFieldclass, but uses a dropdown selection box rather than a text box. - Add one instance of your new button type to the layout, and at least two instances of
LabelledSelectionto your layout.
If you have extra time, feel free create and test some other classes you think might be useful.