mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[ui] display version on title instead of status bar
* also improved look&feel & about text
This commit is contained in:
parent
4f23d1fc8b
commit
5a001f40f4
3 changed files with 28 additions and 75 deletions
21
rufus.c
21
rufus.c
|
@ -591,11 +591,9 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
{
|
{
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
HICON hSmallIcon, hBigIcon;
|
HICON hSmallIcon, hBigIcon;
|
||||||
DRAWITEMSTRUCT* pDI;
|
|
||||||
int nDeviceIndex, fs;
|
int nDeviceIndex, fs;
|
||||||
DWORD DeviceNum;
|
DWORD DeviceNum;
|
||||||
char str[MAX_PATH], tmp[128];
|
char str[MAX_PATH], tmp[128];
|
||||||
static char app_version[32];
|
|
||||||
static uintptr_t format_thid = -1L;
|
static uintptr_t format_thid = -1L;
|
||||||
static HWND hProgress, hDOS;
|
static HWND hProgress, hDOS;
|
||||||
static LONG ProgressStyle = 0;
|
static LONG ProgressStyle = 0;
|
||||||
|
@ -630,10 +628,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
hBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 32, 32, 0);
|
hBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 32, 32, 0);
|
||||||
SendMessage (hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon);
|
SendMessage (hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon);
|
||||||
// Create the status line
|
// Create the status line
|
||||||
CreateStatusBar();
|
hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE,
|
||||||
// Display the version in the right area of the status bar
|
0, 0, 0, 0, hMainDialog, (HMENU)IDC_STATUS, hMainInstance, NULL);
|
||||||
LoadStringA(hMainInstance, IDS_VERSION, app_version, sizeof(app_version));
|
|
||||||
SendMessageA(GetDlgItem(hDlg, IDC_STATUS), SB_SETTEXTA, SBT_OWNERDRAW | 1, (LPARAM)app_version);
|
|
||||||
// We'll switch the progressbar to marquee and back => keep a copy of current style
|
// We'll switch the progressbar to marquee and back => keep a copy of current style
|
||||||
ProgressStyle = GetWindowLong(hProgress, GWL_STYLE);
|
ProgressStyle = GetWindowLong(hProgress, GWL_STYLE);
|
||||||
// Create the string array
|
// Create the string array
|
||||||
|
@ -645,19 +641,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
GetUSBDevices();
|
GetUSBDevices();
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
|
|
||||||
// Change the colour of the version text in the status bar
|
|
||||||
case WM_DRAWITEM:
|
|
||||||
if (wParam == IDC_STATUS) {
|
|
||||||
pDI = (DRAWITEMSTRUCT*)lParam;
|
|
||||||
SetBkMode(pDI->hDC, TRANSPARENT);
|
|
||||||
SetTextColor(pDI->hDC, GetSysColor(COLOR_3DSHADOW));
|
|
||||||
pDI->rcItem.top += (int)(2.0f * fScale);
|
|
||||||
pDI->rcItem.left += (int)(4.0f * fScale);
|
|
||||||
DrawTextExA(pDI->hDC, app_version, -1, &pDI->rcItem, DT_LEFT, NULL);
|
|
||||||
return (INT_PTR)TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch(LOWORD(wParam)) {
|
switch(LOWORD(wParam)) {
|
||||||
case IDOK: // close application
|
case IDOK: // close application
|
||||||
|
|
63
rufus.rc
63
rufus.rc
|
@ -27,29 +27,29 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 221, 260
|
IDD_DIALOG DIALOGEX 12, 12, 206, 263
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_APPWINDOW
|
EXSTYLE WS_EX_APPWINDOW
|
||||||
CAPTION "Rufus"
|
CAPTION "Rufus v1.0.0.65"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,102,224,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,223,50,14
|
||||||
PUSHBUTTON "Close",IDCANCEL,156,224,50,14
|
PUSHBUTTON "Close",IDCANCEL,148,223,50,14
|
||||||
COMBOBOX IDC_DEVICE,16,18,190,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_DEVICE,8,17,190,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
CONTROL "&Device",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,17,7,22,8
|
CONTROL "&Device",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,9,6,22,8
|
||||||
COMBOBOX IDC_FILESYSTEM,16,76,190,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_FILESYSTEM,8,75,190,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
LTEXT "&File system",IDC_STATIC,17,65,51,10
|
LTEXT "&File system",IDC_STATIC,9,64,51,10
|
||||||
COMBOBOX IDC_CAPACITY,16,47,190,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_CAPACITY,8,46,190,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||||
LTEXT "Ca&pacity",IDC_STATIC,17,36,29,8
|
LTEXT "Ca&pacity",IDC_STATIC,9,35,29,8
|
||||||
COMBOBOX IDC_CLUSTERSIZE,16,105,190,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_CLUSTERSIZE,8,104,190,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
LTEXT "&Allocation unit size",IDC_STATIC,17,94,105,10
|
LTEXT "&Allocation unit size",IDC_STATIC,9,93,105,10
|
||||||
PUSHBUTTON "About...",IDC_ABOUT,16,224,50,14
|
PUSHBUTTON "About...",IDC_ABOUT,8,223,50,14
|
||||||
GROUPBOX "Format Options",IDC_STATIC,15,150,189,40
|
GROUPBOX "Format Options",IDC_STATIC,7,149,189,40
|
||||||
EDITTEXT IDC_LABEL,15,132,190,13,ES_AUTOHSCROLL
|
EDITTEXT IDC_LABEL,7,131,190,13,ES_AUTOHSCROLL
|
||||||
CONTROL "&Quick Format",IDC_QUICKFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,162,58,10
|
CONTROL "&Quick Format",IDC_QUICKFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,161,58,10
|
||||||
CONTROL "Create an &MS-DOS startup disk",IDC_DOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,174,115,10
|
CONTROL "Create an &MS-DOS startup disk",IDC_DOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,173,115,10
|
||||||
LTEXT "New volume &label",IDC_STATIC,17,122,105,10
|
LTEXT "New volume &label",IDC_STATIC,9,121,105,10
|
||||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,15,198,189,9
|
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,7,197,189,9
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ABOUTBOX DIALOGEX 0, 0, 287, 195
|
IDD_ABOUTBOX DIALOGEX 0, 0, 287, 195
|
||||||
|
@ -58,12 +58,12 @@ CAPTION "About Rufus"
|
||||||
FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
|
FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_ICON,IDC_ABOUT_ICON,11,8,20,20
|
ICON IDI_ICON,IDC_ABOUT_ICON,11,8,20,20
|
||||||
LTEXT "Rufus *BETA*",IDC_RUFUS_BOLD,46,8,78,8,SS_NOPREFIX | SS_NOTIFY
|
LTEXT "Rufus - The Resourceful USB Formatting Utility *BETA*",IDC_RUFUS_BOLD,46,8,240,10,SS_NOPREFIX | SS_NOTIFY
|
||||||
LTEXT "Copyright (c) 2011 Pete Batard",IDC_STATIC,46,36,139,8
|
LTEXT "Copyright (c) 2011 Pete Batard",IDC_STATIC,46,36,139,8
|
||||||
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
|
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
|
||||||
CONTROL "<a href=""https://github.com/pbatard/rufus/wiki/Rufus"">https://github.com/pbatard/rufus</a>",IDC_ABOUT_RUFUS_URL,
|
CONTROL "<a href=""https://github.com/pbatard/rufus/wiki/Rufus"">https://github.com/pbatard/rufus</a>",IDC_ABOUT_RUFUS_URL,
|
||||||
"SysLink",WS_TABSTOP,46,47,114,9
|
"SysLink",WS_TABSTOP,46,47,114,9
|
||||||
LTEXT "Version 1.0.0 (Build 64)",IDC_STATIC,46,19,78,8
|
LTEXT "Version 1.0.0 (Build 65)",IDC_STATIC,46,19,78,8
|
||||||
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
|
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
|
||||||
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
|
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
|
||||||
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
|
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
|
||||||
|
@ -138,7 +138,7 @@ GUIDELINES DESIGNINFO
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_DIALOG, DIALOG
|
IDD_DIALOG, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
BOTTOMMARGIN, 246
|
BOTTOMMARGIN, 249
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ABOUTBOX, DIALOG
|
IDD_ABOUTBOX, DIALOG
|
||||||
|
@ -162,8 +162,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,0,64
|
FILEVERSION 1,0,0,65
|
||||||
PRODUCTVERSION 1,0,0,64
|
PRODUCTVERSION 1,0,0,65
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -180,13 +180,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "akeo.ie"
|
VALUE "CompanyName", "akeo.ie"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "1.0.0.64"
|
VALUE "FileVersion", "1.0.0.65"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "1.0.0.64"
|
VALUE "ProductVersion", "1.0.0.65"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -204,17 +204,6 @@ END
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_ICON ICON "rufus.ico"
|
IDI_ICON ICON "rufus.ico"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// String Table
|
|
||||||
//
|
|
||||||
|
|
||||||
STRINGTABLE
|
|
||||||
BEGIN
|
|
||||||
IDS_VERSION "Rufus v1.0.0.64"
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // English resources
|
#endif // English resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
19
stdlg.c
19
stdlg.c
|
@ -338,25 +338,6 @@ void CreateBoldFont(HDC dc) {
|
||||||
hBoldFont = CreateFontIndirect(&lf);
|
hBoldFont = CreateFontIndirect(&lf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Create the application status bar
|
|
||||||
*/
|
|
||||||
void CreateStatusBar(void)
|
|
||||||
{
|
|
||||||
RECT rect;
|
|
||||||
int edge[2];
|
|
||||||
|
|
||||||
// Create the status bar.
|
|
||||||
hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE,
|
|
||||||
0, 0, 0, 0, hMainDialog, (HMENU)IDC_STATUS, hMainInstance, NULL);
|
|
||||||
|
|
||||||
// Create 2 status areas
|
|
||||||
GetClientRect(hMainDialog, &rect);
|
|
||||||
edge[0] = rect.right - (int)(100.0f*fScale);
|
|
||||||
edge[1] = rect.right;
|
|
||||||
SendMessage(hStatus, SB_SETPARTS, (WPARAM) 2, (LPARAM)&edge);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Center a dialog with regards to the main application Window or the desktop
|
* Center a dialog with regards to the main application Window or the desktop
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue