- wxSystemSettings ss;
- m_colHighlightFg = ss.GetSystemColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
- m_colHighlightBg = ss.GetSystemColour(wxSYS_COLOUR_HIGHLIGHT);
+ m_colHighlightFg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+ m_colHighlightBg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
const wxString& name)
{
if ( !wxControl::Create(parent, id, pos, size,
const wxString& name)
{
if ( !wxControl::Create(parent, id, pos, size,
- style | wxWANTS_CHARS, wxDefaultValidator, name) )
+ style | wxCLIP_CHILDREN | wxWANTS_CHARS,
+ wxDefaultValidator, name) )
bool sameMonth = m_date.GetMonth() == date.GetMonth(),
sameYear = m_date.GetYear() == date.GetYear();
bool sameMonth = m_date.GetMonth() == date.GetMonth(),
sameYear = m_date.GetYear() == date.GetYear();
- ( !( lowerdate.IsValid() ) || ( ( upperdate.IsValid() ) ? ( lowerdate <= upperdate ) : true ) ) &&
- ( !( upperdate.IsValid() ) || ( ( lowerdate.IsValid() ) ? ( upperdate >= lowerdate ) : true ) ) )
+ ( !( lowerdate.IsValid() ) || ( ( upperdate.IsValid() ) ? ( lowerdate <= upperdate ) : TRUE ) ) &&
+ ( !( upperdate.IsValid() ) || ( ( lowerdate.IsValid() ) ? ( upperdate >= lowerdate ) : TRUE ) ) )
- retval = ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : true )
- && ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : true ) );
+ retval = ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE )
+ && ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : TRUE ) );
// rewind back
datetest.SetToPrevWeekDay(GetWindowStyle() & wxCAL_MONDAY_FIRST
? wxDateTime::Mon : wxDateTime::Sun);
// rewind back
datetest.SetToPrevWeekDay(GetWindowStyle() & wxCAL_MONDAY_FIRST
? wxDateTime::Mon : wxDateTime::Sun);
m_comboMonth->Move(x, y);
m_staticMonth->SetSize(x, y + dy, sizeCombo.x, sizeStatic.y);
m_comboMonth->Move(x, y);
m_staticMonth->SetSize(x, y + dy, sizeCombo.x, sizeStatic.y);
m_spinYear->SetSize(x + xDiff, y, width - xDiff, sizeCombo.y);
m_staticYear->SetSize(x + xDiff, y + dy, width - xDiff, sizeStatic.y);
m_spinYear->SetSize(x + xDiff, y, width - xDiff, sizeCombo.y);
m_staticYear->SetSize(x + xDiff, y + dy, width - xDiff, sizeStatic.y);
dc.GetTextExtent(headertext, &monthw, &monthh);
// draw month-name centered above weekdays
wxCoord monthx = ((m_widthCol * 7) - monthw) / 2;
wxCoord monthy = ((m_heightRow - monthh) / 2) + y;
dc.GetTextExtent(headertext, &monthw, &monthh);
// draw month-name centered above weekdays
wxCoord monthx = ((m_widthCol * 7) - monthw) / 2;
wxCoord monthy = ((m_heightRow - monthh) / 2) + y;
leftarrow[0] = wxPoint(0, arrowheight / 2);
leftarrow[1] = wxPoint(arrowheight / 2, 0);
leftarrow[2] = wxPoint(arrowheight / 2, arrowheight - 1);
leftarrow[0] = wxPoint(0, arrowheight / 2);
leftarrow[1] = wxPoint(arrowheight / 2, 0);
leftarrow[2] = wxPoint(arrowheight / 2, arrowheight - 1);
{
wxDateTime ldpm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) - wxDateSpan::Day(); // last day prev month
// Check if range permits change
{
wxDateTime ldpm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) - wxDateSpan::Day(); // last day prev month
// Check if range permits change
{
m_leftArrowRect = wxRect(larrowx - 3, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
{
m_leftArrowRect = wxRect(larrowx - 3, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
dc.DrawRectangle(m_leftArrowRect);
}
wxDateTime fdnm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) + wxDateSpan::Month(); // first day next month
dc.DrawRectangle(m_leftArrowRect);
}
wxDateTime fdnm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) + wxDateSpan::Month(); // first day next month
{
m_rightArrowRect = wxRect(rarrowx - 4, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
{
m_rightArrowRect = wxRect(rarrowx - 4, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
if ( !IsDateInRange(date) )
{
wxDateTime firstOOR = GetUpperDateLimit() + wxDateSpan::Day(); // first out-of-range
if ( !IsDateInRange(date) )
{
wxDateTime firstOOR = GetUpperDateLimit() + wxDateSpan::Day(); // first out-of-range
// we need to find out if the hit is on left arrow, on month or on right arrow
// left arrow?
if ( wxRegion(m_leftArrowRect).Contains(pos) == wxInRegion )
// we need to find out if the hit is on left arrow, on month or on right arrow
// left arrow?
if ( wxRegion(m_leftArrowRect).Contains(pos) == wxInRegion )
wxDateTime target = wxDateTime(tm.mday, tm.mon, year);
if ( ChangeYear(&target) )
wxDateTime target = wxDateTime(tm.mday, tm.mon, year);
if ( ChangeYear(&target) )