From 0ef4cb9fff6b029b0f453cb87e3210599fc8b192 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sat, 28 Nov 2015 23:18:25 +0000 Subject: [PATCH] Win32: Remove the use of IfDef's for UseVistaDialogs. It has been defined for over 4 years now, without a mechanisme to undefine it. git-svn-id: trunk@50522 - --- lcl/interfaces/win32/win32defines.inc | 4 --- lcl/interfaces/win32/win32extra.pas | 2 -- lcl/interfaces/win32/win32wsdialogs.pp | 36 -------------------------- lcl/interfaces/win32/win32wsextdlgs.pp | 8 ------ 4 files changed, 50 deletions(-) diff --git a/lcl/interfaces/win32/win32defines.inc b/lcl/interfaces/win32/win32defines.inc index 13d4a6c24e..5ae924fb06 100644 --- a/lcl/interfaces/win32/win32defines.inc +++ b/lcl/interfaces/win32/win32defines.inc @@ -21,8 +21,4 @@ // valuable for investigation of message trees / interrelations { $define MSG_DEBUG} -{$IFNDEF DisableUseVistaDialogs} -//please keep this settings because of issue #29105 -{$DEFINE UseVistaDialogs} -{$ENDIF} {.$DEFINE RedirectDestroyMessages} diff --git a/lcl/interfaces/win32/win32extra.pas b/lcl/interfaces/win32/win32extra.pas index b45770ac63..54cbc90dcd 100644 --- a/lcl/interfaces/win32/win32extra.pas +++ b/lcl/interfaces/win32/win32extra.pas @@ -247,7 +247,6 @@ type PROPERTYKEY = _tagpropertykey; REFPROPERTYKEY = ^PROPERTYKEY; REFPROPVARIANT = ^TPROPVARIANT; -{$ifdef UseVistaDialogs} IEnumShellItems = interface(IUnknown) ['{70629033-e363-4a28-a567-0db78006e6d7}'] function Next(celt: ULONG; out rgelt: IShellItem; var pceltFetched: ULONG): HResult; stdcall; @@ -355,7 +354,6 @@ type function GetProperties(var ppStore: IPropertyStore): HResult; stdcall; function ApplyProperties(psi: IShellItem; pStore: IPropertyStore; hwnd: HWND; pSink: IFileOperationProgressSink): HResult; stdcall; end; -{$endif} // AlphaBlend is only defined for win98&2k and up // load dynamic and use ownfunction if not defined diff --git a/lcl/interfaces/win32/win32wsdialogs.pp b/lcl/interfaces/win32/win32wsdialogs.pp index 56bd5f2f83..e37c32ea56 100644 --- a/lcl/interfaces/win32/win32wsdialogs.pp +++ b/lcl/interfaces/win32/win32wsdialogs.pp @@ -71,13 +71,11 @@ type TWin32WSOpenDialog = class(TWSOpenDialog) public - {$ifdef UseVistaDialogs} class procedure SetupVistaFileDialog(ADialog: IFileDialog; const AOpenDialog: TOpenDialog); class function ProcessVistaDialogResult(ADialog: IFileDialog; const AOpenDialog: TOpenDialog): HResult; class procedure VistaDialogShowModal(ADialog: IFileDialog; const AOpenDialog: TOpenDialog); class function GetFileName(ShellItem: IShellItem): String; class function GetParentWnd: HWND; - {$endif} published class function CreateHandle(const ACommonDialog: TCommonDialog): THandle; override; class procedure DestroyHandle(const ACommonDialog: TCommonDialog); override; @@ -122,7 +120,6 @@ type class function CreateHandle(const ACommonDialog: TCommonDialog): THandle; override; end; -{$ifdef UseVistaDialogs} { TFileDialogEvents } @@ -146,7 +143,6 @@ type public constructor Create(ADialog: TOpenDialog); end; -{$endif} function OpenFileDialogCallBack(Wnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): UINT_PTR; stdcall; @@ -156,9 +152,7 @@ procedure RestoreApplicationState(AState: TApplicationState); function UTF8StringToPWideChar(const s: string) : PWideChar; function UTF8StringToPAnsiChar(const s: string) : PAnsiChar; -{$ifdef UseVistaDialogs} function CanUseVistaDialogs(const AOpenDialog: TOpenDialog): Boolean; -{$endif} var cOpenDialogAllFiles: string = 'All files'; @@ -337,12 +331,10 @@ begin ACommonDialog.UserChoice := mrCancel; end; -{$ifdef UseVistaDialogs} function CanUseVistaDialogs(const AOpenDialog: TOpenDialog): Boolean; begin Result := (WindowsVersion >= wvVista) and not (ofOldStyleDialog in AOpenDialog.Options); end; -{$endif} { TWin32WSColorDialog } @@ -737,7 +729,6 @@ begin end; { TWin32WSOpenDialog } -{$ifdef UseVistaDialogs} class procedure TWin32WSOpenDialog.SetupVistaFileDialog(ADialog: IFileDialog; const AOpenDialog: TOpenDialog); @@ -931,15 +922,11 @@ begin else Result := WidgetSet.AppHandle; end; -{$endif} class function TWin32WSOpenDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle; -{$ifdef UseVistaDialogs} var Dialog: IFileOpenDialog; -{$endif} begin - {$ifdef UseVistaDialogs} if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then begin @@ -953,18 +940,14 @@ begin Result := INVALID_HANDLE_VALUE; end else - {$endif} Result := CreateFileDialogHandle(TOpenDialog(ACommonDialog)); end; class procedure TWin32WSOpenDialog.DestroyHandle(const ACommonDialog: TCommonDialog); -{$ifdef UseVistaDialogs} var Dialog: IFileDialog; -{$endif} begin if ACommonDialog.Handle <> 0 then - {$ifdef UseVistaDialogs} if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then begin @@ -973,7 +956,6 @@ begin Dialog := nil; end else - {$endif} DestroyFileDialogHandle(ACommonDialog.Handle) end; @@ -981,9 +963,7 @@ class procedure TWin32WSOpenDialog.ShowModal(const ACommonDialog: TCommonDialog) var State: TApplicationState; lOldWorkingDir, lInitialDir: string; - {$ifdef UseVistaDialogs} Dialog: IFileOpenDialog; - {$endif} begin if ACommonDialog.Handle <> 0 then begin @@ -992,7 +972,6 @@ begin try lInitialDir := TOpenDialog(ACommonDialog).InitialDir; if lInitialDir <> '' then SetCurrentDirUTF8(lInitialDir); - {$ifdef UseVistaDialogs} if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then begin @@ -1000,7 +979,6 @@ begin VistaDialogShowModal(Dialog, TOpenDialog(ACommonDialog)); end else - {$endif} begin if UnicodeEnabledOS then ProcessFileDialogResult(TOpenDialog(ACommonDialog), @@ -1019,12 +997,9 @@ end; { TWin32WSSaveDialog } class function TWin32WSSaveDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle; -{$ifdef UseVistaDialogs} var Dialog: IFileSaveDialog; -{$endif} begin - {$ifdef UseVistaDialogs} if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then begin @@ -1039,18 +1014,14 @@ begin Result := INVALID_HANDLE_VALUE; end else - {$endif} Result := CreateFileDialogHandle(TOpenDialog(ACommonDialog)); end; class procedure TWin32WSSaveDialog.DestroyHandle(const ACommonDialog: TCommonDialog); -{$ifdef UseVistaDialogs} var Dialog: IFileDialog; -{$endif} begin if ACommonDialog.Handle <> 0 then - {$ifdef UseVistaDialogs} if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then begin @@ -1059,7 +1030,6 @@ begin Dialog := nil; end else - {$endif} DestroyFileDialogHandle(ACommonDialog.Handle) end; @@ -1067,9 +1037,7 @@ class procedure TWin32WSSaveDialog.ShowModal(const ACommonDialog: TCommonDialog) var State: TApplicationState; lOldWorkingDir, lInitialDir: string; - {$ifdef UseVistaDialogs} Dialog: IFileSaveDialog; - {$endif} begin if ACommonDialog.Handle <> 0 then begin @@ -1078,7 +1046,6 @@ begin try lInitialDir := TSaveDialog(ACommonDialog).InitialDir; if lInitialDir <> '' then SetCurrentDirUTF8(lInitialDir); - {$ifdef UseVistaDialogs} if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then begin @@ -1086,7 +1053,6 @@ begin TWin32WSOpenDialog.VistaDialogShowModal(Dialog, TOpenDialog(ACommonDialog)); end else - {$endif} begin if UnicodeEnabledOS then ProcessFileDialogResult(TOpenDialog(ACommonDialog), @@ -1338,7 +1304,6 @@ begin Result := 0; end; -{$ifdef UseVistaDialogs} { TFileDialogEvents } function TFileDialogEvents.OnFileOk(pfd: IFileDialog): HResult; stdcall; @@ -1439,7 +1404,6 @@ begin inherited Create; FDialog := ADialog; end; -{$endif} initialization if (Win32MajorVersion = 4) then diff --git a/lcl/interfaces/win32/win32wsextdlgs.pp b/lcl/interfaces/win32/win32wsextdlgs.pp index da27a74580..6a3d27c0ec 100644 --- a/lcl/interfaces/win32/win32wsextdlgs.pp +++ b/lcl/interfaces/win32/win32wsextdlgs.pp @@ -161,14 +161,11 @@ end; { TWin32WSOpenPictureDialog } class function TWin32WSOpenPictureDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle; -{$ifdef UseVistaDialogs} var Dialog: IFileOpenDialog; fos: FILEOPENDIALOGOPTIONS; -{$endif} begin Result := inherited CreateHandle(ACommonDialog); - {$ifdef UseVistaDialogs} //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then begin @@ -180,7 +177,6 @@ begin end; end else - {$endif} AddPreviewControl(ACommonDialog, LPOPENFILENAME(Result)); end; @@ -208,14 +204,11 @@ end; class function TWin32WSSavePictureDialog.CreateHandle( const ACommonDialog: TCommonDialog): THandle; -{$ifdef UseVistaDialogs} var Dialog: IFileSaveDialog; fos: FILEOPENDIALOGOPTIONS; -{$endif} begin Result := inherited CreateHandle(ACommonDialog); - {$ifdef UseVistaDialogs} //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then begin @@ -227,7 +220,6 @@ begin end; end else - {$endif} AddPreviewControl(ACommonDialog, LPOPENFILENAME(Result)); end;