Fixed (?) problem in region handling which caused major redraw problems.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2006-08-06 22:00:10 +00:00
parent 42cd4d35bc
commit 744c594651
3 changed files with 52 additions and 92 deletions

View File

@@ -2641,6 +2641,7 @@ MRESULT wxWindowOS2::OS2WindowProc( WXUINT uMsg,
}
break;
case CBN_LBSELECT:
case BN_CLICKED: // Dups as LN_SELECT and CBN_LBSELECT
{
HWND hWnd = ::WinWindowFromID((HWND)GetHwnd(), SHORT1FROMMP(wParam));
@@ -2697,11 +2698,19 @@ MRESULT wxWindowOS2::OS2WindowProc( WXUINT uMsg,
,(WXWORD)SHORT1FROMMP(wParam)
);
}
if (pWin->IsKindOf(CLASSINFO(wxChoice)))
{
wxChoice* pChoice = wxDynamicCast(pWin, wxChoice);
pChoice->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
,(WXWORD)SHORT1FROMMP(wParam)
);
}
return 0;
}
// break;
case LN_ENTER: /* dups as CBN_EFCHANGE */
case LN_ENTER:
{
HWND hWnd = HWNDFROMMP(lParam);
wxWindowOS2* pWin = wxFindWinFromHandle(hWnd);
@@ -3568,15 +3577,10 @@ bool wxWindowOS2::HandlePaint()
wxLogLastError(wxT("CreateRectRgn"));
return false;
}
// Get all the rectangles from the region, convert the individual
// rectangles to "the other" coordinate system and reassemble a
// region from the rectangles, to be feed into m_updateRegion.
//
// FIXME: This is a bad hack since OS/2 API specifies that rectangles
// passed into GpiSetRegion must not have Bottom > Top,
// however, at first sight, it _seems_ to work nonetheless.
//
RGNRECT vRgnData;
PRECTL pUpdateRects = NULL;
vRgnData.ulDirection = RECTDIR_LFRT_TOPBOT;
@@ -3606,14 +3610,13 @@ bool wxWindowOS2::HandlePaint()
{
int rectHeight;
rectHeight = pUpdateRects[i].yTop - pUpdateRects[i].yBottom;
pUpdateRects[i].yTop = height - pUpdateRects[i].yTop;
pUpdateRects[i].yBottom = pUpdateRects[i].yTop + rectHeight;
pUpdateRects[i].yBottom = height - pUpdateRects[i].yTop;
pUpdateRects[i].yTop = pUpdateRects[i].yBottom + rectHeight;
}
::GpiSetRegion(hPS, hRgn, vRgnData.crc, pUpdateRects);
delete [] pUpdateRects;
}
}
m_updateRegion = wxRegion(hRgn, hPS);
vEvent.SetEventObject(this);