X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54ffa10747e51b9fa8c52b7f864e187e82fd4919..8f4fcc4ee080b020057cc028a809ffc884f63bb8:/src/os2/window.cpp diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 30ac8d5c44..96e10ba3cd 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -583,77 +583,11 @@ bool wxWindowOS2::SetFont( HWND hWnd = GetHwnd(); - if (hWnd != 0) - { - char zFont[128]; - char zFacename[30]; - char zWeight[30]; - char zStyle[30]; - - // - // The fonts available for Presentation Params are just three - // outline fonts, the rest are available to the GPI, so we must - // map the families to one of these three - // - switch(rFont.GetFamily()) - { - case wxSCRIPT: - case wxDECORATIVE: - case wxROMAN: - strcpy(zFacename,"Times New Roman"); - break; - - case wxTELETYPE: - case wxMODERN: - strcpy(zFacename, "Courier"); - break; - - case wxSWISS: - case wxDEFAULT: - default: - strcpy(zFacename, "Helvetica"); - break; - } - - switch(rFont.GetWeight()) - { - default: - case wxNORMAL: - case wxLIGHT: - zWeight[0] = '\0'; - break; - - case wxBOLD: - case wxFONTWEIGHT_MAX: - strcpy(zWeight, "Bold"); - break; - } - switch(rFont.GetStyle()) - { - case wxITALIC: - case wxSLANT: - strcpy(zStyle, "Italic"); - break; - - default: - zStyle[0] = '\0'; - break; - } - sprintf(zFont, "%d.%s", rFont.GetPointSize(), zFacename); - if (zWeight[0] != '\0') - { - strcat(zFont, " "); - strcat(zFont, zWeight); - } - if (zStyle[0] != '\0') - { - strcat(zFont, " "); - strcat(zFont, zStyle); - } - ::WinSetPresParam(hWnd, PP_FONTNAMESIZE, strlen(zFont) + 1, (PVOID)zFont); - } + wxOS2SetFont( hWnd + ,rFont + ); return(TRUE); -} +} // end of wxWindowOS2::SetFont bool wxWindowOS2::SetCursor( const wxCursor& rCursor @@ -1051,9 +985,20 @@ void wxWindowOS2::SubclassWin( { HWND hwnd = (HWND)hWnd; - wxASSERT_MSG( !m_fnOldWndProc, wxT("subclassing window twice?") ); wxCHECK_RET(::WinIsWindow(vHabmain, hwnd), wxT("invalid HWND in SubclassWin") ); - m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, (PFNWP)wxWndProc); + wxAssociateWinWithHandle( hWnd + ,(wxWindow*)this + ); + if (!wxCheckWindowWndProc( hWnd + ,(WXFARPROC)wxWndProc + )) + { + m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, (PFNWP)wxWndProc); + } + else + { + m_fnOldWndProc = (WXFARPROC)NULL; + } } // end of wxWindowOS2::SubclassWin void wxWindowOS2::UnsubclassWin() @@ -3026,17 +2971,22 @@ bool wxWindowOS2::OS2Create( // if (pParent) { - if (IsKindOf(CLASSINFO(wxStatusBar)) && - pParent->IsKindOf(CLASSINFO(wxFrame))) + if ( pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) || + pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) + ) { - RECTL vRect; - wxFrame* pFrame = wxDynamicCast(pParent, wxFrame); + if (IsKindOf(CLASSINFO(wxStatusBar)) && + pParent->IsKindOf(CLASSINFO(wxFrame))) + { + RECTL vRect; + wxFrame* pFrame = wxDynamicCast(pParent, wxFrame); - ::WinQueryWindowRect((HWND)pFrame->GetFrame(), &vRect); - nY = vRect.yTop - (nY + nHeight); + ::WinQueryWindowRect((HWND)pFrame->GetFrame(), &vRect); + nY = vRect.yTop - (nY + nHeight); + } + else + nY = pParent->GetSize().y - (nY + nHeight); } - else - nY = pParent->GetSize().y - (nY + nHeight); } else {