void frmEventEditor::SaveNewContact(wxCommandEvent &event){
- SaveContact();
+ if (!SaveContact())
+ {
+ return;
+ }
// Reset the form for a new entry.
}
-void frmEventEditor::SaveContact(){
+bool frmEventEditor::SaveContact(){
// Verify that a calendar has been selected.
if (cmbCalendar->GetSelection() == -1 && editMode == false){
wxMessageBox("Please select a calendar for this entry.", "No calendar selected", wxOK);
- return;
+ return false;
}
if (txtEventName->GetValue().IsEmpty()){
wxMessageBox("The event name cannot be left empty.", "Event name is empty", wxOK);
- return;
+ return false;
}
}
+ return true;
+
}
void frmEventEditor::CloseWindow(wxCommandEvent &event)