ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
288 discussions
Start a n
N
ew thread
[gadamopoulos] 74474: [BROWSEUI_APITEST] -Add tests for SHExplorerParseCmdLine for CORE-12882.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu May 4 15:15:45 2017 New Revision: 74474 URL:
http://svn.reactos.org/svn/reactos?rev=74474&view=rev
Log: [BROWSEUI_APITEST] -Add tests for SHExplorerParseCmdLine for CORE-12882. Modified: trunk/rostests/apitests/browseui/SHExplorerParseCmdLine.c Modified: trunk/rostests/apitests/browseui/SHExplorerParseCmdLine.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/browseui/SHExplo…
============================================================================== --- trunk/rostests/apitests/browseui/SHExplorerParseCmdLine.c [iso-8859-1] (original) +++ trunk/rostests/apitests/browseui/SHExplorerParseCmdLine.c [iso-8859-1] Thu May 4 15:15:45 2017 @@ -216,6 +216,9 @@ { __LINE__, L"c:\\Program Files\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" }, { __LINE__, L"c:\\Program Files/", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\Program Files/"}, { __LINE__, L"c:/Program Files/", TRUE, PIDL_IS_NULL, 0x02000000, L"c:/Program Files/"}, + { __LINE__, L"fonts", TRUE, PIDL_IS_NULL, 0x02000000, L"fonts" }, + { __LINE__, L"winsxs", TRUE, PIDL_IS_NULL, 0x02000000, L"winsxs" }, + { __LINE__, L"system32", TRUE, PIDL_IS_NULL, 0x02000000, L"system32" }, { __LINE__, TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000200, NULL, TEST_PATHW }, { __LINE__, L"\"c:\\\"\"program files\"", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\\"program files"}, { __LINE__, L"\"c:\\\"program files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
7 years, 7 months
1
0
0
0
[gadamopoulos] 74473: [SHELL32_APITEST] -Add some tests for SHParseDisplayName for CORE-12882.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu May 4 15:05:10 2017 New Revision: 74473 URL:
http://svn.reactos.org/svn/reactos?rev=74473&view=rev
Log: [SHELL32_APITEST] -Add some tests for SHParseDisplayName for CORE-12882. Modified: trunk/rostests/apitests/shell32/SHParseDisplayName.cpp Modified: trunk/rostests/apitests/shell32/SHParseDisplayName.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/shell32/SHParseD…
============================================================================== --- trunk/rostests/apitests/shell32/SHParseDisplayName.cpp [iso-8859-1] (original) +++ trunk/rostests/apitests/shell32/SHParseDisplayName.cpp [iso-8859-1] Thu May 4 15:05:10 2017 @@ -111,11 +111,13 @@ {__LINE__, L"c:\\Program Files\\", L"C:\\Program Files", 0, S_OK, 0}, /* Paths with . are valid for win+r dialog or address bar but not for ParseDisplayName */ {__LINE__, L"c:\\Program Files\\.", NULL, 0, E_INVALIDARG, 0}, - {__LINE__, L"c:\\Program Files\\..", NULL, 0, E_INVALIDARG, 0}, + {__LINE__, L"c:\\Program Files\\..", NULL, 0, E_INVALIDARG, 0}, /* This gives C:\ when entered in address bar */ {__LINE__, L".", NULL, 0, E_INVALIDARG, 0}, {__LINE__, L"..", NULL, 0, E_INVALIDARG, 0}, {__LINE__, L"C:\\.", NULL, 0, E_INVALIDARG, 0}, - {__LINE__, L"C:\\..", NULL, 0, E_INVALIDARG, 0} /* C:\.. in the addressbar gives my computer! */ + {__LINE__, L"fonts", NULL, 0, HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), 0}, /* These three work for ShellExecute */ + {__LINE__, L"winsxs", NULL, 0, HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), 0}, + {__LINE__, L"system32", NULL, 0, HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), 0} }; UINT get_host_os_flag()
7 years, 7 months
1
0
0
0
[hbelusca] 74472: [CONSOLE.CPL]: Spanish translation update by Javier Fernandez, thanks! CORE-13187 #resolve
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu May 4 14:21:41 2017 New Revision: 74472 URL:
http://svn.reactos.org/svn/reactos?rev=74472&view=rev
Log: [CONSOLE.CPL]: Spanish translation update by Javier Fernandez, thanks! CORE-13187 #resolve Modified: trunk/reactos/dll/cpl/console/lang/es-ES.rc Modified: trunk/reactos/dll/cpl/console/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/es-ES…
============================================================================== --- trunk/reactos/dll/cpl/console/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/lang/es-ES.rc [iso-8859-1] Thu May 4 14:21:41 2017 @@ -1,4 +1,4 @@ -/* Spanish translation by Javier Remacha 2007-12-01 */ +/* Spanish translation by Javier Remacha 2007-12-01, Javier Fernandez 2017-05-04 */ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL @@ -27,7 +27,7 @@ GROUPBOX "Editar Opciones", IDC_STATIC, 140, 90, 100, 70, BS_GROUPBOX | WS_CHILD | WS_VISIBLE | WS_GROUP AUTOCHECKBOX "Modo &Edición rápida", IDC_CHECK_QUICK_EDIT, 150, 100, 60, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP AUTOCHECKBOX "Modo &Insertar", IDC_CHECK_INSERT_MODE, 150, 120, 60, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP - GROUPBOX "Code Page", IDC_STATIC, 7, 170, 238, 31 + GROUPBOX "Código de página", IDC_STATIC, 7, 170, 238, 31 COMBOBOX IDL_CODEPAGE, 13, 181, 224, 58, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -42,11 +42,11 @@ LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 50, 86, LBS_SORT | LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_CBOX_FONTSIZE, 130, 20, 30, 86, CBS_SIMPLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP AUTORADIOBUTTON "pi&xels", IDC_RADIO_PIXEL_UNIT, 165, 17, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP - AUTORADIOBUTTON "&points", IDC_RADIO_POINT_UNIT, 165, 28, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP + AUTORADIOBUTTON "&puntos", IDC_RADIO_POINT_UNIT, 165, 28, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP LTEXT "&Fuente", IDC_STATIC, 10, 105, 35, 10 AUTOCHECKBOX "&Negrita", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Selected Font", IDC_GROUPBOX_FONT_NAME, 7, 156, 240, 50 + GROUPBOX "Fuente seleccionada", IDC_GROUPBOX_FONT_NAME, 7, 156, 240, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 12, 166, 104, 35, WS_EX_CLIENTEDGE LTEXT "Cada caracter es:", IDC_STATIC, 125, 166, 85, 10 LTEXT "anchura del pixel\naltura del pixel", IDC_STATIC, 138, 180, 100, 20 @@ -152,5 +152,5 @@ IDS_CPLDESCRIPTION "Configurar propiedades de la consola." IDS_APPLY_SHORTCUT_ALL "Modificar &atajo que comienza esta ventana" IDS_RASTERFONTS "Fuentes Raster" - IDS_GROUPBOX_FONT_NAME "Selected Font: " + IDS_GROUPBOX_FONT_NAME "Fuente seleccionada: " END
7 years, 7 months
1
0
0
0
[hbelusca] 74471: [CONSOLE.CPL]: Fix the console props color buttons (was broken by r74468). Noted by Katayama Hirofumi MZ, thanks! CORE-13186 #resolve
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu May 4 14:18:14 2017 New Revision: 74471 URL:
http://svn.reactos.org/svn/reactos?rev=74471&view=rev
Log: [CONSOLE.CPL]: Fix the console props color buttons (was broken by r74468). Noted by Katayama Hirofumi MZ, thanks! CORE-13186 #resolve Modified: trunk/reactos/dll/cpl/console/colors.c Modified: trunk/reactos/dll/cpl/console/colors.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/colors.c?r…
============================================================================== --- trunk/reactos/dll/cpl/console/colors.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/colors.c [iso-8859-1] Thu May 4 14:18:14 2017 @@ -130,7 +130,8 @@ case WM_COMMAND: { - if (HIWORD(wParam) == BN_CLICKED) + /* NOTE: both BN_CLICKED and STN_CLICKED == 0 */ + if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == STN_CLICKED) { switch (LOWORD(wParam)) { @@ -210,9 +211,49 @@ break; } } + + if (IDC_STATIC_COLOR1 <= LOWORD(wParam) && LOWORD(wParam) <= IDC_STATIC_COLOR16) + { + colorIndex = LOWORD(wParam) - IDC_STATIC_COLOR1; + + /* If the same static control was re-clicked, don't take it into account */ + if (colorIndex == ActiveStaticControl) + break; + + color = ConInfo->ColorTable[colorIndex]; + + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); + + if (IsDlgButtonChecked(hDlg, IDC_RADIO_SCREEN_TEXT)) + { + ConInfo->ScreenAttributes = MakeAttrib(colorIndex, BkgdAttribFromAttrib(ConInfo->ScreenAttributes)); + } + else if (IsDlgButtonChecked(hDlg, IDC_RADIO_SCREEN_BACKGROUND)) + { + ConInfo->ScreenAttributes = MakeAttrib(TextAttribFromAttrib(ConInfo->ScreenAttributes), colorIndex); + } + else if (IsDlgButtonChecked(hDlg, IDC_RADIO_POPUP_TEXT)) + { + ConInfo->PopupAttributes = MakeAttrib(colorIndex, BkgdAttribFromAttrib(ConInfo->PopupAttributes)); + } + else if (IsDlgButtonChecked(hDlg, IDC_RADIO_POPUP_BACKGROUND)) + { + ConInfo->PopupAttributes = MakeAttrib(TextAttribFromAttrib(ConInfo->PopupAttributes), colorIndex); + } + + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + ActiveStaticControl = colorIndex; + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hDlg), hDlg); + break; + } } - else - if (HIWORD(wParam) == EN_KILLFOCUS) + else if (HIWORD(wParam) == EN_KILLFOCUS) { switch (LOWORD(wParam)) { @@ -282,51 +323,6 @@ break; } } - } - else - if ( HIWORD(wParam) == STN_CLICKED && - IDC_STATIC_COLOR1 <= LOWORD(wParam) && LOWORD(wParam) <= IDC_STATIC_COLOR16 ) - { - colorIndex = LOWORD(wParam) - IDC_STATIC_COLOR1; - - if (colorIndex == ActiveStaticControl) - { - /* The same static control was re-clicked */ - break; - } - - color = ConInfo->ColorTable[colorIndex]; - - SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); - SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); - - /* Update global struct */ - if (IsDlgButtonChecked(hDlg, IDC_RADIO_SCREEN_TEXT)) - { - ConInfo->ScreenAttributes = MakeAttrib(colorIndex, BkgdAttribFromAttrib(ConInfo->ScreenAttributes)); - } - else if (IsDlgButtonChecked(hDlg, IDC_RADIO_SCREEN_BACKGROUND)) - { - ConInfo->ScreenAttributes = MakeAttrib(TextAttribFromAttrib(ConInfo->ScreenAttributes), colorIndex); - } - else if (IsDlgButtonChecked(hDlg, IDC_RADIO_POPUP_TEXT)) - { - ConInfo->PopupAttributes = MakeAttrib(colorIndex, BkgdAttribFromAttrib(ConInfo->PopupAttributes)); - } - else if (IsDlgButtonChecked(hDlg, IDC_RADIO_POPUP_BACKGROUND)) - { - ConInfo->PopupAttributes = MakeAttrib(TextAttribFromAttrib(ConInfo->PopupAttributes), colorIndex); - } - - InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - ActiveStaticControl = colorIndex; - InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - - PropSheet_Changed(GetParent(hDlg), hDlg); - break; } break;
7 years, 7 months
1
0
0
0
[tfaber] 74470: [RAPPS] - Display download URL in information panel. Patch by Alexander Shaposhnikov. CORE-12442 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Thu May 4 07:09:18 2017 New Revision: 74470 URL:
http://svn.reactos.org/svn/reactos?rev=74470&view=rev
Log: [RAPPS] - Display download URL in information panel. Patch by Alexander Shaposhnikov. CORE-12442 #resolve Modified: trunk/reactos/base/applications/rapps/available.cpp trunk/reactos/base/applications/rapps/lang/bg-BG.rc trunk/reactos/base/applications/rapps/lang/cs-CZ.rc trunk/reactos/base/applications/rapps/lang/de-DE.rc trunk/reactos/base/applications/rapps/lang/en-US.rc trunk/reactos/base/applications/rapps/lang/es-ES.rc trunk/reactos/base/applications/rapps/lang/fr-FR.rc trunk/reactos/base/applications/rapps/lang/he-IL.rc trunk/reactos/base/applications/rapps/lang/it-IT.rc trunk/reactos/base/applications/rapps/lang/ja-JP.rc trunk/reactos/base/applications/rapps/lang/no-NO.rc trunk/reactos/base/applications/rapps/lang/pl-PL.rc trunk/reactos/base/applications/rapps/lang/pt-BR.rc trunk/reactos/base/applications/rapps/lang/ro-RO.rc trunk/reactos/base/applications/rapps/lang/ru-RU.rc trunk/reactos/base/applications/rapps/lang/sk-SK.rc trunk/reactos/base/applications/rapps/lang/sq-AL.rc trunk/reactos/base/applications/rapps/lang/sv-SE.rc trunk/reactos/base/applications/rapps/lang/tr-TR.rc trunk/reactos/base/applications/rapps/lang/uk-UA.rc trunk/reactos/base/applications/rapps/lang/zh-CN.rc trunk/reactos/base/applications/rapps/lang/zh-TW.rc trunk/reactos/base/applications/rapps/resource.h Modified: trunk/reactos/base/applications/rapps/available.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/av…
============================================================================== --- trunk/reactos/base/applications/rapps/available.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/available.cpp [iso-8859-1] Thu May 4 07:09:18 2017 @@ -45,6 +45,7 @@ ADD_TEXT(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0); ADD_TEXT(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD, CFE_LINK); ADD_TEXT(IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD, 0); + ADD_TEXT(IDS_AINFO_URLDOWNLOAD, Info->szUrlDownload, CFE_BOLD, CFE_LINK); return TRUE; } Modified: trunk/reactos/base/applications/rapps/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -160,6 +160,7 @@ IDS_AINFO_SIZE "\nРазмеÑ: " IDS_AINFO_URLSITE "\nÐомаÑна ÑÑÑаниÑа: " IDS_AINFO_LICENSE "\nРазÑеÑиÑелно: " + IDS_AINFO_URLDOWNLOAD "\nÐзÑеглÑне: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/cs-CZ.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -161,6 +161,7 @@ IDS_AINFO_SIZE "\nVelikost: " IDS_AINFO_URLSITE "\nDomovská stránka: " IDS_AINFO_LICENSE "\nLicense: " + IDS_AINFO_URLDOWNLOAD "\nStaženÃ: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nGröÃe: " IDS_AINFO_URLSITE "\nHomepage: " IDS_AINFO_LICENSE "\nLizenz: " + IDS_AINFO_URLDOWNLOAD "\nHerunterladen: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nSize: " IDS_AINFO_URLSITE "\nHome Page: " IDS_AINFO_LICENSE "\nLicense: " + IDS_AINFO_URLDOWNLOAD "\nDownload: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -159,6 +159,7 @@ IDS_AINFO_SIZE "\nTamaño: " IDS_AINFO_URLSITE "\nPágina Web: " IDS_AINFO_LICENSE "\nLicencia: " + IDS_AINFO_URLDOWNLOAD "\nDescargar: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/fr-FR.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nTaille : " IDS_AINFO_URLSITE "\nSite internet : " IDS_AINFO_LICENSE "\nLicence : " + IDS_AINFO_URLDOWNLOAD "\nTélécharger : " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/he-IL.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -158,6 +158,7 @@ IDS_AINFO_SIZE "\n××××: " IDS_AINFO_URLSITE "\n××£ ××ת: " IDS_AINFO_LICENSE "\nר×ש×××: " + IDS_AINFO_URLDOWNLOAD "\n××ר×: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/it-IT.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nDimensione: " IDS_AINFO_URLSITE "\nHome Page: " IDS_AINFO_LICENSE "\nLicenza: " + IDS_AINFO_URLDOWNLOAD "\nScaricare: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nãµã¤ãº: " IDS_AINFO_URLSITE "\nãã¼ã ãã¼ã¸: " IDS_AINFO_LICENSE "\nã©ã¤ã»ã³ã¹: " + IDS_AINFO_URLDOWNLOAD "\nãã¦ã³ãã¼ã: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nStørrelse: " IDS_AINFO_URLSITE "\nHjemmeside: " IDS_AINFO_LICENSE "\nLisens: " + IDS_AINFO_URLDOWNLOAD "\nNedlasting: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -164,6 +164,7 @@ IDS_AINFO_SIZE "\nRozmiar: " IDS_AINFO_URLSITE "\nStrona: " IDS_AINFO_LICENSE "\nLicencja: " + IDS_AINFO_URLDOWNLOAD "\nPobieranie: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/pt-BR.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -158,6 +158,7 @@ IDS_AINFO_SIZE "\nTamanho: " IDS_AINFO_URLSITE "\nPágina: " IDS_AINFO_LICENSE "\nLicença: " + IDS_AINFO_URLDOWNLOAD "\nTransferir: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/ro-RO.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -162,6 +162,7 @@ IDS_AINFO_SIZE "\nDimensiune: " IDS_AINFO_URLSITE "\nPaginÄ web: " IDS_AINFO_LICENSE "\nLicenÈÄ: " + IDS_AINFO_URLDOWNLOAD "\nDescarca: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -156,6 +156,7 @@ IDS_AINFO_SIZE "\nРазмеÑ: " IDS_AINFO_URLSITE "\nÐомаÑнÑÑ ÑÑÑаниÑа: " IDS_AINFO_LICENSE "\nÐиÑензиÑ: " + IDS_AINFO_URLDOWNLOAD "\nÐагÑÑзиÑÑ: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -161,6 +161,7 @@ IDS_AINFO_SIZE "\nVeľkosť: " IDS_AINFO_URLSITE "\nDomovská stránka: " IDS_AINFO_LICENSE "\nLicencia: " + IDS_AINFO_URLDOWNLOAD "\nStiahnuť: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/sq-AL.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -160,6 +160,7 @@ IDS_AINFO_SIZE "\nMasa: " IDS_AINFO_URLSITE "\nHome Page: " IDS_AINFO_LICENSE "\nLicenca: " + IDS_AINFO_URLDOWNLOAD "\nShkarko: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/sv-SE.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -163,6 +163,7 @@ IDS_AINFO_SIZE "\nStorlek: " IDS_AINFO_URLSITE "\nHemsida: " IDS_AINFO_LICENSE "\nLicens: " + IDS_AINFO_URLDOWNLOAD "\nLadda ner: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/tr-TR.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -158,6 +158,7 @@ IDS_AINFO_SIZE "\nBüyüklüÄü: " IDS_AINFO_URLSITE "\nAna Sayfası: " IDS_AINFO_LICENSE "\nRuhsatı: " + IDS_AINFO_URLDOWNLOAD "\nÄ°ndir: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -164,6 +164,7 @@ IDS_AINFO_SIZE "\nРозмÑÑ: " IDS_AINFO_URLSITE "\nÐомаÑÐ½Ñ ÑÑоÑÑнка: " IDS_AINFO_LICENSE "\nÐÑÑензÑÑ: " + IDS_AINFO_URLDOWNLOAD "\nÐаванÑажиÑи: " END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/zh-CN.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -158,6 +158,7 @@ IDS_AINFO_SIZE "\n大å°ï¼" IDS_AINFO_URLSITE "\n主页ï¼" IDS_AINFO_LICENSE "\nåè®®ï¼" + IDS_AINFO_URLDOWNLOAD "\nä¸è½½:" END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/zh-TW.rc [iso-8859-1] Thu May 4 07:09:18 2017 @@ -158,6 +158,7 @@ IDS_AINFO_SIZE "\n大å°ï¼" IDS_AINFO_URLSITE "\n主é ï¼" IDS_AINFO_LICENSE "\nåè°ï¼" + IDS_AINFO_URLDOWNLOAD "\nä¸è¼:" END STRINGTABLE Modified: trunk/reactos/base/applications/rapps/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/re…
============================================================================== --- trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] Thu May 4 07:09:18 2017 @@ -143,6 +143,7 @@ #define IDS_AINFO_SIZE 352 #define IDS_AINFO_URLSITE 353 #define IDS_AINFO_LICENSE 354 +#define IDS_AINFO_URLDOWNLOAD 355 /* Names of categories */ #define IDS_CAT_AUDIO 700
7 years, 7 months
1
0
0
0
[hbelusca] 74469: [CONSOLE.CPL]: Rewrite the way we deal with console font samples in the console properties dialog: - Remove the font helper functions that were already moved into concfg/font.c in...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed May 3 23:56:35 2017 New Revision: 74469 URL:
http://svn.reactos.org/svn/reactos?rev=74469&view=rev
Log: [CONSOLE.CPL]: Rewrite the way we deal with console font samples in the console properties dialog: - Remove the font helper functions that were already moved into concfg/font.c in r74462, and use the latter instead. - Use a double list for listing the available font sizes for a given face: * a ListBox for raster fonts; * a ComboBox for TrueType fonts, allowing the user to specify a custom size. The raster ListBox is wrapped using the LIST_CTL structure so that we can use the bisection functions on it. - Allow the user to specify TrueType font size either in pixels or in points. Raster font sizes however are always in pixels. - Try to remember the nearest font size across different selected face changes. - Try to support custom-sized TrueType fonts (using the ComboBox's edit field). May need more improvements! - Retrieve the correct character cell height & width size in pixels when selecting a font (especially when it's a TrueType one). - We now support bold console fonts too, see CORE-13122 (thanks Katayama!). - Remove the commented-out "temporary code for future reference". - Use a global cached font "hCurrentFont" that gets initialized when the console properties applet is created, so that we now can have a correct font in the screen samples when one directly views e.g. the "Color" tab, without going first in the "Font" tab. This current font is of course updated whenever one changes the font settings. Tested with success on Windows 2003, Windows 7 and on ReactOS. CORE-13122 CORE-13182 #resolve Modified: trunk/reactos/dll/cpl/console/console.c trunk/reactos/dll/cpl/console/console.h trunk/reactos/dll/cpl/console/font.c trunk/reactos/dll/cpl/console/layout.c Modified: trunk/reactos/dll/cpl/console/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.c?…
============================================================================== --- trunk/reactos/dll/cpl/console/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/console.c [iso-8859-1] Wed May 3 23:56:35 2017 @@ -88,7 +88,7 @@ ApplyConsoleInfo(HWND hwndDlg) { static BOOL ConsoleInfoAlreadySaved = FALSE; - + /* * We already applied all the console properties (and saved if needed). * Nothing more needs to be done. @@ -210,6 +210,11 @@ InitDefaultConsoleInfo(ConInfo); } + /* Initialize the font support */ + hCurrentFont = CreateConsoleFont(ConInfo); + if (hCurrentFont == NULL) + DPRINT1("InitApplet: CreateConsoleFont failed\n"); + /* Initialize the property sheet structure */ ZeroMemory(&psh, sizeof(psh)); psh.dwSize = sizeof(psh); @@ -250,8 +255,14 @@ InitPropSheetPage(&psp[i++], IDD_PROPPAGELAYOUT , LayoutProc ); InitPropSheetPage(&psp[i++], IDD_PROPPAGECOLORS , ColorsProc ); + /* Display the property sheet */ Result = PropertySheetW(&psh); - + + /* First cleanup */ + if (hCurrentFont) DeleteObject(hCurrentFont); + hCurrentFont = NULL; + + /* Save the console settings */ if (SetConsoleInfo) { HANDLE hSection; @@ -286,9 +297,7 @@ UnmapViewOfFile(pSharedInfo); /* Signal to CONSRV that it can apply the new configuration */ - SendMessage(ConInfo->hWnd, - WM_SETCONSOLEINFO, - (WPARAM)hSection, 0); + SendMessageW(ConInfo->hWnd, WM_SETCONSOLEINFO, (WPARAM)hSection, 0); /* Close the section and return */ CloseHandle(hSection); @@ -299,7 +308,7 @@ /* Default settings saved when ConInfo->hWnd == NULL */ ConCfgWriteUserSettings(ConInfo, ConInfo->hWnd == NULL); } - + Quit: /* Cleanup */ HeapFree(GetProcessHeap(), 0, ConInfo); Modified: trunk/reactos/dll/cpl/console/console.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.h?…
============================================================================== --- trunk/reactos/dll/cpl/console/console.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/console.h [iso-8859-1] Wed May 3 23:56:35 2017 @@ -2,17 +2,20 @@ #define CONSOLE_H__ #include <stdio.h> +#include <stdlib.h> #include <wchar.h> #define WIN32_NO_STATUS #include <windef.h> #include <winbase.h> + +#include <wincon.h> #include <wingdi.h> #include <winnls.h> #include <winreg.h> + #include <winuser.h> -#include <wincon.h> #include <commctrl.h> #include <cpl.h> @@ -24,7 +27,7 @@ EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable)) /* Shared header with the GUI Terminal Front-End from consrv.dll */ -#include "settings.h" // in /winsrv/concfg/ +#include "concfg.h" // in /winsrv/concfg/ typedef enum _TEXT_TYPE { @@ -33,12 +36,22 @@ } TEXT_TYPE; /* Globals */ +extern HINSTANCE hApplet; extern PCONSOLE_STATE_INFO ConInfo; +extern HFONT hCurrentFont; VOID ApplyConsoleInfo(HWND hwndDlg); -BYTE CodePageToCharSet(UINT CodePage); -VOID PaintConsole(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo); -BOOL PaintText(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo, TEXT_TYPE TextMode); + +VOID +PaintConsole( + IN LPDRAWITEMSTRUCT drawItem, + IN PCONSOLE_STATE_INFO pConInfo); + +BOOL +PaintText( + IN LPDRAWITEMSTRUCT drawItem, + IN PCONSOLE_STATE_INFO pConInfo, + IN TEXT_TYPE TextMode); struct _LIST_CTL; Modified: trunk/reactos/dll/cpl/console/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/font.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/console/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/font.c [iso-8859-1] Wed May 3 23:56:35 2017 @@ -14,338 +14,499 @@ #include <debug.h> -// -// Some temporary code for future reference... -// -#if 0 /* - * This code comes from PuTTY + * Current active font, corresponding to the active console font, + * and used for painting the text samples. */ -{ - CHOOSEFONT cf; - LOGFONT lf; - HDC hdc; - FontSpec *fs = (FontSpec *)c->data; - - hdc = GetDC(0); - lf.lfHeight = -MulDiv(fs->height, - GetDeviceCaps(hdc, LOGPIXELSY), 72); - ReleaseDC(0, hdc); - lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0; - lf.lfItalic = lf.lfUnderline = lf.lfStrikeOut = 0; - lf.lfWeight = (fs->isbold ? FW_BOLD : 0); - lf.lfCharSet = fs->charset; - lf.lfOutPrecision = OUT_DEFAULT_PRECIS; - lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf.lfQuality = DEFAULT_QUALITY; - lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; - strncpy(lf.lfFaceName, fs->name, - sizeof(lf.lfFaceName) - 1); - lf.lfFaceName[sizeof(lf.lfFaceName) - 1] = '\0'; - - cf.lStructSize = sizeof(cf); - cf.hwndOwner = dp->hwnd; - cf.lpLogFont = &lf; - cf.Flags = (dp->fixed_pitch_fonts ? CF_FIXEDPITCHONLY : 0) | - CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS; - - if (ChooseFont(&cf)) { - fs = fontspec_new(lf.lfFaceName, (lf.lfWeight == FW_BOLD), - cf.iPointSize / 10, lf.lfCharSet); - dlg_fontsel_set(ctrl, dp, fs); - fontspec_free(fs); - - ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE); - } -} +HFONT hCurrentFont = NULL; + /* - * This code is from consrv. + * Standard font pixel/point heights for TrueType fonts */ -{ - if (!GetTextMetricsW(drawItem->hDC, &Metrics)) - { - DPRINT1("PaintText: GetTextMetrics failed\n"); - SelectObject(drawItem->hDC, OldFont); - DeleteObject(Font); - return; - } - GuiData->CharWidth = Metrics.tmMaxCharWidth; - GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; - - /* Measure real char width more precisely if possible */ - if (GetTextExtentPoint32W(drawItem->hDC, L"R", 1, &CharSize)) - GuiData->CharWidth = CharSize.cx; -} - -/* - * See also: Display_SetTypeFace in applications/fontview/display.c - */ -#endif - - -/* - * Font pixel heights for TrueType fonts - */ -static SHORT TrueTypePoints[] = -{ - // 8, 9, 10, 11, 12, 14, 16, 18, 20, - // 22, 24, 26, 28, 36, 48, 72 - 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 24, 28, 36, 72 +static const SHORT TrueTypePoints[] = +{ + 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 }; -#define CP_SHIFTJIS 932 // Japanese Shift-JIS -#define CP_HANGUL 949 // Korean Hangul -#define CP_GB2312 936 // Chinese Simplified (GB2312) -#define CP_BIG5 950 // Chinese Traditional (Big5) - -/* IsFarEastCP(CodePage) */ -#define IsCJKCodePage(CodePage) \ - ((CodePage) == CP_SHIFTJIS || (CodePage) == CP_HANGUL || \ - (CodePage) == CP_BIG5 || (CodePage) == CP_GB2312) - -/* Retrieves the character set associated with a given code page */ -BYTE CodePageToCharSet(UINT CodePage) -{ - CHARSETINFO CharInfo; - if (TranslateCharsetInfo((LPDWORD)CodePage, &CharInfo, TCI_SRCCODEPAGE)) - return CharInfo.ciCharset; +typedef struct _FONTSIZE_LIST_CTL +{ + LIST_CTL RasterSizeList; // ListBox for Raster font sizes; needs to handle bisection. + HWND hWndTTSizeList; // ComboBox for TrueType font sizes. + BOOL bIsTTSizeDirty; // TRUE or FALSE depending on whether we have edited the edit zone. + BOOL UseRasterOrTTList; // TRUE: Use the Raster size list; FALSE: Use the TrueType size list. + BOOL TTSizePixelUnit; // TRUE: Size in pixels (default); FALSE: Size in points. + LONG CurrentRasterSize; + LONG CurrentTTSize; // In whatever unit (pixels or points) currently selected. +} FONTSIZE_LIST_CTL, *PFONTSIZE_LIST_CTL; + +/* Used by FontTypeChange() only */ +static INT CurrentSelFont = LB_ERR; +static DWORD CurrentFontType = (DWORD)-1; // Invalid font type + + +// PLIST_GETCOUNT +static INT +RasterSizeList_GetCount( + IN PLIST_CTL ListCtl) +{ + return (INT)SendMessageW(ListCtl->hWndList, LB_GETCOUNT, 0, 0); +} + +// PLIST_GETDATA +static ULONG_PTR +RasterSizeList_GetData( + IN PLIST_CTL ListCtl, + IN INT Index) +{ + return (ULONG_PTR)SendMessageW(ListCtl->hWndList, LB_GETITEMDATA, (WPARAM)Index, 0); +} + + +INT +LogicalSizeToPointSize( + IN HDC hDC OPTIONAL, + IN UINT LogicalSize) +{ + INT PointSize; + HDC hOrgDC = hDC; + + if (!hDC) + hDC = GetDC(NULL); + + // LogicalSize = tm.tmHeight - tm.tmInternalLeading; + PointSize = MulDiv(LogicalSize, 72, GetDeviceCaps(hDC, LOGPIXELSY)); + + if (!hOrgDC) + ReleaseDC(NULL, hDC); + + return PointSize; +} + +INT +PointSizeToLogicalSize( + IN HDC hDC OPTIONAL, + IN INT PointSize) +{ + INT LogicalSize; + HDC hOrgDC = hDC; + + if (!hDC) + hDC = GetDC(NULL); + + LogicalSize = MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72); + + if (!hOrgDC) + ReleaseDC(NULL, hDC); + + return LogicalSize; +} + + +static VOID +FontSizeList_SelectFontSize( + IN PFONTSIZE_LIST_CTL SizeList, + IN ULONG FontSize) +{ + INT nSel; + WCHAR szFontSize[100]; + + // + // FIXME: Check whether FontSize == 0 + // (or in the case of raster font maybe, whether HIWORD(FontSize) == Height == 0) ?? + // + + /* Find and select the best font size in the list corresponding to the current size */ + if (SizeList->UseRasterOrTTList) + { + INT idx; + + /* Raster font size (in pixels) */ + SizeList->CurrentRasterSize = FontSize; + + nSel = BisectListSortedByValue(&SizeList->RasterSizeList, FontSize, NULL, FALSE); + idx = (INT)SendMessageW(SizeList->RasterSizeList.hWndList, LB_GETCOUNT, 0, 0); + if (nSel == LB_ERR) + { + /* Not found, select the first element of the list */ + nSel = 0; + } + else if (nSel >= idx) + { + /* + * We got an index beyond the end of the list (as per Bisect* functionality), + * so instead, select the last element of the list. + */ + nSel = idx-1; + } + SendMessageW(SizeList->RasterSizeList.hWndList, LB_SETCURSEL, (WPARAM)nSel, 0); + } else - return DEFAULT_CHARSET; + { + /* TrueType font size (in pixels or points) */ + SizeList->CurrentTTSize = FontSize; + + // _ultow(szFontSize, FontSize, 10); + StringCchPrintfW(szFontSize, ARRAYSIZE(szFontSize), L"%d", FontSize); + + /* Find the font size in the list, or add it both in the ComboBox list, sorted by size value (string), and its edit box */ + nSel = SendMessageW(SizeList->hWndTTSizeList, CB_FINDSTRINGEXACT, 0, (LPARAM)szFontSize); + if (nSel == CB_ERR) + { + nSel = (UINT)SendMessageW(SizeList->hWndTTSizeList, CB_ADDSTRING, -1, (LPARAM)szFontSize); + // ComboBox_SetText(...) + SetWindowTextW(SizeList->hWndTTSizeList, szFontSize); + SizeList->bIsTTSizeDirty = TRUE; + } + SendMessageW(SizeList->hWndTTSizeList, CB_SETCURSEL, (WPARAM)nSel, 0); + } +} + +static LONG +FontSizeList_GetSelectedFontSize( + IN PFONTSIZE_LIST_CTL SizeList) +{ + INT nSel; + LONG FontSize; + WCHAR szFontSize[100]; + + if (SizeList->UseRasterOrTTList) + { + /* Raster font size (in pixels) */ + + nSel = (INT)SendMessageW(SizeList->RasterSizeList.hWndList, LB_GETCURSEL, 0, 0); + if (nSel == LB_ERR) return 0; + + FontSize = (LONG)SizeList->RasterSizeList.GetData(&SizeList->RasterSizeList, nSel); + if (FontSize == LB_ERR) return 0; + + SizeList->CurrentRasterSize = FontSize; + } + else + { + /* TrueType font size (in pixels or points) */ + + if (!SizeList->bIsTTSizeDirty) + { + /* + * The user just selected an existing size, read the ComboBox selection. + * + * See:
https://support.microsoft.com/en-us/help/66365/how-to-process-a-cbn-selchan…
+ * for more details. + */ + nSel = SendMessageW(SizeList->hWndTTSizeList, CB_GETCURSEL, 0, 0); + SendMessageW(SizeList->hWndTTSizeList, CB_GETLBTEXT, nSel, (LPARAM)szFontSize); + } + else + { + /* Read the ComboBox edit string, as the user has entered a custom size */ + // ComboBox_GetText(...) + GetWindowTextW(SizeList->hWndTTSizeList, szFontSize, ARRAYSIZE(szFontSize)); + + // HACK??? + nSel = SendMessageW(SizeList->hWndTTSizeList, CB_FINDSTRINGEXACT, 0, (LPARAM)szFontSize); + if (nSel == CB_ERR) + { + nSel = (UINT)SendMessageW(SizeList->hWndTTSizeList, CB_ADDSTRING, -1, (LPARAM)szFontSize); + //// ComboBox_SetText(...) + //SetWindowTextW(SizeList->hWndTTSizeList, szFontSize); + //SizeList->bIsTTSizeDirty = TRUE; + } + SendMessageW(SizeList->hWndTTSizeList, CB_SETCURSEL, (WPARAM)nSel, 0); + } + + SizeList->bIsTTSizeDirty = FALSE; + + /* If _wtol fails and returns 0, the font size is considered invalid */ + // FontSize = wcstoul(szFontSize, &pszNext, 10); if (!*pszNext) { /* Error */ } + FontSize = _wtol(szFontSize); + if (FontSize == 0) return 0; + + SizeList->CurrentTTSize = FontSize; + + /* + * If the font size is given in points, instead of pixels, + * convert it into logical size. + */ + if (!SizeList->TTSizePixelUnit) + FontSize = -PointSizeToLogicalSize(NULL, FontSize); + } + + return FontSize; } static VOID AddFontToList( IN HWND hWndList, - IN LPCWSTR pszFontName, + IN LPCWSTR pszFaceName, IN DWORD FontType) { - INT idx; + INT iItem; /* Make sure the font doesn't already exist in the list */ - if (SendMessageW(hWndList, LB_FINDSTRINGEXACT, 0, (LPARAM)pszFontName) != LB_ERR) + if (SendMessageW(hWndList, LB_FINDSTRINGEXACT, 0, (LPARAM)pszFaceName) != LB_ERR) return; /* Add the font */ - idx = (INT)SendMessageW(hWndList, LB_ADDSTRING, 0, (LPARAM)pszFontName); - if (idx == LB_ERR) - { - DPRINT1("Failed to add font '%S'\n", pszFontName); + iItem = (INT)SendMessageW(hWndList, LB_ADDSTRING, 0, (LPARAM)pszFaceName); + if (iItem == LB_ERR) + { + DPRINT1("Failed to add font '%S'\n", pszFaceName); return; } - DPRINT1("Add font '%S'\n", pszFontName); + DPRINT1("Add font '%S'\n", pszFaceName); /* Store this information in the list-item's userdata area */ - // SendMessageW(hWndList, LB_SETITEMDATA, idx, MAKEWPARAM(fFixed, fTrueType)); - SendMessageW(hWndList, LB_SETITEMDATA, idx, (WPARAM)FontType); -} + // SendMessageW(hWndList, LB_SETITEMDATA, idx, MAKELPARAM(fFixed, fTrueType)); + SendMessageW(hWndList, LB_SETITEMDATA, iItem, (LPARAM)FontType); +} + +typedef struct _FACE_NAMES_PROC_PARAM +{ + HWND hWndList; + UINT CodePage; +} FACE_NAMES_PROC_PARAM, *PFACE_NAMES_PROC_PARAM; static BOOL CALLBACK -EnumFontNamesProc(PLOGFONTW lplf, - PNEWTEXTMETRICW lpntm, - DWORD FontType, - LPARAM lParam) -{ - HWND hwndCombo = (HWND)lParam; - LPWSTR pszName = lplf->lfFaceName; - - /* Record the font's attributes (Fixedwidth and Truetype) */ - // BOOL fFixed = ((lplf->lfPitchAndFamily & 0x03) == FIXED_PITCH); - // BOOL fTrueType = (lplf->lfOutPrecision == OUT_STROKE_PRECIS); +EnumFaceNamesProc( + IN PLOGFONTW lplf, + IN PNEWTEXTMETRICW lpntm, + IN DWORD FontType, + IN LPARAM lParam) +{ + PFACE_NAMES_PROC_PARAM Param = (PFACE_NAMES_PROC_PARAM)lParam; /* - * According to:
http://support.microsoft.com/kb/247815
- * the criteria for console-eligible fonts are: - * - The font must be a fixed-pitch font. - * - The font cannot be an italic font. - * - The font cannot have a negative A or C space. - * - If it is a TrueType font, it must be FF_MODERN. - * - If it is not a TrueType font, it must be OEM_CHARSET. - * - * Non documented: vertical fonts are forbidden (their name start with a '@'). - * - * Additional criteria for Asian installations: - * - If it is not a TrueType font, the face name must be "Terminal". - * - If it is an Asian TrueType font, it must also be an Asian character set. - * * To install additional TrueType fonts to be available for the console, * add entries of type REG_SZ named "0", "00" etc... in: * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont * The names of the fonts listed there should match those in: * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts */ - - /* - * In ReactOS we relax some of the criteria: - * - We allow fixed-pitch FF_MODERN (Monospace) TrueType fonts - * that can be italic or have negative A or C space. - * - If it is not a TrueType font, it can be from another character set - * than OEM_CHARSET. - * - We do not look into the magic registry key mentioned above. - */ - - /* Reject variable width fonts */ - if (((lplf->lfPitchAndFamily & 0x03) != FIXED_PITCH) -#if 0 /* Reject italic and TrueType fonts with negative A or C space */ - || (lplf->lfItalic) - || !(lpntm->ntmFlags & NTM_NONNEGATIVE_AC) -#endif - ) - { - DPRINT1("Font '%S' rejected because it%s (lfPitchAndFamily = %d).\n", - pszName, !(lplf->lfPitchAndFamily & FIXED_PITCH) ? "'s not FIXED_PITCH" - : (!(lpntm->ntmFlags & NTM_NONNEGATIVE_AC) ? " has negative A or C space" - : " is broken"), - lplf->lfPitchAndFamily); + if (IsValidConsoleFont2(lplf, lpntm, FontType, Param->CodePage)) + { + /* Add the font to the list */ + AddFontToList(Param->hWndList, lplf->lfFaceName, FontType); + } + + /* Continue the font enumeration */ + return TRUE; +} + +static BOOL CALLBACK +EnumFontSizesProc( + IN PLOGFONTW lplf, + IN PNEWTEXTMETRICW lpntm, + IN DWORD FontType, + IN LPARAM lParam) +{ + PFONTSIZE_LIST_CTL SizeList = (PFONTSIZE_LIST_CTL)lParam; + UINT iItem, iDupItem; + WCHAR szFontSize[100]; + + if (FontType != TRUETYPE_FONTTYPE) + { + WPARAM FontSize; + + /* + * Format: + * Width = FontSize.X = LOWORD(FontSize); + * Height = FontSize.Y = HIWORD(FontSize); + */ + + StringCchPrintfW(szFontSize, ARRAYSIZE(szFontSize), L"%d x %d", lplf->lfWidth, lplf->lfHeight); + FontSize = MAKEWPARAM(lplf->lfWidth, lplf->lfHeight); + + /* Add the font size into the list, sorted by size value. Avoid any duplicates. */ + /* Store this information in the list-item's userdata area */ + iDupItem = LB_ERR; + iItem = BisectListSortedByValue(&SizeList->RasterSizeList, FontSize, &iDupItem, TRUE); + if (iItem == LB_ERR) + iItem = 0; + if (iDupItem == LB_ERR) + { + iItem = (UINT)SendMessageW(SizeList->RasterSizeList.hWndList, LB_INSERTSTRING, iItem, (LPARAM)szFontSize); + if (iItem != LB_ERR && iItem != LB_ERRSPACE) + iItem = SendMessageW(SizeList->RasterSizeList.hWndList, LB_SETITEMDATA, iItem, FontSize); + } + return TRUE; } - - /* Reject TrueType fonts that are not FF_MODERN */ - if ((FontType == TRUETYPE_FONTTYPE) && ((lplf->lfPitchAndFamily & 0xF0) != FF_MODERN)) - { - DPRINT1("TrueType font '%S' rejected because it's not FF_MODERN (lfPitchAndFamily = %d)\n", - pszName, lplf->lfPitchAndFamily); - return TRUE; - } - - /* Is the current code page Chinese, Japanese or Korean? */ - if (IsCJKCodePage(ConInfo->CodePage)) - { - /* It's Asian */ - if (FontType == TRUETYPE_FONTTYPE) - { - if (lplf->lfCharSet != CodePageToCharSet(ConInfo->CodePage)) - { - DPRINT1("TrueType font '%S' rejected because it's not user Asian charset (lfCharSet = %d)\n", - pszName, lplf->lfCharSet); - return TRUE; - } - } - else - { - /* Reject non-TrueType fonts that are not Terminal */ - if (wcscmp(pszName, L"Terminal") != 0) - { - DPRINT1("Non-TrueType font '%S' rejected because it's not Terminal\n", pszName); - return TRUE; - } - } - } else { - /* Not CJK */ - if ((FontType != TRUETYPE_FONTTYPE) && - (lplf->lfCharSet != ANSI_CHARSET) && - (lplf->lfCharSet != DEFAULT_CHARSET) && - (lplf->lfCharSet != OEM_CHARSET)) - { - DPRINT1("Non-TrueType font '%S' rejected because it's not ANSI_CHARSET or DEFAULT_CHARSET or OEM_CHARSET (lfCharSet = %d)\n", - pszName, lplf->lfCharSet); - return TRUE; - } - } - - /* Reject fonts that are vertical (tategaki) */ - if (pszName[0] == L'@') - { - DPRINT1("Font '%S' rejected because it's vertical\n", pszName); - return TRUE; - } - - /* Add the font to the list */ - AddFontToList(hwndCombo, pszName, /* MAKEWPARAM(fFixed, fTrueType) */ FontType); - - return TRUE; -} - -static BOOL CALLBACK -EnumFontSizesProc(PLOGFONTW lplf, - PNEWTEXTMETRICW lpntm, - DWORD FontType, - LPARAM lParam) -{ - HWND hwndCombo = (HWND)lParam; - WCHAR FontSize[100]; - - if (FontType != TRUETYPE_FONTTYPE) - { - // int logsize = lpntm->tmHeight - lpntm->tmInternalLeading; - // LONG pointsize = MulDiv(logsize, 72, GetDeviceCaps(hdc, LOGPIXELSY)); - - // swprintf(FontSize, L"%2d (%d x %d)", pointsize, lplf->lfWidth, lplf->lfHeight); - swprintf(FontSize, L"%d x %d", lplf->lfWidth, lplf->lfHeight); - - /* Make sure the size doesn't already exist in the list */ - if (SendMessageW(hwndCombo, LB_FINDSTRINGEXACT, 0, (LPARAM)FontSize) == LB_ERR) - { - /* Add the size */ - INT idx = (INT)SendMessageW(hwndCombo, LB_ADDSTRING, 0, (LPARAM)FontSize); - - /* - * Store this information in the list-item's userdata area. - * Format: - * Width = FontSize.X = LOWORD(FontSize); - * Height = FontSize.Y = HIWORD(FontSize); - */ - SendMessageW(hwndCombo, LB_SETITEMDATA, idx, MAKEWPARAM(lplf->lfWidth, lplf->lfHeight)); - } - - return TRUE; - } - else - { + /* TrueType or vectored font: list all the hardcoded font points */ ULONG i; for (i = 0; i < ARRAYSIZE(TrueTypePoints); ++i) { - swprintf(FontSize, L"%2d", TrueTypePoints[i]); - - /* Make sure the size doesn't already exist in the list */ - if (SendMessageW(hwndCombo, LB_FINDSTRINGEXACT, 0, (LPARAM)FontSize) == LB_ERR) - { - /* Add the size */ - INT idx = (INT)SendMessageW(hwndCombo, LB_ADDSTRING, 0, (LPARAM)FontSize); - - /* - * Store this information in the list-item's userdata area. - * Format: - * Width = FontSize.X = LOWORD(FontSize); - * Height = FontSize.Y = HIWORD(FontSize); - */ - SendMessageW(hwndCombo, LB_SETITEMDATA, idx, MAKEWPARAM(0, TrueTypePoints[i])); - } - } - + // _ultow(szFontSize, TrueTypePoints[i], 10); + StringCchPrintfW(szFontSize, ARRAYSIZE(szFontSize), L"%d", TrueTypePoints[i]); + + /* Add the font size into the list, sorted by size value (string). Avoid any duplicates. */ + if (SendMessageW(SizeList->hWndTTSizeList, CB_FINDSTRINGEXACT, 0, (LPARAM)szFontSize) == CB_ERR) + iItem = (UINT)SendMessageW(SizeList->hWndTTSizeList, CB_INSERTSTRING, -1, (LPARAM)szFontSize); + } + + /* Stop the enumeration now */ return FALSE; } } - static VOID -FontSizeChange(HWND hwndDlg, - PCONSOLE_STATE_INFO pConInfo); - -static VOID -FontTypeChange(HWND hwndDlg, - PCONSOLE_STATE_INFO pConInfo) -{ - HWND hListBox = GetDlgItem(hwndDlg, IDC_LBOX_FONTTYPE); - INT Length, nSel; - LPWSTR FaceName; +FaceNameList_Initialize( + IN HWND hWndList, + IN UINT CodePage) +{ + FACE_NAMES_PROC_PARAM Param; HDC hDC; LOGFONTW lf; + INT idx; + + Param.hWndList = hWndList; + Param.CodePage = CodePage; + + ZeroMemory(&lf, sizeof(lf)); + lf.lfCharSet = DEFAULT_CHARSET; // CodePageToCharSet(CodePage); + // lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; + + hDC = GetDC(NULL); + EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)EnumFaceNamesProc, (LPARAM)&Param, 0); + ReleaseDC(NULL, hDC); + + idx = (INT)SendMessageW(hWndList, LB_GETCOUNT, 0, 0); + if (idx != LB_ERR && idx != 0) + { + /* We have found some fonts and filled the list, we are fine! */ + return; + } + + /* No fonts were found. Manually add default ones into the list. */ + DPRINT1("The ideal console fonts were not found; manually add default ones.\n"); + + AddFontToList(hWndList, L"Terminal", RASTER_FONTTYPE); + AddFontToList(hWndList, L"Lucida Console", TRUETYPE_FONTTYPE); + if (CodePageToCharSet(CodePage) != DEFAULT_CHARSET) + AddFontToList(hWndList, L"Droid Sans Fallback", TRUETYPE_FONTTYPE); +} + +static VOID +FaceNameList_SelectFaceName( + IN HWND hWndList, + IN LPCWSTR FaceName) +{ + INT iItem; + + iItem = (INT)SendMessageW(hWndList, LB_FINDSTRINGEXACT, 0, (LPARAM)FaceName); + if (iItem == LB_ERR) + iItem = (INT)SendMessageW(hWndList, LB_FINDSTRINGEXACT, 0, (LPARAM)L"Terminal"); + if (iItem == LB_ERR) + iItem = 0; + SendMessageW(hWndList, LB_SETCURSEL, (WPARAM)iItem, 0); + + // return iItem; +} + +static VOID +UpdateFontSizeList( + IN HWND hDlg, + IN PFONTSIZE_LIST_CTL SizeList) +{ + HWND hDlgItem; + + if (SizeList->UseRasterOrTTList) + { + /* + * Raster font: show the Raster size list, and + * hide the TrueType size list and the units. + */ + + // EnableDlgItem(hDlg, IDC_CHECK_BOLD_FONTS, FALSE); + + hDlgItem = GetDlgItem(hDlg, IDC_RADIO_PIXEL_UNIT); + ShowWindow(hDlgItem, SW_HIDE); + EnableWindow(hDlgItem, FALSE); + + hDlgItem = GetDlgItem(hDlg, IDC_RADIO_POINT_UNIT); + ShowWindow(hDlgItem, SW_HIDE); + EnableWindow(hDlgItem, FALSE); + + hDlgItem = SizeList->hWndTTSizeList; + ShowWindow(hDlgItem, SW_HIDE); + EnableWindow(hDlgItem, FALSE); + + hDlgItem = SizeList->RasterSizeList.hWndList; + EnableWindow(hDlgItem, TRUE); + ShowWindow(hDlgItem, SW_SHOW); + } + else + { + /* + * TrueType font: show the TrueType size list + * and the units, and hide the Raster size list. + */ + + // EnableDlgItem(hDlg, IDC_CHECK_BOLD_FONTS, TRUE); + + hDlgItem = SizeList->RasterSizeList.hWndList; + ShowWindow(hDlgItem, SW_HIDE); + EnableWindow(hDlgItem, FALSE); + + hDlgItem = SizeList->hWndTTSizeList; + EnableWindow(hDlgItem, TRUE); + ShowWindow(hDlgItem, SW_SHOW); + + hDlgItem = GetDlgItem(hDlg, IDC_RADIO_PIXEL_UNIT); + EnableWindow(hDlgItem, TRUE); + ShowWindow(hDlgItem, SW_SHOW); + + hDlgItem = GetDlgItem(hDlg, IDC_RADIO_POINT_UNIT); + EnableWindow(hDlgItem, TRUE); + ShowWindow(hDlgItem, SW_SHOW); + } +} + +static BOOL +FontSizeChange( + IN HWND hDlg, + IN PFONTSIZE_LIST_CTL SizeList, + IN OUT PCONSOLE_STATE_INFO pConInfo); + +static BOOL +FontTypeChange( + IN HWND hDlg, + IN PFONTSIZE_LIST_CTL SizeList, + IN OUT PCONSOLE_STATE_INFO pConInfo) +{ + HWND hListBox = GetDlgItem(hDlg, IDC_LBOX_FONTTYPE); + INT Length, nSel; + LOGFONTW lf; + LPWSTR FaceName; + DWORD FontType; + LPCWSTR FontGrpBoxLabelTpl = NULL; + WCHAR FontGrpBoxLabel[260]; nSel = (INT)SendMessageW(hListBox, LB_GETCURSEL, 0, 0); - if (nSel == LB_ERR) return; + if (nSel == LB_ERR) return FALSE; + + /* + * This is disabled, because there can be external parameters + * that may have changed (e.g. ConInfo->FontWeight, code page, ...) + * and that we don't control here, and that need a font refresh. + */ +#if 0 + /* Check whether the selection has changed */ + if (nSel == CurrentSelFont) + return FALSE; +#endif Length = (INT)SendMessageW(hListBox, LB_GETTEXTLEN, nSel, 0); - if (Length == LB_ERR) return; + if (Length == LB_ERR) return FALSE; FaceName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (Length + 1) * sizeof(WCHAR)); - if (FaceName == NULL) return; + if (FaceName == NULL) return FALSE; Length = (INT)SendMessageW(hListBox, LB_GETTEXT, nSel, (LPARAM)FaceName); FaceName[Length] = L'\0'; @@ -353,105 +514,202 @@ StringCchCopyW(pConInfo->FaceName, ARRAYSIZE(pConInfo->FaceName), FaceName); DPRINT1("pConInfo->FaceName = '%S'\n", pConInfo->FaceName); - /* Enumerate the available sizes for the selected font */ ZeroMemory(&lf, sizeof(lf)); lf.lfCharSet = DEFAULT_CHARSET; // CodePageToCharSet(pConInfo->CodePage); // lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; StringCchCopyW(lf.lfFaceName, ARRAYSIZE(lf.lfFaceName), FaceName); + /* + * Retrieve the read-only font group box label string template, + * and set the group box label to the name of the selected font. + */ + Length = LoadStringW(hApplet, IDS_GROUPBOX_FONT_NAME, (LPWSTR)&FontGrpBoxLabelTpl, 0); + if (FontGrpBoxLabelTpl && Length > 0) + { + StringCchCopyNW(FontGrpBoxLabel, ARRAYSIZE(FontGrpBoxLabel), FontGrpBoxLabelTpl, Length); + StringCchCatW(FontGrpBoxLabel, ARRAYSIZE(FontGrpBoxLabel), FaceName); + SetDlgItemTextW(hDlg, IDC_GROUPBOX_FONT_NAME, FontGrpBoxLabel); + } + + HeapFree(GetProcessHeap(), 0, FaceName); + + /* + * Reset the font size list, only: + * - if we have changed the type of font, or + * - if the font type is the same and is RASTER but the font has changed. + * Otherwise, if the font type is not RASTER and has not changed, + * we always display the TrueType default sizes and we don't need to + * recreate the list when we change between different TrueType fonts. + */ + FontType = SendMessageW(hListBox, LB_GETITEMDATA, nSel, 0); + if (FontType != LB_ERR) + { + SizeList->UseRasterOrTTList = (FontType == RASTER_FONTTYPE); + + /* Display the correct font size list (if needed) */ + if (CurrentFontType != FontType) + UpdateFontSizeList(hDlg, SizeList); + + /* Enumerate the available sizes for the selected font */ + if ((CurrentFontType != FontType) || + (FontType == RASTER_FONTTYPE && CurrentSelFont != nSel)) + { + HDC hDC; + + if (SizeList->UseRasterOrTTList) + SendMessageW(SizeList->RasterSizeList.hWndList, LB_RESETCONTENT, 0, 0); + else + SendMessageW(SizeList->hWndTTSizeList, CB_RESETCONTENT, 0, 0); + + hDC = GetDC(NULL); + EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)EnumFontSizesProc, (LPARAM)SizeList, 0); + ReleaseDC(NULL, hDC); + + /* Re-select the current font size */ + if (SizeList->UseRasterOrTTList) + FontSizeList_SelectFontSize(SizeList, SizeList->CurrentRasterSize); + else + FontSizeList_SelectFontSize(SizeList, SizeList->CurrentTTSize); + } + } + else + { + /* We failed, display the raster fonts size list */ + SizeList->UseRasterOrTTList = TRUE; + UpdateFontSizeList(hDlg, SizeList); + } + CurrentFontType = FontType; + CurrentSelFont = nSel; + + FontSizeChange(hDlg, SizeList, pConInfo); + return TRUE; +} + +static BOOL +FontSizeChange( + IN HWND hDlg, + IN PFONTSIZE_LIST_CTL SizeList, + IN OUT PCONSOLE_STATE_INFO pConInfo) +{ + HDC hDC; + LONG CharWidth, CharHeight, FontSize; + WCHAR szFontSize[100]; + + /* + * Retrieve the current selected font size. + * - If SizeList->UseRasterOrTTList is TRUE, or if it is FALSE but + * if SizeList->TTSizePixelUnit is TRUE, then the font size is in pixels; + * - If SizeList->TTSizePixelUnit is FALSE, then the font size is in points. + */ + FontSize = FontSizeList_GetSelectedFontSize(SizeList); + CharHeight = (SizeList->UseRasterOrTTList ? (LONG)HIWORD(FontSize) : FontSize); + CharWidth = (SizeList->UseRasterOrTTList ? (LONG)LOWORD(FontSize) : 0); + + if (hCurrentFont) DeleteObject(hCurrentFont); + hCurrentFont = CreateConsoleFont2(CharHeight, CharWidth, pConInfo); + if (hCurrentFont == NULL) + DPRINT1("FontSizeChange: CreateConsoleFont2 failed\n"); + + /* Retrieve the real character size in pixels */ hDC = GetDC(NULL); - EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)EnumFontSizesProc, - (LPARAM)GetDlgItem(hwndDlg, IDC_LBOX_FONTSIZE), 0); + GetFontCellSize(hDC, hCurrentFont, (PUINT)&CharHeight, (PUINT)&CharWidth); ReleaseDC(NULL, hDC); - - HeapFree(GetProcessHeap(), 0, FaceName); - - // TODO: Select a default font size???? - FontSizeChange(hwndDlg, pConInfo); - - // InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_FONT_WINDOW_PREVIEW), NULL, TRUE); - // InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SELECT_FONT_PREVIEW), NULL, TRUE); -} - -static VOID -FontSizeChange(HWND hwndDlg, - PCONSOLE_STATE_INFO pConInfo) -{ - HWND hListBox = GetDlgItem(hwndDlg, IDC_LBOX_FONTSIZE); - INT nSel; - ULONG FontSize; - WCHAR FontSizeStr[20]; - - nSel = (INT)SendMessageW(hListBox, LB_GETCURSEL, 0, 0); - if (nSel == LB_ERR) return; /* * Format: * Width = FontSize.X = LOWORD(FontSize); * Height = FontSize.Y = HIWORD(FontSize); */ - FontSize = (ULONG)SendMessageW(hListBox, LB_GETITEMDATA, nSel, 0); - if (FontSize == LB_ERR) return; - - pConInfo->FontSize.X = LOWORD(FontSize); - pConInfo->FontSize.Y = HIWORD(FontSize); - DPRINT1("pConInfo->FontSize = (%d x %d)\n", pConInfo->FontSize.X, pConInfo->FontSize.Y); - - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_FONT_WINDOW_PREVIEW), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SELECT_FONT_PREVIEW), NULL, TRUE); - - swprintf(FontSizeStr, L"%2d", pConInfo->FontSize.X); - SetDlgItemText(hwndDlg, IDC_FONT_SIZE_X, FontSizeStr); - swprintf(FontSizeStr, L"%2d", pConInfo->FontSize.Y); - SetDlgItemText(hwndDlg, IDC_FONT_SIZE_Y, FontSizeStr); + pConInfo->FontSize.X = (SHORT)(SizeList->UseRasterOrTTList ? CharWidth : 0); + pConInfo->FontSize.Y = (SHORT)CharHeight; + + DPRINT1("pConInfo->FontSize = (%d x %d) ; (CharWidth x CharHeight) = (%d x %d)\n", + pConInfo->FontSize.X, pConInfo->FontSize.Y, CharWidth, CharHeight); + + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_FONT_WINDOW_PREVIEW), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SELECT_FONT_PREVIEW), NULL, TRUE); + + StringCchPrintfW(szFontSize, ARRAYSIZE(szFontSize), L"%d", CharWidth); + SetDlgItemText(hDlg, IDC_FONT_SIZE_X, szFontSize); + StringCchPrintfW(szFontSize, ARRAYSIZE(szFontSize), L"%d", CharHeight); + SetDlgItemText(hDlg, IDC_FONT_SIZE_Y, szFontSize); + + return TRUE; } INT_PTR CALLBACK -FontProc(HWND hwndDlg, +FontProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - UNREFERENCED_PARAMETER(wParam); + PFONTSIZE_LIST_CTL SizeList; + + SizeList = (PFONTSIZE_LIST_CTL)GetWindowLongPtrW(hDlg, DWLP_USER); switch (uMsg) { case WM_INITDIALOG: { - HWND hListBox = GetDlgItem(hwndDlg, IDC_LBOX_FONTTYPE); - HDC hDC; - LOGFONTW lf; - INT idx; - - ZeroMemory(&lf, sizeof(lf)); - lf.lfCharSet = DEFAULT_CHARSET; // CodePageToCharSet(ConInfo->CodePage); - // lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; - - hDC = GetDC(NULL); - EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)EnumFontNamesProc, (LPARAM)hListBox, 0); - ReleaseDC(NULL, hDC); - - idx = (INT)SendMessageW(hListBox, LB_GETCOUNT, 0, 0); - if ((idx == 0) || (idx == LB_ERR)) + HWND hFontList = GetDlgItem(hDlg, IDC_LBOX_FONTTYPE); + + SizeList = (PFONTSIZE_LIST_CTL)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*SizeList)); + if (!SizeList) { - DPRINT1("The ideal console fonts are not found; manually add default ones.\n"); - - /* This world is not ideal. We have to do it realistically. */ - AddFontToList(hListBox, L"Lucida Console", TRUETYPE_FONTTYPE); - if (CodePageToCharSet(ConInfo->CodePage) != DEFAULT_CHARSET) - AddFontToList(hListBox, L"Droid Sans Fallback", TRUETYPE_FONTTYPE); + EndDialog(hDlg, 0); + return (INT_PTR)TRUE; } - + SizeList->RasterSizeList.hWndList = GetDlgItem(hDlg, IDC_LBOX_FONTSIZE); + SizeList->RasterSizeList.GetCount = RasterSizeList_GetCount; + SizeList->RasterSizeList.GetData = RasterSizeList_GetData; + SizeList->hWndTTSizeList = GetDlgItem(hDlg, IDC_CBOX_FONTSIZE); + SizeList->bIsTTSizeDirty = FALSE; + SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)SizeList); + + /* By default show the raster font size list */ + SizeList->UseRasterOrTTList = TRUE; + + /* By default show the font sizes in pixel units */ + CheckRadioButton(hDlg, IDC_RADIO_PIXEL_UNIT, IDC_RADIO_POINT_UNIT, IDC_RADIO_PIXEL_UNIT); + SizeList->TTSizePixelUnit = TRUE; + + UpdateFontSizeList(hDlg, SizeList); + + /* Initialize the font list */ + FaceNameList_Initialize(hFontList, ConInfo->CodePage); + + /* Select the current font */ DPRINT1("ConInfo->FaceName = '%S'\n", ConInfo->FaceName); - idx = (INT)SendMessageW(hListBox, LB_FINDSTRINGEXACT, 0, (LPARAM)ConInfo->FaceName); - if (idx != LB_ERR) - SendMessageW(hListBox, LB_SETCURSEL, (WPARAM)idx, 0); - - FontTypeChange(hwndDlg, ConInfo); + FaceNameList_SelectFaceName(hFontList, ConInfo->FaceName); + + if (ConInfo->FontWeight >= FW_BOLD) + CheckDlgButton(hDlg, IDC_CHECK_BOLD_FONTS, BST_CHECKED); + else + CheckDlgButton(hDlg, IDC_CHECK_BOLD_FONTS, BST_UNCHECKED); + + /* Select the current font size */ + /* + * Format: + * Width = FontSize.X = LOWORD(FontSize); + * Height = FontSize.Y = HIWORD(FontSize); + */ + SizeList->CurrentRasterSize = MAKELONG(ConInfo->FontSize.X, ConInfo->FontSize.Y); + SizeList->CurrentTTSize = ConInfo->FontSize.Y; + // FontSizeList_SelectFontSize(SizeList, SizeList->CurrentRasterSize); + + /* Refresh everything */ + FontTypeChange(hDlg, SizeList, ConInfo); return TRUE; + } + + case WM_DESTROY: + { + if (SizeList) + HeapFree(GetProcessHeap(), 0, SizeList); + return (INT_PTR)TRUE; } case WM_DRAWITEM: @@ -472,7 +730,7 @@ { case PSN_APPLY: { - ApplyConsoleInfo(hwndDlg); + ApplyConsoleInfo(hDlg); return TRUE; } } @@ -482,29 +740,85 @@ case WM_COMMAND: { - switch (HIWORD(wParam)) + if (HIWORD(wParam) == LBN_SELCHANGE /* || CBN_SELCHANGE */) { - case LBN_SELCHANGE: + switch (LOWORD(wParam)) { - switch (LOWORD(wParam)) + case IDC_LBOX_FONTTYPE: { - case IDC_LBOX_FONTTYPE: - { - FontTypeChange(hwndDlg, ConInfo); - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - - case IDC_LBOX_FONTSIZE: - { - FontSizeChange(hwndDlg, ConInfo); - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } + /* Change the property sheet state only if the font has really changed */ + if (FontTypeChange(hDlg, SizeList, ConInfo)) + PropSheet_Changed(GetParent(hDlg), hDlg); + break; } + case IDC_LBOX_FONTSIZE: + case IDC_CBOX_FONTSIZE: + { + /* Change the property sheet state only if the font has really changed */ + if (FontSizeChange(hDlg, SizeList, ConInfo)) + PropSheet_Changed(GetParent(hDlg), hDlg); + break; + } + } + } + /* NOTE: CBN_EDITUPDATE is sent first, and is followed by CBN_EDITCHANGE */ + else if (HIWORD(wParam) == CBN_EDITUPDATE && LOWORD(wParam) == IDC_CBOX_FONTSIZE) + { + ULONG FontSize; + PWCHAR pszNext = NULL; + WCHAR szFontSize[100]; + WCHAR szMessage[260]; + + GetWindowTextW(SizeList->hWndTTSizeList, szFontSize, ARRAYSIZE(szFontSize)); + FontSize = wcstoul(szFontSize, &pszNext, 10); + if (!*pszNext) + { + // FIXME: Localize! + StringCchPrintfW(szMessage, ARRAYSIZE(szMessage), L"\"%s\" is not a valid font size.", szFontSize); + MessageBoxW(hDlg, szMessage, L"Error", MB_ICONINFORMATION | MB_OK); + FontSizeList_SelectFontSize(SizeList, FontSize); + } + /**/SizeList->bIsTTSizeDirty = TRUE;/**/ + } + else if (HIWORD(wParam) == CBN_KILLFOCUS && LOWORD(wParam) == IDC_CBOX_FONTSIZE) + { + /* Change the property sheet state only if the font has really changed */ + if (FontSizeChange(hDlg, SizeList, ConInfo)) + PropSheet_Changed(GetParent(hDlg), hDlg); + } + else + if (HIWORD(wParam) == BN_CLICKED) + { + switch (LOWORD(wParam)) + { + case IDC_CHECK_BOLD_FONTS: + { + if (IsDlgButtonChecked(hDlg, IDC_CHECK_BOLD_FONTS) == BST_CHECKED) + ConInfo->FontWeight = FW_BOLD; + else + ConInfo->FontWeight = FW_NORMAL; + + FontTypeChange(hDlg, SizeList, ConInfo); + PropSheet_Changed(GetParent(hDlg), hDlg); break; } + + case IDC_RADIO_PIXEL_UNIT: + case IDC_RADIO_POINT_UNIT: + { + SizeList->TTSizePixelUnit = (LOWORD(wParam) == IDC_RADIO_PIXEL_UNIT); + + /* The call is valid only for TrueType fonts */ + if (CurrentFontType != TRUETYPE_FONTTYPE) + break; + + /* Change the property sheet state only if the font has really changed */ + if (FontSizeChange(hDlg, SizeList, ConInfo)) + PropSheet_Changed(GetParent(hDlg), hDlg); + break; + } + } } break; Modified: trunk/reactos/dll/cpl/console/layout.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/layout.c?r…
============================================================================== --- trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] Wed May 3 23:56:35 2017 @@ -105,9 +105,7 @@ COLORREF pbkColor, ptColor; COLORREF nbkColor, ntColor; HBRUSH hBrush; - HFONT Font, OldFont; - - COORD FontSize = pConInfo->FontSize; + HFONT hOldFont; if (TextMode == Screen) CurrentAttrib = pConInfo->ScreenAttributes; @@ -122,37 +120,12 @@ hBrush = CreateSolidBrush(nbkColor); if (!hBrush) return FALSE; - FontSize.Y = FontSize.Y > 0 ? -MulDiv(FontSize.Y, GetDeviceCaps(drawItem->hDC, LOGPIXELSY), 72) - : FontSize.Y; - - Font = CreateFontW(FontSize.Y, - FontSize.X, - 0, - TA_BASELINE, - pConInfo->FontWeight, - FALSE, - FALSE, - FALSE, - CodePageToCharSet(pConInfo->CodePage), - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, - FIXED_PITCH | pConInfo->FontFamily, - pConInfo->FaceName); - if (Font == NULL) - { - DPRINT1("PaintText: CreateFont failed\n"); - DeleteObject(hBrush); - return FALSE; - } - - OldFont = SelectObject(drawItem->hDC, Font); - if (OldFont == NULL) - { - DeleteObject(Font); - DeleteObject(hBrush); - return FALSE; - } + hOldFont = SelectObject(drawItem->hDC, hCurrentFont); + //if (hOldFont == NULL) + //{ + // DeleteObject(hBrush); + // return FALSE; + //} FillRect(drawItem->hDC, &drawItem->rcItem, hBrush); @@ -161,10 +134,10 @@ DrawTextW(drawItem->hDC, szPreviewText, wcslen(szPreviewText), &drawItem->rcItem, 0); SetTextColor(drawItem->hDC, ptColor); SetBkColor(drawItem->hDC, pbkColor); + + SelectObject(drawItem->hDC, hOldFont); + DeleteObject(hBrush); - - SelectObject(drawItem->hDC, OldFont); - DeleteObject(Font); return TRUE; }
7 years, 7 months
1
0
0
0
[hbelusca] 74468: [CONSOLE.CPL]: Minor code refactoring (cont.): - Use 'hDlg' for the dialog window handle variable (instead of hwndDlg), as already done in other parts of the code; - Use our regul...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed May 3 23:05:25 2017 New Revision: 74468 URL:
http://svn.reactos.org/svn/reactos?rev=74468&view=rev
Log: [CONSOLE.CPL]: Minor code refactoring (cont.): - Use 'hDlg' for the dialog window handle variable (instead of hwndDlg), as already done in other parts of the code; - Use our regular formatting for function prototypes; - Use explicit unicode functions; In addition: - Correctly check for the dialog controls notifications (within WM_COMMAND message); - Update the current code page when the code page combobox selection changes, but only notify the property sheet of the change when the combobox contents is validated (either the user pressed ENTER in some way, or the combobox lost its focus). Modified: trunk/reactos/dll/cpl/console/colors.c trunk/reactos/dll/cpl/console/layout.c trunk/reactos/dll/cpl/console/options.c Modified: trunk/reactos/dll/cpl/console/colors.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/colors.c?r…
============================================================================== --- trunk/reactos/dll/cpl/console/colors.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/colors.c [iso-8859-1] Wed May 3 23:05:25 2017 @@ -4,6 +4,7 @@ * FILE: dll/cpl/console/colors.c * PURPOSE: Colors dialog * PROGRAMMERS: Johannes Anderwald (johannes.anderwald(a)reactos.org) + * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) */ #include "console.h" @@ -14,30 +15,31 @@ static DWORD ActiveStaticControl = 0; static BOOL -PaintStaticControls(HWND hwndDlg, - PCONSOLE_STATE_INFO pConInfo, - LPDRAWITEMSTRUCT drawItem) +PaintStaticControls( + IN HWND hDlg, + IN PCONSOLE_STATE_INFO pConInfo, + IN LPDRAWITEMSTRUCT drawItem) { HBRUSH hBrush; DWORD index; index = min(drawItem->CtlID - IDC_STATIC_COLOR1, ARRAYSIZE(pConInfo->ColorTable) - 1); + hBrush = CreateSolidBrush(pConInfo->ColorTable[index]); if (!hBrush) return FALSE; FillRect(drawItem->hDC, &drawItem->rcItem, hBrush); - DeleteObject((HGDIOBJ)hBrush); + DeleteObject(hBrush); + if (ActiveStaticControl == index) - { DrawFocusRect(drawItem->hDC, &drawItem->rcItem); - } return TRUE; } INT_PTR CALLBACK -ColorsProc(HWND hwndDlg, +ColorsProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -50,13 +52,13 @@ case WM_INITDIALOG: { /* Set the valid range of the colour indicators */ - SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_COLOR_RED , UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); - SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_COLOR_GREEN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); - SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_COLOR_BLUE , UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); + SendDlgItemMessageW(hDlg, IDC_UPDOWN_COLOR_RED , UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); + SendDlgItemMessageW(hDlg, IDC_UPDOWN_COLOR_GREEN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); + SendDlgItemMessageW(hDlg, IDC_UPDOWN_COLOR_BLUE , UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); /* Select by default the screen background option */ - CheckRadioButton(hwndDlg, IDC_RADIO_SCREEN_TEXT, IDC_RADIO_POPUP_BACKGROUND, IDC_RADIO_SCREEN_BACKGROUND); - SendMessage(hwndDlg, WM_COMMAND, IDC_RADIO_SCREEN_BACKGROUND, 0); + CheckRadioButton(hDlg, IDC_RADIO_SCREEN_TEXT, IDC_RADIO_POPUP_BACKGROUND, IDC_RADIO_SCREEN_BACKGROUND); + SendMessageW(hDlg, WM_COMMAND, IDC_RADIO_SCREEN_BACKGROUND, 0); return TRUE; } @@ -66,7 +68,7 @@ LPDRAWITEMSTRUCT drawItem = (LPDRAWITEMSTRUCT)lParam; if (drawItem->CtlID >= IDC_STATIC_COLOR1 && drawItem->CtlID <= IDC_STATIC_COLOR16) - return PaintStaticControls(hwndDlg, ConInfo, drawItem); + return PaintStaticControls(hDlg, ConInfo, drawItem); else if (drawItem->CtlID == IDC_STATIC_SCREEN_COLOR) return PaintText(drawItem, ConInfo, Screen); else if (drawItem->CtlID == IDC_STATIC_POPUP_COLOR) @@ -81,7 +83,7 @@ { case PSN_APPLY: { - ApplyConsoleInfo(hwndDlg); + ApplyConsoleInfo(hDlg); return TRUE; } @@ -114,11 +116,11 @@ } ConInfo->ColorTable[colorIndex] = color; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hDlg), hDlg); break; } } @@ -128,8 +130,10 @@ case WM_COMMAND: { - switch (LOWORD(wParam)) + if (HIWORD(wParam) == BN_CLICKED) { + switch (LOWORD(wParam)) + { case IDC_RADIO_SCREEN_TEXT: { /* Get the color of the screen foreground */ @@ -137,15 +141,15 @@ color = ConInfo->ColorTable[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); - - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); + + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); ActiveStaticControl = colorIndex; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } @@ -156,15 +160,15 @@ color = ConInfo->ColorTable[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); - - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); + + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); ActiveStaticControl = colorIndex; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } @@ -175,15 +179,15 @@ color = ConInfo->ColorTable[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); - - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); + + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); ActiveStaticControl = colorIndex; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } @@ -194,95 +198,92 @@ color = ConInfo->ColorTable[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); - - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); + + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); ActiveStaticControl = colorIndex; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - break; - } - + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + break; + } + } + } + else + if (HIWORD(wParam) == EN_KILLFOCUS) + { + switch (LOWORD(wParam)) + { case IDC_EDIT_COLOR_RED: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD red; - - /* Get the current color */ - colorIndex = ActiveStaticControl; - color = ConInfo->ColorTable[colorIndex]; - - red = GetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, NULL, FALSE); - red = min(max(red, 0), 255); - - color = RGB(red, GetGValue(color), GetBValue(color)); - - ConInfo->ColorTable[colorIndex] = color; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + DWORD red; + + /* Get the current color */ + colorIndex = ActiveStaticControl; + color = ConInfo->ColorTable[colorIndex]; + + red = GetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED, NULL, FALSE); + red = min(max(red, 0), 255); + + color = RGB(red, GetGValue(color), GetBValue(color)); + + ConInfo->ColorTable[colorIndex] = color; + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_EDIT_COLOR_GREEN: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD green; - - /* Get the current color */ - colorIndex = ActiveStaticControl; - color = ConInfo->ColorTable[colorIndex]; - - green = GetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, NULL, FALSE); - green = min(max(green, 0), 255); - - color = RGB(GetRValue(color), green, GetBValue(color)); - - ConInfo->ColorTable[colorIndex] = color; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + DWORD green; + + /* Get the current color */ + colorIndex = ActiveStaticControl; + color = ConInfo->ColorTable[colorIndex]; + + green = GetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, NULL, FALSE); + green = min(max(green, 0), 255); + + color = RGB(GetRValue(color), green, GetBValue(color)); + + ConInfo->ColorTable[colorIndex] = color; + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_EDIT_COLOR_BLUE: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD blue; - - /* Get the current color */ - colorIndex = ActiveStaticControl; - color = ConInfo->ColorTable[colorIndex]; - - blue = GetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, NULL, FALSE); - blue = min(max(blue, 0), 255); - - color = RGB(GetRValue(color), GetGValue(color), blue); - - ConInfo->ColorTable[colorIndex] = color; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - + DWORD blue; + + /* Get the current color */ + colorIndex = ActiveStaticControl; + color = ConInfo->ColorTable[colorIndex]; + + blue = GetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE, NULL, FALSE); + blue = min(max(blue, 0), 255); + + color = RGB(GetRValue(color), GetGValue(color), blue); + + ConInfo->ColorTable[colorIndex] = color; + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hDlg), hDlg); + break; + } + } } - + else if ( HIWORD(wParam) == STN_CLICKED && IDC_STATIC_COLOR1 <= LOWORD(wParam) && LOWORD(wParam) <= IDC_STATIC_COLOR16 ) { @@ -290,43 +291,45 @@ if (colorIndex == ActiveStaticControl) { - /* Same static control was re-clicked */ + /* The same static control was re-clicked */ break; } color = ConInfo->ColorTable[colorIndex]; - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); + SetDlgItemInt(hDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); /* Update global struct */ - if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_SCREEN_TEXT)) + if (IsDlgButtonChecked(hDlg, IDC_RADIO_SCREEN_TEXT)) { ConInfo->ScreenAttributes = MakeAttrib(colorIndex, BkgdAttribFromAttrib(ConInfo->ScreenAttributes)); } - else if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_SCREEN_BACKGROUND)) + else if (IsDlgButtonChecked(hDlg, IDC_RADIO_SCREEN_BACKGROUND)) { ConInfo->ScreenAttributes = MakeAttrib(TextAttribFromAttrib(ConInfo->ScreenAttributes), colorIndex); } - else if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_POPUP_TEXT)) + else if (IsDlgButtonChecked(hDlg, IDC_RADIO_POPUP_TEXT)) { ConInfo->PopupAttributes = MakeAttrib(colorIndex, BkgdAttribFromAttrib(ConInfo->PopupAttributes)); } - else if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_POPUP_BACKGROUND)) + else if (IsDlgButtonChecked(hDlg, IDC_RADIO_POPUP_BACKGROUND)) { ConInfo->PopupAttributes = MakeAttrib(TextAttribFromAttrib(ConInfo->PopupAttributes), colorIndex); } - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); ActiveStaticControl = colorIndex; - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); - - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_COLOR1 + ActiveStaticControl), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hDlg), hDlg); break; } + + break; } default: Modified: trunk/reactos/dll/cpl/console/layout.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/layout.c?r…
============================================================================== --- trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] Wed May 3 23:05:25 2017 @@ -24,8 +24,9 @@ VOID -PaintConsole(LPDRAWITEMSTRUCT drawItem, - PCONSOLE_STATE_INFO pConInfo) +PaintConsole( + IN LPDRAWITEMSTRUCT drawItem, + IN PCONSOLE_STATE_INFO pConInfo) { HBRUSH hBrush; RECT cRect, fRect; @@ -91,13 +92,14 @@ hBrush = CreateSolidBrush(pConInfo->ColorTable[BkgdAttribFromAttrib(pConInfo->ScreenAttributes)]); SetRect(&fRect, startx + 3, starty + 6, cRect.right - 6, cRect.bottom - 3); FillRect(drawItem->hDC, &fRect, hBrush); - DeleteObject((HGDIOBJ)hBrush); + DeleteObject(hBrush); } BOOL -PaintText(LPDRAWITEMSTRUCT drawItem, - PCONSOLE_STATE_INFO pConInfo, - TEXT_TYPE TextMode) +PaintText( + IN LPDRAWITEMSTRUCT drawItem, + IN PCONSOLE_STATE_INFO pConInfo, + IN TEXT_TYPE TextMode) { USHORT CurrentAttrib; COLORREF pbkColor, ptColor; @@ -174,9 +176,6 @@ WPARAM wParam, LPARAM lParam) { - UNREFERENCED_PARAMETER(hwndDlg); - UNREFERENCED_PARAMETER(wParam); - switch (uMsg) { case WM_INITDIALOG: @@ -343,166 +342,149 @@ case WM_COMMAND: { - switch (LOWORD(wParam)) + if (HIWORD(wParam) == EN_KILLFOCUS) { + switch (LOWORD(wParam)) + { case IDC_EDIT_SCREEN_BUFFER_WIDTH: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD swidth, wwidth; - - swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); - wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE); + DWORD swidth, wwidth; + + swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); + wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE); + + /* Be sure that the (new) screen buffer width is in the correct range */ + swidth = min(max(swidth, 1), 0xFFFF); + + /* Automatically adjust window size when screen buffer decreases */ + if (wwidth > swidth) + { + wwidth = swidth; + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, wwidth, TRUE); + } + + ConInfo->ScreenBufferSize.X = (SHORT)swidth; + ConInfo->WindowSize.X = (SHORT)wwidth; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } + + case IDC_EDIT_WINDOW_SIZE_WIDTH: + { + DWORD swidth, wwidth; + + swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); + wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE); + + /* Automatically adjust screen buffer size when window size enlarges */ + if (wwidth >= swidth) + { + swidth = wwidth; /* Be sure that the (new) screen buffer width is in the correct range */ swidth = min(max(swidth, 1), 0xFFFF); - /* Automatically adjust window size when screen buffer decreases */ - if (wwidth > swidth) - { - wwidth = swidth; - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, wwidth, TRUE); - } - - ConInfo->ScreenBufferSize.X = (SHORT)swidth; - ConInfo->WindowSize.X = (SHORT)wwidth; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, swidth, TRUE); + } + + ConInfo->ScreenBufferSize.X = (SHORT)swidth; + ConInfo->WindowSize.X = (SHORT)wwidth; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } - case IDC_EDIT_WINDOW_SIZE_WIDTH: - { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD swidth, wwidth; - - swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); - wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE); - - /* Automatically adjust screen buffer size when window size enlarges */ - if (wwidth >= swidth) - { - swidth = wwidth; - - /* Be sure that the (new) screen buffer width is in the correct range */ - swidth = min(max(swidth, 1), 0xFFFF); - - SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, swidth, TRUE); - } - - ConInfo->ScreenBufferSize.X = (SHORT)swidth; - ConInfo->WindowSize.X = (SHORT)wwidth; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + case IDC_EDIT_SCREEN_BUFFER_HEIGHT: + { + DWORD sheight, wheight; + + sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); + wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE); + + /* Be sure that the (new) screen buffer width is in the correct range */ + sheight = min(max(sheight, 1), 0xFFFF); + + /* Automatically adjust window size when screen buffer decreases */ + if (wheight > sheight) + { + wheight = sheight; + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, wheight, TRUE); + } + + ConInfo->ScreenBufferSize.Y = (SHORT)sheight; + ConInfo->WindowSize.Y = (SHORT)wheight; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } - case IDC_EDIT_SCREEN_BUFFER_HEIGHT: - { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD sheight, wheight; - - sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); - wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE); + case IDC_EDIT_WINDOW_SIZE_HEIGHT: + { + DWORD sheight, wheight; + + sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); + wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE); + + /* Automatically adjust screen buffer size when window size enlarges */ + if (wheight >= sheight) + { + sheight = wheight; /* Be sure that the (new) screen buffer width is in the correct range */ sheight = min(max(sheight, 1), 0xFFFF); - /* Automatically adjust window size when screen buffer decreases */ - if (wheight > sheight) - { - wheight = sheight; - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, wheight, TRUE); - } - - ConInfo->ScreenBufferSize.Y = (SHORT)sheight; - ConInfo->WindowSize.Y = (SHORT)wheight; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - - case IDC_EDIT_WINDOW_SIZE_HEIGHT: - { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD sheight, wheight; - - sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); - wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE); - - /* Automatically adjust screen buffer size when window size enlarges */ - if (wheight >= sheight) - { - sheight = wheight; - - /* Be sure that the (new) screen buffer width is in the correct range */ - sheight = min(max(sheight, 1), 0xFFFF); - - SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, sheight, TRUE); - } - - ConInfo->ScreenBufferSize.Y = (SHORT)sheight; - ConInfo->WindowSize.Y = (SHORT)wheight; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, sheight, TRUE); + } + + ConInfo->ScreenBufferSize.Y = (SHORT)sheight; + ConInfo->WindowSize.Y = (SHORT)wheight; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } case IDC_EDIT_WINDOW_POS_LEFT: case IDC_EDIT_WINDOW_POS_TOP: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD left, top; - - left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); - top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE); - - ConInfo->WindowPosition.x = left; - ConInfo->WindowPosition.y = top; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + ConInfo->WindowPosition.x = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); + ConInfo->WindowPosition.y = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } - - case IDC_CHECK_SYSTEM_POS_WINDOW: - { - LONG res = SendMessage((HWND)lParam, BM_GETCHECK, 0, 0); - if (res == BST_CHECKED) - { - ULONG left, top; - - left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); - top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE); - - ConInfo->AutoPosition = FALSE; - ConInfo->WindowPosition.x = left; - ConInfo->WindowPosition.y = top; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - - SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, TRUE); - EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , TRUE); - EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, TRUE); - EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , TRUE); - } - else if (res == BST_UNCHECKED) - { - ConInfo->AutoPosition = TRUE; - // Do not touch ConInfo->WindowPosition !! - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - - SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, FALSE); - EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , FALSE); - EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, FALSE); - EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , FALSE); - } } } + else + if (HIWORD(wParam) == BN_CLICKED && + LOWORD(wParam) == IDC_CHECK_SYSTEM_POS_WINDOW) + { + if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_SYSTEM_POS_WINDOW) == BST_CHECKED) + { + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, FALSE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , FALSE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, FALSE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , FALSE); + + ConInfo->AutoPosition = TRUE; + // Do not touch ConInfo->WindowPosition !! + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + else + { + ULONG left, top; + + left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); + top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE); + + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, TRUE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , TRUE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, TRUE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , TRUE); + + ConInfo->AutoPosition = FALSE; + ConInfo->WindowPosition.x = left; + ConInfo->WindowPosition.y = top; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + } + + break; } default: Modified: trunk/reactos/dll/cpl/console/options.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/options.c?…
============================================================================== --- trunk/reactos/dll/cpl/console/options.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/options.c [iso-8859-1] Wed May 3 23:05:25 2017 @@ -136,87 +136,74 @@ } static VOID -UpdateDialogElements(HWND hwndDlg, PCONSOLE_STATE_INFO pConInfo) -{ - HWND hDlgCtrl; - - /* Update cursor size */ +UpdateDialogElements( + IN HWND hDlg, + IN PCONSOLE_STATE_INFO pConInfo) +{ + /* Update the cursor size */ if (pConInfo->CursorSize <= 25) { /* Small cursor */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + CheckRadioButton(hDlg, IDC_RADIO_SMALL_CURSOR, IDC_RADIO_LARGE_CURSOR, IDC_RADIO_SMALL_CURSOR); + // CheckDlgButton(hDlg, IDC_RADIO_SMALL_CURSOR , BST_CHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_MEDIUM_CURSOR, BST_UNCHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_LARGE_CURSOR , BST_UNCHECKED); } else if (pConInfo->CursorSize <= 50) { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + /* Medium cursor */ + CheckRadioButton(hDlg, IDC_RADIO_SMALL_CURSOR, IDC_RADIO_LARGE_CURSOR, IDC_RADIO_MEDIUM_CURSOR); + // CheckDlgButton(hDlg, IDC_RADIO_SMALL_CURSOR , BST_UNCHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_MEDIUM_CURSOR, BST_CHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_LARGE_CURSOR , BST_UNCHECKED); } else /* if (pConInfo->CursorSize <= 100) */ { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - - /* Update num buffers */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_NUM_BUFFER); - SendMessageW(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG(999, 1)); - SetDlgItemInt(hwndDlg, IDC_EDIT_NUM_BUFFER, pConInfo->NumberOfHistoryBuffers, FALSE); - - /* Update buffer size */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_BUFFER_SIZE); - SendMessageW(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG(999, 1)); - SetDlgItemInt(hwndDlg, IDC_EDIT_BUFFER_SIZE, pConInfo->HistoryBufferSize, FALSE); + /* Large cursor */ + CheckRadioButton(hDlg, IDC_RADIO_SMALL_CURSOR, IDC_RADIO_LARGE_CURSOR, IDC_RADIO_LARGE_CURSOR); + // CheckDlgButton(hDlg, IDC_RADIO_SMALL_CURSOR , BST_UNCHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_MEDIUM_CURSOR, BST_UNCHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_LARGE_CURSOR , BST_CHECKED); + } + + /* Update the number of history buffers */ + SendDlgItemMessageW(hDlg, IDC_UPDOWN_NUM_BUFFER, UDM_SETRANGE, 0, MAKELONG(999, 1)); + SetDlgItemInt(hDlg, IDC_EDIT_NUM_BUFFER, pConInfo->NumberOfHistoryBuffers, FALSE); + + /* Update the history buffer size */ + SendDlgItemMessageW(hDlg, IDC_UPDOWN_BUFFER_SIZE, UDM_SETRANGE, 0, MAKELONG(999, 1)); + SetDlgItemInt(hDlg, IDC_EDIT_BUFFER_SIZE, pConInfo->HistoryBufferSize, FALSE); /* Update discard duplicates */ - CheckDlgButton(hwndDlg, IDC_CHECK_DISCARD_DUPLICATES, + CheckDlgButton(hDlg, IDC_CHECK_DISCARD_DUPLICATES, pConInfo->HistoryNoDup ? BST_CHECKED : BST_UNCHECKED); - /* Update full/window screen */ + /* Update full/window screen state */ if (pConInfo->FullScreen) { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + CheckRadioButton(hDlg, IDC_RADIO_DISPLAY_WINDOW, IDC_RADIO_DISPLAY_FULL, IDC_RADIO_DISPLAY_FULL); + // CheckDlgButton(hDlg, IDC_RADIO_DISPLAY_WINDOW, BST_UNCHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_DISPLAY_FULL , BST_CHECKED); } else { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - - /* Update quick edit */ - CheckDlgButton(hwndDlg, IDC_CHECK_QUICK_EDIT, + CheckRadioButton(hDlg, IDC_RADIO_DISPLAY_WINDOW, IDC_RADIO_DISPLAY_FULL, IDC_RADIO_DISPLAY_WINDOW); + // CheckDlgButton(hDlg, IDC_RADIO_DISPLAY_WINDOW, BST_CHECKED); + // CheckDlgButton(hDlg, IDC_RADIO_DISPLAY_FULL , BST_UNCHECKED); + } + + /* Update "Quick-edit" state */ + CheckDlgButton(hDlg, IDC_CHECK_QUICK_EDIT, pConInfo->QuickEdit ? BST_CHECKED : BST_UNCHECKED); - /* Update insert mode */ - CheckDlgButton(hwndDlg, IDC_CHECK_INSERT_MODE, + /* Update "Insert mode" state */ + CheckDlgButton(hDlg, IDC_CHECK_INSERT_MODE, pConInfo->InsertMode ? BST_CHECKED : BST_UNCHECKED); } INT_PTR CALLBACK -OptionsProc(HWND hwndDlg, +OptionsProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -225,8 +212,8 @@ { case WM_INITDIALOG: { - BuildCodePageList(hwndDlg); - UpdateDialogElements(hwndDlg, ConInfo); + BuildCodePageList(hDlg); + UpdateDialogElements(hDlg, ConInfo); return TRUE; } @@ -242,18 +229,18 @@ { lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999); ConInfo->HistoryBufferSize = lpnmud->iPos; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); } else if (lppsn->hdr.idFrom == IDC_UPDOWN_NUM_BUFFER) { lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999); ConInfo->NumberOfHistoryBuffers = lpnmud->iPos; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); } } else if (lppsn->hdr.code == PSN_APPLY) { - ApplyConsoleInfo(hwndDlg); + ApplyConsoleInfo(hDlg); return TRUE; } break; @@ -261,139 +248,112 @@ case WM_COMMAND: { - LRESULT lResult; - - switch (LOWORD(wParam)) - { + if (HIWORD(wParam) == BN_CLICKED) + { + switch (LOWORD(wParam)) + { case IDC_RADIO_SMALL_CURSOR: { ConInfo->CursorSize = 25; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_RADIO_MEDIUM_CURSOR: { ConInfo->CursorSize = 50; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_RADIO_LARGE_CURSOR: { ConInfo->CursorSize = 100; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_RADIO_DISPLAY_WINDOW: { ConInfo->FullScreen = FALSE; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_RADIO_DISPLAY_FULL: { ConInfo->FullScreen = TRUE; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_CHECK_QUICK_EDIT: { - lResult = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0); - if (lResult == BST_CHECKED) - { - ConInfo->QuickEdit = FALSE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (lResult == BST_UNCHECKED) - { - ConInfo->QuickEdit = TRUE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + ConInfo->QuickEdit = (IsDlgButtonChecked(hDlg, IDC_CHECK_QUICK_EDIT) == BST_CHECKED); // BST_UNCHECKED or BST_INDETERMINATE => FALSE + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_CHECK_INSERT_MODE: { - lResult = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0); - if (lResult == BST_CHECKED) - { - ConInfo->InsertMode = FALSE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (lResult == BST_UNCHECKED) - { - ConInfo->InsertMode = TRUE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + ConInfo->InsertMode = (IsDlgButtonChecked(hDlg, IDC_CHECK_INSERT_MODE) == BST_CHECKED); // BST_UNCHECKED or BST_INDETERMINATE => FALSE + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_CHECK_DISCARD_DUPLICATES: { - lResult = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0); - if (lResult == BST_CHECKED) - { - ConInfo->HistoryNoDup = FALSE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (lResult == BST_UNCHECKED) - { - ConInfo->HistoryNoDup = TRUE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } + ConInfo->HistoryNoDup = (IsDlgButtonChecked(hDlg, IDC_CHECK_DISCARD_DUPLICATES) == BST_CHECKED); // BST_UNCHECKED or BST_INDETERMINATE => FALSE + PropSheet_Changed(GetParent(hDlg), hDlg); + break; + } + } + } + else + if (HIWORD(wParam) == EN_KILLFOCUS) + { + switch (LOWORD(wParam)) + { case IDC_EDIT_BUFFER_SIZE: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD sizeBuff; - - sizeBuff = GetDlgItemInt(hwndDlg, IDC_EDIT_BUFFER_SIZE, NULL, FALSE); - sizeBuff = min(max(sizeBuff, 1), 999); - - ConInfo->HistoryBufferSize = sizeBuff; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } + DWORD sizeBuff; + + sizeBuff = GetDlgItemInt(hDlg, IDC_EDIT_BUFFER_SIZE, NULL, FALSE); + sizeBuff = min(max(sizeBuff, 1), 999); + + ConInfo->HistoryBufferSize = sizeBuff; + PropSheet_Changed(GetParent(hDlg), hDlg); break; } case IDC_EDIT_NUM_BUFFER: { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD numBuff; - - numBuff = GetDlgItemInt(hwndDlg, IDC_EDIT_NUM_BUFFER, NULL, FALSE); - numBuff = min(max(numBuff, 1), 999); - - ConInfo->NumberOfHistoryBuffers = numBuff; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - case IDL_CODEPAGE: - { - if (HIWORD(wParam) == CBN_SELENDOK) - { - INT iItem; - UINT CodePage; - - iItem = (INT)SendMessageW((HWND)lParam, CB_GETCURSEL, 0, 0); - if (iItem != CB_ERR) - { - CodePage = (UINT)SendMessageW((HWND)lParam, CB_GETITEMDATA, iItem, 0); - if (CodePage != CB_ERR) - { - ConInfo->CodePage = CodePage; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - } - } - break; - } - default: - break; - } + DWORD numBuff; + + numBuff = GetDlgItemInt(hDlg, IDC_EDIT_NUM_BUFFER, NULL, FALSE); + numBuff = min(max(numBuff, 1), 999); + + ConInfo->NumberOfHistoryBuffers = numBuff; + PropSheet_Changed(GetParent(hDlg), hDlg); + break; + } + } + } + else + if ((HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_SELENDOK) && + (LOWORD(wParam) == IDL_CODEPAGE)) + { + HWND hWndList = GetDlgItem(hDlg, IDL_CODEPAGE); + INT iItem; + UINT CodePage; + + iItem = (INT)SendMessageW(hWndList, CB_GETCURSEL, 0, 0); + if (iItem == CB_ERR) + break; + + CodePage = (UINT)SendMessageW(hWndList, CB_GETITEMDATA, iItem, 0); + if (CodePage == CB_ERR) + break; + + ConInfo->CodePage = CodePage; + + /* Change the property sheet state only if the user validated */ + if (HIWORD(wParam) == CBN_SELENDOK) + PropSheet_Changed(GetParent(hDlg), hDlg); + } + break; }
7 years, 7 months
1
0
0
0
[gadamopoulos] 74467: [SHELL32] -CMenuBand: Correctly get the setting for flat menus. CORE-8925
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Wed May 3 21:49:38 2017 New Revision: 74467 URL:
http://svn.reactos.org/svn/reactos?rev=74467&view=rev
Log: [SHELL32] -CMenuBand: Correctly get the setting for flat menus. CORE-8925 Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuToolbars.cpp Modified: trunk/reactos/dll/win32/shell32/shellmenu/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellmen…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellmenu/CMenuToolbars.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellmenu/CMenuToolbars.cpp [iso-8859-1] Wed May 3 21:49:38 2017 @@ -296,10 +296,7 @@ UpdateImageLists(); // For custom-drawing - if (IsAppThemed()) - GetThemeSysBool(GetWindowTheme(m_hWnd), TMT_FLATMENUS); - else - SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0); + SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0); return S_OK; } @@ -387,10 +384,7 @@ SetWindowTheme(m_hWnd, L"", L""); - if (IsAppThemed()) - GetThemeSysBool(GetWindowTheme(m_hWnd), TMT_FLATMENUS); - else - SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0); + SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0); m_menuBand->AdjustForTheme(m_useFlatMenus);
7 years, 7 months
1
0
0
0
[hbelusca] 74466: [CONSOLE.CPL]: Minor code refactoring: - Move the bisection functions into their own source file, and make them a bit more general so that they can be used on other types of list ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed May 3 20:35:12 2017 New Revision: 74466 URL:
http://svn.reactos.org/svn/reactos?rev=74466&view=rev
Log: [CONSOLE.CPL]: Minor code refactoring: - Move the bisection functions into their own source file, and make them a bit more general so that they can be used on other types of list structures than win32 combo-boxes. - Adjust the code in options.c to reflect those changes. Added: trunk/reactos/dll/cpl/console/utils.c - copied, changed from r74465, trunk/reactos/dll/cpl/console/options.c Modified: trunk/reactos/dll/cpl/console/CMakeLists.txt trunk/reactos/dll/cpl/console/console.h trunk/reactos/dll/cpl/console/options.c Modified: trunk/reactos/dll/cpl/console/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/CMakeLists…
============================================================================== --- trunk/reactos/dll/cpl/console/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/CMakeLists.txt [iso-8859-1] Wed May 3 20:35:12 2017 @@ -10,6 +10,7 @@ font.c layout.c colors.c + utils.c console.h) add_rc_deps(console.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/terminal.ico) Modified: trunk/reactos/dll/cpl/console/console.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.h?…
============================================================================== --- trunk/reactos/dll/cpl/console/console.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/console.h [iso-8859-1] Wed May 3 20:35:12 2017 @@ -40,4 +40,33 @@ VOID PaintConsole(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo); BOOL PaintText(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo, TEXT_TYPE TextMode); + +struct _LIST_CTL; + +typedef INT (*PLIST_GETCOUNT)(IN struct _LIST_CTL* ListCtl); +typedef ULONG_PTR (*PLIST_GETDATA)(IN struct _LIST_CTL* ListCtl, IN INT Index); + +typedef struct _LIST_CTL +{ + HWND hWndList; + PLIST_GETCOUNT GetCount; + PLIST_GETDATA GetData; +} LIST_CTL, *PLIST_CTL; + +UINT +BisectListSortedByValueEx( + IN PLIST_CTL ListCtl, + IN ULONG_PTR Value, + IN UINT itemStart, + IN UINT itemEnd, + OUT PUINT pValueItem OPTIONAL, + IN BOOL BisectRightOrLeft); + +UINT +BisectListSortedByValue( + IN PLIST_CTL ListCtl, + IN ULONG_PTR Value, + OUT PUINT pValueItem OPTIONAL, + IN BOOL BisectRightOrLeft); + #endif /* CONSOLE_H__ */ Modified: trunk/reactos/dll/cpl/console/options.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/options.c?…
============================================================================== --- trunk/reactos/dll/cpl/console/options.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/options.c [iso-8859-1] Wed May 3 20:35:12 2017 @@ -15,126 +15,21 @@ #define MAX_VALUE_NAME 16383 -/* - * A function that locates the insertion point (index) for a given value 'Value' - * in a list 'List' to maintain its sorted order by increasing values. - * - * - When 'BisectRightOrLeft' == TRUE, the bisection is performed to the right, - * i.e. the returned insertion point comes after (to the right of) any existing - * entries of 'Value' in 'List'. - * The returned insertion point 'i' partitions the list 'List' into two halves - * such that: - * all(val <= Value for val in List[start:i[) for the left side, and - * all(val > Value for val in List[i:end+1[) for the right side. - * - * - When 'BisectRightOrLeft' == FALSE, the bisection is performed to the left, - * i.e. the returned insertion point comes before (to the left of) any existing - * entries of 'Value' in 'List'. - * The returned insertion point 'i' partitions the list 'List' into two halves - * such that: - * all(val < Value for val in List[start:i[) for the left side, and - * all(val >= Value for val in List[i:end+1[) for the right side. - * - * The exact value of List[i] may, or may not, be equal to Value, depending on - * whether or not 'Value' is actually present on the list. - */ -static UINT -BisectListSortedByValueEx( - IN HWND hWndList, - IN ULONG_PTR Value, - IN UINT itemStart, - IN UINT itemEnd, - OUT PUINT pValueItem OPTIONAL, - IN BOOL BisectRightOrLeft) -{ - UINT iItemStart, iItemEnd, iItem; - ULONG_PTR itemData; - - /* Sanity checks */ - if (itemStart > itemEnd) - return CB_ERR; // Fail - - /* Initialize */ - iItemStart = itemStart; - iItemEnd = itemEnd; - iItem = iItemStart; - - if (pValueItem) - *pValueItem = CB_ERR; - - while (iItemStart <= iItemEnd) - { - /* - * Bisect. Note the following: - * - if iItemEnd == iItemStart + 1, then iItem == iItemStart; - * - if iItemStart == iItemEnd, then iItemStart == iItem == iItemEnd. - * In all but the last case, iItemStart <= iItem < iItemEnd. - */ - iItem = (iItemStart + iItemEnd) / 2; - - itemData = (ULONG_PTR)SendMessageW(hWndList, CB_GETITEMDATA, (WPARAM)iItem, 0); - if (itemData == CB_ERR) - return CB_ERR; // Fail - - if (Value == itemData) - { - /* Found a candidate */ - if (pValueItem) - *pValueItem = iItem; - - /* - * Try to find the last element (if BisectRightOrLeft == TRUE) - * or the first element (if BisectRightOrLeft == FALSE). - */ - if (BisectRightOrLeft) - { - iItemStart = iItem + 1; // iItemStart may be > iItemEnd - } - else - { - if (iItem <= itemStart) break; - iItemEnd = iItem - 1; // iItemEnd may be < iItemStart, i.e. iItemStart may be > iItemEnd - } - } - else if (Value < itemData) - { - if (iItem <= itemStart) break; - /* The value should be before iItem */ - iItemEnd = iItem - 1; // iItemEnd may be < iItemStart, i.e. iItemStart may be > iItemEnd, if iItem == iItemStart. - } - else // if (itemData < Value) - { - /* The value should be after iItem */ - iItemStart = iItem + 1; // iItemStart may be > iItemEnd, if iItem == iItemEnd. - } - - /* Here, iItemStart may be == iItemEnd */ - } - - return iItemStart; -} - -static UINT -BisectListSortedByValue( - IN HWND hWndList, - IN ULONG_PTR Value, - OUT PUINT pValueItem OPTIONAL, - IN BOOL BisectRightOrLeft) -{ - INT iItemEnd = (INT)SendMessageW(hWndList, CB_GETCOUNT, 0, 0); - if (iItemEnd == CB_ERR || iItemEnd <= 0) - return CB_ERR; // Fail - - return BisectListSortedByValueEx(hWndList, Value, - 0, (UINT)(iItemEnd - 1), - pValueItem, - BisectRightOrLeft); -} - +static INT +List_GetCount(IN PLIST_CTL ListCtl) +{ + return (INT)SendMessageW(ListCtl->hWndList, CB_GETCOUNT, 0, 0); +} + +static ULONG_PTR +List_GetData(IN PLIST_CTL ListCtl, IN INT Index) +{ + return (ULONG_PTR)SendMessageW(ListCtl->hWndList, CB_GETITEMDATA, (WPARAM)Index, 0); +} static VOID AddCodePage( - IN HWND hWndList, + IN PLIST_CTL ListCtl, IN UINT CodePage) { UINT iItem, iDupItem; @@ -160,25 +55,26 @@ { /* We failed, just use the code page value as its name */ // _ultow(CodePage, CPInfo.CodePageName, 10); - _snwprintf(CPInfo.CodePageName, ARRAYSIZE(CPInfo.CodePageName), L"%lu", CodePage); + StringCchPrintfW(CPInfo.CodePageName, ARRAYSIZE(CPInfo.CodePageName), L"%lu", CodePage); } /* Add the code page into the list, sorted by code page value. Avoid any duplicates. */ iDupItem = CB_ERR; - iItem = BisectListSortedByValue(hWndList, CodePage, &iDupItem, TRUE); + iItem = BisectListSortedByValue(ListCtl, CodePage, &iDupItem, TRUE); if (iItem == CB_ERR) iItem = 0; if (iDupItem != CB_ERR) return; - iItem = (UINT)SendMessageW(hWndList, CB_INSERTSTRING, iItem, (LPARAM)CPInfo.CodePageName); + iItem = (UINT)SendMessageW(ListCtl->hWndList, CB_INSERTSTRING, iItem, (LPARAM)CPInfo.CodePageName); if (iItem != CB_ERR && iItem != CB_ERRSPACE) - iItem = SendMessageW(hWndList, CB_SETITEMDATA, iItem, CodePage); + iItem = SendMessageW(ListCtl->hWndList, CB_SETITEMDATA, iItem, CodePage); } static VOID -BuildCodePageList(IN HWND hDlg) -{ - HWND hWndList; +BuildCodePageList( + IN HWND hDlg) +{ + LIST_CTL ListCtl; HKEY hKey; DWORD dwIndex, dwSize, dwType; UINT CodePage; @@ -195,7 +91,9 @@ return; } - hWndList = GetDlgItem(hDlg, IDL_CODEPAGE); + ListCtl.hWndList = GetDlgItem(hDlg, IDL_CODEPAGE); + ListCtl.GetCount = List_GetCount; + ListCtl.GetData = List_GetData; /* Enumerate all the available code pages on the system */ dwSize = ARRAYSIZE(szValueName); @@ -218,23 +116,23 @@ */ CodePage = (UINT)_wtol(szValueName); if (CodePage == 0) continue; - AddCodePage(hWndList, CodePage); + AddCodePage(&ListCtl, CodePage); } RegCloseKey(hKey); /* Add the special UTF-7 (CP_UTF7 65000) and UTF-8 (CP_UTF8 65001) code pages */ - AddCodePage(hWndList, CP_UTF7); - AddCodePage(hWndList, CP_UTF8); + AddCodePage(&ListCtl, CP_UTF7); + AddCodePage(&ListCtl, CP_UTF8); /* Find and select the current code page in the sorted list */ - if (BisectListSortedByValue(hWndList, ConInfo->CodePage, &CodePage, FALSE) == CB_ERR || + if (BisectListSortedByValue(&ListCtl, ConInfo->CodePage, &CodePage, FALSE) == CB_ERR || CodePage == CB_ERR) { /* Not found, select the first element */ CodePage = 0; } - SendMessageW(hWndList, CB_SETCURSEL, (WPARAM)CodePage, 0); + SendMessageW(ListCtl.hWndList, CB_SETCURSEL, (WPARAM)CodePage, 0); } static VOID Copied: trunk/reactos/dll/cpl/console/utils.c (from r74465, trunk/reactos/dll/cpl/console/options.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/utils.c?p2…
============================================================================== --- trunk/reactos/dll/cpl/console/options.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/utils.c [iso-8859-1] Wed May 3 20:35:12 2017 @@ -1,18 +1,15 @@ /* * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory - * FILE: dll/cpl/console/options.c - * PURPOSE: Options dialog - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald(a)reactos.org) - * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + * FILE: dll/cpl/console/utils.c + * PURPOSE: Utility functions + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) */ #include "console.h" #define NDEBUG #include <debug.h> - -#define MAX_VALUE_NAME 16383 /* @@ -38,9 +35,9 @@ * The exact value of List[i] may, or may not, be equal to Value, depending on * whether or not 'Value' is actually present on the list. */ -static UINT +UINT BisectListSortedByValueEx( - IN HWND hWndList, + IN PLIST_CTL ListCtl, IN ULONG_PTR Value, IN UINT itemStart, IN UINT itemEnd, @@ -72,7 +69,7 @@ */ iItem = (iItemStart + iItemEnd) / 2; - itemData = (ULONG_PTR)SendMessageW(hWndList, CB_GETITEMDATA, (WPARAM)iItem, 0); + itemData = ListCtl->GetData(ListCtl, iItem); if (itemData == CB_ERR) return CB_ERR; // Fail @@ -114,394 +111,19 @@ return iItemStart; } -static UINT +UINT BisectListSortedByValue( - IN HWND hWndList, + IN PLIST_CTL ListCtl, IN ULONG_PTR Value, OUT PUINT pValueItem OPTIONAL, IN BOOL BisectRightOrLeft) { - INT iItemEnd = (INT)SendMessageW(hWndList, CB_GETCOUNT, 0, 0); + INT iItemEnd = ListCtl->GetCount(ListCtl); if (iItemEnd == CB_ERR || iItemEnd <= 0) return CB_ERR; // Fail - return BisectListSortedByValueEx(hWndList, Value, + return BisectListSortedByValueEx(ListCtl, Value, 0, (UINT)(iItemEnd - 1), pValueItem, BisectRightOrLeft); } - - -static VOID -AddCodePage( - IN HWND hWndList, - IN UINT CodePage) -{ - UINT iItem, iDupItem; - CPINFOEXW CPInfo; - - /* - * Add only valid code pages, that is: - * - If the CodePage is one of the reserved (alias) values: - * CP_ACP == 0 ; CP_OEMCP == 1 ; CP_MACCP == 2 ; CP_THREAD_ACP == 3 ; - * or the deprecated CP_SYMBOL == 42 (see
http://archives.miloush.net/michkap/archive/2005/11/08/490495.html
) - * it is considered invalid. - * - If IsValidCodePage() fails because the code page is listed but - * not installed on the system, it is also considered invalid. - */ - if (CodePage == CP_ACP || CodePage == CP_OEMCP || CodePage == CP_MACCP || - CodePage == CP_THREAD_ACP || CodePage == CP_SYMBOL || !IsValidCodePage(CodePage)) - { - return; - } - - /* Retrieve the code page display name */ - if (!GetCPInfoExW(CodePage, 0, &CPInfo)) - { - /* We failed, just use the code page value as its name */ - // _ultow(CodePage, CPInfo.CodePageName, 10); - _snwprintf(CPInfo.CodePageName, ARRAYSIZE(CPInfo.CodePageName), L"%lu", CodePage); - } - - /* Add the code page into the list, sorted by code page value. Avoid any duplicates. */ - iDupItem = CB_ERR; - iItem = BisectListSortedByValue(hWndList, CodePage, &iDupItem, TRUE); - if (iItem == CB_ERR) - iItem = 0; - if (iDupItem != CB_ERR) - return; - iItem = (UINT)SendMessageW(hWndList, CB_INSERTSTRING, iItem, (LPARAM)CPInfo.CodePageName); - if (iItem != CB_ERR && iItem != CB_ERRSPACE) - iItem = SendMessageW(hWndList, CB_SETITEMDATA, iItem, CodePage); -} - -static VOID -BuildCodePageList(IN HWND hDlg) -{ - HWND hWndList; - HKEY hKey; - DWORD dwIndex, dwSize, dwType; - UINT CodePage; - WCHAR szValueName[MAX_VALUE_NAME]; - - // #define REGSTR_PATH_CODEPAGE TEXT("System\\CurrentControlSet\\Control\\Nls\\CodePage") - /* Open the Nls\CodePage key */ - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"System\\CurrentControlSet\\Control\\Nls\\CodePage", - 0, - KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, - &hKey) != ERROR_SUCCESS) - { - return; - } - - hWndList = GetDlgItem(hDlg, IDL_CODEPAGE); - - /* Enumerate all the available code pages on the system */ - dwSize = ARRAYSIZE(szValueName); - dwIndex = 0; - while (RegEnumValueW(hKey, dwIndex, szValueName, &dwSize, - NULL, &dwType, NULL, NULL) == ERROR_SUCCESS) // != ERROR_NO_MORE_ITEMS - { - /* Ignore these parameters, prepare for next iteration */ - dwSize = ARRAYSIZE(szValueName); - ++dwIndex; - - /* Check the value type validity */ - if (dwType != REG_SZ) - continue; - - /* - * Add the code page into the list. - * If _wtol fails and returns 0, the code page is considered invalid - * (and indeed this value corresponds to the CP_ACP alias too). - */ - CodePage = (UINT)_wtol(szValueName); - if (CodePage == 0) continue; - AddCodePage(hWndList, CodePage); - } - - RegCloseKey(hKey); - - /* Add the special UTF-7 (CP_UTF7 65000) and UTF-8 (CP_UTF8 65001) code pages */ - AddCodePage(hWndList, CP_UTF7); - AddCodePage(hWndList, CP_UTF8); - - /* Find and select the current code page in the sorted list */ - if (BisectListSortedByValue(hWndList, ConInfo->CodePage, &CodePage, FALSE) == CB_ERR || - CodePage == CB_ERR) - { - /* Not found, select the first element */ - CodePage = 0; - } - SendMessageW(hWndList, CB_SETCURSEL, (WPARAM)CodePage, 0); -} - -static VOID -UpdateDialogElements(HWND hwndDlg, PCONSOLE_STATE_INFO pConInfo) -{ - HWND hDlgCtrl; - - /* Update cursor size */ - if (pConInfo->CursorSize <= 25) - { - /* Small cursor */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (pConInfo->CursorSize <= 50) - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else /* if (pConInfo->CursorSize <= 100) */ - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - - /* Update num buffers */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_NUM_BUFFER); - SendMessageW(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG(999, 1)); - SetDlgItemInt(hwndDlg, IDC_EDIT_NUM_BUFFER, pConInfo->NumberOfHistoryBuffers, FALSE); - - /* Update buffer size */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_BUFFER_SIZE); - SendMessageW(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG(999, 1)); - SetDlgItemInt(hwndDlg, IDC_EDIT_BUFFER_SIZE, pConInfo->HistoryBufferSize, FALSE); - - /* Update discard duplicates */ - CheckDlgButton(hwndDlg, IDC_CHECK_DISCARD_DUPLICATES, - pConInfo->HistoryNoDup ? BST_CHECKED : BST_UNCHECKED); - - /* Update full/window screen */ - if (pConInfo->FullScreen) - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); - SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - - /* Update quick edit */ - CheckDlgButton(hwndDlg, IDC_CHECK_QUICK_EDIT, - pConInfo->QuickEdit ? BST_CHECKED : BST_UNCHECKED); - - /* Update insert mode */ - CheckDlgButton(hwndDlg, IDC_CHECK_INSERT_MODE, - pConInfo->InsertMode ? BST_CHECKED : BST_UNCHECKED); -} - -INT_PTR -CALLBACK -OptionsProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - { - BuildCodePageList(hwndDlg); - UpdateDialogElements(hwndDlg, ConInfo); - return TRUE; - } - - case WM_NOTIFY: - { - LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; - - if (lppsn->hdr.code == UDN_DELTAPOS) - { - LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; - - if (lppsn->hdr.idFrom == IDC_UPDOWN_BUFFER_SIZE) - { - lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999); - ConInfo->HistoryBufferSize = lpnmud->iPos; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - else if (lppsn->hdr.idFrom == IDC_UPDOWN_NUM_BUFFER) - { - lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999); - ConInfo->NumberOfHistoryBuffers = lpnmud->iPos; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - } - else if (lppsn->hdr.code == PSN_APPLY) - { - ApplyConsoleInfo(hwndDlg); - return TRUE; - } - break; - } - - case WM_COMMAND: - { - LRESULT lResult; - - switch (LOWORD(wParam)) - { - case IDC_RADIO_SMALL_CURSOR: - { - ConInfo->CursorSize = 25; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_RADIO_MEDIUM_CURSOR: - { - ConInfo->CursorSize = 50; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_RADIO_LARGE_CURSOR: - { - ConInfo->CursorSize = 100; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_RADIO_DISPLAY_WINDOW: - { - ConInfo->FullScreen = FALSE; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_RADIO_DISPLAY_FULL: - { - ConInfo->FullScreen = TRUE; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_CHECK_QUICK_EDIT: - { - lResult = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0); - if (lResult == BST_CHECKED) - { - ConInfo->QuickEdit = FALSE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (lResult == BST_UNCHECKED) - { - ConInfo->QuickEdit = TRUE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_CHECK_INSERT_MODE: - { - lResult = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0); - if (lResult == BST_CHECKED) - { - ConInfo->InsertMode = FALSE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (lResult == BST_UNCHECKED) - { - ConInfo->InsertMode = TRUE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_CHECK_DISCARD_DUPLICATES: - { - lResult = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0); - if (lResult == BST_CHECKED) - { - ConInfo->HistoryNoDup = FALSE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (lResult == BST_UNCHECKED) - { - ConInfo->HistoryNoDup = TRUE; - SendMessageW((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - break; - } - case IDC_EDIT_BUFFER_SIZE: - { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD sizeBuff; - - sizeBuff = GetDlgItemInt(hwndDlg, IDC_EDIT_BUFFER_SIZE, NULL, FALSE); - sizeBuff = min(max(sizeBuff, 1), 999); - - ConInfo->HistoryBufferSize = sizeBuff; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - case IDC_EDIT_NUM_BUFFER: - { - if (HIWORD(wParam) == EN_KILLFOCUS) - { - DWORD numBuff; - - numBuff = GetDlgItemInt(hwndDlg, IDC_EDIT_NUM_BUFFER, NULL, FALSE); - numBuff = min(max(numBuff, 1), 999); - - ConInfo->NumberOfHistoryBuffers = numBuff; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - case IDL_CODEPAGE: - { - if (HIWORD(wParam) == CBN_SELENDOK) - { - INT iItem; - UINT CodePage; - - iItem = (INT)SendMessageW((HWND)lParam, CB_GETCURSEL, 0, 0); - if (iItem != CB_ERR) - { - CodePage = (UINT)SendMessageW((HWND)lParam, CB_GETITEMDATA, iItem, 0); - if (CodePage != CB_ERR) - { - ConInfo->CodePage = CodePage; - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - } - } - break; - } - default: - break; - } - break; - } - - default: - break; - } - - return FALSE; -}
7 years, 7 months
1
0
0
0
[hbelusca] 74465: [CONSOLE.CPL]: Harmonize most of the resources (sizes of dialog controls for some dialogs), and add some new controls in the font dialog that will be used soon. To translators: Pl...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed May 3 20:23:12 2017 New Revision: 74465 URL:
http://svn.reactos.org/svn/reactos?rev=74465&view=rev
Log: [CONSOLE.CPL]: Harmonize most of the resources (sizes of dialog controls for some dialogs), and add some new controls in the font dialog that will be used soon. To translators: Please check that I haven't broken any translations! :) CORE-13182 Modified: trunk/reactos/dll/cpl/console/lang/bg-BG.rc trunk/reactos/dll/cpl/console/lang/cs-CZ.rc trunk/reactos/dll/cpl/console/lang/de-DE.rc trunk/reactos/dll/cpl/console/lang/en-US.rc trunk/reactos/dll/cpl/console/lang/es-ES.rc trunk/reactos/dll/cpl/console/lang/fr-FR.rc trunk/reactos/dll/cpl/console/lang/he-IL.rc trunk/reactos/dll/cpl/console/lang/id-ID.rc trunk/reactos/dll/cpl/console/lang/it-IT.rc trunk/reactos/dll/cpl/console/lang/ja-JP.rc trunk/reactos/dll/cpl/console/lang/no-NO.rc trunk/reactos/dll/cpl/console/lang/pl-PL.rc trunk/reactos/dll/cpl/console/lang/pt-BR.rc trunk/reactos/dll/cpl/console/lang/ro-RO.rc trunk/reactos/dll/cpl/console/lang/ru-RU.rc trunk/reactos/dll/cpl/console/lang/sk-SK.rc trunk/reactos/dll/cpl/console/lang/sq-AL.rc trunk/reactos/dll/cpl/console/lang/tr-TR.rc trunk/reactos/dll/cpl/console/lang/uk-UA.rc trunk/reactos/dll/cpl/console/lang/zh-CN.rc trunk/reactos/dll/cpl/console/lang/zh-TW.rc trunk/reactos/dll/cpl/console/resource.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/cpl/console/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/bg-BG…
Modified: trunk/reactos/dll/cpl/console/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/cs-CZ…
Modified: trunk/reactos/dll/cpl/console/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/de-DE…
Modified: trunk/reactos/dll/cpl/console/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/en-US…
Modified: trunk/reactos/dll/cpl/console/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/es-ES…
Modified: trunk/reactos/dll/cpl/console/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/fr-FR…
Modified: trunk/reactos/dll/cpl/console/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/he-IL…
Modified: trunk/reactos/dll/cpl/console/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/id-ID…
Modified: trunk/reactos/dll/cpl/console/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/it-IT…
Modified: trunk/reactos/dll/cpl/console/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/ja-JP…
Modified: trunk/reactos/dll/cpl/console/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/no-NO…
Modified: trunk/reactos/dll/cpl/console/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/pl-PL…
Modified: trunk/reactos/dll/cpl/console/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/pt-BR…
Modified: trunk/reactos/dll/cpl/console/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/ro-RO…
Modified: trunk/reactos/dll/cpl/console/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/ru-RU…
Modified: trunk/reactos/dll/cpl/console/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/sk-SK…
Modified: trunk/reactos/dll/cpl/console/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/sq-AL…
Modified: trunk/reactos/dll/cpl/console/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/tr-TR…
Modified: trunk/reactos/dll/cpl/console/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/uk-UA…
Modified: trunk/reactos/dll/cpl/console/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/zh-CN…
Modified: trunk/reactos/dll/cpl/console/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/lang/zh-TW…
Modified: trunk/reactos/dll/cpl/console/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/resource.h…
7 years, 7 months
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Results per page:
10
25
50
100
200