// Setup the top menu.
- ManipulatorCtrl = new XCCalendarManipulator(this, "XCCalendarManipulator Test", wxDefaultPosition, wxDefaultSize, calendarStorage);
+ manipulatorCtrl = new XCCalendarManipulator(this, "XCCalendarManipulator Test", wxDefaultPosition, wxDefaultSize, calendarStorage);
// Setup the month view grid.
- wxDateTime DTNow = wxDateTime::Now();
- int currentMonth = ((int)DTNow.GetMonth() + 1);
- int currentYear = DTNow.GetYear();
+ wxDateTime dtNow = wxDateTime::Now();
+ int currentMonth = ((int)dtNow.GetMonth() + 1);
+ int currentYear = dtNow.GetYear();
XCCalendarMonthViewGrid CurrentMonthGrid = GenerateMonthGrid(currentMonth, currentYear);
- szrMain->Add(ManipulatorCtrl, 1, wxEXPAND, 5);
+ szrMain->Add(manipulatorCtrl, 1, wxEXPAND, 5);
// Get the list of hidden accounts and calendars.
- vector<int> hideAccountsList = ManipulatorCtrl->GetHiddenAccountsList();
- vector<int> hideCalendarsList = ManipulatorCtrl->GetHiddenCalendarsList();
+ vector<int> hideAccountsList = manipulatorCtrl->GetHiddenAccountsList();
+ vector<int> hideCalendarsList = manipulatorCtrl->GetHiddenCalendarsList();
- MonthViewCtrl = new XCCalendarMonthView(this, "XCCalendarMonthView Test", wxDefaultPosition, wxDefaultSize, &CurrentMonthGrid, calendarStorage, &hideAccountsList, &hideCalendarsList);
- szrMain->Add(MonthViewCtrl, 1, wxEXPAND, 5);
+ monthViewCtrl = new XCCalendarMonthView(this, "XCCalendarMonthView Test", wxDefaultPosition, wxDefaultSize, &CurrentMonthGrid, calendarStorage, &hideAccountsList, &hideCalendarsList);
+ szrMain->Add(monthViewCtrl, 1, wxEXPAND, 5);
// Connect events to the control.
void XCCalendarCtrl::UpdateGrid(wxCommandEvent &event){
- XCCalendarMonthView *OldGrid = nullptr;
+ XCCalendarMonthView *oldGrid = nullptr;
// Park the old grid.
- OldGrid = MonthViewCtrl;
+ oldGrid = monthViewCtrl;
// Get the list of hidden accounts and calendars.
- vector<int> hideAccountsList = ManipulatorCtrl->GetHiddenAccountsList();
- vector<int> hideCalendarsList = ManipulatorCtrl->GetHiddenCalendarsList();
+ vector<int> hideAccountsList = manipulatorCtrl->GetHiddenAccountsList();
+ vector<int> hideCalendarsList = manipulatorCtrl->GetHiddenCalendarsList();
// Create a new grid.
- XCCalendarMonthViewGrid NewGrid = GenerateMonthGrid(ManipulatorCtrl->GetMonth(), ManipulatorCtrl->GetYear());
- MonthViewCtrl = new XCCalendarMonthView(this, _(""), wxDefaultPosition, wxDefaultSize, &NewGrid, calendarStorage, &hideAccountsList, &hideCalendarsList);
+ XCCalendarMonthViewGrid NewGrid = GenerateMonthGrid(manipulatorCtrl->GetMonth(), manipulatorCtrl->GetYear());
+ monthViewCtrl = new XCCalendarMonthView(this, _(""), wxDefaultPosition, wxDefaultSize, &NewGrid, calendarStorage, &hideAccountsList, &hideCalendarsList);
// Detach the old grid and attach the new one.
szrMain->Detach(1);
- OldGrid->Show(false);
- szrMain->Add(MonthViewCtrl, 1, wxEXPAND, 5);
+ oldGrid->Show(false);
+ szrMain->Add(monthViewCtrl, 1, wxEXPAND, 5);
szrMain->Layout();
// Delete the old grid.
- delete OldGrid;
- OldGrid = nullptr;
+ delete oldGrid;
+ oldGrid = nullptr;
}
wxCommandEvent event(XCCALENDARMONTH_HIDEACCOUNTENTRIES);
event.SetInt(accountData.GetInt());
event.SetId(ID_HIDEENTRIES);
- wxPostEvent(MonthViewCtrl, event);
+ wxPostEvent(monthViewCtrl, event);
}
wxCommandEvent event(XCCALENDARMONTH_SHOWACCOUNTENTRIES);
event.SetInt(accountData.GetInt());
event.SetId(ID_SHOWENTRIES);
- wxPostEvent(MonthViewCtrl, event);
+ wxPostEvent(monthViewCtrl, event);
}
wxCommandEvent event(XCCALENDARMONTH_HIDECALENDARENTRIES);
event.SetInt(calendarData.GetInt());
event.SetId(ID_HIDECALENDARENTRIES);
- wxPostEvent(MonthViewCtrl, event);
+ wxPostEvent(monthViewCtrl, event);
}
wxCommandEvent event(XCCALENDARMONTH_SHOWCALENDARENTRIES);
event.SetInt(calendarData.GetInt());
event.SetId(ID_SHOWCALENDARENTRIES);
- wxPostEvent(MonthViewCtrl, event);
+ wxPostEvent(monthViewCtrl, event);
}
wxCommandEvent event(XCCALENDARMONTH_DELETECALENDARENTRIES);
event.SetInt(calendarData.GetInt());
event.SetId(ID_DELETECALENDARENTRIES);
- wxPostEvent(MonthViewCtrl, event);
+ wxPostEvent(monthViewCtrl, event);
}
wxCommandEvent event(XCCALENDARMONTH_DELETEENTRY);
event.SetInt(eventData.GetInt());
event.SetId(ID_DELETEENTRY);
- wxPostEvent(MonthViewCtrl, event);
+ wxPostEvent(monthViewCtrl, event);
}
EventProperties *eventInfo = (EventProperties*)eventData.GetClientData();
- eventInfo->hideAccountsList = ManipulatorCtrl->GetHiddenAccountsList();
- eventInfo->hideCalendarsList = ManipulatorCtrl->GetHiddenCalendarsList();
+ eventInfo->hideAccountsList = manipulatorCtrl->GetHiddenAccountsList();
+ eventInfo->hideCalendarsList = manipulatorCtrl->GetHiddenCalendarsList();
wxCommandEvent addEvent(XCCALENDARMONTH_ADDENTRY);
addEvent.SetId(ID_ADDENTRY);
addEvent.SetClientData(eventInfo);
- wxPostEvent(MonthViewCtrl, addEvent);
+ wxPostEvent(monthViewCtrl, addEvent);
}
wxCommandEvent addEvent(XCCALENDARMONTH_UPDATEENTRY);
addEvent.SetId(ID_UPDATEENTRY);
addEvent.SetClientData(eventInfo);
- wxPostEvent(MonthViewCtrl, addEvent);
+ wxPostEvent(monthViewCtrl, addEvent);
}
wxCommandEvent colourEvent(XCCALENDARMONTH_UPDATECALENDARCOLOUR);
colourEvent.SetId(ID_UPDATECOLOUR);
colourEvent.SetClientData(colourInfo);
- wxPostEvent(MonthViewCtrl, colourEvent);
+ wxPostEvent(monthViewCtrl, colourEvent);
}
\ No newline at end of file
{
private:
- XCCalendarMonthView *MonthViewCtrl = nullptr;
- XCCalendarManipulator *ManipulatorCtrl = nullptr;
+ XCCalendarMonthView *monthViewCtrl = nullptr;
+ XCCalendarManipulator *manipulatorCtrl = nullptr;
wxFlexGridSizer *szrMain = nullptr;
CalendarDataStorage *calendarStorage = nullptr;
wxImage icons_priority_png(priorityicon, wxBITMAP_TYPE_PNG);
wxBitmap imgPriorityIcon(icons_priority_png, -1);
- AlertIcon->SetBitmap(imgAlertIcon);
- HighPriorityIcon->SetBitmap(imgPriorityIcon);
+ alertIcon->SetBitmap(imgAlertIcon);
+ highPriorityIcon->SetBitmap(imgPriorityIcon);
- WindowSizer->AddGrowableCol(0);
- WindowSizer->AddGrowableRow(1);
- WindowSizer->SetFlexibleDirection( wxBOTH );
- WindowSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+ windowSizer->AddGrowableCol(0);
+ windowSizer->AddGrowableRow(1);
+ windowSizer->SetFlexibleDirection( wxBOTH );
+ windowSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
- NumberText = new wxStaticText(this, wxID_ANY, wxT("09"), wxDefaultPosition, wxDefaultSize, 0);
- NumberText->SetFont(wxFont(24, 70, 90, 92, false, wxEmptyString));
+ numberText = new wxStaticText(this, wxID_ANY, wxT("09"), wxDefaultPosition, wxDefaultSize, 0);
+ numberText->SetFont(wxFont(24, 70, 90, 92, false, wxEmptyString));
- TopSectionSizer->Add(HighPriorityIcon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 0);
- TopSectionSizer->Add(AlertIcon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 0);
- TopSectionSizer->Add(0, 0, 1, wxEXPAND, 5);
- TopSectionSizer->Add(NumberText, 0, wxALL|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5);
+ topSectionSizer->Add(highPriorityIcon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 0);
+ topSectionSizer->Add(alertIcon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 0);
+ topSectionSizer->Add(0, 0, 1, wxEXPAND, 5);
+ topSectionSizer->Add(numberText, 0, wxALL|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5);
// Setup the scrollable section.
- Colour EventColour;
- EventColour.red = 40; EventColour.green = 80; EventColour.blue = 80;
+ Colour eventColour;
+ eventColour.red = 40; eventColour.green = 80; eventColour.blue = 80;
- EventListFrame->SetSizer(EventListFrameSizer);
+ eventListFrame->SetSizer(eventListFrameSizer);
- EventListFrame->SetScrollRate(0,1);
+ eventListFrame->SetScrollRate(0,1);
//EventListFrameSizer->FitInside(EventListFrame);
- EventListFrameSizer->Fit(EventListFrame);
- EventListFrameSizer->Layout();
- WindowSizer->Fit(this);
+ eventListFrameSizer->Fit(EventListFrame);
+ eventListFrameSizer->Layout();
+ windowSizer->Fit(this);
// Setup the scroll window.
- MainSectionSizer->Add(EventListFrame, 1, wxGROW | wxALL, 10);
+ mainSectionSizer->Add(eventListFrame, 1, wxGROW | wxALL, 10);
- WindowSizer->Add(TopSectionSizer, 1, wxEXPAND, 5);
- WindowSizer->Add(MainSectionSizer, 1, wxEXPAND, 5);
+ windowSizer->Add(topSectionSizer, 1, wxEXPAND, 5);
+ windowSizer->Add(mainSectionSizer, 1, wxEXPAND, 5);
- this->SetSizer(WindowSizer);
+ this->SetSizer(windowSizer);
this->SetSize(size);
this->Layout();
this->SetBackgroundStyle(wxBG_STYLE_PAINT);
// Destory the controls from the widget.
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- delete((*CalendarEntryIter));
+ delete((*calendarEntryIter));
}
- CalendarEntryList.clear();
+ calendarEntryList.clear();
this->Refresh();
void XCCalendarDay::Repaint(){
wxPaintDC dc(this);
- wxPaintDC EventListFrameDC(EventListFrame);
+ wxPaintDC eventListFrameDC(eventListFrame);
// Get the wxSizerItem for the top date and the entries part.
- wxSizerItem *TopSectionSizerItem = WindowSizer->GetItem((size_t)0);
- wxSizerItem *MainSectionSizerItem = WindowSizer->GetItem((size_t)1);
- wxRect TopSizer = wxRect(WindowSizer->GetPosition(), WindowSizer->GetSize());
+ wxSizerItem *topSectionSizerItem = windowSizer->GetItem((size_t)0);
+ wxSizerItem *mainSectionSizerItem = windowSizer->GetItem((size_t)1);
+ wxRect topSizer = wxRect(windowSizer->GetPosition(), windowSizer->GetSize());
- if (IsInMonth == true){
+ if (isInMonth == true){
dc.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
dc.SetBrush(wxBrush(wxColor(255,255,255)));
- dc.DrawRectangle(TopSectionSizerItem->GetRect());
+ dc.DrawRectangle(topSectionSizerItem->GetRect());
dc.SetBrush(wxBrush(wxColor(225,225,225)));
- dc.DrawRectangle(MainSectionSizerItem->GetRect());
- EventListFrameDC.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
- EventListFrameDC.SetBrush(wxBrush(wxColor(225,225,225)));
- EventListFrameDC.DrawRectangle(EventListFrame->GetClientRect());
+ dc.DrawRectangle(mainSectionSizerItem->GetRect());
+ eventListFrameDC.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
+ eventListFrameDC.SetBrush(wxBrush(wxColor(225,225,225)));
+ eventListFrameDC.DrawRectangle(eventListFrame->GetClientRect());
} else {
dc.SetPen(wxPen(wxColor(185,185,185), 0, wxPENSTYLE_TRANSPARENT));
dc.SetBrush(wxBrush(wxColor(185,185,185)));
- dc.DrawRectangle(TopSectionSizerItem->GetRect());
+ dc.DrawRectangle(topSectionSizerItem->GetRect());
dc.SetBrush(wxBrush(wxColor(155,155,155)));
- dc.DrawRectangle(MainSectionSizerItem->GetRect());
- EventListFrameDC.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
- EventListFrameDC.SetBrush(wxBrush(wxColor(155,155,155)));
- EventListFrameDC.DrawRectangle(EventListFrame->GetClientRect());
+ dc.DrawRectangle(mainSectionSizerItem->GetRect());
+ eventListFrameDC.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
+ eventListFrameDC.SetBrush(wxBrush(wxColor(155,155,155)));
+ eventListFrameDC.DrawRectangle(eventListFrame->GetClientRect());
}
void XCCalendarDay::UpdateTopIcons(){
- bool AlarmFound = false;
- bool HighPriorityFound = false;
+ bool alarmFound = false;
+ bool highPriorityFound = false;
- for (vector<XCCalendarDayEntry*>::iterator EntryIter = CalendarEntryList.begin();
- EntryIter != CalendarEntryList.end(); EntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator entryIter = calendarEntryList.begin();
+ entryIter != calendarEntryList.end(); entryIter++){
- if ((*EntryIter)->GetDisplayAlarm() == true){
+ if ((*entryIter)->GetDisplayAlarm() == true){
- AlarmFound = true;
+ alarmFound = true;
}
- if ((*EntryIter)->GetDisplayHighPriority() == true){
+ if ((*entryIter)->GetDisplayHighPriority() == true){
- HighPriorityFound = true;
+ highPriorityFound = true;
}
- if (AlarmFound == true && HighPriorityFound == true){
+ if (alarmFound == true && highPriorityFound == true){
break;
}
- AlertIcon->Show(AlarmFound);
- HighPriorityIcon->Show(HighPriorityFound);
+ alertIcon->Show(alarmFound);
+ highPriorityIcon->Show(highPriorityFound);
}
-void XCCalendarDay::PaintFrameEvent(wxPaintEvent &PaintEvent)
+void XCCalendarDay::PaintFrameEvent(wxPaintEvent &paintEvent)
{
Repaint();
}
-void XCCalendarDay::ResizeFrameEvent(wxSizeEvent &SizeEvent)
+void XCCalendarDay::ResizeFrameEvent(wxSizeEvent &sizeEvent)
{
// TODO: Check if window size is less than 120 pixels and if it is,
}
-void XCCalendarDay::DeselectOthersEvent(wxCommandEvent &DeselectEvent)
+void XCCalendarDay::DeselectOthersEvent(wxCommandEvent &deselectEvent)
{
- int SelectedEntryID = DeselectEvent.GetInt();
+ int selectedEntryID = deselectEvent.GetInt();
- wxCommandEvent DeselectEntryEvent(XCCALENDARDAYENTRY_DESELECT);
- DeselectEntryEvent.SetId(ID_ENTRYDESELECT);
+ wxCommandEvent deselectEntryEvent(XCCALENDARDAYENTRY_DESELECT);
+ deselectEntryEvent.SetId(ID_ENTRYDESELECT);
- for (vector<XCCalendarDayEntry*>::iterator EntryIter = CalendarEntryList.begin();
- EntryIter != CalendarEntryList.end(); EntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator entryIter = calendarEntryList.begin();
+ entryIter != calendarEntryList.end(); entryIter++){
- if ((*EntryIter)->GetID() != SelectedEntryID){
+ if ((*entryIter)->GetID() != selectedEntryID){
- wxPostEvent((*EntryIter), DeselectEntryEvent);
+ wxPostEvent((*entryIter), deselectEntryEvent);
}
// Send event notification to deselect the other calendar entries.
- if (this->MonthViewPointer != nullptr){
+ if (this->monthViewPointer != nullptr){
- wxCommandEvent DeselectEvent(XCCALENDARMONTH_DESELECTOTHERENTRIES);
- DeselectEvent.SetClientData(this);
- DeselectEvent.SetId(ID_MONTHVIEWCLEARSELECTION);
- wxPostEvent(this->MonthViewPointer, DeselectEvent);
+ wxCommandEvent deselectEvent(XCCALENDARMONTH_DESELECTOTHERENTRIES);
+ deselectEvent.SetClientData(this);
+ deselectEvent.SetId(ID_MONTHVIEWCLEARSELECTION);
+ wxPostEvent(this->monthViewPointer, deselectEvent);
}
void XCCalendarDay::DeselectAllEvent(wxCommandEvent &DeselectEvent)
{
- int SelectedEntryID = DeselectEvent.GetInt();
+ int selectedEntryID = deselectEvent.GetInt();
- wxCommandEvent DeselectEntryEvent(XCCALENDARDAYENTRY_DESELECT);
- DeselectEntryEvent.SetId(ID_ENTRYDESELECT);
+ wxCommandEvent deselectEntryEvent(XCCALENDARDAYENTRY_DESELECT);
+ deselectEntryEvent.SetId(ID_ENTRYDESELECT);
- for (vector<XCCalendarDayEntry*>::iterator EntryIter = CalendarEntryList.begin();
- EntryIter != CalendarEntryList.end(); EntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator entryIter = calendarEntryList.begin();
+ entryIter != calendarEntryList.end(); EntryIter++){
- wxPostEvent((*EntryIter), DeselectEntryEvent);
+ wxPostEvent((*entryIter), deselectEntryEvent);
}
}
-void XCCalendarDay::SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage, vector<int> *hideAccounts, vector<int> *hideCalendars)
+void XCCalendarDay::SetupControl(int setupDay, int setupMonth, int setupYear, bool setupIsInMonth, XCCalendarMonthView *monthViewPointer, CalendarDataStorage *dataStorage, vector<int> *hideAccounts, vector<int> *hideCalendars)
{
this->dataStorage = dataStorage;
// Set the day
- NumberText->SetLabel(wxString::Format("%02i", SetupDay));
- calendarDay = SetupDay;
+ numberText->SetLabel(wxString::Format("%02i", setupDay));
+ calendarDay = setupDay;
// Set the month
- calendarMonth = SetupMonth;
+ calendarMonth = setupMonth;
// Set the year.
- calendarYear = SetupYear;
+ calendarYear = setupYear;
// Setup the Is In Month value.
- IsInMonth = SetupIsInMonth;
+ isInMonth = setupIsInMonth;
// Setup the month view pointer.
- this->MonthViewPointer = MonthViewPointer;
+ this->monthViewPointer = monthViewPointer;
// Setup the calendar items.
- CDSEntryList calendarItems = dataStorage->GetEventListByDate(SetupYear, SetupMonth, SetupDay);
+ CDSEntryList calendarItems = dataStorage->GetEventListByDate(setupYear, setupMonth, setupDay);
for (int entrySeek = 0; entrySeek < calendarItems.entryList.size(); entrySeek++){
// Setup the calendar entry.
- XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(EventListFrame, newEntryInfo.entryName, wxDefaultPosition, wxDefaultSize, calendarItems.entryList[entrySeek]);
+ XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(eventListFrame, newEntryInfo.entryName, wxDefaultPosition, wxDefaultSize, calendarItems.entryList[entrySeek]);
newEntry->SetColour(&newEntryCalendarInfo.calendarColour);
newEntry->SetTime(newEntryInfo.entryStartHour, newEntryInfo.entryStartMinute, newEntryInfo.entryStartSecond);
newEntry->SetEntryIDs(newEntryCalendarInfo.accountID, newEntryInfo.calendarID, newEntryInfo.calendarEntryID);
- EventListFrameSizer->Add(newEntry, 0, wxEXPAND, 5);
- wxSizerItem *afterSpacer = EventListFrameSizer->Add(0, 5, 0, 0, 5);
+ eventListFrameSizer->Add(newEntry, 0, wxEXPAND, 5);
+ wxSizerItem *afterSpacer = eventListFrameSizer->Add(0, 5, 0, 0, 5);
newEntry->SetAfterSpacer(afterSpacer);
}
- CalendarEntryList.push_back(newEntry);
+ calendarEntryList.push_back(newEntry);
}
}
int sizerPosition = 0;
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- (*CalendarEntryIter)->SetShowAccountStatus(false);
+ (*calendarEntryIter)->SetShowAccountStatus(false);
- if ((*CalendarEntryIter)->GetAccountID() == accountData.GetInt()){
+ if ((*calendarEntryIter)->GetAccountID() == accountData.GetInt()){
- wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
- (*CalendarEntryIter)->Show(false);
+ wxSizerItem *calendarItem = eventListFrameSizer->GetItem((*calendarEntryIter));
+ (*calendarEntryIter)->Show(false);
// Get the spacing and hide it as well.
- wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
afterSpacer->Show(false);
}
int sizerPosition = 0;
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- (*CalendarEntryIter)->SetShowAccountStatus(true);
+ (*calendarEntryIter)->SetShowAccountStatus(true);
- if ((*CalendarEntryIter)->GetShowCalendarStatus() == false){
+ if ((*calendarEntryIter)->GetShowCalendarStatus() == false){
continue;
}
- if ((*CalendarEntryIter)->GetAccountID() == accountData.GetInt()){
+ if ((*calendarEntryIter)->GetAccountID() == accountData.GetInt()){
- wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
- (*CalendarEntryIter)->Show(true);
+ wxSizerItem *calendarItem = eventListFrameSizer->GetItem((*calendarEntryIter));
+ (*calendarEntryIter)->Show(true);
// Get the spacing and hide it as well.
- wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
afterSpacer->Show(true);
}
-
+
}
this->Refresh();
int sizerPosition = 0;
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- if ((*CalendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
+ if ((*calendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
- (*CalendarEntryIter)->SetShowCalendarStatus(false);
+ (*calendarEntryIter)->SetShowCalendarStatus(false);
- wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
- (*CalendarEntryIter)->Show(false);
+ wxSizerItem *calendarItem = eventListFrameSizer->GetItem((*calendarEntryIter));
+ (*calendarEntryIter)->Show(false);
// Get the spacing and hide it as well.
- wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
afterSpacer->Show(false);
}
int sizerPosition = 0;
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- if ((*CalendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
+ if ((*calendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
- (*CalendarEntryIter)->SetShowCalendarStatus(true);
+ (*calendarEntryIter)->SetShowCalendarStatus(true);
- if ((*CalendarEntryIter)->GetShowAccountStatus() == false){
+ if ((*calendarEntryIter)->GetShowAccountStatus() == false){
// Don't show the calendar entry because the account status
// is set to hidden. Continue to the next one.
}
- wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
- (*CalendarEntryIter)->Show(true);
+ wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*calendarEntryIter));
+ (*calendarEntryIter)->Show(true);
// Get the spacing and hide it as well.
- wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
afterSpacer->Show(true);
}
void XCCalendarDay::DeleteCalendarEntries(wxCommandEvent &calendarData){
- vector<vector<XCCalendarDayEntry*>::iterator> DeleteEntriesList;
+ vector<vector<XCCalendarDayEntry*>::iterator> deleteEntriesList;
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- if ((*CalendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
+ if ((*calendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
- wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
- (*CalendarEntryIter)->Show(false);
+ wxSizerItem *calendarItem = eventListFrameSizer->GetItem((*calendarEntryIter));
+ (*calendarEntryIter)->Show(false);
// Get the spacing and hide it as well.
- wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
afterSpacer->Show(false);
afterSpacer->DetachSizer();
delete afterSpacer;
afterSpacer = nullptr;
- delete (*CalendarEntryIter);
- DeleteEntriesList.push_back(CalendarEntryIter);
+ delete (*calendarEntryIter);
+ deleteEntriesList.push_back(calendarEntryIter);
}
this->Refresh();
Repaint();
- for (auto DeleteIter : DeleteEntriesList){
- CalendarEntryList.erase(DeleteIter);
+ for (auto deleteIter : deleteEntriesList){
+ calendarEntryList.erase(deleteIter);
}
}
void XCCalendarDay::DeleteCalendarEntry(wxCommandEvent &eventData){
- vector<vector<XCCalendarDayEntry*>::iterator> DeleteEntriesList;
+ vector<vector<XCCalendarDayEntry*>::iterator> deleteEntriesList;
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- if ((*CalendarEntryIter)->GetEventID() == eventData.GetInt()){
+ if ((*calendarEntryIter)->GetEventID() == eventData.GetInt()){
- wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
- (*CalendarEntryIter)->Show(false);
+ wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*calendarEntryIter));
+ (*calendarEntryIter)->Show(false);
// Get the spacing and hide it as well.
- wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
afterSpacer->Show(false);
afterSpacer->DetachSizer();
delete afterSpacer;
afterSpacer = nullptr;
- delete (*CalendarEntryIter);
- DeleteEntriesList.push_back(CalendarEntryIter);
+ delete (*calendarEntryIter);
+ deleteEntriesList.push_back(calendarEntryIter);
}
}
- for (auto DeleteIter : DeleteEntriesList){
- CalendarEntryList.erase(DeleteIter);
+ for (auto deleteIter : deleteEntriesList){
+ calendarEntryList.erase(deleteIter);
}
this->Refresh();
EventProperties *eventInfo = (EventProperties*)eventData.GetClientData();
- XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(EventListFrame, eventInfo->eventName, wxDefaultPosition, wxDefaultSize, eventInfo->eventID);
+ XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(eventListFrame, eventInfo->eventName, wxDefaultPosition, wxDefaultSize, eventInfo->eventID);
CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar(eventInfo->calendarID);
newEntry->SetTime(eventInfo->eventHour, eventInfo->eventMinute, eventInfo->eventSecond);
newEntry->SetEntryIDs(calendarInfo.accountID, eventInfo->calendarID, eventInfo->eventID);
- EventListFrameSizer->Add(newEntry, 0, wxEXPAND, 5);
- wxSizerItem *afterSpacer = EventListFrameSizer->Add(0, 5, 0, 0, 5);
+ eventListFrameSizer->Add(newEntry, 0, wxEXPAND, 5);
+ wxSizerItem *afterSpacer = eventListFrameSizer->Add(0, 5, 0, 0, 5);
newEntry->SetAfterSpacer(afterSpacer);
}
- CalendarEntryList.push_back(newEntry);
+ calendarEntryList.push_back(newEntry);
this->Refresh();
Repaint();
EventProperties *eventInfo = (EventProperties*)eventData.GetClientData();
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- if ((*CalendarEntryIter)->GetEventID() == eventInfo->eventID){
+ if ((*calendarEntryIter)->GetEventID() == eventInfo->eventID){
- (*CalendarEntryIter)->SetEventName(eventInfo->eventName);
- (*CalendarEntryIter)->SetTime(eventInfo->eventHour, eventInfo->eventMinute, eventInfo->eventSecond);
+ (*calendarEntryIter)->SetEventName(eventInfo->eventName);
+ (*calendarEntryIter)->SetTime(eventInfo->eventHour, eventInfo->eventMinute, eventInfo->eventSecond);
}
ColourUpdateProperties *colourInfo = (ColourUpdateProperties*)colourData.GetClientData();
- for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
- CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+ for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
+ calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
- if ((*CalendarEntryIter)->GetCalendarID() == colourInfo->calendarID){
+ if ((*calendarEntryIter)->GetCalendarID() == colourInfo->calendarID){
- (*CalendarEntryIter)->SetColour(&colourInfo->newColour);
+ (*calendarEntryIter)->SetColour(&colourInfo->newColour);
}
class XCCalendarDay: public wxPanel
{
private:
- XCCalendarMonthView *MonthViewPointer = nullptr;
- wxFlexGridSizer *WindowSizer = new wxFlexGridSizer(2, 1, 0, 0);
- wxBoxSizer *TopSectionSizer = new wxBoxSizer(wxHORIZONTAL);
- wxBoxSizer *MainSectionSizer = new wxBoxSizer(wxVERTICAL);
- wxBoxSizer *EventListFrameSizer = new wxBoxSizer(wxVERTICAL);
- wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
- wxStaticBitmap *AlertIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
+ XCCalendarMonthView *monthViewPointer = nullptr;
+ wxFlexGridSizer *windowSizer = new wxFlexGridSizer(2, 1, 0, 0);
+ wxBoxSizer *topSectionSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *mainSectionSizer = new wxBoxSizer(wxVERTICAL);
+ wxBoxSizer *eventListFrameSizer = new wxBoxSizer(wxVERTICAL);
+ wxStaticBitmap *highPriorityIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
+ wxStaticBitmap *alertIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
CalendarDataStorage *dataStorage = nullptr;
- wxBitmap AlertIconBitmap;
- wxBitmap PriorityIconBitmap;
- wxStaticText *NumberText = nullptr;
- wxScrolledWindow *EventListFrame = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
- int CalendarEntrySeekNumber = 0;
+ wxBitmap alertIconBitmap;
+ wxBitmap priorityIconBitmap;
+ wxStaticText *numberText = nullptr;
+ wxScrolledWindow *eventListFrame = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
+ int calendarEntrySeekNumber = 0;
int calendarDay = 0;
int calendarMonth = 0;
int calendarYear = 0;
- bool IsInMonth = false;
+ bool isInMonth = false;
- vector<XCCalendarDayEntry*> CalendarEntryList;
+ vector<XCCalendarDayEntry*> calendarEntryList;
void Repaint();
public:
XCCalendarDay(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size);
~XCCalendarDay();
- void PaintFrameEvent(wxPaintEvent &PaintEvent);
- void ResizeFrameEvent(wxSizeEvent &SizeEvent);
- void DeselectOthersEvent(wxCommandEvent &DeselectEvent);
- void DeselectAllEvent(wxCommandEvent &DeselectEvent);
+ void PaintFrameEvent(wxPaintEvent &paintEvent);
+ void ResizeFrameEvent(wxSizeEvent &sizeEvent);
+ void DeselectOthersEvent(wxCommandEvent &deselectEvent);
+ void DeselectAllEvent(wxCommandEvent &deselectEvent);
void UpdateTopIcons();
- void SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
+ void SetupControl(int setupDay, int setupMonth, int setupYear, bool setupIsInMonth, XCCalendarMonthView *monthViewPointer, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
int GetCalendarDay();
int GetCalendarMonth();
int GetCalendarYear();
XCCalendarDayEntry::XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id)
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){
- DayPanel = parent->GetParent();
+ dayPanel = parent->GetParent();
eventID = id;
this->SetMinSize(wxSize(65, 30));
- EventTextData = title.mb_str();
- EventText = new wxStaticText(this, wxID_ANY, title, wxPoint(49, 14), wxDefaultSize, wxST_ELLIPSIZE_END);
- EventTime = new wxStaticText(this, wxID_ANY, wxT("Time"), wxPoint(49,3), wxDefaultSize, 0);
+ eventTextData = title.mb_str();
+ eventText = new wxStaticText(this, wxID_ANY, title, wxPoint(49, 14), wxDefaultSize, wxST_ELLIPSIZE_END);
+ eventTime = new wxStaticText(this, wxID_ANY, wxT("Time"), wxPoint(49,3), wxDefaultSize, 0);
- wxFont eventTimeFont = EventTime->GetFont();
+ wxFont eventTimeFont = eventTime->GetFont();
eventTimeFont.MakeBold();
- EventTime->SetFont(eventTimeFont);
+ eventTime->SetFont(eventTimeFont);
wxMemoryInputStream alerticon(icons_alert_png, sizeof(icons_alert_png));
wxMemoryInputStream priorityicon(icons_priority_png, sizeof(icons_priority_png));
wxImage icons_alert_png(alerticon, wxBITMAP_TYPE_PNG);
- AlarmIconBitmap = wxBitmap(icons_alert_png, -1);
+ alarmIconBitmap = wxBitmap(icons_alert_png, -1);
wxImage icons_priority_png(priorityicon, wxBITMAP_TYPE_PNG);
- PriorityIconBitmap = wxBitmap(icons_priority_png, -1);
+ priorityIconBitmap = wxBitmap(icons_priority_png, -1);
- AlarmIcon->SetBitmap(AlarmIconBitmap);
- HighPriorityIcon->SetBitmap(PriorityIconBitmap);
+ alarmIcon->SetBitmap(alarmIconBitmap);
+ highPriorityIcon->SetBitmap(priorityIconBitmap);
Connect(ID_ENTRYDESELECT, XCCALENDARDAYENTRY_DESELECT, wxCommandEventHandler(XCCalendarDayEntry::Deselect));
- AlarmIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- HighPriorityIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- EventText->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- EventTime->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- DayPanel->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ alarmIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ highPriorityIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ eventText->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ eventTime->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ dayPanel->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- AlarmIcon->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
- HighPriorityIcon->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
- EventText->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
- EventTime->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
- DayPanel->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ alarmIcon->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ highPriorityIcon->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ eventText->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ eventTime->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ dayPanel->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
UpdateInformation();
// Draw the calendar colour.
dc.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
- dc.SetBrush(wxBrush(wxColor(EntryColour.red,
- EntryColour.green,
- EntryColour.blue), wxBRUSHSTYLE_SOLID));
+ dc.SetBrush(wxBrush(wxColor(entryColour.red,
+ entryColour.green,
+ entryColour.blue), wxBRUSHSTYLE_SOLID));
dc.DrawRectangle(wxRect(1,1,10,28));
}
void XCCalendarDayEntry::UpdateInformation(){
- PositionMode = 0;
+ positionMode = 0;
// Check if the high priority icon needs to be displayed.
- if (HasHighPriority == true){
+ if (hasHighPriority == true){
- HighPriorityIcon->SetPosition(wxPoint(FirstPosition,7));
+ highPriorityIcon->SetPosition(wxPoint(firstPosition,7));
- HighPriorityIcon->Show(true);
+ highPriorityIcon->Show(true);
- PositionMode++;
+ positionMode++;
} else {
- HighPriorityIcon->Show(false);
+ highPriorityIcon->Show(false);
}
// Check if the alarm icon needs to be displayed.
- if (HasAlarm == true){
+ if (hasAlarm == true){
- switch(PositionMode){
+ switch(positionMode){
case 0:
- AlarmIcon->SetPosition(wxPoint(FirstPosition,7));
+ alarmIcon->SetPosition(wxPoint(firstPosition,7));
break;
case 1:
- AlarmIcon->SetPosition(wxPoint(SecondPosition,7));
+ alarmIcon->SetPosition(wxPoint(secondPosition,7));
break;
}
- AlarmIcon->Show(true);
+ alarmIcon->Show(true);
- PositionMode++;
+ positionMode++;
} else {
- AlarmIcon->Show(false);
+ alarmIcon->Show(false);
}
// Now set the text.
- switch(PositionMode){
+ switch(positionMode){
case 0:
- EventText->SetPosition(wxPoint(FirstPosition,14));
- EventTime->SetPosition(wxPoint(FirstPosition,3));
+ eventText->SetPosition(wxPoint(firstPosition,14));
+ eventTime->SetPosition(wxPoint(firstPosition,3));
break;
case 1:
- EventText->SetPosition(wxPoint(SecondPosition,14));
- EventTime->SetPosition(wxPoint(FirstPosition,3));
+ eventText->SetPosition(wxPoint(secondPosition,14));
+ eventTime->SetPosition(wxPoint(firstPosition,3));
break;
case 2:
- EventText->SetPosition(wxPoint(ThirdPosition,14));
- EventTime->SetPosition(wxPoint(FirstPosition,3));
+ eventText->SetPosition(wxPoint(thirdPosition,14));
+ eventTime->SetPosition(wxPoint(firstPosition,3));
break;
}
}
-void XCCalendarDayEntry::PaintFrameEvent(wxPaintEvent &PaintEvent){
+void XCCalendarDayEntry::PaintFrameEvent(wxPaintEvent &paintEvent){
Repaint();
}
-void XCCalendarDayEntry::ResizeFrameEvent(wxSizeEvent &SizeEvent){
+void XCCalendarDayEntry::ResizeFrameEvent(wxSizeEvent &sizeEvent){
// Adjust the Event text so it is displayed properly.
- switch(PositionMode){
+ switch(positionMode){
case 0:
- EventText->SetSize(wxSize((this->GetClientRect().width - FirstPosition - 5),15));
- EventTime->SetSize(wxSize((this->GetClientRect().width - FirstPosition - 5),15));
+ eventText->SetSize(wxSize((this->GetClientRect().width - firstPosition - 5),15));
+ eventTime->SetSize(wxSize((this->GetClientRect().width - firstPosition - 5),15));
break;
case 1:
- EventText->SetSize(wxSize((this->GetClientRect().width - SecondPosition - 5),15));
- EventTime->SetSize(wxSize((this->GetClientRect().width - SecondPosition - 5),15));
+ eventText->SetSize(wxSize((this->GetClientRect().width - secondPosition - 5),15));
+ eventTime->SetSize(wxSize((this->GetClientRect().width - secondPosition - 5),15));
break;
case 2:
- EventText->SetSize(wxSize((this->GetClientRect().width - ThirdPosition - 5),14));
- EventTime->SetSize(wxSize((this->GetClientRect().width - ThirdPosition - 5),15));
+ eventText->SetSize(wxSize((this->GetClientRect().width - thirdPosition - 5),14));
+ eventTime->SetSize(wxSize((this->GetClientRect().width - thirdPosition - 5),15));
break;
}
}
-void XCCalendarDayEntry::LeftClick(wxMouseEvent &MouseEvent){
+void XCCalendarDayEntry::LeftClick(wxMouseEvent &mouseEvent){
// Change the background of the widget to mark
// the entry as selected.
this->SetBackgroundColour(wxColor(255,215,0));
- wxCommandEvent DeselectOthersEvent(XCCALENDARDAY_DESELECTOTHERENTRIES);
- DeselectOthersEvent.SetInt(eventID);
- DeselectOthersEvent.SetId(ID_DESELECTOTHERENTRIES);
- wxPostEvent(DayPanel, DeselectOthersEvent);
+ wxCommandEvent deselectOthersEvent(XCCALENDARDAY_DESELECTOTHERENTRIES);
+ deselectOthersEvent.SetInt(eventID);
+ deselectOthersEvent.SetId(ID_DESELECTOTHERENTRIES);
+ wxPostEvent(dayPanel, deselectOthersEvent);
}
this->timeSecond = timeSecond;
string timeOutput = BuildEventTime(timeHour, timeMinute);
- EventTime->SetLabel(timeOutput);
+ eventTime->SetLabel(timeOutput);
}
void XCCalendarDayEntry::SetColour(Colour *ColourIn){
- EntryColour = *ColourIn;
+ entryColour = *colourIn;
Repaint();
}
void XCCalendarDayEntry::SetDisplayAlarm(bool DisplayValue){
- HasAlarm = DisplayValue;
+ hasAlarm = displayValue;
UpdateInformation();
}
void XCCalendarDayEntry::SetDisplayHighPriority(bool DisplayValue){
- HasHighPriority = DisplayValue;
+ hasHighPriority = displayValue;
UpdateInformation();
}
bool XCCalendarDayEntry::GetDisplayAlarm(){
- return HasAlarm;
+ return hasAlarm;
}
bool XCCalendarDayEntry::GetDisplayHighPriority(){
- return HasHighPriority;
+ return hasHighPriority;
}
void XCCalendarDayEntry::SetEventName(string eventName){
- EventText->SetLabel((wxString)eventName);
+ eventText->SetLabel((wxString)eventName);
}
{
private:
- wxWindow *DayPanel = nullptr;
- string EventTextData = "";
- wxStaticText *EventTime = nullptr;
- wxStaticText *EventText = nullptr;
- wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
- wxStaticBitmap *AlarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
+ wxWindow *dayPanel = nullptr;
+ string eventTextData = "";
+ wxStaticText *eventTime = nullptr;
+ wxStaticText *eventText = nullptr;
+ wxStaticBitmap *highPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
+ wxStaticBitmap *alarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
wxSizerItem *afterSpacer = nullptr;
- wxBitmap AlarmIconBitmap;
- wxBitmap PriorityIconBitmap;
+ wxBitmap alarmIconBitmap;
+ wxBitmap priorityIconBitmap;
- Colour EntryColour;
+ Colour entryColour;
int timeHour = 0;
int timeMinute = 0;
int timeSecond = 0;
- bool HasAlarm = false;
- bool HasHighPriority = false;
- int PositionMode = 0;
+ bool hasAlarm = false;
+ bool hasHighPriority = false;
+ int positionMode = 0;
int eventID = 0;
int accountID = 0;
bool showAccount = true;
bool showCalendar = true;
- const int FirstPosition = 14;
- const int SecondPosition = 30;
- const int ThirdPosition = 49;
+ const int firstPosition = 14;
+ const int secondPosition = 30;
+ const int thirdPosition = 49;
void Repaint();
void RepaintSelected();
XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
~XCCalendarDayEntry();
- void PaintFrameEvent(wxPaintEvent &PaintEvent);
- void ResizeFrameEvent(wxSizeEvent &SizeEvent);
- void Deselect(wxCommandEvent &DeselectEvent);
+ void PaintFrameEvent(wxPaintEvent &paintEvent);
+ void ResizeFrameEvent(wxSizeEvent &sizeEvent);
+ void Deselect(wxCommandEvent &deselectEvent);
void SetTime(int timeHour, int timeMinute, int timeSecond);
- void SetColour(Colour *ColourIn);
- void SetDisplayAlarm(bool DisplayValue);
- void SetDisplayHighPriority(bool DisplayValue);
+ void SetColour(Colour *colourIn);
+ void SetDisplayAlarm(bool displayValue);
+ void SetDisplayHighPriority(bool displayValue);
void SetEntryIDs(int accountID, int calendarID, int eventID);
void SetAfterSpacer(wxSizerItem *afterSpacer);
void SetEventName(std::string eventName);
szrMain = new wxBoxSizer( wxVERTICAL );
this->SetSizer(szrMain);
- this->SetSize(wxSize(350, 500));
-
- //scwMain = new wxScrolledWindow();
-
- //szrScrolled = new wxBoxSizer( wxHORIZONTAL );
- //scwMain->SetSizer(szrScrolled);
-
- //szrMain->Add(scwMain, 0, wxEXPAND, 5);
- //szrMain->Layout();
-
+ this->SetSize(wxSize(350, 500));
}
// Add next month and previous month buttons.
- PreviousButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(32,32), 0|wxNO_BORDER);
- NextButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(32,32), 0|wxNO_BORDER);
- CalendarsButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(32,32), 0|wxNO_BORDER);
+ previousButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(32,32), 0|wxNO_BORDER);
+ nextButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(32,32), 0|wxNO_BORDER);
+ calendarsButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(32,32), 0|wxNO_BORDER);
- wxMemoryInputStream PreviousIcon(icons_previous_png, sizeof(icons_previous_png));
- wxMemoryInputStream NextIcon(icons_next_png, sizeof(icons_next_png));
- wxMemoryInputStream CalendarsIcon(icons_calendars_png, sizeof(icons_calendars_png));
+ wxMemoryInputStream previousIcon(icons_previous_png, sizeof(icons_previous_png));
+ wxMemoryInputStream nextIcon(icons_next_png, sizeof(icons_next_png));
+ wxMemoryInputStream calendarsIcon(icons_calendars_png, sizeof(icons_calendars_png));
- wxImage icons_previous_png(PreviousIcon, wxBITMAP_TYPE_PNG);
- PreviousIconBitmap = wxBitmap(icons_previous_png, -1);
+ wxImage icons_previous_png(previousIcon, wxBITMAP_TYPE_PNG);
+ previousIconBitmap = wxBitmap(icons_previous_png, -1);
- wxImage icons_next_png(NextIcon, wxBITMAP_TYPE_PNG);
- NextIconBitmap = wxBitmap(icons_next_png, -1);
+ wxImage icons_next_png(nextIcon, wxBITMAP_TYPE_PNG);
+ nextIconBitmap = wxBitmap(icons_next_png, -1);
- wxImage icons_calendars_png(CalendarsIcon, wxBITMAP_TYPE_PNG);
- CalendarsIconBitmap = wxBitmap(icons_calendars_png, -1);
+ wxImage icons_calendars_png(calendarsIcon, wxBITMAP_TYPE_PNG);
+ calendarsIconBitmap = wxBitmap(icons_calendars_png, -1);
- PreviousButton->SetBitmap(PreviousIconBitmap);
- NextButton->SetBitmap(NextIconBitmap);
- CalendarsButton->SetBitmap(CalendarsIconBitmap);
+ previousButton->SetBitmap(previousIconBitmap);
+ nextButton->SetBitmap(nextIconBitmap);
+ calendarsButton->SetBitmap(calendarsIconBitmap);
// Setup the static text.
- DateButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER);
+ dateButton = new wxButton(pnlMain, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER);
- wxFont Test;
+ wxFont test;
- Test.SetWeight(wxFONTWEIGHT_BOLD);
- Test.SetPointSize(18);
+ test.SetWeight(wxFONTWEIGHT_BOLD);
+ test.SetPointSize(18);
- DateButton->SetFont(Test);
- DateButton->SetForegroundColour(wxColour(255,255,255));
+ dateButton->SetFont(Test);
+ dateButton->SetForegroundColour(wxColour(255,255,255));
// Setup the event controls.
- DateButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::DateTextClick), NULL, this);
- NextButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::NextMonth), NULL, this);
- CalendarsButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::ShowCalendarsList), NULL, this);
- PreviousButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::PreviousMonth), NULL, this);
+ dateButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::DateTextClick), NULL, this);
+ nextButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::NextMonth), NULL, this);
+ calendarsButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::ShowCalendarsList), NULL, this);
+ previousButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::PreviousMonth), NULL, this);
Connect(ID_CHANGEGRID, XCCALENDARMANIPULATOR_CHANGEGRID, wxCommandEventHandler(XCCalendarManipulator::ChangeGrid));
// Setup the manipulator control.
- szrNavigation->Add(PreviousButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
- szrNavigation->Add(CalendarsButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ szrNavigation->Add(previousButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ szrNavigation->Add(calendarsButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
szrNavigation->Add( 0, 0, 1, wxEXPAND, 5 );
- szrNavigation->Add(DateButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+ szrNavigation->Add(dateButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
szrNavigation->Add( 0, 0, 1, wxEXPAND, 5 );
- szrNavigation->Add(NextButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ szrNavigation->Add(nextButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
szrNavigation->Layout();
// Setup the month selection control.
- wxDateTime DTNow = wxDateTime::Now();
+ wxDateTime dtNow = wxDateTime::Now();
- Moo = new XCCalendarMonthSelect(this);
- Month = ((int)DTNow.GetMonth() + 1);
- Year = DTNow.GetYear();
- Moo->UpdateDate(Month, Year);
+ moo = new XCCalendarMonthSelect(this);
+ month = ((int)dtNow.GetMonth() + 1);
+ year = dtNow.GetYear();
+ moo->UpdateDate(month, year);
UpdateDateButtonText();
// Setup the calendars list.
// Bring up a popup control to select the month and year.
- Moo->SetPosition(wxPoint(DateButton->GetScreenRect().GetLeft(), DateButton->GetScreenRect().GetBottom()));
- Moo->UpdateDate(Month, Year);
- Moo->Popup();
+ moo->SetPosition(wxPoint(dateButton->GetScreenRect().GetLeft(), dateButton->GetScreenRect().GetBottom()));
+ moo->UpdateDate(month, year);
+ moo->Popup();
}
void XCCalendarManipulator::ChangeGrid(wxCommandEvent &event){
- if (Month == Moo->GetMonth() && Year == Moo->GetYear()){
+ if (month == moo->GetMonth() && year == moo->GetYear()){
return;
}
- Month = Moo->GetMonth();
- Year = Moo->GetYear();
+ month = moo->GetMonth();
+ year = moo->GetYear();
// Post an event to the parent control to update the grid.
- wxCommandEvent ChangeGrid(XCCALENDARCTRL_CHANGEGRID);
- ChangeGrid.SetId(ID_CHANGEGRID);
- wxPostEvent(this->GetParent(), ChangeGrid);
+ wxCommandEvent changeGrid(XCCALENDARCTRL_CHANGEGRID);
+ changeGrid.SetId(ID_CHANGEGRID);
+ wxPostEvent(this->GetParent(), changeGrid);
UpdateDateButtonText();
void XCCalendarManipulator::NextMonth(wxCommandEvent &event){
- int NewMonth = 1;
- int NewYear = 0;
+ int newMonth = 1;
+ int newYear = 0;
// Get the current month and year.
- NewMonth = Moo->GetMonth();
- NewYear = Moo->GetYear();
+ newMonth = moo->GetMonth();
+ newYear = moo->GetYear();
- if (NewMonth == 12){
- NewMonth = 1;
- NewYear++;
+ if (newMonth == 12){
+ newMonth = 1;
+ newYear++;
} else {
- NewMonth++;
+ newMonth++;
}
- Month = NewMonth;
- Year = NewYear;
+ month = newMonth;
+ year = newYear;
- Moo->UpdateDate(Month, Year);
+ moo->UpdateDate(month, year);
// Post an event to the parent control to update the grid.
- wxCommandEvent ChangeGrid(XCCALENDARCTRL_CHANGEGRID);
- ChangeGrid.SetId(ID_CHANGEGRID);
- wxPostEvent(this->GetParent(), ChangeGrid);
+ wxCommandEvent changeGrid(XCCALENDARCTRL_CHANGEGRID);
+ changeGrid.SetId(ID_CHANGEGRID);
+ wxPostEvent(this->GetParent(), changeGrid);
UpdateDateButtonText();
void XCCalendarManipulator::PreviousMonth(wxCommandEvent &event){
- int NewMonth = 1;
- int NewYear = 0;
+ int newMonth = 1;
+ int newYear = 0;
// Get the current month and year.
- NewMonth = Moo->GetMonth();
- NewYear = Moo->GetYear();
+ newMonth = moo->GetMonth();
+ newYear = moo->GetYear();
- if (NewMonth == 1){
- NewMonth = 12;
- NewYear--;
+ if (newMonth == 1){
+ newMonth = 12;
+ newYear--;
} else {
- NewMonth--;
+ newMonth--;
}
- Month = NewMonth;
- Year = NewYear;
+ month = newMonth;
+ year = newYear;
- Moo->UpdateDate(Month, Year);
+ moo->UpdateDate(month, year);
// Post an event to the parent control to update the grid.
- wxCommandEvent ChangeGrid(XCCALENDARCTRL_CHANGEGRID);
- ChangeGrid.SetId(ID_CHANGEGRID);
- wxPostEvent(this->GetParent(), ChangeGrid);
+ wxCommandEvent changeGrid(XCCALENDARCTRL_CHANGEGRID);
+ changeGrid.SetId(ID_CHANGEGRID);
+ wxPostEvent(this->GetParent(), changeGrid);
UpdateDateButtonText();
// Update the list of calendars before showing.
- calendarList->SetPosition(wxPoint(CalendarsButton->GetScreenRect().GetLeft(), CalendarsButton->GetScreenRect().GetBottom()));
+ calendarList->SetPosition(wxPoint(calendarsButton->GetScreenRect().GetLeft(), calendarsButton->GetScreenRect().GetBottom()));
calendarList->UpdateCalendarList(dataStorage);
calendarList->Popup();
// Update the date text.
- string NewDateText = "";
+ string newDateText = "";
- switch (Moo->GetMonth()){
+ switch (moo->GetMonth()){
case 1:
- NewDateText = _("January");
+ newDateText = _("January");
break;
case 2:
- NewDateText = _("February");
+ newDateText = _("February");
break;
case 3:
- NewDateText = _("March");
+ newDateText = _("March");
break;
case 4:
- NewDateText = _("April");
+ newDateText = _("April");
break;
case 5:
- NewDateText = _("May");
+ newDateText = _("May");
break;
case 6:
- NewDateText = _("June");
+ newDateText = _("June");
break;
case 7:
- NewDateText = _("July");
+ newDateText = _("July");
break;
case 8:
- NewDateText = _("August");
+ newDateText = _("August");
break;
case 9:
- NewDateText = _("September");
+ newDateText = _("September");
break;
case 10:
- NewDateText = _("October");
+ newDateText = _("October");
break;
case 11:
- NewDateText = _("November");
+ newDateText = _("November");
break;
case 12:
- NewDateText = _("December");
+ newDateText = _("December");
break;
}
- NewDateText += " ";
+ newDateText += " ";
- NewDateText += to_string(Year);
+ newDateText += to_string(year);
- DateButton->SetLabel(NewDateText);
+ dateButton->SetLabel(newDateText);
szrMain->Layout();
}
int XCCalendarManipulator::GetMonth(){
- return Month;
+ return month;
}
int XCCalendarManipulator::GetYear(){
- return Year;
+ return year;
}
wxBoxSizer *szrMain = nullptr;
wxBoxSizer *szrNavigation = nullptr;
wxPanel *pnlMain = nullptr;
- wxButton *PreviousButton = nullptr;
- wxButton *NextButton = nullptr;
- wxButton *CalendarsButton = nullptr;
- wxButton *DateButton = nullptr;
- XCCalendarMonthSelect *Moo = nullptr;
+ wxButton *previousButton = nullptr;
+ wxButton *nextButton = nullptr;
+ wxButton *calendarsButton = nullptr;
+ wxButton *dateButton = nullptr;
+ XCCalendarMonthSelect *moo = nullptr;
XCCalendarList *calendarList = nullptr;
CalendarDataStorage *dataStorage = nullptr;
- int Month = 0;
- int Year = 2016;
- wxBitmap NextIconBitmap;
- wxBitmap PreviousIconBitmap;
- wxBitmap CalendarsIconBitmap;
+ int month = 0;
+ int year = 2016;
+ wxBitmap nextIconBitmap;
+ wxBitmap previousIconBitmap;
+ wxBitmap calendarsIconBitmap;
void UpdateDateButtonText();
protected:
// Delete the menu items.
- for (std::map<std::string, wxMenuItem*>::iterator MenuItemIter = MenuItems.begin();
- MenuItemIter != MenuItems.end(); ++MenuItemIter){
+ for (std::map<std::string, wxMenuItem*>::iterator menuItemIter = menuItems.begin();
+ menuItemIter != menuItems.end(); ++menuItemIter){
// Delete the wxMenuItem object.
- this->Disconnect(MenuItemIter->second->GetId(), wxEVT_COMMAND_MENU_SELECTED,
+ this->Disconnect(menuItemIter->second->GetId(), wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(XCCalendarMenu::ProcessMenuItemClick) );
- delete(MenuItemIter->second);
- MenuItemIter->second = NULL;
+ delete(menuItemIter->second);
+ menuItemIter->second = NULL;
}
- MenuItems.clear();
+ menuItems.clear();
}
-void XCCalendarMenu::AppendMenuItem(wxString ObjectName,
- wxString MenuName,
- wxString MenuDescription,
- XCCalendarMenuID ItemID,
- wxItemKind ItemType){
+void XCCalendarMenu::AppendMenuItem(wxString objectName,
+ wxString menuName,
+ wxString menuDescription,
+ XCCalendarMenuID itemID,
+ wxItemKind itemType){
- if (ItemType == wxITEM_SEPARATOR){
+ if (itemType == wxITEM_SEPARATOR){
this->AppendSeparator();
return;
}
// Append a menu item to the XCCalendarMenu control.
- wxMenuItem *menuitem = this->Append(ItemID, MenuName, MenuDescription);
+ wxMenuItem *menuitem = this->Append(ItemID, menuName, menuDescription);
this->Connect(menuitem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(XCCalendarMenu::ProcessMenuItemClick));
- MenuItems.insert(std::make_pair(ObjectName.ToStdString(), menuitem));
+ menuItems.insert(std::make_pair(objectName.ToStdString(), menuitem));
}
// Process an action when a menu item in the XCCalendarMenu
// control is selected.
- int ItemID = event.GetId();
+ int itemID = event.GetId();
PopupPtr->Dismiss();
- switch (ItemID){
+ switch (itemID){
case ID_CALENDARMENU_EDIT:
{
class XCCalendarMenu : public XCCalendarMenuADT
{
private:
- std::map<std::string, wxMenuItem*> MenuItems = {};
- wxListCtrl *ContactListCtrl = NULL;
- wxWindow *WindowPtr = NULL;
- wxPopupTransientWindow *PopupPtr = NULL;
- bool EnableAccountSettings = FALSE;
- bool SearchModeOnly = FALSE;
- void AppendMenuItem(wxString ObjectName,
- wxString MenuName,
- wxString MenuDescription,
- XCCalendarMenuID ItemID,
- wxItemKind ItemType);
+ std::map<std::string, wxMenuItem*> menuItems = {};
+ wxListCtrl *contactListCtrl = NULL;
+ wxWindow *windowPtr = NULL;
+ wxPopupTransientWindow *popupPtr = NULL;
+ bool enableAccountSettings = FALSE;
+ bool searchModeOnly = FALSE;
int calendarID = 0;
int accountPreferencesID = 0;
+
+ void AppendMenuItem(wxString objectName,
+ wxString menuName,
+ wxString menuDescription,
+ XCCalendarMenuID itemID,
+ wxItemKind itemType);
+
protected:
void ProcessMenuItemClick(wxCommandEvent& event);
public:
calendarStorage = dataStorage;
- MondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
- TuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
- WednesdayText = new XCCalendarMonthViewDayTitle(this, _("Wednesday"), wxDefaultPosition, wxDefaultSize);
- ThursdayText = new XCCalendarMonthViewDayTitle(this, _("Thursday"), wxDefaultPosition, wxDefaultSize);
- FridayText = new XCCalendarMonthViewDayTitle(this, _("Friday"), wxDefaultPosition, wxDefaultSize);
- SaturdayText = new XCCalendarMonthViewDayTitle(this, _("Saturday"), wxDefaultPosition, wxDefaultSize);
- SundayText = new XCCalendarMonthViewDayTitle(this, _("Sunday"), wxDefaultPosition, wxDefaultSize);
+ mondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
+ tuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
+ wednesdayText = new XCCalendarMonthViewDayTitle(this, _("Wednesday"), wxDefaultPosition, wxDefaultSize);
+ thursdayText = new XCCalendarMonthViewDayTitle(this, _("Thursday"), wxDefaultPosition, wxDefaultSize);
+ fridayText = new XCCalendarMonthViewDayTitle(this, _("Friday"), wxDefaultPosition, wxDefaultSize);
+ saturdayText = new XCCalendarMonthViewDayTitle(this, _("Saturday"), wxDefaultPosition, wxDefaultSize);
+ sundayText = new XCCalendarMonthViewDayTitle(this, _("Sunday"), wxDefaultPosition, wxDefaultSize);
eventMenu = new XCEventMenu;
- WindowSizer->Add(MondayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(TuesdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(WednesdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(ThursdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(FridayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(SaturdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(SundayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(mondayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(tuesdayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(wednesdayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(thursdayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(fridayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(saturdayText, 1, wxEXPAND|wxALL, 0);
+ WindowSizer->Add(sundayText, 1, wxEXPAND|wxALL, 0);
ProcessGrid(grid, hideAccounts, hideCalendars);
// Setup the growable rows and columns.
- WindowSizer->AddGrowableCol(0);
- WindowSizer->AddGrowableCol(1);
- WindowSizer->AddGrowableCol(2);
- WindowSizer->AddGrowableCol(3);
- WindowSizer->AddGrowableCol(4);
- WindowSizer->AddGrowableCol(5);
- WindowSizer->AddGrowableCol(6);
- WindowSizer->SetFlexibleDirection( wxBOTH );
- WindowSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
- this->SetSizer(WindowSizer);
- WindowSizer->Fit(this);
+ windowSizer->AddGrowableCol(0);
+ windowSizer->AddGrowableCol(1);
+ windowSizer->AddGrowableCol(2);
+ windowSizer->AddGrowableCol(3);
+ windowSizer->AddGrowableCol(4);
+ windowSizer->AddGrowableCol(5);
+ windowSizer->AddGrowableCol(6);
+ windowSizer->SetFlexibleDirection( wxBOTH );
+ windowSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ this->SetSizer(windowSizer);
+ windowSizer->Fit(this);
this->Layout();
this->SetBackgroundColour(wxColour(0,0,0));
calendarStorage = dataStorage;
- MondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
- TuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
- WednesdayText = new XCCalendarMonthViewDayTitle(this, _("Wednesday"), wxDefaultPosition, wxDefaultSize);
- ThursdayText = new XCCalendarMonthViewDayTitle(this, _("Thursday"), wxDefaultPosition, wxDefaultSize);
- FridayText = new XCCalendarMonthViewDayTitle(this, _("Friday"), wxDefaultPosition, wxDefaultSize);
- SaturdayText = new XCCalendarMonthViewDayTitle(this, _("Saturday"), wxDefaultPosition, wxDefaultSize);
- SundayText = new XCCalendarMonthViewDayTitle(this, _("Sunday"), wxDefaultPosition, wxDefaultSize);
-
- WindowSizer->Add(MondayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(TuesdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(WednesdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(ThursdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(FridayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(SaturdayText, 1, wxEXPAND|wxALL, 0);
- WindowSizer->Add(SundayText, 1, wxEXPAND|wxALL, 0);
+ mondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
+ tuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
+ wednesdayText = new XCCalendarMonthViewDayTitle(this, _("Wednesday"), wxDefaultPosition, wxDefaultSize);
+ thursdayText = new XCCalendarMonthViewDayTitle(this, _("Thursday"), wxDefaultPosition, wxDefaultSize);
+ fridayText = new XCCalendarMonthViewDayTitle(this, _("Friday"), wxDefaultPosition, wxDefaultSize);
+ saturdayText = new XCCalendarMonthViewDayTitle(this, _("Saturday"), wxDefaultPosition, wxDefaultSize);
+ sundayText = new XCCalendarMonthViewDayTitle(this, _("Sunday"), wxDefaultPosition, wxDefaultSize);
+
+ windowSizer->Add(MondayText, 1, wxEXPAND|wxALL, 0);
+ windowSizer->Add(TuesdayText, 1, wxEXPAND|wxALL, 0);
+ windowSizer->Add(WednesdayText, 1, wxEXPAND|wxALL, 0);
+ windowSizer->Add(ThursdayText, 1, wxEXPAND|wxALL, 0);
+ windowSizer->Add(FridayText, 1, wxEXPAND|wxALL, 0);
+ windowSizer->Add(SaturdayText, 1, wxEXPAND|wxALL, 0);
+ windowSizer->Add(SundayText, 1, wxEXPAND|wxALL, 0);
ProcessGrid(grid, hideAccounts, hideCalendars);
// Setup the growable rows and columns.
- WindowSizer->AddGrowableCol(0);
- WindowSizer->AddGrowableCol(1);
- WindowSizer->AddGrowableCol(2);
- WindowSizer->AddGrowableCol(3);
- WindowSizer->AddGrowableCol(4);
- WindowSizer->AddGrowableCol(5);
- WindowSizer->AddGrowableCol(6);
- WindowSizer->SetFlexibleDirection( wxBOTH );
- WindowSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
- this->SetSizer(WindowSizer);
- WindowSizer->Fit(this);
+ windowSizer->AddGrowableCol(0);
+ windowSizer->AddGrowableCol(1);
+ windowSizer->AddGrowableCol(2);
+ windowSizer->AddGrowableCol(3);
+ windowSizer->AddGrowableCol(4);
+ windowSizer->AddGrowableCol(5);
+ windowSizer->AddGrowableCol(6);
+ windowSizer->SetFlexibleDirection( wxBOTH );
+ windowSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ this->SetSizer(windowSizer);
+ windowSizer->Fit(this);
this->Layout();
this->SetBackgroundColour(wxColour(0,0,0));
// Add the new calendar entries.
- int Week = 0;
+ int week = 0;
- for (vector<XCCalendarMonthViewGridDayWeek>::iterator WeekIter = grid->WeekList.begin();
- WeekIter != grid->WeekList.end(); WeekIter++){
+ for (vector<XCCalendarMonthViewGridDayWeek>::iterator weekIter = grid->weekList.begin();
+ weekIter != grid->weekList.end(); weekIter++){
- Week++;
+ week++;
- for (vector<XCCalendarMonthViewGridDayData>::iterator DayIter = (*WeekIter).DayList.begin();
- DayIter != (*WeekIter).DayList.end(); DayIter++){
+ for (vector<XCCalendarMonthViewGridDayData>::iterator dayIter = (*weekIter).dayList.begin();
+ dayIter != (*weekIter).dayList.end(); DayIter++){
- // TODO: Add CalendarEntries.
+ // Add Calendar entries.
- XCCalendarDay *CalendarDayItem = new XCCalendarDay(this, "XCCalendarMonthView Test", wxPoint(50, 50), wxSize(200, 200));
+ XCCalendarDay *calendarDayItem = new XCCalendarDay(this, "XCCalendarMonthView Test", wxPoint(50, 50), wxSize(200, 200));
// Setup the control.
- CalendarDayItem->SetupControl((*DayIter).Day, (*DayIter).Month, (*DayIter).Year, (*DayIter).IsInMonth, this, calendarStorage, hideAccounts, hideCalendars);
+ calendarDayItem->SetupControl((*dayIter).day, (*dayIter).month, (*dayIter).year, (*dayIter).isInMonth, this, calendarStorage, hideAccounts, hideCalendars);
- CalendarDayList.push_back(CalendarDayItem);
- WindowSizer->Add(CalendarDayItem, 1, wxEXPAND, 5);
+ calendarDayList.push_back(calendarDayItem);
+ windowSizer->Add(calendarDayItem, 1, wxEXPAND, 5);
}
// Add the Growable Rows.
- for (int WeekSeek = 0; WeekSeek < Week; WeekSeek++){
+ for (int weekSeek = 0; weekSeek < week; weekSeek++){
- WindowSizer->AddGrowableRow((WeekSeek + 1));
+ windowSizer->AddGrowableRow((weekSeek + 1));
}
void XCCalendarMonthView::DeselectOthersEvent(wxCommandEvent &DeselectEvent){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); DayIter++){
- if (DeselectEvent.GetClientData() != (void*)(*DayIter)){
+ if (deselectEvent.GetClientData() != (void*)(*dayIter)){
- wxCommandEvent DeselectEvent(XCCALENDARDAY_DESELECTALLENTRIES);
- DeselectEvent.SetId(ID_DESELECTALLITEMS);
- wxPostEvent((*DayIter), DeselectEvent);
+ wxCommandEvent deselectEvent(XCCALENDARDAY_DESELECTALLENTRIES);
+ deselectEvent.SetId(ID_DESELECTALLITEMS);
+ wxPostEvent((*dayIter), deselectEvent);
}
void XCCalendarMonthView::HideAccountEntries(wxCommandEvent &accountData){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
- wxCommandEvent HideEvent(XCCALENDARDAY_HIDEACCOUNTENTRIES);
- HideEvent.SetInt(accountData.GetInt());
- HideEvent.SetId(ID_HIDEENTRIES);
- wxPostEvent((*DayIter), HideEvent);
+ wxCommandEvent hideEvent(XCCALENDARDAY_HIDEACCOUNTENTRIES);
+ hideEvent.SetInt(accountData.GetInt());
+ hideEvent.SetId(ID_HIDEENTRIES);
+ wxPostEvent((*dayIter), hideEvent);
}
void XCCalendarMonthView::ShowAccountEntries(wxCommandEvent &accountData){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
- wxCommandEvent ShowEvent(XCCALENDARDAY_SHOWACCOUNTENTRIES);
- ShowEvent.SetInt(accountData.GetInt());
- ShowEvent.SetId(ID_SHOWENTRIES);
- wxPostEvent((*DayIter), ShowEvent);
+ wxCommandEvent showEvent(XCCALENDARDAY_SHOWACCOUNTENTRIES);
+ showEvent.SetInt(accountData.GetInt());
+ showEvent.SetId(ID_SHOWENTRIES);
+ wxPostEvent((*dayIter), showEvent);
}
void XCCalendarMonthView::HideCalendarEntries(wxCommandEvent &accountData){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
- wxCommandEvent HideEvent(XCCALENDARDAY_HIDECALENDARENTRIES);
- HideEvent.SetInt(accountData.GetInt());
- HideEvent.SetId(ID_HIDECALENDARENTRIES);
- wxPostEvent((*DayIter), HideEvent);
+ wxCommandEvent hideEvent(XCCALENDARDAY_HIDECALENDARENTRIES);
+ hideEvent.SetInt(accountData.GetInt());
+ hideEvent.SetId(ID_HIDECALENDARENTRIES);
+ wxPostEvent((*dayIter), hideEvent);
}
void XCCalendarMonthView::ShowCalendarEntries(wxCommandEvent &accountData){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
- wxCommandEvent HideEvent(XCCALENDARDAY_SHOWCALENDARENTRIES);
- HideEvent.SetInt(accountData.GetInt());
- HideEvent.SetId(ID_SHOWCALENDARENTRIES);
- wxPostEvent((*DayIter), HideEvent);
+ wxCommandEvent hideEvent(XCCALENDARDAY_SHOWCALENDARENTRIES);
+ hideEvent.SetInt(accountData.GetInt());
+ hideEvent.SetId(ID_SHOWCALENDARENTRIES);
+ wxPostEvent((*dayIter), hideEvent);
}
void XCCalendarMonthView::DeleteCalendarEntries(wxCommandEvent &calendarData){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
wxCommandEvent deleteEvent(XCCALENDARDAY_DELETECALENDARENTRIES);
deleteEvent.SetInt(calendarData.GetInt());
deleteEvent.SetId(ID_DELETECALENDARENTRIES);
- wxPostEvent((*DayIter), deleteEvent);
+ wxPostEvent((*dayIter), deleteEvent);
}
void XCCalendarMonthView::DeleteCalendarEntry(wxCommandEvent &eventData){
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
wxCommandEvent deleteEvent(XCCALENDARDAY_DELETEENTRY);
deleteEvent.SetInt(eventData.GetInt());
deleteEvent.SetId(ID_DELETEENTRY);
- wxPostEvent((*DayIter), deleteEvent);
+ wxPostEvent((*dayIter), deleteEvent);
}
EventProperties *eventInfo = (EventProperties*)eventData.GetClientData();
bool foundDate = false;
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
// Check if the date matches with the date in the day
// widget. If it does, add the widget.
- if ((*DayIter)->GetCalendarYear() == eventInfo->eventYear &&
- (*DayIter)->GetCalendarMonth() == (eventInfo->eventMonth + 1) &&
- (*DayIter)->GetCalendarDay() == eventInfo->eventDay){
+ if ((*dayIter)->GetCalendarYear() == eventInfo->eventYear &&
+ (*dayIter)->GetCalendarMonth() == (eventInfo->eventMonth + 1) &&
+ (*dayIter)->GetCalendarDay() == eventInfo->eventDay){
wxCommandEvent addEvent(XCCALENDARDAY_ADDENTRY);
addEvent.SetId(ID_ADDENTRY);
addEvent.SetClientData(eventInfo);
- wxPostEvent((*DayIter), addEvent);
+ wxPostEvent((*dayIter), addEvent);
foundDate = true;
break;
EventProperties *eventInfo = (EventProperties*)eventData.GetClientData();
bool foundDate = false;
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
// Check if the date matches with the date in the day
// widget. If it does, update the widget.
- if ((*DayIter)->GetCalendarYear() == eventInfo->eventYear &&
- (*DayIter)->GetCalendarMonth() == (eventInfo->eventMonth + 1) &&
- (*DayIter)->GetCalendarDay() == eventInfo->eventDay){
+ if ((*dayIter)->GetCalendarYear() == eventInfo->eventYear &&
+ (*dayIter)->GetCalendarMonth() == (eventInfo->eventMonth + 1) &&
+ (*dayIter)->GetCalendarDay() == eventInfo->eventDay){
wxCommandEvent addEvent(XCCALENDARDAY_UPDATEENTRY);
addEvent.SetId(ID_UPDATEENTRY);
addEvent.SetClientData(eventInfo);
- wxPostEvent((*DayIter), addEvent);
+ wxPostEvent((*dayIter), addEvent);
foundDate = true;
break;
ColourUpdateProperties *colourDataInfo = (ColourUpdateProperties*)colourData.GetClientData();
- for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
- DayIter != CalendarDayList.end(); DayIter++){
+ for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+ dayIter != calendarDayList.end(); dayIter++){
// Check if the date matches with the date in the day
// widget. If it does, update the widget.
wxCommandEvent updateColour(XCCALENDARDAY_UPDATECALENDARCOLOUR);
updateColour.SetId(ID_UPDATECOLOUR);
updateColour.SetClientData(colourDataPassInfo);
- wxPostEvent((*DayIter), updateColour);
+ wxPostEvent((*dayIter), updateColour);
}
{
private:
- wxFlexGridSizer *WindowSizer = new wxFlexGridSizer(0, 7, 1, 1);
- vector<XCCalendarDay*> CalendarDayList;
- wxStaticText *NumberText = nullptr;
- XCCalendarMonthViewDayTitle *MondayText = nullptr;
- XCCalendarMonthViewDayTitle *TuesdayText = nullptr;
- XCCalendarMonthViewDayTitle *WednesdayText = nullptr;
- XCCalendarMonthViewDayTitle *ThursdayText = nullptr;
- XCCalendarMonthViewDayTitle *FridayText = nullptr;
- XCCalendarMonthViewDayTitle *SaturdayText = nullptr;
- XCCalendarMonthViewDayTitle *SundayText = nullptr;
+ wxFlexGridSizer *windowSizer = new wxFlexGridSizer(0, 7, 1, 1);
+ vector<XCCalendarDay*> calendarDayList;
+ wxStaticText *numberText = nullptr;
+ XCCalendarMonthViewDayTitle *mondayText = nullptr;
+ XCCalendarMonthViewDayTitle *tuesdayText = nullptr;
+ XCCalendarMonthViewDayTitle *wednesdayText = nullptr;
+ XCCalendarMonthViewDayTitle *thursdayText = nullptr;
+ XCCalendarMonthViewDayTitle *fridayText = nullptr;
+ XCCalendarMonthViewDayTitle *saturdayText = nullptr;
+ XCCalendarMonthViewDayTitle *sundayText = nullptr;
XCEventMenu *eventMenu = nullptr;
CalendarDataStorage *calendarStorage = nullptr;
XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
~XCCalendarMonthView();
- void PaintFrameEvent(wxPaintEvent &PaintEvent);
- void ResizeFrameEvent(wxSizeEvent &SizeEvent);
- void DeselectOthersEvent(wxCommandEvent &DeselectEvent);
+ void PaintFrameEvent(wxPaintEvent &paintEvent);
+ void ResizeFrameEvent(wxSizeEvent &sizeEvent);
+ void DeselectOthersEvent(wxCommandEvent &deselectEvent);
DECLARE_EVENT_TABLE()
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title)
{
- WindowSizer->Add(DayPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
- DayPanel->SetSizer(DaySizer);
+ windowSizer->Add(dayPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
+ dayPanel->SetSizer(daySizer);
- DayText = new wxStaticText(DayPanel, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
- DaySizer->Add(DayText, 1, wxALL, 0);
- DayPanel->Layout();
+ dayText = new wxStaticText(dayPanel, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
+ daySizer->Add(dayText, 1, wxALL, 0);
+ dayPanel->Layout();
- this->SetSizer(WindowSizer);
+ this->SetSizer(windowSizer);
this->Layout();
}
private:
- wxBoxSizer *WindowSizer = new wxBoxSizer(wxHORIZONTAL);
- wxBoxSizer *DaySizer = new wxBoxSizer(wxHORIZONTAL);
- wxPanel *DayPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, "Test");
- wxStaticText *DayText = nullptr;
+ wxBoxSizer *windowSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *daySizer = new wxBoxSizer(wxHORIZONTAL);
+ wxPanel *dayPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, "Test");
+ wxStaticText *dayText = nullptr;
public:
// Delete the menu items.
- for (std::map<std::string, wxMenuItem*>::iterator MenuItemIter = MenuItems.begin();
- MenuItemIter != MenuItems.end(); ++MenuItemIter){
+ for (std::map<std::string, wxMenuItem*>::iterator menuItemIter = menuItems.begin();
+ menuItemIter != menuItems.end(); ++menuItemIter){
// Delete the wxMenuItem object.
- this->Disconnect(MenuItemIter->second->GetId(), wxEVT_COMMAND_MENU_SELECTED,
+ this->Disconnect(menuItemIter->second->GetId(), wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(XCEventMenu::ProcessMenuItemClick) );
- delete(MenuItemIter->second);
- MenuItemIter->second = NULL;
+ delete(menuItemIter->second);
+ menuItemIter->second = NULL;
}
- MenuItems.clear();
+ menuItems.clear();
}
-void XCEventMenu::AppendMenuItem(wxString ObjectName,
- wxString MenuName,
- wxString MenuDescription,
- XCEventMenuID ItemID,
- wxItemKind ItemType){
+void XCEventMenu::AppendMenuItem(wxString objectName,
+ wxString menuName,
+ wxString menuDescription,
+ XCEventMenuID itemID,
+ wxItemKind itemType){
- if (ItemType == wxITEM_SEPARATOR){
+ if (itemType == wxITEM_SEPARATOR){
this->AppendSeparator();
return;
}
// Append a menu item to the XCEventMenu control.
- wxMenuItem *menuitem = this->Append(ItemID, MenuName, MenuDescription);
+ wxMenuItem *menuitem = this->Append(itemID, menuName, menuDescription);
this->Connect(menuitem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(XCEventMenu::ProcessMenuItemClick));
- MenuItems.insert(std::make_pair(ObjectName.ToStdString(), menuitem));
+ menuItems.insert(std::make_pair(objectName.ToStdString(), menuitem));
}
// Process an action when a menu item in the XCEventMenu
// control is selected.
- int ItemID = event.GetId();
+ int itemID = event.GetId();
- switch (ItemID){
+ switch (itemID){
case ID_EVENTMENU_EDIT:
{
void XCEventMenu::SetWindowPointer(wxWindow *windowPointer){
- WindowPtr = windowPointer;
+ windowPtr = windowPointer;
}
\ No newline at end of file
class XCEventMenu : public XCEventMenuADT
{
private:
- std::map<std::string, wxMenuItem*> MenuItems = {};
- wxWindow *WindowPtr = NULL;
- bool EnableAccountSettings = FALSE;
- bool SearchModeOnly = FALSE;
+ std::map<std::string, wxMenuItem*> menuItems = {};
+ wxWindow *windowPtr = NULL;
+ bool enableAccountSettings = FALSE;
+ bool searchModeOnly = FALSE;
+ int calendarID = 0;
+ int eventID = 0;
void AppendMenuItem(wxString ObjectName,
wxString MenuName,
wxString MenuDescription,
XCEventMenuID ItemID,
wxItemKind ItemType);
- int calendarID = 0;
- int eventID = 0;
+
protected:
void ProcessMenuItemClick(wxCommandEvent& event);
public: