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
{
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()
#endif //wxUSE_ACCEL
} // end of wxWindowOS2::OS2TranslateMessage
+bool wxWindowOS2::OS2ShouldPreProcessMessage(
+ WXMSG* pMsg
+)
+{
+ // preprocess all messages by default
+ return TRUE;
+} // end of wxWindowOS2::OS2ShouldPreProcessMessage
+
// ---------------------------------------------------------------------------
// message params unpackers
// ---------------------------------------------------------------------------
if (IsKindOf(CLASSINFO(wxDialog)))
{
PSWP pSwp = (PSWP)PVOIDFROMMP(wParam);
+ PSWP pSwp2 = pSwp++;
- bProcessed = HandleSize( pSwp->cx
- ,pSwp->cy
- ,(WXUINT)lParam
- );
+ if (!(pSwp->cx == pSwp2->cx &&
+ pSwp->cy == pSwp2->cy))
+ bProcessed = HandleSize( pSwp->cx
+ ,pSwp->cy
+ ,(WXUINT)lParam
+ );
}
break;
//
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
{
WXHWND WXUNUSED(hWnd)
)
{
+ //
+ // Notify the parent keeping track of focus for the kbd navigation
+ // purposes that we got it
+ //
+ wxChildFocusEvent vEventFocus((wxWindow *)this);
+ (void)GetEventHandler()->ProcessEvent(vEventFocus);
+
#if wxUSE_CARET
//
// Deal with caret