]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/calctrl.cpp
non owned window implementation
[wxWidgets.git] / src / generic / calctrl.cpp
index cd1593d7b1c9b9c3f0d825664a786ae7940fa878..80e1bb4a001789da04580e479c8e07f076edaadb 100644 (file)
@@ -202,9 +202,6 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
                             long style,
                             const wxString& name)
 {
                             long style,
                             const wxString& name)
 {
-    // set the style first to avoid assert in our SetWindowStyleFlag()
-    m_windowStyle = style;
-
     if ( !wxControl::Create(parent, id, pos, size,
                             style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE,
                             wxDefaultValidator, name) )
     if ( !wxControl::Create(parent, id, pos, size,
                             style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE,
                             wxDefaultValidator, name) )
@@ -939,10 +936,10 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
     {
         // draw the sequential month-selector
 
     {
         // draw the sequential month-selector
 
-        dc.SetBackgroundMode(wxTRANSPARENT);
+        dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
         dc.SetTextForeground(*wxBLACK);
         dc.SetTextForeground(*wxBLACK);
-        dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID));
-        dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID));
+        dc.SetBrush(wxBrush(m_colHeaderBg, wxBRUSHSTYLE_SOLID));
+        dc.SetPen(wxPen(m_colHeaderBg, 1, wxPENSTYLE_SOLID));
         dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
 
         // Get extent of month-name + year
         dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
 
         // Get extent of month-name + year
@@ -1011,10 +1008,10 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         wxLogDebug("painting the header");
 #endif
 
         wxLogDebug("painting the header");
 #endif
 
-        dc.SetBackgroundMode(wxTRANSPARENT);
+        dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
         dc.SetTextForeground(m_colHeaderFg);
         dc.SetTextForeground(m_colHeaderFg);
-        dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID));
-        dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID));
+        dc.SetBrush(wxBrush(m_colHeaderBg, wxBRUSHSTYLE_SOLID));
+        dc.SetPen(wxPen(m_colHeaderBg, 1, wxPENSTYLE_SOLID));
         dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
 
         bool startOnMonday = (GetWindowStyle() & wxCAL_MONDAY_FIRST) != 0;
         dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
 
         bool startOnMonday = (GetWindowStyle() & wxCAL_MONDAY_FIRST) != 0;
@@ -1043,7 +1040,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
             date.Format("%a %d-%m-%Y %H:%M:%S").c_str());
 #endif
 
             date.Format("%a %d-%m-%Y %H:%M:%S").c_str());
 #endif
 
-    dc.SetBackgroundMode(wxSOLID);
+    dc.SetBackgroundMode(wxBRUSHSTYLE_SOLID);
     for ( size_t nWeek = 1; nWeek <= 6; nWeek++, y += m_heightRow )
     {
         // if the update region doesn't intersect this row, don't paint it
     for ( size_t nWeek = 1; nWeek <= 6; nWeek++, y += m_heightRow )
     {
         // if the update region doesn't intersect this row, don't paint it
@@ -1144,7 +1141,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
                         colBorder = GetForegroundColour();
                     }
 
                         colBorder = GetForegroundColour();
                     }
 
-                    wxPen pen(colBorder, 1, wxSOLID);
+                    wxPen pen(colBorder, 1, wxPENSTYLE_SOLID);
                     dc.SetPen(pen);
                     dc.SetBrush(*wxTRANSPARENT_BRUSH);
 
                     dc.SetPen(pen);
                     dc.SetBrush(*wxTRANSPARENT_BRUSH);
 
@@ -1191,7 +1188,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         wxDateTime firstOOR = GetLowerDateLimit() - wxDateSpan::Day(); // first out-of-range
 
         wxBrush oorbrush = *wxLIGHT_GREY_BRUSH;
         wxDateTime firstOOR = GetLowerDateLimit() - wxDateSpan::Day(); // first out-of-range
 
         wxBrush oorbrush = *wxLIGHT_GREY_BRUSH;
-        oorbrush.SetStyle(wxFDIAGONAL_HATCH);
+        oorbrush.SetStyle(wxBRUSHSTYLE_FDIAGONAL_HATCH);
 
         HighlightRange(&dc, date, firstOOR, wxTRANSPARENT_PEN, &oorbrush);
     }
 
         HighlightRange(&dc, date, firstOOR, wxTRANSPARENT_PEN, &oorbrush);
     }
@@ -1202,7 +1199,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         wxDateTime firstOOR = GetUpperDateLimit() + wxDateSpan::Day(); // first out-of-range
 
         wxBrush oorbrush = *wxLIGHT_GREY_BRUSH;
         wxDateTime firstOOR = GetUpperDateLimit() + wxDateSpan::Day(); // first out-of-range
 
         wxBrush oorbrush = *wxLIGHT_GREY_BRUSH;
-        oorbrush.SetStyle(wxFDIAGONAL_HATCH);
+        oorbrush.SetStyle(wxBRUSHSTYLE_FDIAGONAL_HATCH);
 
         HighlightRange(&dc, firstOOR, date, wxTRANSPARENT_PEN, &oorbrush);
     }
 
         HighlightRange(&dc, firstOOR, date, wxTRANSPARENT_PEN, &oorbrush);
     }