Drawing with Buttons, ListBoxes, and ComboBoxes

Demo of Many Clickable Button Objects

You can click the panel to create various objects as specified by the ListBoxes and ComboBoxes on the left and right. Objects have from 1 to 4 vertices. When you change color options, they are implemented on the current shape and future shapes. However, if you change shape after giving the current figure any points, you will need to complete it before the new shape is implemented.

Note: when drawing multiple points objects, the sketch starts the drawing by using the points it currently has available. I.e. a line is drawn after the second point is clicked, and a triangle is drawn after the third point even if the final figure is a quadrilateral.

The sketch remembers the last 10 figures drawn.

Display sketch code: DrawingButtons.pde

Clickable Objects Used

ClassExample
(Traditional) ListBoxShapes ListBox.
(Traditional) ComboBoxPoint Color ComboBox.
(Non-traditional) ListBox Line Color ListBox (each item is a CircleButton and is arranged 2 items per line).
(Non-traditional) ComboBox Background Color ComboBox (opens to the right and each box has its own color).
ClickablePanel The panel in the center.
Button The Clear Button. Also explicitly created for Background color and implicitly created for the traditional ComboBox and ListBox.
Checkbox The Fill Shape Checkbox.
RadioButtonListBox The Fill Color radio buttons.
ButtonGroup Explicitly created for Background Color ComboBox and Line Color List Box. Implicitly created by the traditional ComboBox, traditional ListBox and RadioButtonListBox.
ClickableGroup All the Clickable items are in a ClickableGroup.
CircleButton Explicitly created for Line Color ListBox.
RadioButton Implicitly created for Fill Color RadioButtonListBox.

Return to the top of the page

Revised: 04/11/2014