modern 24-bit toolbar for comctl32 => 4.70
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3344 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
898401b262
commit
b65f878e84
9 changed files with 80 additions and 19 deletions
|
@ -163,6 +163,18 @@ SOURCE=.\shell.ico
|
|||
|
||||
SOURCE=.\toolbar.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\toolbar24.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\toolbar24d.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\toolbar24h.bmp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Documentation"
|
||||
|
||||
|
|
|
@ -39,6 +39,10 @@
|
|||
#define IDB_TOOLBAR 122
|
||||
#define DLG_COMPRESSOR 124
|
||||
#define DLG_SYMBOLSET 125
|
||||
#define IDB_TOOLBAR24 129
|
||||
#define IDB_TOOLBAR24D 130
|
||||
#define IDB_BITMAP2 131
|
||||
#define IDB_TOOLBAR24H 132
|
||||
#define IDC_LOGWIN 402
|
||||
#define IDC_VERSION 405
|
||||
#define IDC_CLOSE 406
|
||||
|
@ -90,7 +94,7 @@
|
|||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 126
|
||||
#define _APS_NEXT_RESOURCE_VALUE 133
|
||||
#define _APS_NEXT_COMMAND_VALUE 40034
|
||||
#define _APS_NEXT_CONTROL_VALUE 1032
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
|
|
|
@ -81,6 +81,7 @@ BEGIN
|
|||
MENUITEM "&Find...\tCtrl+F", IDM_FIND
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Select All\tCtrl+A", IDM_SELECTALL
|
||||
MENUITEM "Clear &Log Window\tCtrl+W", IDM_CLEARLOG
|
||||
END
|
||||
POPUP "&Script"
|
||||
BEGIN
|
||||
|
@ -104,7 +105,6 @@ BEGIN
|
|||
BEGIN
|
||||
MENUITEM "&Settings..\tCtrl+S", IDM_SETTINGS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Clear &Log Window\tCtrl+W", IDM_CLEARLOG
|
||||
MENUITEM "Clear Recent &Files List", IDM_CLEAR_MRU_LIST
|
||||
END
|
||||
POPUP "&Help"
|
||||
|
@ -172,7 +172,7 @@ CAPTION "About MakeNSISW"
|
|||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,174,104,49,15
|
||||
CONTROL 115,IDC_STATIC,"Static",SS_BITMAP,0,0,20,20
|
||||
CONTROL 115,IDC_STATIC,"Static",SS_BITMAP,0,0,233,25
|
||||
LTEXT "MakeNSISW",IDC_ABOUTVERSION,14,31,219,8
|
||||
LTEXT "Copyright",IDC_ABOUTCOPY,14,43,220,8
|
||||
LTEXT "Other Contributors:",IDC_ABOUTPORTIONS,14,56,220,10
|
||||
|
@ -297,6 +297,8 @@ END
|
|||
|
||||
IDB_LOGO BITMAP "logo.bmp"
|
||||
IDB_TOOLBAR BITMAP "toolbar.bmp"
|
||||
IDB_TOOLBAR24 BITMAP "toolbar24.bmp"
|
||||
IDB_TOOLBAR24D BITMAP "toolbar24d.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -337,6 +339,25 @@ END
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Dutch (Netherlands) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_DUTCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_TOOLBAR24H BITMAP "toolbar24h.bmp"
|
||||
#endif // Dutch (Netherlands) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
@ -52,13 +52,13 @@ void CreateToolBar()
|
|||
tbButton[TBB_SEP1] = CreateToolBarButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0);
|
||||
tbButton[TBB_COPY] = CreateToolBarButton(IDB_COPY, IDM_COPY, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_FIND] = CreateToolBarButton(IDB_FIND, IDM_FIND, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_CLEARLOG] = CreateToolBarButton(IDB_CLEARLOG, IDM_CLEARLOG, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_SEP2] = CreateToolBarButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0);
|
||||
tbButton[TBB_RECOMPILE] = CreateToolBarButton(IDB_RECOMPILE, IDM_RECOMPILE, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_COMPRESSOR] = CreateToolBarButton(IDB_COMPRESSOR, IDM_COMPRESSOR, TBSTATE_ENABLED, TBSTYLE_DROPDOWN, 0, 0);
|
||||
tbButton[TBB_TEST] = CreateToolBarButton(IDB_TEST, IDM_TEST, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_EDITSCRIPT] = CreateToolBarButton(IDB_EDITSCRIPT, IDM_EDITSCRIPT, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_BROWSESCR] = CreateToolBarButton(IDB_BROWSESCR, IDM_BROWSESCR, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_CLEARLOG] = CreateToolBarButton(IDB_CLEARLOG, IDM_CLEARLOG, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_SEP3] = CreateToolBarButton(0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0);
|
||||
tbButton[TBB_NSISHOME] = CreateToolBarButton(IDB_NSISHOME, IDM_NSISHOME, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0);
|
||||
tbButton[TBB_DOCS] = CreateToolBarButton(IDB_DOCS, IDM_DOCS, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0);
|
||||
|
@ -73,16 +73,39 @@ void CreateToolBar()
|
|||
(HMENU) TOOLBAR_ID,
|
||||
g_sdata.hInstance,
|
||||
NULL );
|
||||
|
||||
TBADDBITMAP tbBitmap;
|
||||
|
||||
tbBitmap.hInst = g_sdata.hInstance;
|
||||
tbBitmap.nID = IDB_TOOLBAR;
|
||||
|
||||
SendMessage(g_toolbar.hwnd, TB_BUTTONSTRUCTSIZE, sizeof(tbButton[0]), 0);
|
||||
SendMessage(g_toolbar.hwnd, TB_ADDBITMAP, IMAGECOUNT, (LONG) &tbBitmap);
|
||||
SendMessage(g_toolbar.hwnd, TB_ADDBUTTONS, BUTTONCOUNT, (LONG) &tbButton);
|
||||
SendMessage(g_toolbar.hwnd, TB_SETEXTENDEDSTYLE, 0, (LPARAM) (DWORD) TBSTYLE_EX_DRAWDDARROWS);
|
||||
|
||||
// For Comctl32.dll version detection
|
||||
HMODULE hMod = GetModuleHandle("comctl32.dll");
|
||||
|
||||
if (GetProcAddress(hMod, "InitCommonControlsEx")) { // Version 4.70
|
||||
// Modern toolbar, 24-bit bitmaps
|
||||
|
||||
SendMessage(g_toolbar.hwnd, TB_SETIMAGELIST, 0, (LPARAM) ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(IDB_TOOLBAR24), 16, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION));
|
||||
SendMessage(g_toolbar.hwnd, TB_SETDISABLEDIMAGELIST, 0, (LPARAM) ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(IDB_TOOLBAR24D), 16, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION));
|
||||
SendMessage(g_toolbar.hwnd, TB_SETHOTIMAGELIST, 0, (LPARAM) ImageList_LoadImage(g_sdata.hInstance, MAKEINTRESOURCE(IDB_TOOLBAR24H), 16, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION));
|
||||
|
||||
// Version 4.71
|
||||
if (GetProcAddress(hMod, "DllGetVersion")) {
|
||||
SendMessage(g_toolbar.hwnd, TB_SETEXTENDEDSTYLE, 0, (LPARAM) (DWORD) TBSTYLE_EX_DRAWDDARROWS);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Old Windows 95 toolbar, 256 color bitmap with system palette
|
||||
|
||||
TBADDBITMAP tbBitmap;
|
||||
|
||||
tbBitmap.hInst = g_sdata.hInstance;
|
||||
tbBitmap.nID = IDB_TOOLBAR;
|
||||
|
||||
SendMessage(g_toolbar.hwnd, TB_ADDBITMAP, IMAGECOUNT, (LONG) &tbBitmap);
|
||||
}
|
||||
|
||||
FreeLibrary(hMod);
|
||||
|
||||
HMENU toolmenu = GetSubMenu(g_sdata.menu, SCRIPT_MENU_INDEX);
|
||||
g_toolbar.dropdownmenu = GetSubMenu(toolmenu, COMPRESSOR_MENU_INDEX);
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#define TOOLBAR_ID 10001
|
||||
|
||||
#define IMAGECOUNT 16
|
||||
#define BUTTONCOUNT 15
|
||||
|
||||
#define TBB_LOADSCRIPT 0
|
||||
|
@ -33,17 +32,19 @@
|
|||
#define TBB_SEP1 2
|
||||
#define TBB_COPY 3
|
||||
#define TBB_FIND 4
|
||||
#define TBB_SEP2 5
|
||||
#define TBB_RECOMPILE 6
|
||||
#define TBB_TEST 7
|
||||
#define TBB_COMPRESSOR 8
|
||||
#define TBB_EDITSCRIPT 9
|
||||
#define TBB_BROWSESCR 10
|
||||
#define TBB_CLEARLOG 11
|
||||
#define TBB_CLEARLOG 5
|
||||
#define TBB_SEP2 6
|
||||
#define TBB_RECOMPILE 7
|
||||
#define TBB_TEST 8
|
||||
#define TBB_COMPRESSOR 9
|
||||
#define TBB_EDITSCRIPT 10
|
||||
#define TBB_BROWSESCR 11
|
||||
#define TBB_SEP3 12
|
||||
#define TBB_NSISHOME 13
|
||||
#define TBB_DOCS 14
|
||||
|
||||
#define IMAGECOUNT 16
|
||||
|
||||
#define IDB_LOADSCRIPT 0
|
||||
#define IDB_SAVE 1
|
||||
#define IDB_COPY 2
|
||||
|
|
BIN
Contrib/Makensisw/toolbar24.bmp
Normal file
BIN
Contrib/Makensisw/toolbar24.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
Contrib/Makensisw/toolbar24d.bmp
Normal file
BIN
Contrib/Makensisw/toolbar24d.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
Contrib/Makensisw/toolbar24h.bmp
Normal file
BIN
Contrib/Makensisw/toolbar24h.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Add table
Add a link
Reference in a new issue