- delete[] files;
-
- return rc;
-}
-
-bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
-{
-#if wxUSE_OWNER_DRAWN
- if ( id == 0 ) { // is it a menu item?
- DRAWITEMSTRUCT *pDrawStruct = (DRAWITEMSTRUCT *)itemStruct;
- wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
- wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );
-
- // prepare to call OnDrawItem()
- wxDC dc;
- dc.SetHDC((WXHDC)pDrawStruct->hDC, FALSE);
- wxRect rect(pDrawStruct->rcItem.left, pDrawStruct->rcItem.top,
- pDrawStruct->rcItem.right - pDrawStruct->rcItem.left,
- pDrawStruct->rcItem.bottom - pDrawStruct->rcItem.top);
- return pMenuItem->OnDrawItem(
- dc, rect,
- (wxOwnerDrawn::wxODAction)pDrawStruct->itemAction,
- (wxOwnerDrawn::wxODStatus)pDrawStruct->itemState
- );
- }
-#endif // owner-drawn menus
-
- wxWindow *item = FindItem(id);
-#if wxUSE_DYNAMIC_CLASSES
- if ( item && item->IsKindOf(CLASSINFO(wxControl)) )
- {
- return ((wxControl *)item)->MSWOnDraw(itemStruct);
- }
- else
-#endif
- return FALSE;
-}
-
-bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
-{
-#if wxUSE_OWNER_DRAWN
- if ( id == 0 ) { // is it a menu item?
- MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct;
- wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
- wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );
-
- return pMenuItem->OnMeasureItem(&pMeasureStruct->itemWidth,
- &pMeasureStruct->itemHeight);
- }
-#endif // owner-drawn menus
-
- wxWindow *item = FindItem(id);
-#if wxUSE_DYNAMIC_CLASSES
- if ( item && item->IsKindOf(CLASSINFO(wxControl)) )
- {
- return ((wxControl *)item)->MSWOnMeasure(itemStruct);
- }
- else
-#endif
- return FALSE;
-}
-
-bool wxWindow::MSWOnCtlColor(WXHBRUSH *brush,
- WXHDC pDC,
- WXHWND pWnd,
- WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
-{
- WXHBRUSH hBrush = 0;
-
- if ( nCtlColor == CTLCOLOR_DLG )
- {
- hBrush = OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam);
- }
- else
- {
- wxControl *item = (wxControl *)FindItemByHWND(pWnd, TRUE);
- if ( item )
- hBrush = item->OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam);
- }
-
- if ( hBrush )
- *brush = hBrush;
-
- return hBrush != 0;
-}
-
-// Define for each class of dialog and control
-WXHBRUSH wxWindow::OnCtlColor(WXHDC hDC,
- WXHWND hWnd,
- WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
-{
- return (WXHBRUSH)0;
-}
-
-bool wxWindow::MSWOnPaletteChanged(WXHWND hWndPalChange)
-{
- wxPaletteChangedEvent event(GetId());
- event.SetEventObject(this);
- event.SetChangedWindow(wxFindWinFromHandle(hWndPalChange));
-
- return GetEventHandler()->ProcessEvent(event);
-}
-
-bool wxWindow::MSWOnQueryNewPalette()
-{
- wxQueryNewPaletteEvent event(GetId());
- event.SetEventObject(this);
-
- return GetEventHandler()->ProcessEvent(event) && event.GetPaletteRealized();
-}
-
-// Responds to colour changes: passes event on to children.
-void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
-{
- wxNode *node = GetChildren().First();
- while ( node )
- {
- // Only propagate to non-top-level windows
- wxWindow *win = (wxWindow *)node->Data();
- if ( win->GetParent() )
- {
- wxSysColourChangedEvent event2;
- event.m_eventObject = win;
- win->GetEventHandler()->ProcessEvent(event2);
- }
-
- node = node->Next();
- }
-}
-
-long wxWindow::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
-{
- if ( m_oldWndProc )
- return ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
- else
- return ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam);
-}
-
-bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
-{
- if ( m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL) )
- {
- // intercept dialog navigation keys
- MSG *msg = (MSG *)pMsg;
- bool bProcess = TRUE;
- if ( msg->message != WM_KEYDOWN )
- bProcess = FALSE;
-
- if ( bProcess && (HIWORD(msg->lParam) & KF_ALTDOWN) == KF_ALTDOWN )
- bProcess = FALSE;
-
- if ( bProcess )
- {
- bool bCtrlDown = (::GetKeyState(VK_CONTROL) & 0x100) != 0;
-
- // WM_GETDLGCODE: ask the control if it wants the key for itself,
- // don't process it if it's the case (except for Ctrl-Tab/Enter
- // combinations which are always processed)
- LONG lDlgCode = 0;
- if ( !bCtrlDown )
- {
- lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
- }