From 63403da7808aa56477160c179c41884fdce3d620 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 16 Jul 2006 20:49:29 +0000 Subject: [PATCH] Make wxCalendarCtrl work on OS/2's PM port as well (patch #1523304). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40143 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/calctrl.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index e5e98717bc..59b083f668 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -790,7 +790,7 @@ void wxCalendarCtrl::DoMoveWindow(int x, int y, int width, int height) if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) && m_staticMonth ) { - wxSize sizeCombo = m_comboMonth->GetSize(); + wxSize sizeCombo = m_comboMonth->GetBestFittingSize(); wxSize sizeStatic = m_staticMonth->GetSize(); wxSize sizeSpin = m_spinYear->GetSize(); @@ -826,7 +826,7 @@ void wxCalendarCtrl::DoMoveWindow(int x, int y, int width, int height) void wxCalendarCtrl::DoGetPosition(int *x, int *y) const { wxControl::DoGetPosition(x, y); - +#ifndef __WXPM__ if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) && GetMonthControl() ) { // our real top corner is not in this position @@ -835,13 +835,14 @@ void wxCalendarCtrl::DoGetPosition(int *x, int *y) const *y -= GetMonthControl()->GetSize().y + VERT_MARGIN; } } +#endif } void wxCalendarCtrl::DoGetSize(int *width, int *height) const { wxControl::DoGetSize(width, height); - - if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ) +#ifndef __WXPM__ + if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) { // our real height is bigger if ( height && GetMonthControl()) @@ -849,6 +850,7 @@ void wxCalendarCtrl::DoGetSize(int *width, int *height) const *height += GetMonthControl()->GetSize().y + VERT_MARGIN; } } +#endif } void wxCalendarCtrl::RecalcGeometry() @@ -886,7 +888,7 @@ void wxCalendarCtrl::RecalcGeometry() m_widthCol += 2; m_heightRow += 2; - m_rowOffset = (GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ? m_heightRow : 0; // conditional in relation to style + m_rowOffset = HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ? m_heightRow : 0; // conditional in relation to style } // ----------------------------------------------------------------------------