Commit 12ae8ff8 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Add a license message box and a build id to the About dialog. Clean things up a little.

parent f29b5757
...@@ -136,17 +136,19 @@ FONT 8, "MS Shell Dlg" ...@@ -136,17 +136,19 @@ FONT 8, "MS Shell Dlg"
LTEXT "", IDD_MESSAGE, 40, 10, 238, 52, 0 LTEXT "", IDD_MESSAGE, 40, 10, 238, 52, 0
} }
SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 210, 152 SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 15, 40, 220, 152
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About %s" CAPTION "About %s"
FONT 10, "MS Shell Dlg" FONT 10, "MS Shell Dlg"
{ {
DEFPUSHBUTTON "OK", IDOK, 153, 133, 50, 12, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 153, 133, 60, 12, WS_TABSTOP
PUSHBUTTON "Wine &license...", IDC_ABOUT_LICENSE, 153, 113, 60, 12, WS_TABSTOP
LISTBOX IDC_ABOUT_LISTBOX, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER LISTBOX IDC_ABOUT_LISTBOX, 8, 65, 137, 82, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
ICON "", stc1, 10, 10, 30, 30 ICON "", stc1, 10, 10, 30, 30
LTEXT "", IDC_ABOUT_STATIC_TEXT1, 40, 10, 137, 10 LTEXT "", IDC_ABOUT_STATIC_TEXT1, 42, 10, 170, 10
LTEXT "", IDC_ABOUT_STATIC_TEXT2, 40, 22, 137, 10 LTEXT "", IDC_ABOUT_STATIC_TEXT2, 42, 22, 170, 10
LTEXT "Wine was brought to you by:", IDC_ABOUT_WINE_TEXT, 8, 55, 137, 10 LTEXT "Running on %s", IDC_ABOUT_STATIC_TEXT3, 42, 34, 170, 10
LTEXT "Wine was brought to you by:", IDC_ABOUT_WINE_TEXT, 8, 54, 204, 10
} }
SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95 SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
...@@ -248,3 +250,20 @@ STRINGTABLE ...@@ -248,3 +250,20 @@ STRINGTABLE
IDS_NEWFOLDER "New Folder" IDS_NEWFOLDER "New Folder"
} }
STRINGTABLE
{
IDS_LICENSE_CAPTION, "Wine License"
IDS_LICENSE,
"Wine is free software; you can redistribute it and/or \
modify it under the terms of the GNU Lesser General Public \
License as published by the Free Software Foundation; either \
version 2.1 of the License, or (at your option) any later version.\n\n\
Wine is distributed in the hope that it will be useful, \
but WITHOUT ANY WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \
Lesser General Public License for more details.\n\n\
You should have received a copy of the GNU Lesser General Public \
License along with this library; if not, write to the Free Software \
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA."
}
...@@ -851,21 +851,19 @@ typedef struct ...@@ -851,21 +851,19 @@ typedef struct
HFONT hFont; HFONT hFont;
} ABOUT_INFO; } ABOUT_INFO;
#define DROP_FIELD_TOP (-15) #define DROP_FIELD_TOP (-12)
#define DROP_FIELD_HEIGHT 15
static BOOL __get_dropline( HWND hWnd, LPRECT lprect ) static void paint_dropline( HDC hdc, HWND hWnd )
{ {
HWND hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_WINE_TEXT); HWND hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_WINE_TEXT);
RECT rect;
if( hWndCtl )
{ if (!hWndCtl) return;
GetWindowRect( hWndCtl, lprect ); GetWindowRect( hWndCtl, &rect );
MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 ); MapWindowPoints( 0, hWnd, (LPPOINT)&rect, 2 );
lprect->bottom = (lprect->top += DROP_FIELD_TOP); rect.top += DROP_FIELD_TOP;
return TRUE; rect.bottom = rect.top + 2;
} DrawEdge( hdc, &rect, BDR_SUNKENOUTER, BF_RECT );
return FALSE;
} }
/************************************************************************* /*************************************************************************
...@@ -979,26 +977,32 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -979,26 +977,32 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
ABOUT_INFO *info = (ABOUT_INFO *)lParam; ABOUT_INFO *info = (ABOUT_INFO *)lParam;
WCHAR Template[512], AppTitle[512]; WCHAR template[512], buffer[512], version[64];
extern const char *wine_get_build_id(void);
if (info) if (info)
{ {
const char* const *pstr = SHELL_Authors; const char* const *pstr = SHELL_Authors;
SendDlgItemMessageW(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0); SendDlgItemMessageW(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0);
GetWindowTextW( hWnd, Template, sizeof(Template)/sizeof(WCHAR) ); GetWindowTextW( hWnd, template, sizeof(template)/sizeof(WCHAR) );
sprintfW( AppTitle, Template, info->szApp ); sprintfW( buffer, template, info->szApp );
SetWindowTextW( hWnd, AppTitle ); SetWindowTextW( hWnd, buffer );
SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT1), info->szApp ); SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT1), info->szApp );
SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT2), info->szOtherStuff ); SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT2), info->szOtherStuff );
GetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT3),
template, sizeof(template)/sizeof(WCHAR) );
MultiByteToWideChar( CP_UTF8, 0, wine_get_build_id(), -1,
version, sizeof(version)/sizeof(WCHAR) );
sprintfW( buffer, template, version );
SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT3), buffer );
hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX); hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX);
SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 ); SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 );
SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 ); SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 );
while (*pstr) while (*pstr)
{ {
WCHAR name[64];
/* authors list is in utf-8 format */ /* authors list is in utf-8 format */
MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, name, sizeof(name)/sizeof(WCHAR) ); MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, buffer, sizeof(buffer)/sizeof(WCHAR) );
SendMessageW( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)name ); SendMessageW( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)buffer );
pstr++; pstr++;
} }
SendMessageW( hWndCtl, WM_SETREDRAW, 1, 0 ); SendMessageW( hWndCtl, WM_SETREDRAW, 1, 0 );
...@@ -1008,16 +1012,9 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -1008,16 +1012,9 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
case WM_PAINT: case WM_PAINT:
{ {
RECT rect;
PAINTSTRUCT ps; PAINTSTRUCT ps;
HDC hDC = BeginPaint( hWnd, &ps ); HDC hDC = BeginPaint( hWnd, &ps );
paint_dropline( hDC, hWnd );
if (__get_dropline( hWnd, &rect ))
{
SelectObject( hDC, GetStockObject( BLACK_PEN ) );
MoveToEx( hDC, rect.left, rect.top, NULL );
LineTo( hDC, rect.right, rect.bottom );
}
EndPaint( hWnd, &ps ); EndPaint( hWnd, &ps );
} }
break; break;
...@@ -1028,6 +1025,22 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -1028,6 +1025,22 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
EndDialog(hWnd, TRUE); EndDialog(hWnd, TRUE);
return TRUE; return TRUE;
} }
if (wParam == IDC_ABOUT_LICENSE)
{
MSGBOXPARAMSW params;
params.cbSize = sizeof(params);
params.hwndOwner = hWnd;
params.hInstance = shell32_hInstance;
params.lpszText = MAKEINTRESOURCEW(IDS_LICENSE);
params.lpszCaption = MAKEINTRESOURCEW(IDS_LICENSE_CAPTION);
params.dwStyle = MB_ICONINFORMATION | MB_OK;
params.lpszIcon = 0;
params.dwContextHelpId = 0;
params.lpfnMsgBoxCallback = NULL;
params.dwLanguageId = LANG_NEUTRAL;
MessageBoxIndirectW( &params );
}
break; break;
case WM_CLOSE: case WM_CLOSE:
EndDialog(hWnd, TRUE); EndDialog(hWnd, TRUE);
......
...@@ -96,6 +96,9 @@ ...@@ -96,6 +96,9 @@
#define IDS_NEWFOLDER 142 #define IDS_NEWFOLDER 142
#define IDS_LICENSE 256
#define IDS_LICENSE_CAPTION 257
#define MENU_SHV_FILE 144 #define MENU_SHV_FILE 144
/* Note: this string is referenced from the registry*/ /* Note: this string is referenced from the registry*/
...@@ -161,9 +164,11 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi ...@@ -161,9 +164,11 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi
#define IDR_AVI_FILEDELETE 164 #define IDR_AVI_FILEDELETE 164
/* about box */ /* about box */
#define IDC_ABOUT_LICENSE 97
#define IDC_ABOUT_WINE_TEXT 98 #define IDC_ABOUT_WINE_TEXT 98
#define IDC_ABOUT_LISTBOX 99 #define IDC_ABOUT_LISTBOX 99
#define IDC_ABOUT_STATIC_TEXT1 100 #define IDC_ABOUT_STATIC_TEXT1 100
#define IDC_ABOUT_STATIC_TEXT2 101 #define IDC_ABOUT_STATIC_TEXT2 101
#define IDC_ABOUT_STATIC_TEXT3 102
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment