Further expanded the concept of modes. The okButton and cancelButton can now also define the commands they will raise when clicked.