MSI: make tabs work in msi dialogs
Mike McCormack
mike at codeweavers.com
Mon Jun 20 04:00:57 CDT 2005
This allows the user to tab round the dialog. The tab stops are still
in the wrong order, and the default button is not set, but it improves
usability alot.
Mike
ChangeLog:
* make tabs work in msi dialogs
-------------- next part --------------
Index: dlls/msi/dialog.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/dialog.c,v
retrieving revision 1.25
diff -u -p -r1.25 dialog.c
--- dlls/msi/dialog.c 17 Jun 2005 20:54:42 -0000 1.25
+++ dlls/msi/dialog.c 20 Jun 2005 09:02:06 -0000
@@ -402,7 +402,7 @@ static UINT msi_dialog_button_control( m
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, szButton, 0 );
+ control = msi_dialog_add_control( dialog, rec, szButton, WS_TABSTOP );
control->handler = msi_dialog_button_handler;
return ERROR_SUCCESS;
@@ -458,7 +458,7 @@ static UINT msi_dialog_checkbox_control(
TRACE("%p %p\n", dialog, rec);
control = msi_dialog_add_control( dialog, rec, szButton,
- BS_CHECKBOX | BS_MULTILINE );
+ BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP );
control->handler = msi_dialog_checkbox_handler;
prop = MSI_RecordGetString( rec, 9 );
if( prop )
@@ -515,7 +515,8 @@ static UINT msi_dialog_scrolltext_contro
EDITSTREAM es;
DWORD style;
- style = WS_BORDER | ES_MULTILINE | WS_VSCROLL | ES_READONLY | ES_AUTOVSCROLL;
+ style = WS_BORDER | ES_MULTILINE | WS_VSCROLL |
+ ES_READONLY | ES_AUTOVSCROLL | WS_TABSTOP;
control = msi_dialog_add_control( dialog, rec, szRichEdit20W, style );
text = MSI_RecordGetString( rec, 10 );
@@ -601,7 +602,8 @@ static UINT msi_dialog_edit_control( msi
LPCWSTR prop;
LPWSTR val;
- control = msi_dialog_add_control( dialog, rec, szEdit, WS_BORDER );
+ control = msi_dialog_add_control( dialog, rec, szEdit,
+ WS_BORDER | WS_TABSTOP );
control->handler = msi_dialog_edit_handler;
prop = MSI_RecordGetString( rec, 9 );
if( prop )
@@ -838,13 +840,15 @@ static UINT msi_dialog_maskedit_control(
info->dialog = dialog;
- control = msi_dialog_add_control( dialog, rec, szStatic, SS_OWNERDRAW|WS_GROUP );
+ control = msi_dialog_add_control( dialog, rec, szStatic,
+ SS_OWNERDRAW | WS_GROUP | WS_VISIBLE );
if( !control )
{
ERR("Failed to create maskedit container\n");
ret = ERROR_FUNCTION_FAILED;
goto end;
}
+ SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_CONTROLPARENT );
info->hwnd = control->hwnd;
@@ -895,7 +899,7 @@ static UINT msi_dialog_create_radiobutto
DWORD style;
DWORD attributes = group->attributes;
- style = WS_CHILD | BS_AUTORADIOBUTTON | BS_MULTILINE;
+ style = WS_CHILD | BS_AUTORADIOBUTTON | BS_MULTILINE | WS_TABSTOP;
name = MSI_RecordGetString( rec, 3 );
text = MSI_RecordGetString( rec, 8 );
if( attributes & 1 )
@@ -941,6 +945,7 @@ static UINT msi_dialog_radiogroup_contro
oldproc = (WNDPROC) SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIRadioGroup_WndProc );
SetPropW(control->hwnd, szButtonData, oldproc);
+ SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_CONTROLPARENT );
if( prop )
control->property = strdupW( prop );
@@ -1048,7 +1053,7 @@ static UINT msi_dialog_set_control_condi
TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
/* FIXME: case sensitive? */
- if(!strcmpW(action, szHide))
+ if(!lstrcmpW(action, szHide))
ShowWindow(control->hwnd, SW_HIDE);
else if(!strcmpW(action, szShow))
ShowWindow(control->hwnd, SW_SHOW);
@@ -1513,12 +1518,14 @@ msi_dialog *msi_dialog_create( MSIPACKAG
return dialog;
}
-static void msi_process_pending_messages(void)
+static void msi_process_pending_messages( HWND hdlg )
{
MSG msg;
while( PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ) )
{
+ if( hdlg && IsDialogMessageW( hdlg, &msg ))
+ continue;
TranslateMessage( &msg );
DispatchMessageW( &msg );
}
@@ -1546,7 +1553,7 @@ void msi_dialog_check_messages( HANDLE h
/* there's two choices for the UI thread */
while (1)
{
- msi_process_pending_messages();
+ msi_process_pending_messages( NULL );
if( !handle )
break;
@@ -1589,7 +1596,7 @@ UINT msi_dialog_run_message_loop( msi_di
while( !dialog->finished )
{
MsgWaitForMultipleObjects( 0, NULL, 0, INFINITE, QS_ALLEVENTS );
- msi_process_pending_messages();
+ msi_process_pending_messages( dialog->hwnd );
}
}
else
More information about the wine-patches
mailing list