mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[ui] modernize the language button
* The language button is now a toolbar button with a dropdown arrow. * Its icon is a globe for Windows XP to Windows 7 and a globe with characters on it for Windows 8 and above (same as the icon for the 'Languages' control panel). * Closes #488
This commit is contained in:
		
							parent
							
								
									fa5f8702c3
								
							
						
					
					
						commit
						3579c770a2
					
				
					 5 changed files with 98 additions and 58 deletions
				
			
		|  | @ -902,7 +902,6 @@ b "en-US" | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG +15,0 | ||||
| m IDC_LANG +15,0 | ||||
| s IDS_FORMAT_OPTIONS_GRP +15,0 | ||||
| s IDC_DEVICE +15,0 | ||||
| s IDC_PARTITION_TYPE +15,0 | ||||
|  | @ -3414,7 +3413,6 @@ b "en-US" | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG 20,0 | ||||
| m IDC_LANG 20,0 | ||||
| t IDS_DEVICE_TXT "Apparaat" | ||||
| s IDC_DEVICE 20,0 | ||||
| t IDS_PARTITION_TYPE_TXT "Partitie-indeling en type computer" | ||||
|  | @ -4692,7 +4690,6 @@ m IDC_BOOTTYPE +30,0 | |||
| m IDC_SELECT_ISO +30,0 | ||||
| s IDC_INFO +30,0 | ||||
| m IDC_DISK_ID +30,0 | ||||
| m IDC_LANG +28,0 | ||||
| m IDC_START +28,0 | ||||
| m IDCANCEL +28,0 | ||||
| 
 | ||||
|  | @ -5105,7 +5102,6 @@ g IDD_DIALOG | |||
| s IDD_DIALOG +156,0 | ||||
| t IDS_DEVICE_TXT "Συσκευή" | ||||
| s IDC_DEVICE +156,0 | ||||
| m IDC_LANG +156,0 | ||||
| t IDS_PARTITION_TYPE_TXT "Σύστημα διαμερισμού και τύπος συστήματος" | ||||
| s IDC_PARTITION_TYPE +156,0 | ||||
| t IDS_FILESYSTEM_TXT "Σύστημα αρχείων" | ||||
|  | @ -6002,7 +5998,6 @@ m IDC_BOOTTYPE +66,0 | |||
| s IDC_BOOTTYPE -4,0 | ||||
| m IDC_DISK_ID +66,0 | ||||
| s IDC_DISK_ID -4,0 | ||||
| m IDC_LANG +62,0 | ||||
| m IDC_LOG +10,0 | ||||
| m IDC_NBPASSES +66,0 | ||||
| s IDC_NBPASSES -4,0 | ||||
|  | @ -6779,7 +6774,6 @@ b "en-US" | |||
| g IDD_DIALOG | ||||
| 
 | ||||
| s IDD_DIALOG +60,0 | ||||
| m IDC_LANG +60,0 | ||||
| s IDC_PROGRESS +60,0 | ||||
| s IDC_DEVICE +60,0 | ||||
| s IDC_PARTITION_TYPE +60,0 | ||||
|  | @ -7660,7 +7654,6 @@ v 1.0.17 | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG 20,0 | ||||
| m IDC_LANG 20,0 | ||||
| s IDC_DEVICE 20,0 | ||||
| s IDC_PARTITION_TYPE 20,0 | ||||
| s IDC_FILESYSTEM 20,0 | ||||
|  | @ -8540,7 +8533,6 @@ b "en-US" | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG +30,0 | ||||
| m IDC_LANG +30,0 | ||||
| s IDC_PROGRESS +30,0 | ||||
| s IDC_DEVICE +30,0 | ||||
| s IDC_PARTITION_TYPE +30,0 | ||||
|  | @ -8971,7 +8963,6 @@ t IDC_ENABLE_FIXED_DISKS "Før opp USB Hard Disker" | |||
| t IDC_EXTRA_PARTITION "Legger til fiks for gamle BIOSer (ekstra partisjon, etc.)" | ||||
| t IDC_RUFUS_MBR "Bruk Rufus MBR med BIOS ID" | ||||
| s IDC_RUFUS_MBR 10,0 | ||||
| m IDC_LANG 10,0 | ||||
| s IDC_DEVICE 10,0 | ||||
| s IDC_PARTITION_TYPE 10,0 | ||||
| s IDC_FILESYSTEM 10,0 | ||||
|  | @ -9404,7 +9395,6 @@ b "en-US" | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG +40,0 | ||||
| m IDC_LANG +40,0 | ||||
| s IDS_FORMAT_OPTIONS_GRP +40,0 | ||||
| s IDC_PROGRESS +40,0 | ||||
| s IDC_DEVICE +40,0 | ||||
|  | @ -12100,7 +12090,6 @@ b "en-US" | |||
| g IDD_DIALOG | ||||
| s IDD_DIALOG +5,0 | ||||
| s IDC_DEVICE +5,0 | ||||
| m IDC_LANG +5,0 | ||||
| s IDC_PARTITION_TYPE +5,0 | ||||
| s IDC_FILESYSTEM +5,0 | ||||
| s IDC_CLUSTERSIZE +5,0 | ||||
|  | @ -12568,7 +12557,6 @@ t IDC_ENABLE_FIXED_DISKS "Lista USB-hårddiskar" | |||
| t IDC_EXTRA_PARTITION "Lägg till korrigeringar för äldre BIOS:ar" | ||||
| t IDC_RUFUS_MBR "Använd Rufus MBR med BIOS-ID" | ||||
| s IDC_RUFUS_MBR 20,0 | ||||
| m IDC_LANG 50,0 | ||||
| s IDC_DEVICE 50,0 | ||||
| s IDC_PARTITION_TYPE 50,0 | ||||
| s IDC_FILESYSTEM 50,0 | ||||
|  | @ -12993,7 +12981,6 @@ b "en-US" | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG +5,0 | ||||
| m IDC_LANG +5,0 | ||||
| t IDS_DEVICE_TXT "Aygıt" | ||||
| s IDC_DEVICE +5,0 | ||||
| t IDS_PARTITION_TYPE_TXT "Disk Bölüm Düzeni ve Hedef Sistem Türü" | ||||
|  | @ -13452,7 +13439,6 @@ b "en-US" | |||
| # Main dialog | ||||
| g IDD_DIALOG | ||||
| s IDD_DIALOG +20,0 | ||||
| m IDC_LANG +20,0 | ||||
| s IDS_FORMAT_OPTIONS_GRP +20,0 | ||||
| s IDS_ADVANCED_OPTIONS_GRP +20,0 | ||||
| s IDC_ABOUT +26,0 | ||||
|  |  | |||
|  | @ -68,7 +68,6 @@ const loc_control_id control_id[] = { | |||
| 	LOC_CTRL(IDC_ADVANCED), | ||||
| 	LOC_CTRL(IDS_ADVANCED_OPTIONS_GRP), | ||||
| 	LOC_CTRL(IDC_LOG), | ||||
| 	LOC_CTRL(IDC_LANG), | ||||
| 	LOC_CTRL(IDC_WINDOWS_INSTALL), | ||||
| 	LOC_CTRL(IDC_WINDOWS_TO_GO), | ||||
| 	LOC_CTRL(IDC_LOG_EDIT), | ||||
|  |  | |||
|  | @ -106,7 +106,6 @@ | |||
| #define IDC_ADVANCED                    1043 | ||||
| #define IDS_ADVANCED_OPTIONS_GRP        1044 | ||||
| #define IDC_LOG                         1045 | ||||
| #define IDC_LANG                        1046 | ||||
| #define IDC_WINDOWS_INSTALL             1047 | ||||
| #define IDC_WINDOWS_TO_GO               1048 | ||||
| #define IDC_LOG_EDIT                    1050 | ||||
|  |  | |||
							
								
								
									
										112
									
								
								src/rufus.c
									
										
									
									
									
								
							
							
						
						
									
										112
									
								
								src/rufus.c
									
										
									
									
									
								
							|  | @ -73,7 +73,7 @@ struct { | |||
| 	HIMAGELIST himl; | ||||
| 	RECT margin; | ||||
| 	UINT uAlign; | ||||
| } bi_iso = {0}, bi_up = {0}, bi_down = {0}, bi_lang = {0};	// BUTTON_IMAGELIST
 | ||||
| } bi_iso = {0}, bi_up = {0}, bi_down = {0};	// BUTTON_IMAGELIST
 | ||||
| 
 | ||||
| typedef struct | ||||
| { | ||||
|  | @ -83,9 +83,11 @@ typedef struct | |||
| 
 | ||||
| // MinGW doesn't know these
 | ||||
| PF_TYPE(WINAPI, HIMAGELIST, ImageList_Create, (int, int, UINT, int, int)); | ||||
| PF_TYPE(WINAPI, int, ImageList_AddIcon, (HIMAGELIST, HICON)); | ||||
| PF_TYPE(WINAPI, int, ImageList_ReplaceIcon, (HIMAGELIST, int, HICON)); | ||||
| // WDK blows up when trying to using PF_TYPE_DECL() for the ImageList calls... so we don't.
 | ||||
| PF_DECL(ImageList_Create); | ||||
| PF_DECL(ImageList_AddIcon); | ||||
| PF_DECL(ImageList_ReplaceIcon); | ||||
| PF_TYPE_DECL(WINAPI, BOOL, SHChangeNotifyDeregister, (ULONG)); | ||||
| PF_TYPE_DECL(WINAPI, ULONG, SHChangeNotifyRegister, (HWND, int, LONG, UINT, int, const MY_SHChangeNotifyEntry*)); | ||||
|  | @ -121,7 +123,7 @@ char lost_translators[][6] = LOST_TRANSLATORS; | |||
|  */ | ||||
| OPENED_LIBRARIES_VARS; | ||||
| HINSTANCE hMainInstance; | ||||
| HWND hMainDialog; | ||||
| HWND hMainDialog, hLangToolbar = NULL; | ||||
| char szFolderPath[MAX_PATH], app_dir[MAX_PATH]; | ||||
| char* image_path = NULL; | ||||
| float fScale = 1.0f; | ||||
|  | @ -133,7 +135,7 @@ BOOL use_own_c32[NB_OLD_C32] = {FALSE, FALSE}, detect_fakes = TRUE, mbr_selected | |||
| BOOL iso_op_in_progress = FALSE, format_op_in_progress = FALSE, right_to_left_mode = FALSE; | ||||
| BOOL enable_HDDs = FALSE, advanced_mode = TRUE, force_update = FALSE, use_fake_units = TRUE; | ||||
| BOOL allow_dual_uefi_bios = FALSE, enable_vmdk = FALSE, togo_mode = TRUE; | ||||
| int dialog_showing = 0; | ||||
| int dialog_showing = 0, lang_button_id = 0; | ||||
| uint16_t rufus_version[3], embedded_sl_version[2]; | ||||
| char embedded_sl_version_str[2][12] = { "?.??", "?.??" }; | ||||
| char embedded_sl_version_ext[2][32]; | ||||
|  | @ -787,7 +789,7 @@ static void EnableControls(BOOL bEnable) | |||
| 	EnableWindow(hSelectISO, bEnable); | ||||
| 	EnableWindow(hNBPasses, bEnable); | ||||
| 	EnableWindow(GetDlgItem(hMainDialog, IDC_ADVANCED), bEnable); | ||||
| 	EnableWindow(GetDlgItem(hMainDialog, IDC_LANG), bEnable); | ||||
| 	EnableWindow(hLangToolbar, bEnable); | ||||
| 	EnableWindow(GetDlgItem(hMainDialog, IDC_ENABLE_FIXED_DISKS), bEnable); | ||||
| 	SetDlgItemTextU(hMainDialog, IDCANCEL, lmprintf(bEnable?MSG_006:MSG_007)); | ||||
| 	if (selection_default == DT_IMG) | ||||
|  | @ -1547,7 +1549,10 @@ static INT_PTR CALLBACK InfoCallback(HWND hCtrl, UINT message, WPARAM wParam, LP | |||
| 
 | ||||
| void InitDialog(HWND hDlg) | ||||
| { | ||||
| 	HINSTANCE hDllInst; | ||||
| 	HINSTANCE hShell32DllInst, hUserLanguagesCplDllInst, hINetCplDllInst; | ||||
| 	HIMAGELIST hLangToolbarImageList; | ||||
| 	TBBUTTON tbLangToolbarButtons[1]; | ||||
| 	RECT rcDeviceList, rcToolbarButton; | ||||
| 	DWORD len; | ||||
| 	SIZE sz; | ||||
| 	HWND hCtrl; | ||||
|  | @ -1561,6 +1566,10 @@ void InitDialog(HWND hDlg) | |||
| 	ShowWindow(GetDlgItem(hDlg, IDC_TEST), SW_SHOW); | ||||
| #endif | ||||
| 
 | ||||
| 	PF_INIT(ImageList_Create, Comctl32); | ||||
| 	PF_INIT(ImageList_AddIcon, Comctl32); | ||||
| 	PF_INIT(ImageList_ReplaceIcon, Comctl32); | ||||
| 
 | ||||
| 	// Quite a burden to carry around as parameters
 | ||||
| 	hMainDialog = hDlg; | ||||
| 	hDeviceList = GetDlgItem(hDlg, IDC_DEVICE); | ||||
|  | @ -1670,17 +1679,52 @@ void InitDialog(HWND hDlg) | |||
| 	CheckDlgButton(hDlg, IDC_SET_ICON, BST_CHECKED); | ||||
| 
 | ||||
| 	// Load system icons (NB: Use the excellent http://www.nirsoft.net/utils/iconsext.html to find icon IDs)
 | ||||
| 	hDllInst = GetLibraryHandle("Shell32"); | ||||
| 	hIconDisc = (HICON)LoadImage(hDllInst, MAKEINTRESOURCE(12), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR|LR_SHARED); | ||||
| 	hIconLang = (HICON)LoadImage(hDllInst, MAKEINTRESOURCE(244), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR|LR_SHARED); | ||||
| 	hShell32DllInst = GetLibraryHandle("Shell32"); | ||||
| 	hIconDisc = (HICON)LoadImage(hShell32DllInst, MAKEINTRESOURCE(12), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); | ||||
| 
 | ||||
| 	if (nWindowsVersion >= WINDOWS_8) { | ||||
| 		// Use the icon from the Windows 8+ 'Language' Control Panel
 | ||||
| 		hUserLanguagesCplDllInst = GetLibraryHandle("UserLanguagesCpl"); | ||||
| 		hIconLang = (HICON)LoadImage(hUserLanguagesCplDllInst, MAKEINTRESOURCE(1), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); | ||||
| 	} else { | ||||
| 		// Otherwise use the globe icon, from the Internet Options Control Panel
 | ||||
| 		hINetCplDllInst = GetLibraryHandle("inetcpl.cpl"); | ||||
| 		hIconLang = (HICON)LoadImage(hINetCplDllInst, MAKEINTRESOURCE(1313), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); | ||||
| 	} | ||||
| 
 | ||||
| 	if (nWindowsVersion >= WINDOWS_VISTA) { | ||||
| 		hIconDown = (HICON)LoadImage(hDllInst, MAKEINTRESOURCE(16750), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR|LR_SHARED); | ||||
| 		hIconUp = (HICON)LoadImage(hDllInst, MAKEINTRESOURCE(16749), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR|LR_SHARED); | ||||
| 		hIconDown = (HICON)LoadImage(hShell32DllInst, MAKEINTRESOURCE(16750), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); | ||||
| 		hIconUp = (HICON)LoadImage(hShell32DllInst, MAKEINTRESOURCE(16749), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); | ||||
| 	} else { | ||||
| 		hIconDown = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_DOWN), IMAGE_ICON, 16, 16, 0); | ||||
| 		hIconUp = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_UP), IMAGE_ICON, 16, 16, 0); | ||||
| 	} | ||||
| 
 | ||||
| 	// Create the language toolbar
 | ||||
| 	// NB: We don't make it a tabstop as it would become the default selected button otherwise
 | ||||
| 	hLangToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | TBSTYLE_TRANSPARENT | CCS_NOPARENTALIGN | | ||||
| 		CCS_NORESIZE | CCS_NODIVIDER, 0, 0, 0, 0, hMainDialog, NULL, hMainInstance, NULL); | ||||
| 	if ((pfImageList_Create != NULL) && (pfImageList_AddIcon != NULL)) { | ||||
| 		hLangToolbarImageList = pfImageList_Create(i16, i16, ILC_COLOR32, 1, 0); | ||||
| 		pfImageList_AddIcon(hLangToolbarImageList, hIconLang); | ||||
| 		SendMessage(hLangToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hLangToolbarImageList); | ||||
| 	} | ||||
| 	SendMessage(hLangToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); | ||||
| 	memset(tbLangToolbarButtons, 0, sizeof(TBBUTTON)); | ||||
| 	tbLangToolbarButtons[0].idCommand = lang_button_id; | ||||
| 	tbLangToolbarButtons[0].fsStyle = BTNS_WHOLEDROPDOWN; | ||||
| 	tbLangToolbarButtons[0].fsState = TBSTATE_ENABLED; | ||||
| 	SendMessage(hLangToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&tbLangToolbarButtons); // Add just the 1 button
 | ||||
| 	SendMessage(hLangToolbar, TB_GETRECT, lang_button_id, (LPARAM)&rcToolbarButton); | ||||
| 	 | ||||
| 	// Make the toolbar window just big enough to hold the button
 | ||||
| 	// Set the top margin to 4 DIPs and the right margin so that it's aligned with the Device List Combobox
 | ||||
| 	GetWindowRect(hDeviceList, &rcDeviceList); | ||||
| 	MapWindowPoints(NULL, hDlg, (POINT*)&rcDeviceList, 2); | ||||
| 	SetWindowPos(hLangToolbar, NULL, rcDeviceList.right - rcToolbarButton.right, | ||||
| 		(int)(4.0f * fScale), rcToolbarButton.right, rcToolbarButton.bottom, 0); | ||||
| 	ShowWindow(hLangToolbar, SW_SHOWNORMAL); | ||||
| 
 | ||||
| 	// Reposition the Advanced button
 | ||||
| 	hCtrl = GetDlgItem(hDlg, IDS_FORMAT_OPTIONS_GRP); | ||||
| 	sz = GetTextSize(hCtrl); | ||||
|  | @ -1700,18 +1744,12 @@ void InitDialog(HWND hDlg) | |||
| 	info_original_proc = (WNDPROC)SetWindowLongPtr(hInfo, GWLP_WNDPROC, (LONG_PTR)InfoCallback); | ||||
| 
 | ||||
| 	// Set the icons on the the buttons
 | ||||
| 	PF_INIT(ImageList_Create, Comctl32); | ||||
| 	PF_INIT(ImageList_ReplaceIcon, Comctl32); | ||||
| 	if ((pfImageList_Create != NULL) && (pfImageList_ReplaceIcon != NULL)) { | ||||
| 
 | ||||
| 		bi_iso.himl = pfImageList_Create(i16, i16, ILC_COLOR32 | ILC_MASK, 1, 0); | ||||
| 		pfImageList_ReplaceIcon(bi_iso.himl, -1, hIconDisc); | ||||
| 		SetRect(&bi_iso.margin, 0, 1, 0, 0); | ||||
| 		bi_iso.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER; | ||||
| 		bi_lang.himl = pfImageList_Create(i16, i16, ILC_COLOR32 | ILC_MASK, 1, 0); | ||||
| 		pfImageList_ReplaceIcon(bi_lang.himl, -1, hIconLang); | ||||
| 		SetRect(&bi_lang.margin, 0, 1, 0, 0); | ||||
| 		bi_lang.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER; | ||||
| 		bi_down.himl = pfImageList_Create(i16, i16, ILC_COLOR32 | ILC_MASK, 1, 0); | ||||
| 		pfImageList_ReplaceIcon(bi_down.himl, -1, hIconDown); | ||||
| 		SetRect(&bi_down.margin, 0, 0, 0, 0); | ||||
|  | @ -1722,7 +1760,6 @@ void InitDialog(HWND hDlg) | |||
| 		bi_up.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER; | ||||
| 
 | ||||
| 		SendMessage(hSelectISO, BCM_SETIMAGELIST, 0, (LPARAM)&bi_iso); | ||||
| 		SendMessage(GetDlgItem(hDlg, IDC_LANG), BCM_SETIMAGELIST, 0, (LPARAM)&bi_lang); | ||||
| 		SendMessage(GetDlgItem(hDlg, IDC_ADVANCED), BCM_SETIMAGELIST, 0, (LPARAM)&bi_down); | ||||
| 	} | ||||
| 
 | ||||
|  | @ -1763,9 +1800,9 @@ static void PrintStatus2000(const char* str, BOOL val) | |||
| 	PrintStatus(2000, (val)?MSG_250:MSG_251, str); | ||||
| } | ||||
| 
 | ||||
| void ShowLanguageMenu(HWND hDlg) | ||||
| void ShowLanguageMenu(RECT rcExclude) | ||||
| { | ||||
| 	POINT pt; | ||||
| 	TPMPARAMS tpm; | ||||
| 	HMENU menu; | ||||
| 	loc_cmd* lcmd = NULL; | ||||
| 	char lang[256]; | ||||
|  | @ -1788,9 +1825,13 @@ void ShowLanguageMenu(HWND hDlg) | |||
| 		InsertMenuU(menu, -1, MF_BYPOSITION|((selected_locale == lcmd)?MF_CHECKED:0), UM_LANGUAGE_MENU_MAX++, lang); | ||||
| 	} | ||||
| 
 | ||||
| 	SetForegroundWindow(hDlg); | ||||
| 	GetCursorPos(&pt); | ||||
| 	TrackPopupMenu(menu, TPM_TOPALIGN|TPM_RIGHTALIGN, pt.x, pt.y, 0, hMainDialog, NULL); | ||||
| 	// Open the menu such that it doesn't overlap the specified rect
 | ||||
| 	tpm.cbSize = sizeof(TPMPARAMS); | ||||
| 	tpm.rcExclude = rcExclude; | ||||
| 	TrackPopupMenuEx(menu, 0, | ||||
| 		right_to_left_mode ? rcExclude.right : rcExclude.left, // In RTL languages, the menu should be placed at the bottom-right of the rect
 | ||||
| 		rcExclude.bottom, hMainDialog, &tpm); | ||||
| 
 | ||||
| 	DestroyMenu(menu); | ||||
| } | ||||
| 
 | ||||
|  | @ -1855,13 +1896,14 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA | |||
| 	static MY_SHChangeNotifyEntry NotifyEntry; | ||||
| 	DRAWITEMSTRUCT* pDI; | ||||
| 	POINT Point; | ||||
| 	RECT DialogRect, DesktopRect; | ||||
| 	RECT DialogRect, DesktopRect, LangToolbarRect; | ||||
| 	LONG progress_style; | ||||
| 	int nDeviceIndex, fs, bt, i, nWidth, nHeight, nb_devices, selected_language, offset; | ||||
| 	char tmp[128]; | ||||
| 	loc_cmd* lcmd = NULL; | ||||
| 	EXT_DECL(img_ext, NULL, __VA_GROUP__("*.img;*.vhd;*.gz;*.bzip2;*.xz;*.lzma;*.Z"), __VA_GROUP__(lmprintf(MSG_095))); | ||||
| 	EXT_DECL(iso_ext, NULL, __VA_GROUP__("*.iso"), __VA_GROUP__(lmprintf(MSG_036))); | ||||
| 	LPNMTOOLBAR lpnmtb; | ||||
| 
 | ||||
| 	switch (message) { | ||||
| 
 | ||||
|  | @ -2098,9 +2140,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA | |||
| 				format_op_in_progress = FALSE; | ||||
| 			break; | ||||
| #endif | ||||
| 		case IDC_LANG: | ||||
| 			ShowLanguageMenu(GetDlgItem(hDlg, IDC_LANG)); | ||||
| 			break; | ||||
| 		case IDC_ADVANCED: | ||||
| 			ToggleAdvanced(); | ||||
| 			SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_FILESYSTEM, | ||||
|  | @ -2346,6 +2385,27 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA | |||
| 		} | ||||
| 		return (INT_PTR)TRUE; | ||||
| 
 | ||||
| 	case WM_NOTIFY: | ||||
| 		switch (((LPNMHDR)lParam)->code) { | ||||
| 		case TBN_DROPDOWN: | ||||
| 			lpnmtb = (LPNMTOOLBAR)lParam; | ||||
| 			 | ||||
| 			// We only care about the language button on the language toolbar
 | ||||
| 			if (lpnmtb->hdr.hwndFrom == hLangToolbar | ||||
| 				&& lpnmtb->iItem == lang_button_id) { | ||||
| 				// Get toolbar button rect and map it to actual screen pixels
 | ||||
| 				SendMessage(lpnmtb->hdr.hwndFrom, TB_GETRECT, (WPARAM)lpnmtb->iItem, (LPARAM)&LangToolbarRect); | ||||
| 				MapWindowPoints(lpnmtb->hdr.hwndFrom, NULL, (POINT*)&LangToolbarRect, 2); | ||||
| 
 | ||||
| 				// Show the language menu such that it doesn't overlap the button
 | ||||
| 				ShowLanguageMenu(LangToolbarRect); | ||||
| 				return (INT_PTR)TBDDRET_DEFAULT; | ||||
| 			} | ||||
| 			break; | ||||
| 		} | ||||
| 
 | ||||
| 		break; | ||||
| 
 | ||||
| 	case WM_CLOSE: | ||||
| 		if (format_thid != NULL) { | ||||
| 			return (INT_PTR)TRUE; | ||||
|  |  | |||
							
								
								
									
										28
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										28
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -32,13 +32,12 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | |||
| 
 | ||||
| IDD_DIALOG DIALOGEX 12, 12, 242, 376 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| CAPTION "Rufus 2.2.652" | ||||
| CAPTION "Rufus 2.2.653" | ||||
| FONT 8, "Segoe UI", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,127,339,50,14 | ||||
|     PUSHBUTTON      "...",IDC_SELECT_ISO,207,182,21,14,BS_ICON | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,208,8 | ||||
|     PUSHBUTTON      "",IDC_LANG,217,2,17,13,BS_TOP | BS_FLAT | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,200,8 | ||||
|     COMBOBOX        IDC_DEVICE,8,17,226,33,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|     LTEXT           "Partition scheme and target system type",IDS_PARTITION_TYPE_TXT,9,35,222,8 | ||||
|     COMBOBOX        IDC_PARTITION_TYPE,8,46,226,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|  | @ -157,13 +156,12 @@ END | |||
| 
 | ||||
| IDD_DIALOG_XP DIALOGEX 12, 12, 242, 376 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| CAPTION "Rufus 2.2.652" | ||||
| CAPTION "Rufus 2.2.653" | ||||
| FONT 8, "MS Shell Dlg", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,127,339,50,14 | ||||
|     PUSHBUTTON      "...",IDC_SELECT_ISO,207,182,21,14,BS_ICON | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,208,8 | ||||
|     PUSHBUTTON      "",IDC_LANG,217,2,17,13,BS_TOP | BS_FLAT | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,200,8 | ||||
|     COMBOBOX        IDC_DEVICE,8,17,226,33,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|     LTEXT           "Partition scheme and target system type",IDS_PARTITION_TYPE_TXT,9,35,222,8 | ||||
|     COMBOBOX        IDC_PARTITION_TYPE,8,46,226,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|  | @ -283,13 +281,12 @@ END | |||
| IDD_DIALOG_RTL DIALOGEX 12, 12, 242, 376 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL | ||||
| CAPTION "Rufus 2.2.652" | ||||
| CAPTION "Rufus 2.2.653" | ||||
| FONT 8, "Segoe UI", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,127,339,50,14 | ||||
|     PUSHBUTTON      "...",IDC_SELECT_ISO,207,182,21,14,BS_ICON | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,208,8 | ||||
|     PUSHBUTTON      "",IDC_LANG,217,2,17,13,BS_TOP | BS_FLAT | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,200,8 | ||||
|     COMBOBOX        IDC_DEVICE,8,17,226,33,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|     LTEXT           "Partition scheme and target system type",IDS_PARTITION_TYPE_TXT,9,35,222,8 | ||||
|     COMBOBOX        IDC_PARTITION_TYPE,8,46,226,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|  | @ -415,13 +412,12 @@ END | |||
| IDD_DIALOG_RTL_XP DIALOGEX 12, 12, 242, 376 | ||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
| EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL | ||||
| CAPTION "Rufus 2.2.652" | ||||
| CAPTION "Rufus 2.2.653" | ||||
| FONT 8, "MS Shell Dlg", 400, 0, 0x1 | ||||
| BEGIN | ||||
|     DEFPUSHBUTTON   "Start",IDC_START,127,339,50,14 | ||||
|     PUSHBUTTON      "...",IDC_SELECT_ISO,207,182,21,14,BS_ICON | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,208,8 | ||||
|     PUSHBUTTON      "",IDC_LANG,217,2,17,13,BS_TOP | BS_FLAT | ||||
|     LTEXT           "Device",IDS_DEVICE_TXT,9,6,200,8 | ||||
|     COMBOBOX        IDC_DEVICE,8,17,226,33,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|     LTEXT           "Partition scheme and target system type",IDS_PARTITION_TYPE_TXT,9,35,222,8 | ||||
|     COMBOBOX        IDC_PARTITION_TYPE,8,46,226,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||||
|  | @ -671,8 +667,8 @@ END | |||
| // | ||||
| 
 | ||||
| VS_VERSION_INFO VERSIONINFO | ||||
|  FILEVERSION 2,2,652,0 | ||||
|  PRODUCTVERSION 2,2,652,0 | ||||
|  FILEVERSION 2,2,653,0 | ||||
|  PRODUCTVERSION 2,2,653,0 | ||||
|  FILEFLAGSMASK 0x3fL | ||||
| #ifdef _DEBUG | ||||
|  FILEFLAGS 0x1L | ||||
|  | @ -689,13 +685,13 @@ BEGIN | |||
|         BEGIN | ||||
|             VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" | ||||
|             VALUE "FileDescription", "Rufus" | ||||
|             VALUE "FileVersion", "2.2.652" | ||||
|             VALUE "FileVersion", "2.2.653" | ||||
|             VALUE "InternalName", "Rufus" | ||||
|             VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)" | ||||
|             VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" | ||||
|             VALUE "OriginalFilename", "rufus.exe" | ||||
|             VALUE "ProductName", "Rufus" | ||||
|             VALUE "ProductVersion", "2.2.652" | ||||
|             VALUE "ProductVersion", "2.2.653" | ||||
|         END | ||||
|     END | ||||
|     BLOCK "VarFileInfo" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue