/**
 * Override QWidget::close() to stop close Alert.
 * Instead, activate the abstract command that a close user action
 * is mapped to.
 *
 * @param alsoDelete request to delete the widget 
 * @return TRUE if the widget was closed, otherwise FALSE.
 */
bool Alert::close(bool alsoDelete) {

  /* Suppress unused-parameter warning */
    (void)alsoDelete;
    // Send an event to Java
    MidpCommandSelected(closeCommandId);
    return FALSE;
}
/**
 * Override QWidget::keyReleaseEvent() to grab the "cancel key"
 * event so we can tell MIDP to close the dialog box.
 *
 * @param key ptr to key event
 */
void Alert::keyReleaseEvent(QKeyEvent *key) {

  if (key->key() == Qt::Key_Escape) {
    MidpCommandSelected(closeCommandId);
  } else {
    QWidget::keyReleaseEvent(key);  
  }
}
/** Notify button is clicked */
void
CommandButton::buttonActivated() {
    // Send an event to Java
    MidpCommandSelected(id);
}
/**
 * Notify Java peer that a Menu item is selected.
 *
 * @param commandId Id of the selected abstract command
 */
void CommandManager::commandActivated(int commandId) {
    // Fire a Java abstract command event

    MidpCommandSelected(commandId);
}