[Python-checkins] cpython (merge 3.5 -> default): Merge with 3.5
steve.dower
python-checkins at python.org
Mon Jun 1 01:40:42 CEST 2015
https://hg.python.org/cpython/rev/1cc6cff1892c
changeset: 96436:1cc6cff1892c
parent: 96433:10f92b4d55ed
parent: 96435:5bc396eb4e56
user: Steve Dower <steve.dower at microsoft.com>
date: Sun May 31 16:40:12 2015 -0700
summary:
Merge with 3.5
files:
Tools/msi/bundle/Default.thm | 14 +-
Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp | 63 +++++++++-
Tools/msi/bundle/bundle.wxs | 4 +-
3 files changed, 67 insertions(+), 14 deletions(-)
diff --git a/Tools/msi/bundle/Default.thm b/Tools/msi/bundle/Default.thm
--- a/Tools/msi/bundle/Default.thm
+++ b/Tools/msi/bundle/Default.thm
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
- <Window Background="ffff00" Width="640" Height="382" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
- <Font Id="0" Height="-12" Weight="500">Segoe UI</Font>
- <Font Id="1" Height="-24" Weight="500">Segoe UI</Font>
- <Font Id="2" Height="-22" Weight="500" Foreground="666666">Segoe UI</Font>
- <Font Id="3" Height="-12" Weight="500">Segoe UI</Font>
- <Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Underline="yes">Segoe UI</Font>
- <Font Id="5" Height="-12" Weight="500" Foreground="666666">Segoe UI</Font>
+ <Window Width="640" Height="382" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
+ <Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
+ <Font Id="1" Height="-24" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
+ <Font Id="2" Height="-22" Weight="500" Foreground="808080" Background="ffffff">Segoe UI</Font>
+ <Font Id="3" Height="-12" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
+ <Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="ffffff" Underline="yes">Segoe UI</Font>
+ <Font Id="5" Height="-12" Weight="500" Foreground="808080" Background="ffffff">Segoe UI</Font>
<Page Name="Help">
<Text X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.HelpHeader)</Text>
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -89,6 +89,7 @@
ID_TARGETDIR_EDITBOX,
ID_CUSTOM_ASSOCIATE_FILES_CHECKBOX,
ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX,
+ ID_CUSTOM_COMPILE_ALL_CHECKBOX,
ID_CUSTOM_BROWSE_BUTTON,
ID_CUSTOM_BROWSE_BUTTON_LABEL,
ID_CUSTOM_INSTALL_BUTTON,
@@ -149,6 +150,7 @@
{ ID_TARGETDIR_EDITBOX, L"TargetDir" },
{ ID_CUSTOM_ASSOCIATE_FILES_CHECKBOX, L"AssociateFiles" },
{ ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX, L"InstallAllUsers" },
+ { ID_CUSTOM_COMPILE_ALL_CHECKBOX, L"CompileAll" },
{ ID_CUSTOM_BROWSE_BUTTON, L"CustomBrowseButton" },
{ ID_CUSTOM_BROWSE_BUTTON_LABEL, L"CustomBrowseButtonLabel" },
{ ID_CUSTOM_INSTALL_BUTTON, L"CustomInstallButton" },
@@ -372,6 +374,10 @@
checked = ThemeIsControlChecked(_theme, ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX);
ThemeControlElevates(_theme, ID_CUSTOM_INSTALL_BUTTON, checked && (FAILED(hr) || !elevated));
ThemeControlEnable(_theme, ID_CUSTOM_BROWSE_BUTTON_LABEL, !checked);
+ if (checked) {
+ _engine->SetVariableNumeric(L"CompileAll", 1);
+ ThemeSendControlMessage(_theme, ID_CUSTOM_COMPILE_ALL_CHECKBOX, BM_SETCHECK, BST_CHECKED, 0);
+ }
ThemeGetTextControl(_theme, ID_TARGETDIR_EDITBOX, &targetDir);
if (targetDir) {
// Check the current value against the default to see
@@ -1475,6 +1481,8 @@
POINT ptCursor = { };
HMONITOR hMonitor = nullptr;
MONITORINFO mi = { };
+ COLORREF fg, bg;
+ HBRUSH bgBrush;
// If the theme did not provide an icon, try using the icon from the bundle engine.
if (!hIcon) {
@@ -1484,12 +1492,23 @@
}
}
+ fg = RGB(0, 0, 0);
+ bg = RGB(255, 255, 255);
+ bgBrush = (HBRUSH)(COLOR_WINDOW+1);
+ if (_theme->dwFontId < _theme->cFonts) {
+ THEME_FONT *font = &_theme->rgFonts[_theme->dwFontId];
+ fg = font->crForeground;
+ bg = font->crBackground;
+ bgBrush = font->hBackground;
+ RemapColor(&fg, &bg, &bgBrush);
+ }
+
// Register the window class and create the window.
wc.lpfnWndProc = PythonBootstrapperApplication::WndProc;
wc.hInstance = _hModule;
wc.hIcon = hIcon;
wc.hCursor = ::LoadCursorW(nullptr, (LPCWSTR)IDC_ARROW);
- wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ wc.hbrBackground = bgBrush;
wc.lpszMenuName = nullptr;
wc.lpszClassName = PYBA_WINDOW_CLASS;
if (!::RegisterClassW(&wc)) {
@@ -1704,12 +1723,12 @@
}
break;
+ case WM_CTLCOLORSTATIC:
case WM_CTLCOLORBTN:
if (pBA) {
- HWND button = (HWND)lParam;
- DWORD style = GetWindowLong(button, GWL_STYLE) & BS_TYPEMASK;
- if (style == BS_COMMANDLINK || style == BS_DEFCOMMANDLINK) {
- return (LRESULT)pBA->_theme->rgFonts[pBA->_theme->dwFontId].hBackground;
+ HBRUSH brush = nullptr;
+ if (pBA->SetControlColor((HWND)lParam, (HDC)wParam, &brush)) {
+ return (LRESULT)brush;
}
}
break;
@@ -1782,6 +1801,40 @@
return SUCCEEDED(hr);
}
+ void RemapColor(COLORREF *fg, COLORREF *bg, HBRUSH *bgBrush) {
+ if (*fg == RGB(0, 0, 0)) {
+ *fg = GetSysColor(COLOR_WINDOWTEXT);
+ } else if (*fg == RGB(128, 128, 128)) {
+ *fg = GetSysColor(COLOR_GRAYTEXT);
+ }
+ if (*bgBrush && *bg == RGB(255, 255, 255)) {
+ *bg = GetSysColor(COLOR_WINDOW);
+ *bgBrush = GetSysColorBrush(COLOR_WINDOW);
+ }
+ }
+
+ BOOL SetControlColor(HWND hWnd, HDC hDC, HBRUSH *brush) {
+ for (int i = 0; i < _theme->cControls; ++i) {
+ if (_theme->rgControls[i].hWnd != hWnd) {
+ continue;
+ }
+
+ DWORD fontId = _theme->rgControls[i].dwFontId;
+ if (fontId > _theme->cFonts) {
+ fontId = 0;
+ }
+ THEME_FONT *fnt = &_theme->rgFonts[fontId];
+
+ COLORREF fg = fnt->crForeground, bg = fnt->crBackground;
+ *brush = fnt->hBackground;
+ RemapColor(&fg, &bg, brush);
+ SetTextColor(hDC, fg);
+ SetBkColor(hDC, bg);
+
+ return TRUE;
+ }
+ return FALSE;
+ }
//
// OnShowFailure - display the failure page.
diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs
--- a/Tools/msi/bundle/bundle.wxs
+++ b/Tools/msi/bundle/bundle.wxs
@@ -23,7 +23,7 @@
<Variable Name="ShortVersion" Value="$(var.MajorVersionNumber).$(var.MinorVersionNumber)" />
<Variable Name="ShortVersionNoDot" Value="$(var.MajorVersionNumber)$(var.MinorVersionNumber)" />
- <Variable Name="InstallAllUsers" Value="1" Persisted="yes" bal:Overridable="yes" />
+ <Variable Name="InstallAllUsers" Value="0" Persisted="yes" bal:Overridable="yes" />
<Variable Name="TargetDir" Value="" Persisted="yes" bal:Overridable="yes" />
<?if $(var.Platform)~="x64" ?>
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFiles64Folder]Python [ShortVersion]" bal:Overridable="yes" />
@@ -60,7 +60,7 @@
<Variable Name="AssociateFiles" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="Shortcuts" Value="1" Persisted="yes" bal:Overridable="yes" />
<Variable Name="PrependPath" Value="0" Persisted="yes" bal:Overridable="yes" />
- <Variable Name="CompileAll" Value="1" Persisted="yes" bal:Overridable="yes" />
+ <Variable Name="CompileAll" Value="0" Persisted="yes" bal:Overridable="yes" />
<Variable Name="SimpleInstall" Value="0" bal:Overridable="yes" />
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list