Module: wine Branch: master Commit: 7f11441af9ed6b6bfba188a333e10775f6c63fc6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7f11441af9ed6b6bfba188a333...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Dec 22 17:46:25 2009 +0100
user32: Duplicate DIALOG_Enable/DisableOwner implementation on the 16-bit side.
---
dlls/user32/controls.h | 2 -- dlls/user32/dialog.c | 4 ++-- dlls/user32/dialog16.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 8d1869e..279dc4c 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -240,8 +240,6 @@ typedef struct tagDIALOGINFO #define DF_OWNERENABLED 0x0002
extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN; -extern void DIALOG_EnableOwner( HWND hOwner ) DECLSPEC_HIDDEN; -extern BOOL DIALOG_DisableOwner( HWND hOwner ) DECLSPEC_HIDDEN; extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
#endif /* __WINE_CONTROLS_H */ diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index f0d194d..bce2684 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -109,7 +109,7 @@ const struct builtin_class_descr DIALOG_builtin_class = * Helper function for modal dialogs to enable again the * owner of the dialog box. */ -void DIALOG_EnableOwner( HWND hOwner ) +static void DIALOG_EnableOwner( HWND hOwner ) { /* Owner must be a top-level window */ if (hOwner) @@ -125,7 +125,7 @@ void DIALOG_EnableOwner( HWND hOwner ) * Helper function for modal dialogs to disable the * owner of the dialog box. Returns TRUE if owner was enabled. */ -BOOL DIALOG_DisableOwner( HWND hOwner ) +static BOOL DIALOG_DisableOwner( HWND hOwner ) { /* Owner must be a top-level window */ if (hOwner) diff --git a/dlls/user32/dialog16.c b/dlls/user32/dialog16.c index fc6ad1e..95f009f 100644 --- a/dlls/user32/dialog16.c +++ b/dlls/user32/dialog16.c @@ -66,6 +66,44 @@ typedef struct
/*********************************************************************** + * DIALOG_EnableOwner + * + * Helper function for modal dialogs to enable again the + * owner of the dialog box. + */ +static void DIALOG_EnableOwner( HWND hOwner ) +{ + /* Owner must be a top-level window */ + if (hOwner) + hOwner = GetAncestor( hOwner, GA_ROOT ); + if (!hOwner) return; + EnableWindow( hOwner, TRUE ); +} + + +/*********************************************************************** + * DIALOG_DisableOwner + * + * Helper function for modal dialogs to disable the + * owner of the dialog box. Returns TRUE if owner was enabled. + */ +static BOOL DIALOG_DisableOwner( HWND hOwner ) +{ + /* Owner must be a top-level window */ + if (hOwner) + hOwner = GetAncestor( hOwner, GA_ROOT ); + if (!hOwner) return FALSE; + if (IsWindowEnabled( hOwner )) + { + EnableWindow( hOwner, FALSE ); + return TRUE; + } + else + return FALSE; +} + + +/*********************************************************************** * DIALOG_GetControl16 * * Return the class and text of the control pointed to by ptr,