From 0568d17ef72c887d8d49371e249a43e3048cb723 Mon Sep 17 00:00:00 2001 From: kichik Date: Sun, 25 May 2003 17:51:20 +0000 Subject: [PATCH] LicenseBkColor now supports /windows (default = white) and /grey (default = grey) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2570 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 2 ++ Source/exehead/Ui.c | 4 +++- Source/script.cpp | 19 ++++++++++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index c6d949e4..31c4752e 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -317,6 +317,8 @@ CEXEBuild::CEXEBuild() uDefCodePage=CP_ACP; use_first_insttype=true; + + build_header.license_bg=-COLOR_BTNFACE; } int CEXEBuild::getcurdbsize() { return cur_datablock->getlen(); } diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index b52dfb54..8f11e556 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -573,7 +573,9 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM hwLicense=GetUIItem(IDC_EDIT1); SendMessage(hwLicense,EM_AUTOURLDETECT,TRUE,0); - SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,g_inst_header->license_bg>=0?g_inst_header->license_bg:GetSysColor(COLOR_BTNFACE)); +#define lbg g_inst_header->license_bg + SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,lbg>=0?lbg:GetSysColor(-lbg)); +#undef lbg SendMessage(hwLicense,EM_SETEVENTMASK,0,ENM_LINK|ENM_KEYEVENTS); //XGE 8th September 2002 Or'd in ENM_KEYEVENTS dwRead=0; SendMessage(hwLicense,EM_EXLIMITTEXT,0,mystrlen((char*)es.dwCookie)); diff --git a/Source/script.cpp b/Source/script.cpp index 9d46eb31..fea23cd2 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -1206,9 +1206,22 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char case TOK_LICENSEBKCOLOR: { char *p = line.gettoken_str(1); - int v=strtoul(p,&p,16); - build_header.license_bg=((v&0xff)<<16)|(v&0xff00)|((v&0xff0000)>>16); - SCRIPT_MSG("LicenseBkColor: %06X\n",v); + if (!strcmpi(p,"/windows")) + { + build_header.license_bg=-COLOR_WINDOW; + SCRIPT_MSG("LicenseBkColor: /windows\n"); + } + else if (!strcmpi(p,"/grey") || !strcmpi(p,"/gray")) + { + build_header.license_bg=-COLOR_BTNFACE; + SCRIPT_MSG("LicenseBkColor: /grey\n"); + } + else + { + int v=strtoul(p,&p,16); + build_header.license_bg=((v&0xff)<<16)|(v&0xff00)|((v&0xff0000)>>16); + SCRIPT_MSG("LicenseBkColor: %06X\n",v); + } } return make_sure_not_in_secorfunc(line.gettoken_str(0)); #else//!NSIS_CONFIG_LICENSEPAGE