SetStaticBkColor -> SetBkColor, now works for dialogs, buttons, edit boxes and list boxes (only in IO)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2347 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-03-20 20:49:13 +00:00
parent 2e9cb6d4e9
commit 03cafaf818
15 changed files with 68 additions and 68 deletions

View file

@ -129,16 +129,22 @@ static BOOL NSISCALL SetDlgItemTextFromLang_(HWND dlg, int id, int lid) {
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
#define HandleStaticBkColor() _HandleStaticBkColor(uMsg, wParam, lParam)
static BOOL NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (uMsg == WM_CTLCOLORSTATIC) {
BOOL brush = (BOOL)GetWindowLong((HWND)lParam, GWL_USERDATA);
if (brush == -1) {
COLORREF dlgColor = GetSysColor(COLOR_BTNFACE);
SetBkColor((HDC)wParam, dlgColor);
SetTextColor((HDC)wParam, dlgColor);
return (BOOL)GetStockObject(NULL_BRUSH);
switch (uMsg) {
case WM_CTLCOLORSTATIC:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORDLG:
case WM_CTLCOLORBTN:
{
BOOL brush = (BOOL)GetWindowLong((HWND)lParam, GWL_USERDATA);
if (brush == -1) {
COLORREF dlgColor = GetSysColor(COLOR_BTNFACE);
SetBkColor((HDC)wParam, dlgColor);
SetTextColor((HDC)wParam, dlgColor);
return (BOOL)GetStockObject(NULL_BRUSH);
}
SetBkMode((HDC)wParam, TRANSPARENT);
return brush;
}
SetBkMode((HDC)wParam, TRANSPARENT);
return (BOOL)GetWindowLong((HWND)lParam, GWL_USERDATA);
}
return 0;
}

View file

@ -55,13 +55,9 @@
#define NSIS_CONFIG_VISIBLE_SUPPORT
// NSIS_CONFIG_ENHANCEDUI_SUPPORT enables support for CreateFont,
// SetStaticBkColor (used by some UIs), SetBrandingImage, .onInitDialog, etc
// SetBkColor (used by some UIs), SetBrandingImage, .onInitDialog, etc
#define NSIS_CONFIG_ENHANCEDUI_SUPPORT
// Changed by Amir Szekely 31st July 2002
// Now supports runtime choice of compression method
// NSIS_CONFIG_COMPRESSION_SUPPORT enables support for making installers
// that use compression (recommended).
#define NSIS_CONFIG_COMPRESSION_SUPPORT

View file

@ -607,17 +607,16 @@ static int NSISCALL ExecuteEntry(entry *entry_)
int v,v2;
v=process_string_fromparm_toint(0);
v2=process_string_fromparm_toint(1);
if (v<v2) return parm3;
if (v>v2) return parm4;
}
return parm2;
case EW_INTCMPU:
{
unsigned int v,v2;
v=(unsigned int)process_string_fromparm_toint(0);
v2=(unsigned int)process_string_fromparm_toint(1);
if (v<v2) return parm3;
if (v>v2) return parm4;
if (!parm5) {
// signed
if (v<v2) return parm3;
if (v>v2) return parm4;
}
else {
// unsigned
if ((unsigned int)v<(unsigned int)v2) return parm3;
if ((unsigned int)v>(unsigned int)v2) return parm4;
}
}
return parm2;
case EW_INTOP:
@ -746,7 +745,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
NSIS_MAX_STRLEN
);
return 0;
case EW_SETSTATICBKCOLOR:
case EW_SETBKCOLOR:
DeleteObject(
(HGDIOBJ)SetWindowLong(
(HWND)process_string_fromparm_toint(0),
@ -769,7 +768,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
parm2?r.bottom-r.top:0,
LR_LOADFROMFILE
);
DeleteObject((HGDIOBJ)SetWindowLong(hwImage,DWL_USER,(LONG)hImage));
DeleteObject((HGDIOBJ)SetWindowLong(hwImage,GWL_USERDATA,(LONG)hImage));
SendMessage(
hwImage,
STM_SETIMAGE,

View file

@ -77,8 +77,7 @@ enum
EW_READENVSTR, // ReadEnvStr/ExpandEnvStrings: 3 [output, string_with_env_variables, IsRead]
#endif
#ifdef NSIS_SUPPORT_INTOPTS
EW_INTCMP, // IntCmp: 5 [val1, val2, equal, val1<val2, val1>val2]
EW_INTCMPU, // IntCmpU: 5 [val1, val2, equal, val1<val2, val1>val2]
EW_INTCMP, // IntCmp: 6 [val1, val2, equal, val1<val2, val1>val2, unsigned?]
EW_INTOP, // IntOp: 4 [output, input1, input2, op] where op: 0=add, 1=sub, 2=mul, 3=div, 4=bor, 5=band, 6=bxor, 7=bnot input1, 8=lnot input1, 9=lor, 10=land], 11=1%2
EW_INTFMT, // IntFmt: [output, format, input]
#endif
@ -94,7 +93,7 @@ enum
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
EW_GETDLGITEM, // GetDlgItem: 3: [outputvar, dialog, item_id]
EW_GETWINTEXT, // GetWindowText: 2: [outputvar, hwnd]
EW_SETSTATICBKCOLOR, // SerStaticBkColor: 3: [hwnd, color]
EW_SETBKCOLOR, // SerBkColor: 2: [hwnd, color]
EW_SETBRANDINGIMAGE, // SetBrandingImage: 1: [Bitmap file]
EW_CREATEFONT, // CreateFont: 5: [handle output, face name, height, weight, flags]
EW_SHOWWINDOW, // ShowWindow: 2: [hwnd, show state]