frmEventEditorPtr->Raise();
}
+
+bool frmMain::CloseAllWindows()
+{
+ // Attempt to close all windows.
+
+ if (WindowListPointersMenu.size() == 0)
+ {
+ return true;
+ }
+
+ if (wxMessageBox(_("Before preforming the action, all windows that are open will need to close. Do you wish to continue?"), _("Close All Windowss"), wxYES_NO) == wxYES)
+ {
+ for(std::map<int, void*>::iterator windowIter = WindowListPointers.begin();
+ windowIter != WindowListPointers.end(); windowIter++)
+ {
+ wxWindow *windowPointer = static_cast<wxWindow*>(windowIter->second);
+ windowPointer->Close();
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
\ No newline at end of file
void frmMain::ShowPreferencesWindow( wxCommandEvent& event )
{
+ // Close all windows first.
+
+ if (CloseAllWindows() == false)
+ {
+ return;
+ }
+
// Open the preferences window.
reloadAccounts = FALSE;
void frmMain::EditCalendar( wxCommandEvent& event )
{
+ // Close all windows first.
+
+ if (CloseAllWindows() == false)
+ {
+ return;
+ }
+
// Get the calendar data.
CDSGetCalendarInfo calendarInfo = calendarData.GetCalendar(event.GetInt());
void frmMain::DeleteCalendar( wxCommandEvent& event )
{
+ // Close all windows first.
+
+ if (CloseAllWindows() == false)
+ {
+ return;
+ }
+
CalendarProperties *calendarEventInfo = (CalendarProperties*)event.GetClientData();
// Get the calendar data.
void WindowUpdate( wxCommandEvent& event );
void WindowDelete( wxCommandEvent& event );
void ShowEventWindow( wxCommandEvent &event );
+ bool CloseAllWindows();
+
public:
/** Constructor */
frmMain( wxWindow* parent );