summaryrefslogtreecommitdiff
path: root/plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 09:10:06 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 09:10:06 +0000
commit194923c172167eb3fc33807ec8009b255f86337e (patch)
tree1effc97a1bd872cc3a5eac7a361250cf283e0efd /plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas
parentb2943645fed61d0c0cfee1225654e5ff44fd96f8 (diff)
Plugin is not adapted until someone can compile it and tell others how to do the same
git-svn-id: http://svn.miranda-ng.org/main/trunk@1809 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas')
-rw-r--r--plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas118
1 files changed, 0 insertions, 118 deletions
diff --git a/plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas b/plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas
deleted file mode 100644
index 892bd801ae..0000000000
--- a/plugins/Chess4Net/lib/TntUnicodeControls/Source/TntFileCtrl.pas
+++ /dev/null
@@ -1,118 +0,0 @@
-
-{*****************************************************************************}
-{ }
-{ Tnt Delphi Unicode Controls }
-{ http://www.tntware.com/delphicontrols/unicode/ }
-{ Version: 2.3.0 }
-{ }
-{ Copyright (c) 2002-2007, Troy Wolbrink (troy.wolbrink@tntware.com) }
-{ }
-{*****************************************************************************}
-
-unit TntFileCtrl;
-
-{$INCLUDE TntCompilers.inc}
-
-interface
-
-{$WARN UNIT_PLATFORM OFF}
-
-uses
- Classes, Windows, FileCtrl;
-
-{TNT-WARN SelectDirectory}
-function WideSelectDirectory(const Caption: WideString; const Root: WideString;
- var Directory: WideString): Boolean;
-
-implementation
-
-uses
- SysUtils, Forms, ActiveX, ShlObj, ShellApi, TntSysUtils, TntWindows;
-
-function SelectDirCB_W(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM): Integer stdcall;
-begin
- if (uMsg = BFFM_INITIALIZED) and (lpData <> 0) then
- SendMessageW(Wnd, BFFM_SETSELECTIONW, Integer(True), lpdata);
- result := 0;
-end;
-
-function WideSelectDirectory(const Caption: WideString; const Root: WideString;
- var Directory: WideString): Boolean;
-{$IFNDEF COMPILER_7_UP}
-const
- BIF_NEWDIALOGSTYLE = $0040;
- BIF_USENEWUI = BIF_NEWDIALOGSTYLE or BIF_EDITBOX;
-{$ENDIF}
-var
- WindowList: Pointer;
- BrowseInfo: TBrowseInfoW;
- Buffer: PWideChar;
- OldErrorMode: Cardinal;
- RootItemIDList, ItemIDList: PItemIDList;
- ShellMalloc: IMalloc;
- IDesktopFolder: IShellFolder;
- Eaten, Flags: LongWord;
- AnsiDirectory: AnsiString;
-begin
- if (not Win32PlatformIsUnicode) then begin
- AnsiDirectory := Directory;
- Result := SelectDirectory{TNT-ALLOW SelectDirectory}(Caption, Root, AnsiDirectory);
- Directory := AnsiDirectory;
- end else begin
- Result := False;
- if not WideDirectoryExists(Directory) then
- Directory := '';
- FillChar(BrowseInfo, SizeOf(BrowseInfo), 0);
- if (ShGetMalloc(ShellMalloc) = S_OK) and (ShellMalloc <> nil) then
- begin
- Buffer := ShellMalloc.Alloc(MAX_PATH * SizeOf(WideChar));
- try
- RootItemIDList := nil;
- if Root <> '' then
- begin
- SHGetDesktopFolder(IDesktopFolder);
- IDesktopFolder.ParseDisplayName(Application.Handle, nil,
- POleStr(Root), Eaten, RootItemIDList, Flags);
- end;
- with BrowseInfo do
- begin
- {$IFDEF COMPILER_9_UP}
- hWndOwner := Application.ActiveFormHandle;
- {$ELSE}
- hWndOwner := Application.Handle;
- {$ENDIF}
- pidlRoot := RootItemIDList;
- pszDisplayName := Buffer;
- lpszTitle := PWideChar(Caption);
- ulFlags := BIF_RETURNONLYFSDIRS;
- if Win32MajorVersion >= 5 then
- ulFlags := ulFlags or BIF_USENEWUI;
- if Directory <> '' then
- begin
- lpfn := SelectDirCB_W;
- lParam := Integer(PWideChar(Directory));
- end;
- end;
- WindowList := DisableTaskWindows(0);
- OldErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS);
- try
- ItemIDList := Tnt_ShBrowseForFolderW(BrowseInfo);
- finally
- SetErrorMode(OldErrorMode);
- EnableTaskWindows(WindowList);
- end;
- Result := ItemIDList <> nil;
- if Result then
- begin
- Tnt_ShGetPathFromIDListW(ItemIDList, Buffer);
- ShellMalloc.Free(ItemIDList);
- Directory := Buffer;
- end;
- finally
- ShellMalloc.Free(Buffer);
- end;
- end;
- end;
-end;
-
-end.