MakeNSISW is now System DPI aware (16x16, 24x24 and 32x32 toolbar images)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7042 212acab6-be3b-0410-9dea-997c60f758d6
|
@ -201,6 +201,8 @@ Version History
|
||||||
|
|
||||||
2.3.4
|
2.3.4
|
||||||
- Added Window Info/Spy feature
|
- Added Window Info/Spy feature
|
||||||
|
- System DPI aware
|
||||||
|
- New toolbar images
|
||||||
|
|
||||||
|
|
||||||
Copyright Information
|
Copyright Information
|
||||||
|
|
|
@ -18,11 +18,16 @@ resources = Split("""
|
||||||
assoc_nsi.ico
|
assoc_nsi.ico
|
||||||
assoc_nsh.ico
|
assoc_nsh.ico
|
||||||
makensisw.xml
|
makensisw.xml
|
||||||
logo.bmp
|
|
||||||
toolbar.bmp
|
toolbar.bmp
|
||||||
toolbar24.bmp
|
toolbar16n24.bmp
|
||||||
toolbar24d.bmp
|
toolbar16d24.bmp
|
||||||
toolbar24h.bmp
|
toolbar16h24.bmp
|
||||||
|
toolbar24n24.bmp
|
||||||
|
toolbar24d24.bmp
|
||||||
|
toolbar24h24.bmp
|
||||||
|
toolbar32n24.bmp
|
||||||
|
toolbar32d24.bmp
|
||||||
|
toolbar32h24.bmp
|
||||||
""")
|
""")
|
||||||
|
|
||||||
libs = Split("""
|
libs = Split("""
|
||||||
|
|
Before Width: | Height: | Size: 7.2 KiB |
|
@ -1 +0,0 @@
|
||||||
Paint Shop Pro Image File
|
|
|
@ -192,6 +192,44 @@ DWORD CALLBACK SaveFileStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb
|
||||||
return (*pcb = (LONG) cbio, !wop);
|
return (*pcb = (LONG) cbio, !wop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ToolBarSizeChanged(HWND hDlg)
|
||||||
|
{
|
||||||
|
RECT r;
|
||||||
|
HWND hEd = GetDlgItem(hDlg, IDC_LOGWIN);
|
||||||
|
GetWindowRect(g_toolbar.hwnd, &r);
|
||||||
|
LONG tbh = RectH(r);
|
||||||
|
GetWindowRect(hEd, &r);
|
||||||
|
LONG oldh = RectH(r), margin = DlgUnitToPixelY(hDlg, 7), top = tbh + margin;
|
||||||
|
POINT pt = { r.left, r.top };
|
||||||
|
ScreenToClient(hDlg, &pt);
|
||||||
|
SetWindowPos(hEd, 0, pt.x, top, RectW(r), oldh + (pt.y - top), SWP_NOZORDER|SWP_NOACTIVATE); // Update IDC_LOGWIN position and size
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CALLBACK DialogResize(HWND hWnd, LPARAM /* unused */)
|
||||||
|
{
|
||||||
|
RECT r, r2;
|
||||||
|
GetWindowRect(hWnd, &r);
|
||||||
|
ScreenToClient(g_sdata.hwnd, ((LPPOINT)&r)+0), ScreenToClient(g_sdata.hwnd, ((LPPOINT)&r)+1);
|
||||||
|
switch (GetDlgCtrlID(hWnd))
|
||||||
|
{
|
||||||
|
case IDC_TOOLBAR:
|
||||||
|
GetWindowRect(hWnd, &r2);
|
||||||
|
SetWindowPos(hWnd, 0, 0, 0, RectW(r) + g_resize.dx, RectH(r2), SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
|
break;
|
||||||
|
case IDC_LOGWIN:
|
||||||
|
SetWindowPos(hWnd, 0, r.left, r.top, RectW(r) + g_resize.dx, RectH(r) + g_resize.dy, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE);
|
||||||
|
break;
|
||||||
|
case IDC_TEST:
|
||||||
|
case IDCANCEL:
|
||||||
|
SetWindowPos(hWnd, 0, r.left + g_resize.dx, r.top + g_resize.dy, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SetWindowPos(hWnd, 0, r.left, r.top + g_resize.dy, RectW(r) + g_resize.dx, RectH(r), SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
RedrawWindow(hWnd,NULL,NULL,RDW_INVALIDATE);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
|
@ -219,6 +257,7 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
SetScript(_T(""));
|
SetScript(_T(""));
|
||||||
g_sdata.compressor = COMPRESSOR_NONE_SELECTED;
|
g_sdata.compressor = COMPRESSOR_NONE_SELECTED;
|
||||||
g_sdata.userSelectCompressor = FALSE;
|
g_sdata.userSelectCompressor = FALSE;
|
||||||
|
ToolBarSizeChanged(hwndDlg);
|
||||||
|
|
||||||
ProcessCommandLine();
|
ProcessCommandLine();
|
||||||
|
|
||||||
|
@ -227,7 +266,7 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
|
|
||||||
if(g_sdata.userSelectCompressor) {
|
if(g_sdata.userSelectCompressor) {
|
||||||
if (DialogBox(g_sdata.hInstance,MAKEINTRESOURCE(DLG_COMPRESSOR),g_sdata.hwnd,(DLGPROC)CompressorProc)) {
|
if (DialogBox(g_sdata.hInstance,MAKEINTRESOURCE(DLG_COMPRESSOR),g_sdata.hwnd,API_cast<DLGPROC>(CompressorProc))) {
|
||||||
EnableItems(g_sdata.hwnd);
|
EnableItems(g_sdata.hwnd);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -295,16 +334,12 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
{
|
{
|
||||||
if ((wParam == SIZE_MAXHIDE)||(wParam == SIZE_MAXSHOW)) return TRUE;
|
if (wParam == SIZE_MAXHIDE || wParam == SIZE_MAXSHOW) return TRUE;
|
||||||
RECT rSize;
|
const LONG oldW = g_resize.resizeRect.right, oldH = g_resize.resizeRect.bottom;
|
||||||
if (hwndDlg == g_sdata.hwnd) {
|
GetClientRect(hwndDlg, &g_resize.resizeRect);
|
||||||
GetClientRect(g_sdata.hwnd, &rSize);
|
g_resize.dx = g_resize.resizeRect.right - oldW;
|
||||||
if (((rSize.right==0)&&(rSize.bottom==0))||((g_resize.resizeRect.right==0)&&(g_resize.resizeRect.bottom==0))) return TRUE;
|
g_resize.dy = g_resize.resizeRect.bottom - oldH;
|
||||||
g_resize.dx = rSize.right - g_resize.resizeRect.right;
|
EnumChildWindows(g_sdata.hwnd, DialogResize, (LPARAM) 0);
|
||||||
g_resize.dy = rSize.bottom - g_resize.resizeRect.bottom;
|
|
||||||
EnumChildWindows(g_sdata.hwnd, DialogResize, (LPARAM)0);
|
|
||||||
g_resize.resizeRect = rSize;
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case WM_SIZING:
|
case WM_SIZING:
|
||||||
|
@ -317,7 +352,7 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
{
|
{
|
||||||
RECT r = g_resize.griprect;
|
RECT r = g_resize.griprect;
|
||||||
MapWindowPoints(hwndDlg, 0, (POINT*)&r, 2);
|
MapWindowPoints(hwndDlg, 0, (POINT*)&r, 2);
|
||||||
POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
|
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||||
if (PtInRect(&r, pt))
|
if (PtInRect(&r, pt))
|
||||||
{
|
{
|
||||||
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, HTBOTTOMRIGHT);
|
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, HTBOTTOMRIGHT);
|
||||||
|
@ -590,7 +625,7 @@ INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
case IDM_SETTINGS:
|
case IDM_SETTINGS:
|
||||||
{
|
{
|
||||||
DialogBox(g_sdata.hInstance,MAKEINTRESOURCE(DLG_SETTINGS),g_sdata.hwnd,(DLGPROC)SettingsProc);
|
DialogBox(g_sdata.hInstance,MAKEINTRESOURCE(DLG_SETTINGS),g_sdata.hwnd,API_cast<DLGPROC>(SettingsProc));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case IDM_WNDSPY:
|
case IDM_WNDSPY:
|
||||||
|
@ -788,35 +823,6 @@ logappendfinal:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CALLBACK DialogResize(HWND hWnd, LPARAM /* unused */)
|
|
||||||
{
|
|
||||||
RECT r;
|
|
||||||
GetWindowRect(hWnd, &r);
|
|
||||||
ScreenToClient(g_sdata.hwnd, (LPPOINT)&r);
|
|
||||||
ScreenToClient(g_sdata.hwnd, ((LPPOINT)&r)+1);
|
|
||||||
if(hWnd != g_toolbar.hwnd) {
|
|
||||||
switch (GetDlgCtrlID(hWnd)) {
|
|
||||||
case IDC_LOGWIN:
|
|
||||||
SetWindowPos(hWnd, 0, r.left, r.top,r.right - r.left + g_resize.dx, r.bottom - r.top + g_resize.dy, SWP_NOZORDER|SWP_NOMOVE);
|
|
||||||
break;
|
|
||||||
case IDC_TEST:
|
|
||||||
case IDCANCEL:
|
|
||||||
SetWindowPos(hWnd, 0, r.left + g_resize.dx, r.top + g_resize.dy, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
SetWindowPos(hWnd, 0, r.left, r.top + g_resize.dy, r.right - r.left + g_resize.dx, r.bottom - r.top, SWP_NOZORDER);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
RECT r2;
|
|
||||||
GetWindowRect(g_toolbar.hwnd, &r2);
|
|
||||||
SetWindowPos(hWnd, 0, 0, 0, r.right - r.left + g_resize.dx, r2.bottom-r2.top, SWP_NOMOVE|SWP_NOZORDER);
|
|
||||||
}
|
|
||||||
RedrawWindow(hWnd,NULL,NULL,RDW_INVALIDATE);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static INT_PTR CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
static INT_PTR CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
ABOUTDLGDATA &dd = *(ABOUTDLGDATA*) g_ModalDlgData;
|
ABOUTDLGDATA &dd = *(ABOUTDLGDATA*) g_ModalDlgData;
|
||||||
switch(msg) {
|
switch(msg) {
|
||||||
|
@ -828,7 +834,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
|
||||||
const TCHAR txt[] = TEXT("MakeNSISW");
|
const TCHAR txt[] = TEXT("MakeNSISW");
|
||||||
INT dt = DT_NOCLIP|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER, cch = COUNTOF(txt) - 1, line = DpiScaleY(dis.hwndItem, 2), shadow = 1;
|
INT dt = DT_NOCLIP|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER, cch = COUNTOF(txt) - 1, line = DpiScaleY(dis.hwndItem, 2), shadow = 1;
|
||||||
GetClientRect(dis.hwndItem, &r);
|
GetClientRect(dis.hwndItem, &r);
|
||||||
if (!dd.FinalHeaderPos)
|
if (!dd.hHeaderFont)
|
||||||
dd.hHeaderFont = CreateFont(0, CFF_RAWSIZE, r.bottom / 2, FW_BOLD, DEFAULT_PITCH|FF_DONTCARE, ANSI_CHARSET, _T("Trebuchet MS")); // IE4.01SP2+
|
dd.hHeaderFont = CreateFont(0, CFF_RAWSIZE, r.bottom / 2, FW_BOLD, DEFAULT_PITCH|FF_DONTCARE, ANSI_CHARSET, _T("Trebuchet MS")); // IE4.01SP2+
|
||||||
HGDIOBJ hOrgFont = SelectObject(dis.hDC, dd.hHeaderFont);
|
HGDIOBJ hOrgFont = SelectObject(dis.hDC, dd.hHeaderFont);
|
||||||
DrawHorzGradient(dis.hDC, r.left, r.top, r.right, r.bottom - line, RGB(22, 77, 160), RGB(29, 100, 207));
|
DrawHorzGradient(dis.hDC, r.left, r.top, r.right, r.bottom - line, RGB(22, 77, 160), RGB(29, 100, 207));
|
||||||
|
|
|
@ -64,8 +64,8 @@
|
||||||
#define EXENAME _T("makensis.exe")
|
#define EXENAME _T("makensis.exe")
|
||||||
#define MAX_STRING 256
|
#define MAX_STRING 256
|
||||||
#define TIMEOUT 100
|
#define TIMEOUT 100
|
||||||
#define MINWIDTH 350
|
#define MINWIDTH 400
|
||||||
#define MINHEIGHT 180
|
#define MINHEIGHT 220
|
||||||
#define COMPRESSOR_MESSAGE _T("\n\nThe %s compressor created the smallest installer (%d bytes).")
|
#define COMPRESSOR_MESSAGE _T("\n\nThe %s compressor created the smallest installer (%d bytes).")
|
||||||
#define RESTORED_COMPRESSOR_MESSAGE _T("\n\nThe %s compressor created the smallest installer (%d bytes).")
|
#define RESTORED_COMPRESSOR_MESSAGE _T("\n\nThe %s compressor created the smallest installer (%d bytes).")
|
||||||
#define EXE_HEADER_COMPRESSOR_STAT _T("EXE header size:")
|
#define EXE_HEADER_COMPRESSOR_STAT _T("EXE header size:")
|
||||||
|
@ -164,7 +164,6 @@ extern void* g_ModalDlgData;
|
||||||
|
|
||||||
DWORD WINAPI MakeNSISProc(LPVOID TreadParam);
|
DWORD WINAPI MakeNSISProc(LPVOID TreadParam);
|
||||||
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
BOOL CALLBACK DialogResize(HWND hWnd, LPARAM /* unused*/);
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
enum { TID_HEADER = 1 };
|
enum { TID_HEADER = 1 };
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security>
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security>
|
||||||
<requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/></requestedPrivileges>
|
<requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/></requestedPrivileges>
|
||||||
</security></trustInfo>
|
</security></trustInfo>
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings><dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware></windowsSettings></application>
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application>
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application>
|
||||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||||
|
|
|
@ -36,17 +36,24 @@
|
||||||
#define IDI_ASSOC_NSH 113
|
#define IDI_ASSOC_NSH 113
|
||||||
#define IDB_LOGO 115
|
#define IDB_LOGO 115
|
||||||
#define DLG_SETTINGS 116
|
#define DLG_SETTINGS 116
|
||||||
|
#define DLG_WNDSPY 117
|
||||||
#define IDB_TOOLBAR 122
|
#define IDB_TOOLBAR 122
|
||||||
#define DLG_COMPRESSOR 124
|
#define DLG_COMPRESSOR 124
|
||||||
#define DLG_SYMBOLSET 125
|
#define DLG_SYMBOLSET 125
|
||||||
#define IDB_TOOLBAR24 129
|
#define IDB_TOOLBAR16N24 129
|
||||||
#define IDB_TOOLBAR24D 130
|
#define IDB_TOOLBAR16D24 130
|
||||||
#define IDB_TOOLBAR24H 131
|
#define IDB_TOOLBAR16H24 131
|
||||||
#define DLG_WNDSPY 133
|
#define IDB_TOOLBAR24N24 132
|
||||||
|
#define IDB_TOOLBAR24D24 133
|
||||||
|
#define IDB_TOOLBAR24H24 134
|
||||||
|
#define IDB_TOOLBAR32N24 135
|
||||||
|
#define IDB_TOOLBAR32D24 136
|
||||||
|
#define IDB_TOOLBAR32H24 137
|
||||||
|
|
||||||
#define IDC_VERSION 200
|
#define IDC_VERSION 200
|
||||||
#define IDC_LOGWIN 201
|
#define IDC_TOOLBAR 201
|
||||||
#define IDC_TEST 202
|
#define IDC_LOGWIN 202
|
||||||
|
#define IDC_TEST 203
|
||||||
#define IDC_ABOUTVERSION 220
|
#define IDC_ABOUTVERSION 220
|
||||||
#define IDC_ABOUTCOPY 221
|
#define IDC_ABOUTCOPY 221
|
||||||
#define IDC_ABOUTPORTIONS 222
|
#define IDC_ABOUTPORTIONS 222
|
||||||
|
@ -119,7 +126,7 @@
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 134
|
#define _APS_NEXT_RESOURCE_VALUE 138
|
||||||
#define _APS_NEXT_COMMAND_VALUE 537
|
#define _APS_NEXT_COMMAND_VALUE 537
|
||||||
#define _APS_NEXT_CONTROL_VALUE 241
|
#define _APS_NEXT_CONTROL_VALUE 241
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
|
|
@ -166,7 +166,7 @@ FONT 8, "MS Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "",IDC_LOGWIN,RICHEDIT_CLASS,ES_MULTILINE | ES_AUTOVSCROLL |
|
CONTROL "",IDC_LOGWIN,RICHEDIT_CLASS,ES_MULTILINE | ES_AUTOVSCROLL |
|
||||||
ES_NOHIDESEL | ES_READONLY | ES_SAVESEL |
|
ES_NOHIDESEL | ES_READONLY | ES_SAVESEL |
|
||||||
WS_TABSTOP | WS_BORDER | WS_VSCROLL,7,22,345,186
|
WS_TABSTOP | WS_BORDER | WS_VSCROLL,7,22,348,190
|
||||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,220,346,1
|
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,220,346,1
|
||||||
LTEXT "",IDC_VERSION,7,230,200,12,WS_DISABLED
|
LTEXT "",IDC_VERSION,7,230,200,12,WS_DISABLED
|
||||||
DEFPUSHBUTTON "Test &Installer",IDC_TEST,230,226,60,15,WS_DISABLED | WS_TABSTOP
|
DEFPUSHBUTTON "Test &Installer",IDC_TEST,230,226,60,15,WS_DISABLED | WS_TABSTOP
|
||||||
|
@ -327,11 +327,16 @@ END
|
||||||
// Bitmap
|
// Bitmap
|
||||||
//
|
//
|
||||||
|
|
||||||
//IDB_LOGO BITMAP "logo.bmp"
|
|
||||||
IDB_TOOLBAR BITMAP "toolbar.bmp"
|
IDB_TOOLBAR BITMAP "toolbar.bmp"
|
||||||
IDB_TOOLBAR24 BITMAP "toolbar24.bmp"
|
IDB_TOOLBAR16N24 BITMAP "toolbar16n24.bmp"
|
||||||
IDB_TOOLBAR24D BITMAP "toolbar24d.bmp"
|
IDB_TOOLBAR16D24 BITMAP "toolbar16d24.bmp" // Note: This image should NEVER be <= 256 colors because then Windows will create its own disabled effect
|
||||||
IDB_TOOLBAR24H BITMAP "toolbar24h.bmp"
|
IDB_TOOLBAR16H24 BITMAP "toolbar16h24.bmp"
|
||||||
|
IDB_TOOLBAR24N24 BITMAP "toolbar24n24.bmp"
|
||||||
|
IDB_TOOLBAR24D24 BITMAP "toolbar24d24.bmp" // Note: This image should NEVER be <= 256 colors because then Windows will create its own disabled effect
|
||||||
|
IDB_TOOLBAR24H24 BITMAP "toolbar24h24.bmp"
|
||||||
|
IDB_TOOLBAR32N24 BITMAP "toolbar32n24.bmp"
|
||||||
|
IDB_TOOLBAR32D24 BITMAP "toolbar32d24.bmp" // Note: This image should NEVER be <= 256 colors because then Windows will create its own disabled effect
|
||||||
|
IDB_TOOLBAR32H24 BITMAP "toolbar32h24.bmp"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 4.6 KiB |
|
@ -51,21 +51,27 @@ static const TBBTNDESC g_TBBtnsDesc[BUTTONCOUNT] = {
|
||||||
/*TBB_TEST */ { MKNAMEDTBBTNDESC(TEST, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON ) },
|
/*TBB_TEST */ { MKNAMEDTBBTNDESC(TEST, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON ) },
|
||||||
/*TBB_COMPRESSOR*/ { MKNAMEDTBBTNDESC(COMPRESSOR, TBSTATE_ENABLED, TBSTYLE_DROPDOWN) },
|
/*TBB_COMPRESSOR*/ { MKNAMEDTBBTNDESC(COMPRESSOR, TBSTATE_ENABLED, TBSTYLE_DROPDOWN) },
|
||||||
/*TBB_EDITSCRIPT*/ { MKNAMEDTBBTNDESC(EDITSCRIPT, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON ) },
|
/*TBB_EDITSCRIPT*/ { MKNAMEDTBBTNDESC(EDITSCRIPT, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON ) },
|
||||||
/*TBB_BROWSESCR */ { MKNAMEDTBBTNDESC(BROWSESCR, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON ) },
|
/*TBB_BROWSESCR */ { MKNAMEDTBBTNDESC(BROWSESCR, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON ) }
|
||||||
/*TBB_SEP3 */ { TBSTYLE_SEP },
|
|
||||||
/*TBB_NSISHOME */ { MKNAMEDTBBTNDESC(NSISHOME, TBSTATE_ENABLED, TBSTYLE_BUTTON ) },
|
|
||||||
/*TBB_DOCS */ { MKNAMEDTBBTNDESC(DOCS, TBSTATE_ENABLED, TBSTYLE_BUTTON ) }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const BYTE g_TBIL[] = {
|
||||||
|
/* 16 */ IDB_TOOLBAR16N24, IDB_TOOLBAR16D24, IDB_TOOLBAR16H24,
|
||||||
|
/* 24 */ IDB_TOOLBAR24N24, IDB_TOOLBAR24D24, IDB_TOOLBAR24H24,
|
||||||
|
/* 32 */ IDB_TOOLBAR32N24, IDB_TOOLBAR32D24, IDB_TOOLBAR32H24
|
||||||
|
};
|
||||||
|
|
||||||
|
static void LoadToolBarImages();
|
||||||
|
|
||||||
void CreateToolBar()
|
void CreateToolBar()
|
||||||
{
|
{
|
||||||
g_toolbar.hwnd = CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
|
g_toolbar.hwnd = CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
|
||||||
WS_CHILD | WS_VISIBLE | TBSTYLE_TRANSPARENT | TBSTYLE_FLAT,
|
WS_CHILD | WS_VISIBLE | TBSTYLE_TRANSPARENT | TBSTYLE_FLAT,
|
||||||
0, 0, 0, 30, g_sdata.hwnd, NULL, g_sdata.hInstance, NULL);
|
0, 0, 0, 0, g_sdata.hwnd, (HMENU) IDC_TOOLBAR, g_sdata.hInstance, NULL);
|
||||||
|
|
||||||
TBBUTTON tbbs[BUTTONCOUNT];
|
TBBUTTON tbbs[BUTTONCOUNT];
|
||||||
SendMessage(g_toolbar.hwnd, TB_BUTTONSTRUCTSIZE, sizeof(tbbs[0]), 0);
|
SendMessage(g_toolbar.hwnd, TB_BUTTONSTRUCTSIZE, sizeof(tbbs[0]), 0);
|
||||||
for (UINT i = 0; i < BUTTONCOUNT; ++i) {
|
for (UINT i = 0; i < BUTTONCOUNT; ++i)
|
||||||
|
{
|
||||||
tbbs[i].iBitmap = g_TBBtnsDesc[i].ImgIdx;
|
tbbs[i].iBitmap = g_TBBtnsDesc[i].ImgIdx;
|
||||||
tbbs[i].idCommand = g_TBBtnsDesc[i].CmdId;
|
tbbs[i].idCommand = g_TBBtnsDesc[i].CmdId;
|
||||||
tbbs[i].fsState = g_TBBtnsDesc[i].State;
|
tbbs[i].fsState = g_TBBtnsDesc[i].State;
|
||||||
|
@ -73,47 +79,55 @@ void CreateToolBar()
|
||||||
tbbs[i].dwData = 0, tbbs[i].iString = 0;
|
tbbs[i].dwData = 0, tbbs[i].iString = 0;
|
||||||
}
|
}
|
||||||
SendMessage(g_toolbar.hwnd, TB_ADDBUTTONS, BUTTONCOUNT, (LPARAM) &tbbs);
|
SendMessage(g_toolbar.hwnd, TB_ADDBUTTONS, BUTTONCOUNT, (LPARAM) &tbbs);
|
||||||
|
LoadToolBarImages();
|
||||||
|
}
|
||||||
|
|
||||||
// For Comctl32.dll version detection
|
static void LoadToolBarImages()
|
||||||
#ifndef _WIN64
|
{
|
||||||
|
HWND hTB = g_toolbar.hwnd;
|
||||||
|
// Comctl32.dll version detection
|
||||||
|
#ifndef _WIN64
|
||||||
HMODULE hMod = GetModuleHandle(_T("comctl32.dll"));
|
HMODULE hMod = GetModuleHandle(_T("comctl32.dll"));
|
||||||
const FARPROC hasCC4_70 = sizeof(TCHAR) > 1 ? (FARPROC) TRUE : GetProcAddress(hMod, "InitCommonControlsEx"); // NT4 shipped with v4.70
|
const FARPROC hasCC4_70 = (SupportsW95()) ? GetProcAddress(hMod, "InitCommonControlsEx") : (FARPROC) TRUE; // NT4 shipped with v4.70
|
||||||
const FARPROC hasCC4_71 = (SupportsWNT4() || SupportsW95()) ? GetProcAddress(hMod, "DllGetVersion") : (FARPROC) TRUE; // IE4 shipped with v4.71
|
const FARPROC hasCC4_71 = (SupportsWNT4() || SupportsW95()) ? GetProcAddress(hMod, "DllGetVersion") : (FARPROC) TRUE; // IE4 shipped with v4.71
|
||||||
#else
|
#else
|
||||||
const bool hasCC4_70 = true, hasCC4_71 = true;
|
const bool hasCC4_70 = true, hasCC4_71 = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (hasCC4_70) { // Version 4.70
|
UINT iltypecount = 3, s16 = DpiScaleY(hTB, 16), imgsize, iloffs; // 144dpi(150%)=24 120dpi(125%)=20
|
||||||
// Modern toolbar, 24-bit bitmaps
|
if (s16 > 24)
|
||||||
|
imgsize = 32, iloffs = 2 * iltypecount;
|
||||||
|
else if (s16 > 16)
|
||||||
|
imgsize = 24, iloffs = 1 * iltypecount;
|
||||||
|
else
|
||||||
|
imgsize = 16, iloffs = 0 * iltypecount;
|
||||||
|
|
||||||
g_toolbar.imagelist = ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(IDB_TOOLBAR24), 16, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
|
if (hasCC4_70)
|
||||||
g_toolbar.imagelistd = ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(IDB_TOOLBAR24D), 16, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
|
{
|
||||||
g_toolbar.imagelisth = ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(IDB_TOOLBAR24H), 16, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
|
// Version 4.70 => Modern toolbar, 24-bit bitmaps
|
||||||
|
g_toolbar.imagelist = ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(g_TBIL[iloffs+0]), imgsize, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
|
||||||
SendMessage(g_toolbar.hwnd, TB_SETIMAGELIST, 0, (LPARAM) g_toolbar.imagelist);
|
g_toolbar.imagelistd = ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(g_TBIL[iloffs+1]), imgsize, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
|
||||||
SendMessage(g_toolbar.hwnd, TB_SETDISABLEDIMAGELIST, 0, (LPARAM) g_toolbar.imagelistd);
|
g_toolbar.imagelisth = ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(g_TBIL[iloffs+2]), imgsize, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
|
||||||
SendMessage(g_toolbar.hwnd, TB_SETHOTIMAGELIST, 0, (LPARAM) g_toolbar.imagelisth);
|
SendMessage(hTB, TB_SETIMAGELIST, 0, (LPARAM) g_toolbar.imagelist);
|
||||||
|
SendMessage(hTB, TB_SETDISABLEDIMAGELIST, 0, (LPARAM) g_toolbar.imagelistd);
|
||||||
if (hasCC4_71) { // Version 4.71
|
SendMessage(hTB, TB_SETHOTIMAGELIST, 0, (LPARAM) g_toolbar.imagelisth);
|
||||||
SendMessage(g_toolbar.hwnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (hasCC4_71)
|
||||||
|
SendMessage(hTB, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
// Old Windows 95 toolbar, 256 color bitmap with system palette
|
{
|
||||||
|
// Version 4.00 => Old Windows 95 toolbar, 256 color bitmap with system palette
|
||||||
TBADDBITMAP tbBitmap;
|
TBADDBITMAP tbBitmap;
|
||||||
|
|
||||||
tbBitmap.hInst = g_sdata.hInstance;
|
tbBitmap.hInst = g_sdata.hInstance;
|
||||||
tbBitmap.nID = IDB_TOOLBAR;
|
tbBitmap.nID = IDB_TOOLBAR;
|
||||||
SendMessage(g_toolbar.hwnd, TB_ADDBITMAP, IMAGECOUNT, (LPARAM) &tbBitmap);
|
SendMessage(hTB, TB_ADDBITMAP, IMAGECOUNT, (LPARAM) &tbBitmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateToolBarCompressorButton()
|
void UpdateToolBarCompressorButton()
|
||||||
{
|
{
|
||||||
int iBitmap;
|
int iBitmap, iString;
|
||||||
int iString;
|
|
||||||
TCHAR szBuffer[124]; // increased to 124 for good measure, also.
|
TCHAR szBuffer[124]; // increased to 124 for good measure, also.
|
||||||
TCHAR temp[64]; // increased to 64. Hit limit 08/20/2007 -- Jim Park.
|
TCHAR temp[64]; // increased to 64. Hit limit 08/20/2007 -- Jim Park.
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
#define TOOLBAR_H
|
#define TOOLBAR_H
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
|
|
||||||
#define BUTTONCOUNT 15
|
|
||||||
|
|
||||||
#define TBB_LOADSCRIPT 0
|
#define TBB_LOADSCRIPT 0
|
||||||
#define TBB_SAVE 1
|
#define TBB_SAVE 1
|
||||||
#define TBB_SEP1 2
|
#define TBB_SEP1 2
|
||||||
|
@ -38,11 +36,7 @@
|
||||||
#define TBB_COMPRESSOR 9
|
#define TBB_COMPRESSOR 9
|
||||||
#define TBB_EDITSCRIPT 10
|
#define TBB_EDITSCRIPT 10
|
||||||
#define TBB_BROWSESCR 11
|
#define TBB_BROWSESCR 11
|
||||||
#define TBB_SEP3 12
|
#define BUTTONCOUNT 12
|
||||||
#define TBB_NSISHOME 13
|
|
||||||
#define TBB_DOCS 14
|
|
||||||
|
|
||||||
#define IMAGECOUNT 16
|
|
||||||
|
|
||||||
#define IDB_LOADSCRIPT 0
|
#define IDB_LOADSCRIPT 0
|
||||||
#define IDB_SAVE 1
|
#define IDB_SAVE 1
|
||||||
|
@ -53,14 +47,13 @@
|
||||||
#define IDB_EDITSCRIPT 6
|
#define IDB_EDITSCRIPT 6
|
||||||
#define IDB_BROWSESCR 7
|
#define IDB_BROWSESCR 7
|
||||||
#define IDB_CLEARLOG 8
|
#define IDB_CLEARLOG 8
|
||||||
#define IDB_NSISHOME 9
|
#define IDB_COMPRESSOR_SCRIPT 9
|
||||||
#define IDB_DOCS 10
|
#define IDB_COMPRESSOR_BZIP2 10
|
||||||
#define IDB_COMPRESSOR 11
|
#define IDB_COMPRESSOR_ZLIB 11
|
||||||
#define IDB_COMPRESSOR_SCRIPT 11
|
#define IDB_COMPRESSOR_BEST 12
|
||||||
#define IDB_COMPRESSOR_BZIP2 12
|
#define IDB_COMPRESSOR_LZMA 13
|
||||||
#define IDB_COMPRESSOR_ZLIB 13
|
#define IMAGECOUNT 14
|
||||||
#define IDB_COMPRESSOR_BEST 14
|
#define IDB_COMPRESSOR IDB_COMPRESSOR_SCRIPT
|
||||||
#define IDB_COMPRESSOR_LZMA 15
|
|
||||||
|
|
||||||
typedef struct ToolBarStruct {
|
typedef struct ToolBarStruct {
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|
BIN
Contrib/Makensisw/toolbar16d24.bmp
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
Contrib/Makensisw/toolbar16h24.bmp
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
Contrib/Makensisw/toolbar16n24.bmp
Normal file
After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
BIN
Contrib/Makensisw/toolbar24d24.bmp
Normal file
After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 12 KiB |
BIN
Contrib/Makensisw/toolbar24h24.bmp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
Contrib/Makensisw/toolbar24n24.bmp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
Contrib/Makensisw/toolbar32d24.bmp
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
Contrib/Makensisw/toolbar32h24.bmp
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
Contrib/Makensisw/toolbar32n24.bmp
Normal file
After Width: | Height: | Size: 42 KiB |
|
@ -1034,7 +1034,7 @@ int DpiScaleY(HWND hWnd, int Val)
|
||||||
|
|
||||||
HFONT CreateFontHelper(INT_PTR Data, int Height, DWORD p1, LPCTSTR Face)
|
HFONT CreateFontHelper(INT_PTR Data, int Height, DWORD p1, LPCTSTR Face)
|
||||||
{
|
{
|
||||||
UINT16 w = LOBYTE(p1)<<2, flags = HIBYTE(p1), cs = HIWORD(LOBYTE(p1)), paf = HIWORD(HIBYTE(p1));
|
WORD w = LOBYTE(p1)<<2, flags = HIBYTE(p1), cs = HIWORD(LOBYTE(p1)), paf = HIWORD(HIBYTE(p1));
|
||||||
if (flags & CFF_DPIPT)
|
if (flags & CFF_DPIPT)
|
||||||
{
|
{
|
||||||
UINT dpi = (flags & CFF_DPIFROMHWND) ? DpiGetForWindow((HWND) Data) : (UINT) Data;
|
UINT dpi = (flags & CFF_DPIFROMHWND) ? DpiGetForWindow((HWND) Data) : (UINT) Data;
|
||||||
|
@ -1065,10 +1065,11 @@ static BOOL DrawHorzGradient(HDC hDC, const RECT&rect, COLOR16 r1, COLOR16 g1, C
|
||||||
BOOL DrawHorzGradient(HDC hDC, LONG l, LONG t, LONG r, LONG b, COLORREF c1, COLORREF c2)
|
BOOL DrawHorzGradient(HDC hDC, LONG l, LONG t, LONG r, LONG b, COLORREF c1, COLORREF c2)
|
||||||
{
|
{
|
||||||
RECT rect = { l, t, r, b };
|
RECT rect = { l, t, r, b };
|
||||||
return DrawHorzGradient(hDC, rect, (UINT16)GetRValue(c1)<<8, (UINT16)GetGValue(c1)<<8, (UINT16)GetBValue(c1)<<8, (UINT16)GetRValue(c2)<<8, (UINT16)GetGValue(c2)<<8, (UINT16)GetBValue(c2)<<8);
|
return DrawHorzGradient(hDC, rect, (WORD)GetRValue(c1)<<8, (WORD)GetGValue(c1)<<8, (WORD)GetBValue(c1)<<8, (WORD)GetRValue(c2)<<8, (WORD)GetGValue(c2)<<8, (WORD)GetBValue(c2)<<8);
|
||||||
}
|
}
|
||||||
|
|
||||||
long DlgUnitToPixelX(HWND hDlg, long x) { RECT r = { x, 0, 0, 0 }; MapDialogRect(hDlg, &r); return r.left; }
|
long DlgUnitToPixelX(HWND hDlg, long x) { RECT r = { x, 0, 0, 0 }; MapDialogRect(hDlg, &r); return r.left; }
|
||||||
|
long DlgUnitToPixelY(HWND hDlg, long y) { RECT r = { 0, y, 0, 0 }; MapDialogRect(hDlg, &r); return r.top; }
|
||||||
|
|
||||||
#ifndef SP_GRIPPER
|
#ifndef SP_GRIPPER
|
||||||
#ifndef HTHEME
|
#ifndef HTHEME
|
||||||
|
|
|
@ -88,12 +88,12 @@ HMENU FindSubMenu(HMENU hMenu, UINT uId);
|
||||||
|
|
||||||
typedef enum { CFF_RAWSIZE = 0x00, CFF_DPIPT = 0x01, CFF_DPIFROMHWND = 0x02 } CREATEFONTFLAGS;
|
typedef enum { CFF_RAWSIZE = 0x00, CFF_DPIPT = 0x01, CFF_DPIFROMHWND = 0x02 } CREATEFONTFLAGS;
|
||||||
HFONT CreateFontHelper(INT_PTR Data, int Height, DWORD p1, LPCTSTR Face);
|
HFONT CreateFontHelper(INT_PTR Data, int Height, DWORD p1, LPCTSTR Face);
|
||||||
inline HFONT CreateFont(INT_PTR Data, UINT16 Flags, int Height, UINT16 Weight, BYTE PitchAndFamily, BYTE CharSet, LPCTSTR Face)
|
inline HFONT CreateFont(INT_PTR Data, WORD Flags, int Height, WORD Weight, BYTE PitchAndFamily, BYTE CharSet, LPCTSTR Face)
|
||||||
{
|
{
|
||||||
DWORD packed = MAKELONG(MAKEWORD(Weight>>2, Flags), MAKEWORD(CharSet, PitchAndFamily));
|
DWORD packed = MAKELONG(MAKEWORD(Weight>>2, Flags), MAKEWORD(CharSet, PitchAndFamily));
|
||||||
return CreateFontHelper(Data, Height, packed, Face);
|
return CreateFontHelper(Data, Height, packed, Face);
|
||||||
}
|
}
|
||||||
inline HFONT CreateFontPt(HWND hWndDPI, int Height, UINT16 Weight, BYTE PitchAndFamily, BYTE CharSet, LPCTSTR Face)
|
inline HFONT CreateFontPt(HWND hWndDPI, int Height, WORD Weight, BYTE PitchAndFamily, BYTE CharSet, LPCTSTR Face)
|
||||||
{
|
{
|
||||||
return CreateFont((INT_PTR) hWndDPI, CFF_DPIFROMHWND|CFF_DPIPT, Height, Weight, PitchAndFamily, CharSet, Face);
|
return CreateFont((INT_PTR) hWndDPI, CFF_DPIFROMHWND|CFF_DPIPT, Height, Weight, PitchAndFamily, CharSet, Face);
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,7 @@ BOOL DrawHorzGradient(HDC hDC, LONG l, LONG t, LONG r, LONG b, COLORREF c1, COLO
|
||||||
inline long RectW(const RECT&r) { return r.right - r.left; }
|
inline long RectW(const RECT&r) { return r.right - r.left; }
|
||||||
inline long RectH(const RECT&r) { return r.bottom - r.top; }
|
inline long RectH(const RECT&r) { return r.bottom - r.top; }
|
||||||
long DlgUnitToPixelX(HWND hDlg, long x);
|
long DlgUnitToPixelX(HWND hDlg, long x);
|
||||||
|
long DlgUnitToPixelY(HWND hDlg, long y);
|
||||||
UINT DpiGetForWindow(HWND hWnd);
|
UINT DpiGetForWindow(HWND hWnd);
|
||||||
int DpiScaleY(HWND hWnd, int Val);
|
int DpiScaleY(HWND hWnd, int Val);
|
||||||
|
|
||||||
|
|