mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 08:54:05 +00:00
joy.cpl: Improve the DInput button display with many buttons.
This commit is contained in:
parent
91f7201d42
commit
bb9ee1e94a
|
@ -417,7 +417,8 @@ static void draw_button_view( HDC hdc, RECT rect, BOOL set, const WCHAR *name )
|
|||
SelectObject( hdc, GetStockObject( DC_BRUSH ) );
|
||||
SelectObject( hdc, GetStockObject( DC_PEN ) );
|
||||
|
||||
Ellipse( hdc, rect.left, rect.top, rect.right, rect.bottom );
|
||||
if (rect.right - rect.left < 16) Rectangle( hdc, rect.left, rect.top, rect.right, rect.bottom );
|
||||
else Ellipse( hdc, rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
color = SetTextColor( hdc, GetSysColor( set ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT ) );
|
||||
font = SelectObject( hdc, GetStockObject( ANSI_VAR_FONT ) );
|
||||
|
@ -559,7 +560,7 @@ LRESULT CALLBACK test_di_buttons_window_proc( HWND hwnd, UINT msg, WPARAM wparam
|
|||
}
|
||||
|
||||
if (caps.dwButtons <= 48) step = 16;
|
||||
else step = 32;
|
||||
else step = 24;
|
||||
|
||||
hdc = BeginPaint( hwnd, &paint );
|
||||
|
||||
|
@ -579,7 +580,8 @@ LRESULT CALLBACK test_di_buttons_window_proc( HWND hwnd, UINT msg, WPARAM wparam
|
|||
for (j = 0; j < step && i < caps.dwButtons; j++, i++)
|
||||
{
|
||||
WCHAR buffer[3];
|
||||
swprintf( buffer, ARRAY_SIZE(buffer), L"%d", i );
|
||||
if (step == 24) swprintf( buffer, ARRAY_SIZE(buffer), L"%02x", i );
|
||||
else swprintf( buffer, ARRAY_SIZE(buffer), L"%d", i );
|
||||
draw_button_view( hdc, rect, state.rgbButtons[i], buffer );
|
||||
OffsetRect( &rect, size, 0 );
|
||||
}
|
||||
|
@ -675,7 +677,7 @@ static void create_device_views( HWND hwnd )
|
|||
GetClientRect( parent, &rect );
|
||||
rect.top += 10;
|
||||
|
||||
margin = (rect.bottom - rect.top) * 10 / 100;
|
||||
margin = (rect.bottom - rect.top) * 5 / 100;
|
||||
InflateRect( &rect, -margin, -margin );
|
||||
|
||||
CreateWindowW( L"JoyCplDInputButtons", NULL, WS_CHILD | WS_VISIBLE, rect.left, rect.top,
|
||||
|
|
|
@ -57,9 +57,9 @@ FONT 8, "Ms Shell Dlg"
|
|||
COMBOBOX IDC_DI_DEVICES, 15, 10, 291, 60, CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
GROUPBOX "Axes", IDC_DI_AXES, 15, 30, 214, 60
|
||||
GROUPBOX "POVs", IDC_DI_POVS, 246, 30, 60, 60
|
||||
GROUPBOX "Buttons", IDC_DI_BUTTONS, 15, 100, 291, 70
|
||||
LTEXT "Force Feedback Effect", IDC_STATIC, 15, 180, 291, 10
|
||||
LISTBOX IDC_DI_EFFECTS, 15, 190, 291, 70, WS_TABSTOP | WS_VSCROLL | LBS_NOTIFY
|
||||
GROUPBOX "Buttons", IDC_DI_BUTTONS, 15, 100, 291, 86
|
||||
LTEXT "Force Feedback Effect", IDC_STATIC, 15, 196, 291, 10
|
||||
LISTBOX IDC_DI_EFFECTS, 15, 206, 291, 54, WS_TABSTOP | WS_VSCROLL | LBS_NOTIFY
|
||||
LTEXT "Press any button in the controller to activate the chosen effect. The effect direction can be changed with the controller axis.",
|
||||
IDC_STATIC, 15, 260, 291, 25
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue