Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated Repaint function of XCCalendarDay.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 26 Jun 2016 12:36:54 +0000 (13:36 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 26 Jun 2016 12:36:54 +0000 (13:36 +0100)
The Repaint function of the XCCalendarDay now checks if the IsInMonth
boolean is set and draws the background colours accordingly.

source/widgets/XCCalendarDay.cpp
source/widgets/XCCalendarDay.h

index 2b5eabb..6c0b29b 100644 (file)
@@ -139,29 +139,44 @@ XCCalendarDay::~XCCalendarDay(){
 void XCCalendarDay::Repaint(){
        
        wxPaintDC dc(this);
-
+       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());
        
-       dc.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
-       dc.DrawRectangle(TopSectionSizerItem->GetRect());
-       dc.SetBrush(wxBrush(wxColor(225,225,225)));
-       dc.DrawRectangle(MainSectionSizerItem->GetRect());
+       if (IsInMonth == true){
        
-       // Draw the border.
+               dc.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
+               dc.SetBrush(wxBrush(wxColor(255,255,255)));
+               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());
+               
+       } else {
+
+               dc.SetPen(wxPen(wxColor(185,185,185), 0, wxPENSTYLE_TRANSPARENT));
+               dc.SetBrush(wxBrush(wxColor(185,185,185)));
+               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());
+               
+       }
        
-       this->Layout();
+       // Draw the border.
 
-       dc.SetBrush(wxBrush(wxColor(0,0,0), wxBRUSHSTYLE_TRANSPARENT));
-       
-       wxPaintDC EventListFrameDC(EventListFrame);
-       EventListFrameDC.SetPen(wxPen(wxColor(255,255,255), 0, wxPENSTYLE_TRANSPARENT));
-       EventListFrameDC.SetBrush(wxBrush(wxColor(225,225,225)));
-       EventListFrameDC.DrawRectangle(EventListFrame->GetClientRect());
+       //dc.SetBrush(wxBrush(wxColor(0,0,0), wxBRUSHSTYLE_TRANSPARENT));
 
+       this->Layout();
+       
 }
 
 void XCCalendarDay::UpdateTopIcons(){
index d70594a..6e46b14 100644 (file)
@@ -40,6 +40,7 @@ class XCCalendarDay: public wxPanel
                wxStaticText *NumberText = nullptr;
                wxScrolledWindow *EventListFrame = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
                int CalendarEntrySeekNumber = 0;
+               bool IsInMonth = false;
        
                vector<XCCalendarDayEntry*> CalendarEntryList;
                XCCalendarDayEntry *CalendarEntry1 = new XCCalendarDayEntry(EventListFrame, "Calendar Entry 1", wxDefaultPosition, wxDefaultSize, CalendarEntrySeekNumber++);
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