Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmMain: Manage windows from Window menu.
[xestiacalendar/.git] / source / forms / main / frmMain.cpp
index e1f2bd9..835118b 100644 (file)
@@ -1,3 +1,21 @@
+// frmMain.h - frmMain form functions
+//
+// (c) 2016-2017 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Calendar is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Calendar is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
+
 #include "frmMain.h"
 
 frmMain::frmMain( wxWindow* parent )
@@ -67,6 +85,10 @@ frmMainADT( parent )
        Connect(ID_UPDATEENTRY, XCMAIN_UPDATEEVENT, wxCommandEventHandler(frmMain::UpdateEvent));
        Connect(ID_EDITEVENT, XCMAIN_EDITEVENT, wxCommandEventHandler(frmMain::EditEvent));
        
+       Connect(ID_ADDWINDOW, XCMAIN_ADDWINDOWINFO, wxCommandEventHandler(frmMain::WindowAdd));
+       Connect(ID_UPDATEWINDOW, XCMAIN_UPDATEWINDOWINFO, wxCommandEventHandler(frmMain::WindowUpdate));
+       Connect(ID_DELETEWINDOW, XCMAIN_DELETEWINDOWINFO, wxCommandEventHandler(frmMain::WindowDelete));
+       
 }
 
 void frmMain::QuitApp( wxCloseEvent& event )
@@ -451,6 +473,21 @@ void frmMain::CreateNewEvent( wxCommandEvent& event ){
        
        frmEventEditor *frameNewEvent = new frmEventEditor ( this );
        frameNewEvent->SetupForm(&calendarData, preferences);
+       frameNewEvent->SetWindowMenuItemID(++WindowMenuItemID);
+       
+       // Add the window to the window list.
+       
+       WindowData *newWindowData = new WindowData;
+    
+       newWindowData->DataType = 1;
+       newWindowData->WindowPointer = (void*)frameNewEvent;
+       newWindowData->WindowID = WindowMenuItemID;
+       
+       wxCommandEvent addevent(XCMAIN_ADDWINDOWINFO);
+       addevent.SetId(ID_ADDWINDOW);
+       addevent.SetClientData(newWindowData);
+       wxPostEvent(this, addevent);
+       
        frameNewEvent->Show();
        
 }
@@ -460,7 +497,24 @@ void frmMain::EditEvent( wxCommandEvent& event ){
        frmEventEditor *frameEditEvent = new frmEventEditor ( this );
        frameEditEvent->SetEventID(event.GetInt());
        frameEditEvent->SetEditMode(true);
+       frameEditEvent->SetWindowMenuItemID(++WindowMenuItemID);
        frameEditEvent->SetupForm(&calendarData, preferences);
+       
+       // Add the window to the window list.
+       
+       WindowData *newWindowData = new WindowData;
+    
+       newWindowData->DataType = 1;
+       newWindowData->WindowPointer = (void*)frameEditEvent;
+       newWindowData->WindowID = WindowMenuItemID;
+       
+       wxCommandEvent addevent(XCMAIN_ADDWINDOWINFO);
+       addevent.SetId(ID_ADDWINDOW);
+       addevent.SetClientData(newWindowData);
+       wxPostEvent(this, addevent);
+
+       // Setup the form and display it.
+       
        frameEditEvent->Show();
        
 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy