📄 wxmsw-win32.patch
字号:
@@ -4,7 +4,7 @@ // Author: Julian Smart // Modified by: // Created: 16/04/2000-// RCS-ID: $Id: helpchm.cpp,v 1.23 2005/05/24 08:53:32 CE Exp $+// RCS-ID: $Id: helpchm.cpp,v 1.24 2005/06/20 14:02:35 JS Exp $ // Copyright: (c) Julian Smart // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////@@ -243,7 +243,6 @@ wxCHMHelpController::~wxCHMHelpController() {- gs_htmlHelp(GetSuitableHWND(), 0, HH_CLOSE_ALL, 0L); UnloadHtmlHelpLibrary(); } diff -Naur wxwidgets-orig/src/msw/notebook.cpp wxwidgets/src/msw/notebook.cpp--- wxwidgets-orig/src/msw/notebook.cpp 2005-05-31 20:49:55.000000000 +0000+++ wxwidgets/src/msw/notebook.cpp 2005-08-24 16:47:00.000000000 +0000@@ -4,7 +4,7 @@ // Author: Vadim Zeitlin // Modified by: // Created: 11.06.98-// RCS-ID: $Id: notebook.cpp,v 1.155 2005/05/30 11:23:27 JS Exp $+// RCS-ID: $Id: notebook.cpp,v 1.158 2005/06/19 19:11:11 JS Exp $ // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////////@@ -93,6 +93,14 @@ // the pointer to standard spin button wnd proc static WXFARPROC gs_wndprocNotebookSpinBtn = (WXFARPROC)NULL; +// the pointer to standard tab control wnd proc+static WXFARPROC gs_wndprocNotebook = (WXFARPROC)NULL; ++LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,+ UINT message,+ WPARAM wParam,+ LPARAM lParam);+ #endif // USE_NOTEBOOK_ANTIFLICKER // ----------------------------------------------------------------------------@@ -285,6 +293,7 @@ LPCTSTR className = WC_TABCONTROL; +#if USE_NOTEBOOK_ANTIFLICKER // SysTabCtl32 class has natively CS_HREDRAW and CS_VREDRAW enabled and it // causes horrible flicker when resizing notebook, so get rid of it by // using a class without these styles (but otherwise identical to it)@@ -296,11 +305,14 @@ // get a copy of standard class and modify it WNDCLASS wc; - if ( ::GetClassInfo(::GetModuleHandle(NULL), WC_TABCONTROL, &wc) )+ if ( ::GetClassInfo(NULL, WC_TABCONTROL, &wc) ) {+ gs_wndprocNotebook =+ wx_reinterpret_cast(WXFARPROC, wc.lpfnWndProc); wc.lpszClassName = wxT("_wx_SysTabCtl32"); wc.style &= ~(CS_HREDRAW | CS_VREDRAW);-+ wc.hInstance = wxGetInstance();+ wc.lpfnWndProc = wxNotebookWndProc; s_clsNotebook.Register(wc); } else@@ -318,6 +330,7 @@ className = s_clsNotebook.GetName().c_str(); } }+#endif // USE_NOTEBOOK_ANTIFLICKER if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL, wxDefaultValidator, name) )@@ -789,6 +802,16 @@ hwnd, message, wParam, lParam); } +LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,+ UINT message,+ WPARAM wParam,+ LPARAM lParam)+{+ return ::CallWindowProc(CASTWNDPROC gs_wndprocNotebook,+ hwnd, message, wParam, lParam);+}++ void wxNotebook::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) {@@ -918,7 +941,7 @@ RefreshRect(wxRect(0, rc.top, rc.left, height), false); RefreshRect(wxRect(0, rc.bottom, widthNbook, heightNbook - rc.bottom), false);- RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.bottom, height),+ RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.right, height), false); } @@ -967,7 +990,7 @@ { wxNotebookPage *pPage = m_pages[sel]; pPage->Show(true);- + // As per bug report: // http://sourceforge.net/tracker/index.php?func=detail&aid=1150659&group_id=9863&atid=109863, // we should not set the page focus (and thereby the focus for@@ -1102,17 +1125,17 @@ if ( child ) ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2); -- // apparently DrawThemeBackground() modifies the rect passed to it and if we- // don't do these adjustments, there are some drawing artifacts which are- // only visible with some non default themes; so modify the rect here using- // the magic numbers below so that it still paints the correct area- rc.left -= 2;- rc.top -= 2;- rc.right += 4;- rc.bottom += 5;--+ // we have the content area (page size), but we need to draw all of the+ // background for it to be aligned correctly+ wxUxThemeEngine::Get()->GetThemeBackgroundExtent+ (+ theme,+ (HDC) hDC,+ 9 /* TABP_PANE */,+ 0,+ &rc,+ &rc+ ); wxUxThemeEngine::Get()->DrawThemeBackground ( theme,diff -Naur wxwidgets-orig/src/msw/tbar95.cpp wxwidgets/src/msw/tbar95.cpp--- wxwidgets-orig/src/msw/tbar95.cpp 2005-05-31 20:49:56.000000000 +0000+++ wxwidgets/src/msw/tbar95.cpp 2005-08-24 16:47:00.000000000 +0000@@ -4,7 +4,7 @@ // Author: Julian Smart // Modified by: // Created: 04/01/98-// RCS-ID: $Id: tbar95.cpp,v 1.153 2005/05/27 09:14:58 JS Exp $+// RCS-ID: $Id: tbar95.cpp,v 1.156 2005/06/09 20:18:24 VZ Exp $ // Copyright: (c) Julian Smart // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////@@ -93,9 +93,6 @@ // these values correspond to those used by comctl32.dll #define DEFAULTBITMAPX 16 #define DEFAULTBITMAPY 15-#define DEFAULTBUTTONX 24-#define DEFAULTBUTTONY 24-#define DEFAULTBARHEIGHT 27 // ---------------------------------------------------------------------------- // wxWin macros@@ -245,31 +242,20 @@ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - // workaround for flat toolbar on Windows XP classic style+ // workaround for flat toolbar on Windows XP classic style: we have to set+ // the style after creating the control, doing it at creation time doesn't+ // work #if wxUSE_UXTHEME if ( style & wxTB_FLAT ) {- // Testing for an active theme appears to be unnecessary (see comments in patch 1204217).- // Disabling the test brings back separator lines.- // However, the separators can look ugly and distracting, especially between controls,- // so I'm restoring the test and removing the separators again - JACS-#if 1- wxUxThemeEngine *p = wxUxThemeEngine::Get();- if ( !p || !p->IsThemeActive() )-#endif - {- DWORD dwToolbarStyle;-- dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L );+ LRESULT style = ::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L); - if ((dwToolbarStyle & TBSTYLE_FLAT) == 0)- {- dwToolbarStyle |= TBSTYLE_FLAT;- ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle );- }+ if ( !(style & TBSTYLE_FLAT) )+ {+ ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, style | TBSTYLE_FLAT); } }-#endif+#endif // wxUSE_UXTHEME return true; }@@ -897,7 +883,7 @@ wxToolBarToolBase *tool = nodePrev->GetData(); if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO ) break;- + if ( tool->Toggle(false) ) { DoToggleTool(tool, false);@@ -905,7 +891,7 @@ prevButton.fsState = TBSTATE_ENABLED; nodePrev = nodePrev->GetPrevious(); prevIndex--;- } + } } isRadio = true;@@ -1249,14 +1235,15 @@ return (wxToolBarToolBase *)NULL; } - // if comctl32 version < 4.71 wxToolBar95 adds dummy spacers-#if defined(_WIN32_IE) && (_WIN32_IE >= 0x400 )+ // when TB_SETBUTTONINFO is available (both during compile- and run-time),+ // we don't use the dummy separators hack+#ifdef TB_SETBUTTONINFO if ( wxApp::GetComCtl32Version() >= 471 ) { return m_tools.Item((size_t)index)->GetData(); } else-#endif+#endif // TB_SETBUTTONINFO { return GetItemSkippingDummySpacers( m_tools, (size_t) index ); }diff -Naur wxwidgets-orig/src/msw/window.cpp wxwidgets/src/msw/window.cpp--- wxwidgets-orig/src/msw/window.cpp 2005-05-31 20:49:58.000000000 +0000+++ wxwidgets/src/msw/window.cpp 2005-08-24 16:47:00.000000000 +0000@@ -4,7 +4,7 @@ // Author: Julian Smart // Modified by: VZ on 13.05.99: no more Default(), MSWOnXXX() reorganisation // Created: 04/01/98-// RCS-ID: $Id: window.cpp,v 1.619 2005/05/31 09:20:34 JS Exp $+// RCS-ID: $Id: window.cpp,v 1.622 2005/06/21 16:06:45 JS Exp $ // Copyright: (c) Julian Smart // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////@@ -2353,6 +2353,7 @@ break; #endif // !__WXWINCE__ +#if !(defined(_WIN32_WCE) && _WIN32_WCE < 400) case WM_WINDOWPOSCHANGED: { WINDOWPOS *lpPos = (WINDOWPOS *)lParam;@@ -2365,19 +2366,15 @@ AutoHRGN hrgnClient(::CreateRectRgnIndirect(&rc)); AutoHRGN hrgnNew(::CreateRectRgn(lpPos->x, lpPos->y, lpPos->cx, lpPos->cy));- AutoHRGN hrgn(::CreateRectRgn(0, 0, 0, 0)); // we need to invalidate any new exposed areas here // to force them to repaint- if ( ::CombineRgn(hrgn, hrgnNew, hrgnClient, RGN_DIFF) != NULLREGION )- ::InvalidateRgn(GetHwnd(), hrgn, TRUE);- if ( ::CombineRgn(hrgn, hrgnClient, hrgnNew, RGN_DIFF) != NULLREGION )- ::InvalidateRgn(GetHwnd(), hrgn, TRUE);-+ if ( ::CombineRgn(hrgnNew, hrgnNew, hrgnClient, RGN_DIFF) != NULLREGION )+ ::InvalidateRgn(GetHwnd(), hrgnNew, TRUE); } } break;-+#endif #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) case WM_ACTIVATEAPP: // This implicitly sends a wxEVT_ACTIVATE_APP event@@ -4150,6 +4147,11 @@ if ( IsTopLevel() || InheritsBackgroundColour() ) return false; + // sometimes we don't want the parent to handle it at all, instead+ // return whatever value this window wants+ if ( !MSWShouldPropagatePrintChild() )+ return MSWPrintChild(hDC, (wxWindow *)this);+ for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) { if ( win->MSWPrintChild(hDC, (wxWindow *)this) )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -