]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/wxMSW-win32.patch
goom is patched on win32 too
[vlc] / extras / contrib / src / Patches / wxMSW-win32.patch
1 # This patch was done from wxWidgets-2.6.1-Patch01.zip
2 # found on the download page of wxwidgets
3 # 24/08/05 -- Xtophe
4 diff -Naur wxwidgets-orig/include/wx/msw/listbox.h wxwidgets/include/wx/msw/listbox.h
5 --- wxwidgets-orig/include/wx/msw/listbox.h     2005-04-11 20:18:36.000000000 +0000
6 +++ wxwidgets/include/wx/msw/listbox.h  2005-08-24 16:47:00.000000000 +0000
7 @@ -4,7 +4,7 @@
8  // Author:      Julian Smart
9  // Modified by:
10  // Created:     01/02/97
11 -// RCS-ID:      $Id: listbox.h,v 1.42 2005/04/10 15:22:57 VZ Exp $
12 +// RCS-ID:      $Id: listbox.h,v 1.43 2005/06/16 15:36:42 JS Exp $
13  // Copyright:   (c) Julian Smart
14  // Licence:     wxWindows licence
15  /////////////////////////////////////////////////////////////////////////////
16 @@ -151,6 +151,13 @@
17  
18      virtual wxSize DoGetBestSize() const;
19  
20 +    // under XP when using "transition effect for menus and tooltips" if we
21 +    // return true for WM_PRINTCLIENT here then it causes noticable slowdown
22 +    virtual bool MSWShouldPropagatePrintChild()
23 +    {
24 +        return false;
25 +    }
26 +
27  #if wxUSE_OWNER_DRAWN
28      // control items
29      wxListBoxItemsArray m_aItems;
30 diff -Naur wxwidgets-orig/include/wx/msw/uxthemep.h wxwidgets/include/wx/msw/uxthemep.h
31 --- wxwidgets-orig/include/wx/msw/uxthemep.h    2005-05-14 16:57:49.000000000 +0000
32 +++ wxwidgets/include/wx/msw/uxthemep.h 2005-08-24 16:47:00.000000000 +0000
33 @@ -12,7 +12,7 @@
34  #ifndef __WINE_UXTHEME_H
35  #define __WINE_UXTHEME_H
36  
37 -#include <commctrl.h>
38 +#include "wx/msw/wrapcctl.h"
39  
40  typedef HANDLE HTHEME;
41  
42 diff -Naur wxwidgets-orig/include/wx/msw/window.h wxwidgets/include/wx/msw/window.h
43 --- wxwidgets-orig/include/wx/msw/window.h      2005-05-31 20:47:32.000000000 +0000
44 +++ wxwidgets/include/wx/msw/window.h   2005-08-24 16:47:00.000000000 +0000
45 @@ -5,7 +5,7 @@
46  // Modified by: Vadim Zeitlin on 13.05.99: complete refont of message handling,
47  //              elimination of Default(), ...
48  // Created:     01/02/97
49 -// RCS-ID:      $Id: window.h,v 1.146 2005/05/19 22:17:01 RD Exp $
50 +// RCS-ID:      $Id: window.h,v 1.147 2005/06/16 15:36:42 JS Exp $
51  // Copyright:   (c) Julian Smart
52  // Licence:     wxWindows licence
53  /////////////////////////////////////////////////////////////////////////////
54 @@ -391,6 +391,14 @@
55          return false;
56      }
57  
58 +    // some controls (e.g. wxListBox) need to set the return value themselves
59 +    //
60 +    // return true to let parent handle it if we don't, false otherwise
61 +    virtual bool MSWShouldPropagatePrintChild()
62 +    {
63 +        return true;
64 +    }
65 +
66  
67      // Responds to colour changes: passes event on to children.
68      void OnSysColourChanged(wxSysColourChangedEvent& event);
69 diff -Naur wxwidgets-orig/src/generic/grid.cpp wxwidgets/src/generic/grid.cpp
70 --- wxwidgets-orig/src/generic/grid.cpp 2005-06-02 15:19:48.000000000 +0000
71 +++ wxwidgets/src/generic/grid.cpp      2005-08-24 16:47:00.000000000 +0000
72 @@ -4,7 +4,7 @@
73  // Author:      Michael Bedward (based on code by Julian Smart, Robin Dunn)
74  // Modified by: Robin Dunn, Vadim Zeitlin
75  // Created:     1/08/1999
76 -// RCS-ID:      $Id: grid.cpp,v 1.339 2005/06/02 11:38:16 VZ Exp $
77 +// RCS-ID:      $Id: grid.cpp,v 1.341 2005/06/09 14:49:54 JS Exp $
78  // Copyright:   (c) Michael Bedward (mbedward@ozemail.com.au)
79  // Licence:     wxWindows licence
80  /////////////////////////////////////////////////////////////////////////////
81 @@ -242,7 +242,8 @@
82  public:
83      wxGridCellEditorEvtHandler(wxGrid* grid, wxGridCellEditor* editor)
84          : m_grid(grid),
85 -          m_editor(editor)
86 +          m_editor(editor),
87 +          m_inSetFocus(false)
88      {
89      }
90  
91 @@ -250,10 +251,16 @@
92      void OnKeyDown(wxKeyEvent& event);
93      void OnChar(wxKeyEvent& event);
94  
95 +    void SetInSetFocus(bool inSetFocus) { m_inSetFocus = inSetFocus; }
96 +
97  private:
98      wxGrid*             m_grid;
99      wxGridCellEditor*   m_editor;
100  
101 +    // Work around the fact that a focus kill event can be sent to
102 +    // a combobox within a set focus event.
103 +    bool                m_inSetFocus;
104 +    
105      DECLARE_EVENT_TABLE()
106      DECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler)
107      DECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler)
108 @@ -571,7 +578,7 @@
109      // through in that case.
110      if ((ctrl || alt) && !(ctrl && alt))
111          return false;
112 -    
113 +
114  #if wxUSE_UNICODE
115      int key = event.GetUnicodeKey();
116      bool keyOk = true;
117 @@ -588,7 +595,7 @@
118      return keyOk;
119  #else // !wxUSE_UNICODE
120      int key = event.GetKeyCode();
121 -    if (key <= 255) 
122 +    if (key <= 255)
123          return true;
124      return false;
125  #endif // wxUSE_UNICODE/!wxUSE_UNICODE
126 @@ -752,7 +759,7 @@
127      wxTextCtrl* tc = Text();
128      wxChar ch;
129      long pos;
130 -    
131 +
132  #if wxUSE_UNICODE
133      ch = event.GetUnicodeKey();
134      if (ch <= 127)
135 @@ -1106,7 +1113,7 @@
136      tmpbuf[0] = (char) keycode;
137      tmpbuf[1] = '\0';
138      wxString strbuf(tmpbuf, *wxConvCurrent);
139 -#if wxUSE_INTL        
140 +#if wxUSE_INTL
141      bool is_decimal_point = ( strbuf ==
142         wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) );
143  #else
144 @@ -1184,14 +1191,14 @@
145          tmpbuf[0] = (char) keycode;
146          tmpbuf[1] = '\0';
147          wxString strbuf(tmpbuf, *wxConvCurrent);
148 -#if wxUSE_INTL        
149 +#if wxUSE_INTL
150          bool is_decimal_point =
151              ( strbuf == wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT,
152                                            wxLOCALE_CAT_NUMBER) );
153  #else
154          bool is_decimal_point = ( strbuf == _T(".") );
155  #endif
156 -        if ( (keycode < 128) && 
157 +        if ( (keycode < 128) &&
158               (wxIsdigit(keycode) || tolower(keycode) == 'e' ||
159                is_decimal_point || keycode == '+' || keycode == '-') )
160              return true;
161 @@ -1375,11 +1382,11 @@
162          case WXK_SPACE:
163              CBox()->SetValue(!CBox()->GetValue());
164              break;
165 -            
166 +
167          case '+':
168              CBox()->SetValue(true);
169              break;
170 -                
171 +
172          case '-':
173              CBox()->SetValue(false);
174              break;
175 @@ -1460,6 +1467,14 @@
176      wxASSERT_MSG(m_control,
177                   wxT("The wxGridCellEditor must be Created first!"));
178  
179 +    wxGridCellEditorEvtHandler* evtHandler = NULL;
180 +    if (m_control)
181 +        evtHandler = wxDynamicCast(m_control->GetEventHandler(), wxGridCellEditorEvtHandler);
182 +
183 +    // Don't immediately end if we get a kill focus event within BeginEdit
184 +    if (evtHandler)
185 +        evtHandler->SetInSetFocus(true);
186 +
187      m_startValue = grid->GetTable()->GetValue(row, col);
188  
189      if (m_allowOthers)
190 @@ -1468,12 +1483,15 @@
191      {
192          // find the right position, or default to the first if not found
193          int pos = Combo()->FindString(m_startValue);
194 -        if (pos == -1)
195 +        if (pos == wxNOT_FOUND)
196              pos = 0;
197          Combo()->SetSelection(pos);
198      }
199      Combo()->SetInsertionPointEnd();
200      Combo()->SetFocus();
201 +
202 +    if (evtHandler)
203 +        evtHandler->SetInSetFocus(false);
204  }
205  
206  bool wxGridCellChoiceEditor::EndEdit(int row, int col,
207 @@ -1525,6 +1543,10 @@
208  
209  void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event)
210  {
211 +    // Don't disable the cell if we're just starting to edit it
212 +    if (m_inSetFocus)
213 +        return;
214 +
215      // accept changes
216      m_grid->DisableCellEditControl();
217  
218 @@ -3783,7 +3805,7 @@
219  {
220      if (event.ButtonDown(wxMOUSE_BTN_LEFT) && FindFocus() != this)
221          SetFocus();
222 -    
223 +
224      m_owner->ProcessGridCellMouseEvent( event );
225  }
226  
227 @@ -4905,6 +4927,7 @@
228                  break;
229  
230                  case WXGRID_CURSOR_SELECT_ROW:
231 +                {
232                      if ( (row = YToRow( y )) >= 0 )
233                      {
234                          if ( m_selection )
235 @@ -4916,6 +4939,8 @@
236                                                      event.MetaDown() );
237                          }
238                      }
239 +                }
240 +                break;
241  
242                  // default label to suppress warnings about "enumeration value
243                  // 'xxx' not handled in switch
244 @@ -5127,6 +5152,7 @@
245                  break;
246  
247                  case WXGRID_CURSOR_SELECT_COL:
248 +                {
249                      if ( (col = XToCol( x )) >= 0 )
250                      {
251                          if ( m_selection )
252 @@ -5138,6 +5164,8 @@
253                                                      event.MetaDown() );
254                          }
255                      }
256 +                }
257 +                break;
258  
259                  // default label to suppress warnings about "enumeration value
260                  // 'xxx' not handled in switch
261 diff -Naur wxwidgets-orig/src/generic/splitter.cpp wxwidgets/src/generic/splitter.cpp
262 --- wxwidgets-orig/src/generic/splitter.cpp     2005-03-29 12:22:43.000000000 +0000
263 +++ wxwidgets/src/generic/splitter.cpp  2005-08-24 16:47:00.000000000 +0000
264 @@ -4,7 +4,7 @@
265  // Author:      Julian Smart
266  // Modified by:
267  // Created:     01/02/97
268 -// RCS-ID:      $Id: splitter.cpp,v 1.114 2005/03/29 12:22:43 JS Exp $
269 +// RCS-ID:      $Id: splitter.cpp,v 1.115 2005/06/21 16:08:22 JS Exp $
270  // Copyright:   (c) Julian Smart
271  // Licence:     wxWindows licence
272  /////////////////////////////////////////////////////////////////////////////
273 @@ -94,6 +94,11 @@
274      if ( !wxWindow::Create(parent, id, pos, size, style, name) )
275          return false;
276  
277 +    if (size.x >= 0)
278 +        m_lastSize.x = size.x;
279 +    if (size.y >= 0)
280 +        m_lastSize.y = size.y;
281 +    
282      m_permitUnsplitAlways = (style & wxSP_PERMIT_UNSPLIT) != 0;
283  
284      // FIXME: with this line the background is not erased at all under GTK1,
285 @@ -700,8 +705,8 @@
286              y2 = size2;
287          }
288  
289 -        GetWindow1()->SetSize(border, border, w1, h1);
290          GetWindow2()->SetSize(x2, y2, w2, h2);
291 +        GetWindow1()->SetSize(border, border, w1, h1);
292      }
293  
294      wxClientDC dc(this);
295 diff -Naur wxwidgets-orig/src/msw/helpchm.cpp wxwidgets/src/msw/helpchm.cpp
296 --- wxwidgets-orig/src/msw/helpchm.cpp  2005-05-31 20:49:53.000000000 +0000
297 +++ wxwidgets/src/msw/helpchm.cpp       2005-08-24 16:47:00.000000000 +0000
298 @@ -4,7 +4,7 @@
299  // Author:      Julian Smart
300  // Modified by:
301  // Created:     16/04/2000
302 -// RCS-ID:      $Id: helpchm.cpp,v 1.23 2005/05/24 08:53:32 CE Exp $
303 +// RCS-ID:      $Id: helpchm.cpp,v 1.24 2005/06/20 14:02:35 JS Exp $
304  // Copyright:   (c) Julian Smart
305  // Licence:     wxWindows licence
306  /////////////////////////////////////////////////////////////////////////////
307 @@ -243,7 +243,6 @@
308  
309  wxCHMHelpController::~wxCHMHelpController()
310  {
311 -       gs_htmlHelp(GetSuitableHWND(), 0, HH_CLOSE_ALL, 0L);
312      UnloadHtmlHelpLibrary();
313  }
314  
315 diff -Naur wxwidgets-orig/src/msw/notebook.cpp wxwidgets/src/msw/notebook.cpp
316 --- wxwidgets-orig/src/msw/notebook.cpp 2005-05-31 20:49:55.000000000 +0000
317 +++ wxwidgets/src/msw/notebook.cpp      2005-08-24 16:47:00.000000000 +0000
318 @@ -4,7 +4,7 @@
319  // Author:      Vadim Zeitlin
320  // Modified by:
321  // Created:     11.06.98
322 -// RCS-ID:      $Id: notebook.cpp,v 1.155 2005/05/30 11:23:27 JS Exp $
323 +// RCS-ID:      $Id: notebook.cpp,v 1.158 2005/06/19 19:11:11 JS Exp $
324  // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
325  // Licence:     wxWindows licence
326  ///////////////////////////////////////////////////////////////////////////////
327 @@ -93,6 +93,14 @@
328  // the pointer to standard spin button wnd proc
329  static WXFARPROC gs_wndprocNotebookSpinBtn = (WXFARPROC)NULL;
330  
331 +// the pointer to standard tab control wnd proc
332 +static WXFARPROC gs_wndprocNotebook = (WXFARPROC)NULL; 
333 +
334 +LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,
335 +                                           UINT message,
336 +                                           WPARAM wParam,
337 +                                           LPARAM lParam);
338 +
339  #endif // USE_NOTEBOOK_ANTIFLICKER
340  
341  // ----------------------------------------------------------------------------
342 @@ -285,6 +293,7 @@
343  
344      LPCTSTR className = WC_TABCONTROL;
345  
346 +#if USE_NOTEBOOK_ANTIFLICKER
347      // SysTabCtl32 class has natively CS_HREDRAW and CS_VREDRAW enabled and it
348      // causes horrible flicker when resizing notebook, so get rid of it by
349      // using a class without these styles (but otherwise identical to it)
350 @@ -296,11 +305,14 @@
351              // get a copy of standard class and modify it
352              WNDCLASS wc;
353  
354 -            if ( ::GetClassInfo(::GetModuleHandle(NULL), WC_TABCONTROL, &wc) )
355 +            if ( ::GetClassInfo(NULL, WC_TABCONTROL, &wc) )
356              {
357 +                gs_wndprocNotebook =
358 +                    wx_reinterpret_cast(WXFARPROC, wc.lpfnWndProc);
359                  wc.lpszClassName = wxT("_wx_SysTabCtl32");
360                  wc.style &= ~(CS_HREDRAW | CS_VREDRAW);
361 -
362 +                wc.hInstance = wxGetInstance();
363 +                wc.lpfnWndProc = wxNotebookWndProc;
364                  s_clsNotebook.Register(wc);
365              }
366              else
367 @@ -318,6 +330,7 @@
368              className = s_clsNotebook.GetName().c_str();
369          }
370      }
371 +#endif // USE_NOTEBOOK_ANTIFLICKER
372  
373      if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL,
374                          wxDefaultValidator, name) )
375 @@ -789,6 +802,16 @@
376                              hwnd, message, wParam, lParam);
377  }
378  
379 +LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,
380 +                                           UINT message,
381 +                                           WPARAM wParam,
382 +                                           LPARAM lParam)
383 +{
384 +    return ::CallWindowProc(CASTWNDPROC gs_wndprocNotebook,
385 +                            hwnd, message, wParam, lParam);
386 +}
387 +
388
389  
390  void wxNotebook::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
391  {
392 @@ -918,7 +941,7 @@
393          RefreshRect(wxRect(0, rc.top, rc.left, height), false);
394          RefreshRect(wxRect(0, rc.bottom, widthNbook, heightNbook - rc.bottom),
395                      false);
396 -        RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.bottom, height),
397 +        RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.right, height),
398                      false);
399      }
400  
401 @@ -967,7 +990,7 @@
402        {
403          wxNotebookPage *pPage = m_pages[sel];
404          pPage->Show(true);
405 -        
406 +
407          // As per bug report:
408          // http://sourceforge.net/tracker/index.php?func=detail&aid=1150659&group_id=9863&atid=109863,
409          // we should not set the page focus (and thereby the focus for
410 @@ -1102,17 +1125,17 @@
411      if ( child )
412          ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);
413  
414 -
415 -    // apparently DrawThemeBackground() modifies the rect passed to it and if we
416 -    // don't do these adjustments, there are some drawing artifacts which are
417 -    // only visible with some non default themes; so modify the rect here using
418 -    // the magic numbers below so that it still paints the correct area
419 -    rc.left   -= 2;
420 -    rc.top    -= 2;
421 -    rc.right  += 4;
422 -    rc.bottom += 5;
423 -
424 -
425 +    // we have the content area (page size), but we need to draw all of the
426 +    // background for it to be aligned correctly
427 +    wxUxThemeEngine::Get()->GetThemeBackgroundExtent
428 +                            (
429 +                                theme,
430 +                                (HDC) hDC,
431 +                                9 /* TABP_PANE */,
432 +                                0,
433 +                                &rc,
434 +                                &rc
435 +                            );
436      wxUxThemeEngine::Get()->DrawThemeBackground
437                              (
438                                  theme,
439 diff -Naur wxwidgets-orig/src/msw/tbar95.cpp wxwidgets/src/msw/tbar95.cpp
440 --- wxwidgets-orig/src/msw/tbar95.cpp   2005-05-31 20:49:56.000000000 +0000
441 +++ wxwidgets/src/msw/tbar95.cpp        2005-08-24 16:47:00.000000000 +0000
442 @@ -4,7 +4,7 @@
443  // Author:      Julian Smart
444  // Modified by:
445  // Created:     04/01/98
446 -// RCS-ID:      $Id: tbar95.cpp,v 1.153 2005/05/27 09:14:58 JS Exp $
447 +// RCS-ID:      $Id: tbar95.cpp,v 1.156 2005/06/09 20:18:24 VZ Exp $
448  // Copyright:   (c) Julian Smart
449  // Licence:     wxWindows licence
450  /////////////////////////////////////////////////////////////////////////////
451 @@ -93,9 +93,6 @@
452  // these values correspond to those used by comctl32.dll
453  #define DEFAULTBITMAPX   16
454  #define DEFAULTBITMAPY   15
455 -#define DEFAULTBUTTONX   24
456 -#define DEFAULTBUTTONY   24
457 -#define DEFAULTBARHEIGHT 27
458  
459  // ----------------------------------------------------------------------------
460  // wxWin macros
461 @@ -245,31 +242,20 @@
462      SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
463      SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
464  
465 -    // workaround for flat toolbar on Windows XP classic style
466 +    // workaround for flat toolbar on Windows XP classic style: we have to set
467 +    // the style after creating the control, doing it at creation time doesn't
468 +    // work
469  #if wxUSE_UXTHEME
470      if ( style & wxTB_FLAT )
471      {
472 -        // Testing for an active theme appears to be unnecessary (see comments in patch 1204217).
473 -        // Disabling the test brings back separator lines.
474 -        // However, the separators can look ugly and distracting, especially between controls,
475 -        // so I'm restoring the test and removing the separators again - JACS
476 -#if 1
477 -        wxUxThemeEngine *p = wxUxThemeEngine::Get();
478 -        if ( !p || !p->IsThemeActive() )
479 -#endif            
480 -        {
481 -            DWORD dwToolbarStyle;
482 -
483 -            dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L );
484 +        LRESULT style = ::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L);
485  
486 -            if ((dwToolbarStyle & TBSTYLE_FLAT) == 0)
487 -            {
488 -                dwToolbarStyle |= TBSTYLE_FLAT;
489 -                ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle );
490 -            }
491 +        if ( !(style & TBSTYLE_FLAT) )
492 +        {
493 +            ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, style | TBSTYLE_FLAT);
494          }
495      }
496 -#endif
497 +#endif // wxUSE_UXTHEME
498  
499      return true;
500  }
501 @@ -897,7 +883,7 @@
502                                  wxToolBarToolBase *tool = nodePrev->GetData();
503                                  if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO )
504                                      break;
505 -                                
506 +
507                                  if ( tool->Toggle(false) )
508                                  {
509                                      DoToggleTool(tool, false);
510 @@ -905,7 +891,7 @@
511                                  prevButton.fsState = TBSTATE_ENABLED;
512                                  nodePrev = nodePrev->GetPrevious();
513                                  prevIndex--;
514 -                            }                            
515 +                            }
516                          }
517  
518                          isRadio = true;
519 @@ -1249,14 +1235,15 @@
520          return (wxToolBarToolBase *)NULL;
521      }
522  
523 -    // if comctl32 version < 4.71 wxToolBar95 adds dummy spacers
524 -#if defined(_WIN32_IE) && (_WIN32_IE >= 0x400 )
525 +    // when TB_SETBUTTONINFO is available (both during compile- and run-time),
526 +    // we don't use the dummy separators hack
527 +#ifdef TB_SETBUTTONINFO
528      if ( wxApp::GetComCtl32Version() >= 471 )
529      {
530          return m_tools.Item((size_t)index)->GetData();
531      }
532      else
533 -#endif
534 +#endif // TB_SETBUTTONINFO
535      {
536          return GetItemSkippingDummySpacers( m_tools, (size_t) index );
537      }
538 diff -Naur wxwidgets-orig/src/msw/window.cpp wxwidgets/src/msw/window.cpp
539 --- wxwidgets-orig/src/msw/window.cpp   2005-05-31 20:49:58.000000000 +0000
540 +++ wxwidgets/src/msw/window.cpp        2005-08-24 16:47:00.000000000 +0000
541 @@ -4,7 +4,7 @@
542  // Author:      Julian Smart
543  // Modified by: VZ on 13.05.99: no more Default(), MSWOnXXX() reorganisation
544  // Created:     04/01/98
545 -// RCS-ID:      $Id: window.cpp,v 1.619 2005/05/31 09:20:34 JS Exp $
546 +// RCS-ID:      $Id: window.cpp,v 1.622 2005/06/21 16:06:45 JS Exp $
547  // Copyright:   (c) Julian Smart
548  // Licence:     wxWindows licence
549  /////////////////////////////////////////////////////////////////////////////
550 @@ -2353,6 +2353,7 @@
551              break;
552  #endif // !__WXWINCE__
553  
554 +#if !(defined(_WIN32_WCE) && _WIN32_WCE < 400)
555          case WM_WINDOWPOSCHANGED:
556              {
557                  WINDOWPOS *lpPos = (WINDOWPOS *)lParam;
558 @@ -2365,19 +2366,15 @@
559                      AutoHRGN hrgnClient(::CreateRectRgnIndirect(&rc));
560                      AutoHRGN hrgnNew(::CreateRectRgn(lpPos->x,  lpPos->y,
561                                                       lpPos->cx, lpPos->cy));
562 -                    AutoHRGN hrgn(::CreateRectRgn(0, 0, 0, 0));
563  
564                      // we need to invalidate any new exposed areas here
565                      // to force them to repaint
566 -                    if ( ::CombineRgn(hrgn, hrgnNew, hrgnClient, RGN_DIFF) != NULLREGION )
567 -                        ::InvalidateRgn(GetHwnd(), hrgn, TRUE);
568 -                    if ( ::CombineRgn(hrgn, hrgnClient, hrgnNew, RGN_DIFF) != NULLREGION )
569 -                        ::InvalidateRgn(GetHwnd(), hrgn, TRUE);
570 -
571 +                    if ( ::CombineRgn(hrgnNew, hrgnNew, hrgnClient, RGN_DIFF) != NULLREGION )
572 +                        ::InvalidateRgn(GetHwnd(), hrgnNew, TRUE);
573                  }
574              }
575              break;
576 -
577 +#endif
578  #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
579          case WM_ACTIVATEAPP:
580              // This implicitly sends a wxEVT_ACTIVATE_APP event
581 @@ -4150,6 +4147,11 @@
582      if ( IsTopLevel() || InheritsBackgroundColour() )
583          return false;
584  
585 +    // sometimes we don't want the parent to handle it at all, instead
586 +    // return whatever value this window wants
587 +    if ( !MSWShouldPropagatePrintChild() )
588 +        return MSWPrintChild(hDC, (wxWindow *)this);
589 +
590      for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
591      {
592          if ( win->MSWPrintChild(hDC, (wxWindow *)this) )