mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
winedbg: Make the crash details dialog resizable.
This commit is contained in:
parent
dcd5643f74
commit
a70ac0e971
2 changed files with 52 additions and 1 deletions
|
@ -261,12 +261,63 @@ static INT_PTR WINAPI crash_dlg_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||||
static INT_PTR WINAPI details_dlg_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
|
static INT_PTR WINAPI details_dlg_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
|
||||||
{
|
{
|
||||||
static const WCHAR openW[] = {'o','p','e','n',0};
|
static const WCHAR openW[] = {'o','p','e','n',0};
|
||||||
|
static POINT orig_size, min_size, edit_size, text_pos, save_pos, close_pos;
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
set_fixed_font( hwnd, IDC_CRASH_TXT );
|
set_fixed_font( hwnd, IDC_CRASH_TXT );
|
||||||
SetDlgItemTextA( hwnd, IDC_CRASH_TXT, crash_log );
|
SetDlgItemTextA( hwnd, IDC_CRASH_TXT, crash_log );
|
||||||
|
|
||||||
|
GetClientRect( hwnd, &rect );
|
||||||
|
orig_size.x = rect.right;
|
||||||
|
orig_size.y = rect.bottom;
|
||||||
|
|
||||||
|
GetWindowRect( hwnd, &rect );
|
||||||
|
min_size.x = rect.right - rect.left;
|
||||||
|
min_size.y = rect.bottom - rect.top;
|
||||||
|
|
||||||
|
GetWindowRect( GetDlgItem( hwnd, IDOK ), &rect );
|
||||||
|
MapWindowPoints( 0, hwnd, (POINT *)&rect, 2 );
|
||||||
|
close_pos.x = rect.left;
|
||||||
|
close_pos.y = rect.top;
|
||||||
|
|
||||||
|
GetWindowRect( GetDlgItem( hwnd, ID_SAVEAS ), &rect );
|
||||||
|
MapWindowPoints( 0, hwnd, (POINT *)&rect, 2 );
|
||||||
|
save_pos.x = rect.left;
|
||||||
|
save_pos.y = rect.top;
|
||||||
|
|
||||||
|
GetWindowRect( GetDlgItem( hwnd, IDC_STATIC_TXT2 ), &rect );
|
||||||
|
MapWindowPoints( 0, hwnd, (POINT *)&rect, 2 );
|
||||||
|
text_pos.x = rect.left;
|
||||||
|
text_pos.y = rect.top;
|
||||||
|
|
||||||
|
GetWindowRect( GetDlgItem( hwnd, IDC_CRASH_TXT ), &rect );
|
||||||
|
MapWindowPoints( 0, hwnd, (POINT *)&rect, 2 );
|
||||||
|
edit_size.x = rect.right - rect.left;
|
||||||
|
edit_size.y = rect.bottom - rect.top;
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
case WM_GETMINMAXINFO:
|
||||||
|
((MINMAXINFO *)lparam)->ptMinTrackSize = min_size;
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
case WM_SIZE:
|
||||||
|
if (wparam == SIZE_RESTORED)
|
||||||
|
{
|
||||||
|
int off_x = (short)LOWORD( lparam ) - orig_size.x;
|
||||||
|
int off_y = (short)HIWORD( lparam ) - orig_size.y;
|
||||||
|
|
||||||
|
SetWindowPos( GetDlgItem( hwnd, IDOK ), 0, close_pos.x + off_x,
|
||||||
|
close_pos.y + off_y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
|
SetWindowPos( GetDlgItem( hwnd, ID_SAVEAS ), 0, save_pos.x + off_x,
|
||||||
|
save_pos.y + off_y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
|
SetWindowPos( GetDlgItem( hwnd, IDC_STATIC_TXT2 ), 0, text_pos.x,
|
||||||
|
text_pos.y + off_y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
|
SetWindowPos( GetDlgItem( hwnd, IDC_CRASH_TXT ), 0, 0, 0, edit_size.x + off_x,
|
||||||
|
edit_size.y + off_y, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
|
|
|
@ -58,7 +58,7 @@ BEGIN
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_DETAILS_DLG DIALOGEX 100, 100, 300, 240
|
IDD_DETAILS_DLG DIALOGEX 100, 100, 300, 240
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||||
CAPTION "Program Error Details"
|
CAPTION "Program Error Details"
|
||||||
FONT 8, "Tahoma"
|
FONT 8, "Tahoma"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
Loading…
Reference in a new issue