- NSISdl will now take the installer's style

- Little typo in script.cpp


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2569 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-05-25 17:10:14 +00:00
parent 409385923a
commit 3c29d31593
5 changed files with 39 additions and 15 deletions

View file

@ -30,9 +30,11 @@ IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 265, 104
STYLE DS_CONTROL | WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,
0,36,265,11
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",NOT
WS_VISIBLE | WS_BORDER,0,36,265,11
CTEXT "",IDC_STATIC2,0,25,263,8
CONTROL "Progress1",IDC_PROGRESS2,"msctls_progress32",PBS_SMOOTH |
NOT WS_VISIBLE | WS_BORDER,0,37,265,11
END

View file

@ -195,32 +195,54 @@ __declspec(dllexport) void download (HWND parent,
DownloadDialogProc);
if (dlg)
{
int pbid = IDC_PROGRESS1;
HWND hwPb = GetDlgItem(childwnd, 1004);
// Set progress bar style
if (GetWindowLong(hwPb, GWL_STYLE) & PBS_SMOOTH)
pbid = IDC_PROGRESS2;
HWND pb = g_hwndProgressBar = GetDlgItem(dlg, pbid);
long c;
if (hwPb)
{
c = SendMessage(hwPb, PBM_SETBARCOLOR, 0, 0);
SendMessage(hwPb, PBM_SETBARCOLOR, 0, c);
SendMessage(pb, PBM_SETBARCOLOR, 0, c);
c = SendMessage(hwPb, PBM_SETBKCOLOR, 0, 0);
SendMessage(hwPb, PBM_SETBKCOLOR, 0, c);
SendMessage(pb, PBM_SETBKCOLOR, 0, c);
}
ShowWindow(pb, SW_SHOW);
GetWindowRect(dlg,&cr);
ScreenToClient(dlg,(LPPOINT)&cr);
ScreenToClient(dlg,((LPPOINT)&cr)+1);
GetWindowRect(GetDlgItem(childwnd,1016),&r);
GetWindowRect(hwndL,&r);
ScreenToClient(childwnd,(LPPOINT)&r);
ScreenToClient(childwnd,((LPPOINT)&r)+1);
SetWindowPos(dlg,0,r.left,r.top,r.right-r.left,cr.bottom-cr.top,SWP_NOACTIVATE|SWP_NOZORDER);
AdjustSize(IDC_STATIC2);
AdjustSize(IDC_PROGRESS1);
AdjustSize(pbid);
ShowWindow(dlg,SW_SHOWNA);
char *p=filename;
while (*p) p++;
while (*p != '\\' && p != filename) p=CharPrev(filename,p);
wsprintf(buf,szDownloading, p!=filename?p+1:p);
SetDlgItemText(childwnd,1006,buf);
SetDlgItemText (dlg, IDC_STATIC2, szConnecting);
SetDlgItemText(dlg, IDC_STATIC2, szConnecting);
// set font
long hFont = SendMessage(parent, WM_GETFONT, 0, 0);
SendDlgItemMessage(dlg, IDC_PROGRESS1, WM_SETFONT, hFont, 0);
SendDlgItemMessage(dlg, pbid, WM_SETFONT, hFont, 0);
SendDlgItemMessage(dlg, IDC_STATIC2, WM_SETFONT, hFont, 0);
}
}
g_hwndProgressBar = GetDlgItem (dlg, IDC_PROGRESS1);
JNL_HTTPGet *get = 0;
{
@ -427,5 +449,4 @@ __declspec(dllexport) void download_quiet(HWND parent,
download(NULL,stringsize,variables,stacktop);
}
} //extern "C"
} //extern "C"

View file

@ -4,16 +4,17 @@
//
#define IDD_DIALOG1 101
#define IDC_PROGRESS1 1001
#define IDC_STATIC1 1002
#define IDC_STATIC2 1003
#define IDC_PROGRESS2 1002
#define IDC_STATIC1 1003
#define IDC_STATIC2 1004
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Binary file not shown.

View file

@ -1197,7 +1197,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
free(dlg);
}
catch (exception& err) {
ERROR_MSG("Error setting smooth progress bar: %s\n", err.what());
ERROR_MSG("Error in LicenseForceSelection: %s\n", err.what());
return PS_ERROR;
}
SCRIPT_MSG("LicenseForceSelection: %s \"%s\" \"%s\"\n", line.gettoken_str(1+a), line.gettoken_str(2+a), line.gettoken_str(3+a));