[Initranslator-svncheckins] SF.net SVN: initranslator: [170] translator/trunk
Brought to you by:
peter3
|
From: <pe...@us...> - 2006-12-05 19:49:58
|
Revision: 170
http://svn.sourceforge.net/initranslator/?rev=170&view=rev
Author: peter3
Date: 2006-12-05 11:49:58 -0800 (Tue, 05 Dec 2006)
Log Message:
-----------
- have to check if user is on XP before using XP specific functions
- FileAge for pre-BDS
Modified Paths:
--------------
translator/trunk/help/images/translator.jpg
translator/trunk/src/AppUtils.pas
translator/trunk/src/FileMonitor.pas
Modified: translator/trunk/help/images/translator.jpg
===================================================================
(Binary files differ)
Modified: translator/trunk/src/AppUtils.pas
===================================================================
--- translator/trunk/src/AppUtils.pas 2006-12-05 18:40:50 UTC (rev 169)
+++ translator/trunk/src/AppUtils.pas 2006-12-05 19:49:58 UTC (rev 170)
@@ -556,7 +556,7 @@
begin
if TWinControl(AControl).Controls[i] is TCustomComboBox then
begin
- if IsAppThemed {Win32PlatformIsXP} then
+ if Assigned(IsAppThemed) and IsAppThemed {Win32PlatformIsXP} then
TAccessComboBox(TWinControl(AControl).Controls[i]).BevelKind := bkNone
else
TAccessComboBox(TWinControl(AControl).Controls[i]).BevelKind := bkFlat;
@@ -578,7 +578,7 @@
begin
if WC.Controls[i] is TCustomComboBox then
begin
- if IsAppThemed {Win32PlatformIsXP} then
+ if Assigned(IsAppThemed) and IsAppThemed {Win32PlatformIsXP} then
TAccessComboBox(TWinControl(AControl).Controls[i]).BevelKind := bkNone
else
TAccessComboBox(TWinControl(AControl).Controls[i]).BevelKind := bkFlat;
Modified: translator/trunk/src/FileMonitor.pas
===================================================================
--- translator/trunk/src/FileMonitor.pas 2006-12-05 18:40:50 UTC (rev 169)
+++ translator/trunk/src/FileMonitor.pas 2006-12-05 19:49:58 UTC (rev 170)
@@ -57,6 +57,32 @@
resourcestring
SFmtMonitorFileNotFound = 'File "%s" not found: cannot monitor a nonexistent file!';
+{$IFNDEF COMPILER9_UP}
+function FileAge(const FileName: string; out FileDateTime: TDateTime): Boolean;
+var
+ Handle: THandle;
+ FindData: TWin32FindData;
+ LSystemTime: TSystemTime;
+ LocalFileTime: TFileTime;
+begin
+ Result := False;
+ Handle := FindFirstFile(PChar(FileName), FindData);
+ if Handle <> INVALID_HANDLE_VALUE then
+ begin
+ Windows.FindClose(Handle);
+ if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then
+ begin
+ Result := True;
+ FileTimeToLocalFileTime(FindData.ftLastWriteTime, LocalFileTime);
+ FileTimeToSystemTime(LocalFileTime, LSystemTime);
+ with LSystemTime do
+ FileDateTime := EncodeDate(wYear, wMonth, wDay) +
+ EncodeTime(wHour, wMinute, wSecond, wMilliSeconds);
+ end;
+ end;
+end;
+{$ENDIF}
+
{ TFileMonitorThread }
procedure TFileMonitorThread.Change;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|