[Initranslator-svncheckins] SF.net SVN: initranslator: [249] translator/trunk/src
Brought to you by:
peter3
|
From: <pe...@us...> - 2007-08-14 16:29:54
|
Revision: 249
http://initranslator.svn.sourceforge.net/initranslator/?rev=249&view=rev
Author: peter3
Date: 2007-08-14 09:29:55 -0700 (Tue, 14 Aug 2007)
Log Message:
-----------
- consistent formatting (DelForEx)
Modified Paths:
--------------
translator/trunk/src/AppConsts.pas
translator/trunk/src/AppOptions.pas
translator/trunk/src/AppUtils.pas
translator/trunk/src/ApplicationServices.pas
translator/trunk/src/BaseForm.pas
translator/trunk/src/ColorsFrm.pas
translator/trunk/src/CommentsFrm.pas
translator/trunk/src/CommonUtils.pas
translator/trunk/src/DCPPPlugin/DCPPParser.res
translator/trunk/src/DictEditFrm.pas
translator/trunk/src/DictTranslationSelectDlg.pas
translator/trunk/src/Dictionary.pas
translator/trunk/src/EditItemFrm.pas
translator/trunk/src/ExceptDlg.pas
translator/trunk/src/ExceptDlgMail.pas
translator/trunk/src/ExtToolsFrm.pas
translator/trunk/src/FileMonitor.pas
translator/trunk/src/FindReplaceFrm.pas
translator/trunk/src/FoxitPlugin/FoxitParser.res
translator/trunk/src/IBForumsPlugin/IBForumsParser.res
translator/trunk/src/ImportExportFrm.pas
translator/trunk/src/KbdCfgFrame.pas
translator/trunk/src/KbdCfgFrm.pas
translator/trunk/src/KeePassPlugin/KeePassParser.res
translator/trunk/src/MSDictPlugin/MSDictParser.res
translator/trunk/src/MainFrm.pas
translator/trunk/src/MozillaPlugin/MozillaDTDParser.res
translator/trunk/src/MozillaPlugin/MozillaPropsParser.res
translator/trunk/src/MsDictBuild/MSDictBuild.res
translator/trunk/src/MsTermBuild/MsTermBuild.res
translator/trunk/src/MsgTranslate.pas
translator/trunk/src/OlegPlugin/OlegParser.res
translator/trunk/src/OpenOfficeGSIPlugin/OOGSIParser.res
translator/trunk/src/OptionsFrm.pas
translator/trunk/src/OrphansFrm.pas
translator/trunk/src/PHPNukePlugin/PHPNukeParser.res
translator/trunk/src/PHPPlugin/PHPParser.res
translator/trunk/src/POPlugin/POParser.res
translator/trunk/src/PolyglotPlugin/PolyGlotParser.res
translator/trunk/src/PromptArgsFrm.pas
translator/trunk/src/SDFSplit/SDFSplit.res
translator/trunk/src/SciTEPlugin/SciTEParser.res
translator/trunk/src/ShortCutEdit.pas
translator/trunk/src/SuspiciousConfigFrm.pas
translator/trunk/src/TMXPlugin/TMXParser.res
translator/trunk/src/ToolConsistency/ToolConsistency.res
translator/trunk/src/ToolItems.pas
translator/trunk/src/ToolKeyCheck/ToolKeyCheck.res
translator/trunk/src/ToolListEdit/ToolListEdit.res
translator/trunk/src/ToolPropertiesView/ToolPropertiesView.res
translator/trunk/src/ToolTreeView/ToolTreeView.res
translator/trunk/src/ToolTrim/ToolTrim.res
translator/trunk/src/TransIntf.pas
translator/trunk/src/UndoList.pas
translator/trunk/src/WixPlugin/WixParser.res
translator/trunk/src/XLIFFPlugin/XLIFFParser.res
translator/trunk/src/XilisoftPlugin/XilisoftParser.res
translator/trunk/src/translator.res
Modified: translator/trunk/src/AppConsts.pas
===================================================================
--- translator/trunk/src/AppConsts.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/AppConsts.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -136,7 +136,7 @@
cRegMRUKey = '\Software\Peter3\Ini Translator\';
cIniToolbarKey = 'Toolbars';
cIniMRUKey = 'MRU';
- cArgsMacros: array[0..18] of PWideChar =
+ cArgsMacros:array[0..18] of PWideChar =
(
'$(OrigLine)',
'$(OrigText)',
@@ -158,7 +158,7 @@
'$(WinDir)',
'$(SysDir)'
);
- cDirMacros: array[0..5] of PWideChar =
+ cDirMacros:array[0..5] of PWideChar =
(
'$(OrigDir)',
'$(TransDir)',
Modified: translator/trunk/src/AppOptions.pas
===================================================================
--- translator/trunk/src/AppOptions.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/AppOptions.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -26,206 +26,206 @@
type
PAppWindowInfo = ^TAppWindowInfo;
TAppWindowInfo = record
- Name: shortstring;
- BoundsRect: TRect;
- WindowState: TWindowState;
+ Name:shortstring;
+ BoundsRect:TRect;
+ WindowState:TWindowState;
end;
TToolItem = class(TCollectionItem)
private
- FCaptureOutput: boolean;
- FWaitForCompletion: boolean;
- FPromptForArguments: boolean;
- FInitialDirectory: WideString;
- FArguments: WideString;
- FTitle: WideString;
- FCommand: WideString;
- FUseShellExecute: boolean;
- FShortCut: Word;
- function GetAsString: WideString;
- procedure SetAsString(const Value: WideString);
+ FCaptureOutput:boolean;
+ FWaitForCompletion:boolean;
+ FPromptForArguments:boolean;
+ FInitialDirectory:WideString;
+ FArguments:WideString;
+ FTitle:WideString;
+ FCommand:WideString;
+ FUseShellExecute:boolean;
+ FShortCut:Word;
+ function GetAsString:WideString;
+ procedure SetAsString(const Value:WideString);
public
- procedure Assign(Source: TPersistent); override;
- property AsString: WideString read GetAsString write SetAsString;
+ procedure Assign(Source:TPersistent); override;
+ property AsString:WideString read GetAsString write SetAsString;
published
- property Title: WideString read FTitle write FTitle;
- property Command: WideString read FCommand write FCommand;
- property Arguments: WideString read FArguments write FArguments;
- property InitialDirectory: WideString read FInitialDirectory write FInitialDirectory;
- property CaptureOutput: boolean read FCaptureOutput write FCaptureOutput;
- property PromptForArguments: boolean read FPromptForArguments write FPromptForArguments;
- property WaitForCompletion: boolean read FWaitForCompletion write FWaitForCompletion;
- property UseShellExecute: boolean read FUseShellExecute write FUseShellExecute;
- property ShortCut: Word read FShortCut write FShortCut;
+ property Title:WideString read FTitle write FTitle;
+ property Command:WideString read FCommand write FCommand;
+ property Arguments:WideString read FArguments write FArguments;
+ property InitialDirectory:WideString read FInitialDirectory write FInitialDirectory;
+ property CaptureOutput:boolean read FCaptureOutput write FCaptureOutput;
+ property PromptForArguments:boolean read FPromptForArguments write FPromptForArguments;
+ property WaitForCompletion:boolean read FWaitForCompletion write FWaitForCompletion;
+ property UseShellExecute:boolean read FUseShellExecute write FUseShellExecute;
+ property ShortCut:Word read FShortCut write FShortCut;
end;
TToolItems = class(TCollection)
private
- function GetItem(Index: integer): TToolItem;
- procedure SetItem(Index: integer; const Value: TToolItem);
+ function GetItem(Index:integer):TToolItem;
+ procedure SetItem(Index:integer; const Value:TToolItem);
public
constructor Create;
- procedure Assign(Source: TPersistent); override;
- function Add: TToolItem;
- function IndexOf(const Title: WideString): integer;
- procedure Exchange(Index1, Index2: integer);
- procedure LoadFromIni(ini: TWideCustomIniFile);
- procedure SaveToIni(ini: TWideCustomIniFile);
- property Items[Index: integer]: TToolItem read GetItem write SetItem; default;
+ procedure Assign(Source:TPersistent); override;
+ function Add:TToolItem;
+ function IndexOf(const Title:WideString):integer;
+ procedure Exchange(Index1, Index2:integer);
+ procedure LoadFromIni(ini:TWideCustomIniFile);
+ procedure SaveToIni(ini:TWideCustomIniFile);
+ property Items[Index:integer]:TToolItem read GetItem write SetItem; default;
end;
TAppOptions = class
private
- FWindowInfos: TTntStrings;
- FInvertDictionary: boolean;
- FSaveFormPos: boolean;
- FSaveOnReturn: boolean;
- FShowToolTips: boolean;
- FAutoMoveToNext: boolean;
- FShowDetails: boolean;
- FShowQuotes: boolean;
- FShowToolTipShortCuts: boolean;
- FSaveMinMaxState: boolean;
- FSplitterPosition: integer;
- FAppTitle: WideString;
- FOriginalFile: WideString;
- FLanguageFile: WideString;
- FTranslationFile: WideString;
- FHelpFile: WideString;
- FDictionaryFile: WideString;
- FFilename: WideString;
- FFilterIndex: integer;
- FGlobalPath: boolean;
- FPinCommentWindow: boolean;
- FMatchCase: boolean;
- FMatchLine: boolean;
- FSearchUp: boolean;
- FFindText: WideString;
- FReplaceText: WideString;
- FReplaceHistory: WideString;
- FFindHistory: WideString;
- FFindInIndex: integer;
- FTransEncoding: integer;
- FOrigEncoding: integer;
- FMonitorFiles: boolean;
- FTheme: WideString;
- FFuzzySearch: boolean;
- FDictIgnoreSpeedKeys: boolean;
- FShowFullNameInColumns: boolean;
- FUseTranslationEverywhere: boolean;
- FAutoFocusTranslation: boolean;
- FTools: TToolItems;
- FMisMatchItems: WideString;
- FMisMatchTrailingSpaces: boolean;
- FMisMatchLeadingSpaces: boolean;
- FMisMatchIdentical: boolean;
- FMisMatchEmptyTranslation: boolean;
- FMisMatchEndControl: boolean;
- FDictIgnoreNonEmpty: boolean;
- FDictEditFilter: Integer;
- FColorEvenRow: TColor;
- FColorUntranslated: TColor;
- FColorOddRow: TColor;
- FColorFontUntranslated: TColor;
- FColorFontOddRow: TColor;
- FColorFontEvenRow: TColor;
- FDefaultOrigEncoding: integer;
- FDefaultTransEncoding: integer;
- FFooter: TTntStrings;
- FHeader: TTntStrings;
- FFontSize: integer;
- FFontName: WideString;
- procedure ReadWindowInfos(ini: TWideCustomIniFile);
- procedure WriteWindowInfos(ini: TWideCustomIniFile);
- function GetWindowInfo(AForm: TForm): TAppWindowInfo;
- procedure SetWindowInfo(AForm: TForm; const Value: TAppWindowInfo);
- procedure SetTools(const Value: TToolItems);
- procedure SetFooter(const Value: TTntStrings);
- procedure SetHeader(const Value: TTntStrings);
- function GetOption(const Section, Name: WideString): WideString;
- procedure SetOption(const Section, Name, Value: WideString);
+ FWindowInfos:TTntStrings;
+ FInvertDictionary:boolean;
+ FSaveFormPos:boolean;
+ FSaveOnReturn:boolean;
+ FShowToolTips:boolean;
+ FAutoMoveToNext:boolean;
+ FShowDetails:boolean;
+ FShowQuotes:boolean;
+ FShowToolTipShortCuts:boolean;
+ FSaveMinMaxState:boolean;
+ FSplitterPosition:integer;
+ FAppTitle:WideString;
+ FOriginalFile:WideString;
+ FLanguageFile:WideString;
+ FTranslationFile:WideString;
+ FHelpFile:WideString;
+ FDictionaryFile:WideString;
+ FFilename:WideString;
+ FFilterIndex:integer;
+ FGlobalPath:boolean;
+ FPinCommentWindow:boolean;
+ FMatchCase:boolean;
+ FMatchLine:boolean;
+ FSearchUp:boolean;
+ FFindText:WideString;
+ FReplaceText:WideString;
+ FReplaceHistory:WideString;
+ FFindHistory:WideString;
+ FFindInIndex:integer;
+ FTransEncoding:integer;
+ FOrigEncoding:integer;
+ FMonitorFiles:boolean;
+ FTheme:WideString;
+ FFuzzySearch:boolean;
+ FDictIgnoreSpeedKeys:boolean;
+ FShowFullNameInColumns:boolean;
+ FUseTranslationEverywhere:boolean;
+ FAutoFocusTranslation:boolean;
+ FTools:TToolItems;
+ FMisMatchItems:WideString;
+ FMisMatchTrailingSpaces:boolean;
+ FMisMatchLeadingSpaces:boolean;
+ FMisMatchIdentical:boolean;
+ FMisMatchEmptyTranslation:boolean;
+ FMisMatchEndControl:boolean;
+ FDictIgnoreNonEmpty:boolean;
+ FDictEditFilter:Integer;
+ FColorEvenRow:TColor;
+ FColorUntranslated:TColor;
+ FColorOddRow:TColor;
+ FColorFontUntranslated:TColor;
+ FColorFontOddRow:TColor;
+ FColorFontEvenRow:TColor;
+ FDefaultOrigEncoding:integer;
+ FDefaultTransEncoding:integer;
+ FFooter:TTntStrings;
+ FHeader:TTntStrings;
+ FFontSize:integer;
+ FFontName:WideString;
+ procedure ReadWindowInfos(ini:TWideCustomIniFile);
+ procedure WriteWindowInfos(ini:TWideCustomIniFile);
+ function GetWindowInfo(AForm:TForm):TAppWindowInfo;
+ procedure SetWindowInfo(AForm:TForm; const Value:TAppWindowInfo);
+ procedure SetTools(const Value:TToolItems);
+ procedure SetFooter(const Value:TTntStrings);
+ procedure SetHeader(const Value:TTntStrings);
+ function GetOption(const Section, Name:WideString):WideString;
+ procedure SetOption(const Section, Name, Value:WideString);
public
- constructor Create(const AFilename: WideString);
+ constructor Create(const AFilename:WideString);
destructor Destroy; override;
procedure ClearWindowInfos;
- procedure SaveToFile(AFilename: WideString);
- procedure LoadFromFile(AFilename: WideString);
- property Filename: WideString read FFilename;
- property WindowInfos[AForm: TForm]: TAppWindowInfo read GetWindowInfo write SetWindowInfo;
+ procedure SaveToFile(AFilename:WideString);
+ procedure LoadFromFile(AFilename:WideString);
+ property Filename:WideString read FFilename;
+ property WindowInfos[AForm:TForm]:TAppWindowInfo read GetWindowInfo write SetWindowInfo;
public
- property Option[const Section, Name: WideString]: WideString read GetOption write SetOption;
- property ShowQuotes: boolean read FShowQuotes write FShowQuotes;
- property InvertDictionary: boolean read FInvertDictionary write FInvertDictionary;
- property SaveFormPos: boolean read FSaveFormPos write FSaveFormPos default true;
- property SaveMinMaxState: boolean read FSaveMinMaxState write FSaveMinMaxState default true;
- property ShowDetails: boolean read FShowDetails write FShowDetails;
- property SaveOnReturn: boolean read FSaveOnReturn write FSaveOnReturn;
- property AutoMoveToNext: boolean read FAutoMoveToNext write FAutoMoveToNext;
- property ShowToolTips: boolean read FShowToolTips write FShowToolTips;
- property ShowToolTipShortCuts: boolean read FShowToolTipShortCuts write FShowToolTipShortCuts;
- property DictIgnoreSpeedKeys: boolean read FDictIgnoreSpeedKeys write FDictIgnoreSpeedKeys;
- property LanguageFile: WideString read FLanguageFile write FLanguageFile;
- property GlobalPath: boolean read FGlobalPath write FGlobalPath;
- property UseTranslationEverywhere: boolean read FUseTranslationEverywhere write FUseTranslationEverywhere;
- property AutoFocusTranslation: boolean read FAutoFocusTranslation write FAutoFocusTranslation;
- property HelpFile: WideString read FHelpFile write FHelpFile;
- property DictionaryFile: WideString read FDictionaryFile write FDictionaryFile;
+ property Option[const Section, Name:WideString]:WideString read GetOption write SetOption;
+ property ShowQuotes:boolean read FShowQuotes write FShowQuotes;
+ property InvertDictionary:boolean read FInvertDictionary write FInvertDictionary;
+ property SaveFormPos:boolean read FSaveFormPos write FSaveFormPos default true;
+ property SaveMinMaxState:boolean read FSaveMinMaxState write FSaveMinMaxState default true;
+ property ShowDetails:boolean read FShowDetails write FShowDetails;
+ property SaveOnReturn:boolean read FSaveOnReturn write FSaveOnReturn;
+ property AutoMoveToNext:boolean read FAutoMoveToNext write FAutoMoveToNext;
+ property ShowToolTips:boolean read FShowToolTips write FShowToolTips;
+ property ShowToolTipShortCuts:boolean read FShowToolTipShortCuts write FShowToolTipShortCuts;
+ property DictIgnoreSpeedKeys:boolean read FDictIgnoreSpeedKeys write FDictIgnoreSpeedKeys;
+ property LanguageFile:WideString read FLanguageFile write FLanguageFile;
+ property GlobalPath:boolean read FGlobalPath write FGlobalPath;
+ property UseTranslationEverywhere:boolean read FUseTranslationEverywhere write FUseTranslationEverywhere;
+ property AutoFocusTranslation:boolean read FAutoFocusTranslation write FAutoFocusTranslation;
+ property HelpFile:WideString read FHelpFile write FHelpFile;
+ property DictionaryFile:WideString read FDictionaryFile write FDictionaryFile;
- property TranslationFile: WideString read FTranslationFile write FTranslationFile;
- property DefaultTransEncoding: integer read FDefaultTransEncoding write FDefaultTransEncoding;
- property DefaultOrigEncoding: integer read FDefaultOrigEncoding write FDefaultOrigEncoding;
- property TransEncoding: integer read FTransEncoding write FTransEncoding;
- property OriginalFile: WideString read FOriginalFile write FOriginalFile;
- property OrigEncoding: integer read FOrigEncoding write FOrigEncoding;
- property SplitterPosition: integer read FSplitterPosition write FSplitterPosition default 160;
- property FilterIndex: integer read FFilterIndex write FFilterIndex default 1;
- property AppTitle: WideString read FAppTitle write FAppTitle;
- property FontName: WideString read FFontName write FFontName;
- property FontSize: integer read FFontSize write FFontSize;
- property MonitorFiles: boolean read FMonitorFiles write FMonitorFiles default true;
- property Theme: WideString read FTheme write FTheme;
- property Header: TTntStrings read FHeader write SetHeader;
- property Footer: TTntStrings read FFooter write SetFooter;
+ property TranslationFile:WideString read FTranslationFile write FTranslationFile;
+ property DefaultTransEncoding:integer read FDefaultTransEncoding write FDefaultTransEncoding;
+ property DefaultOrigEncoding:integer read FDefaultOrigEncoding write FDefaultOrigEncoding;
+ property TransEncoding:integer read FTransEncoding write FTransEncoding;
+ property OriginalFile:WideString read FOriginalFile write FOriginalFile;
+ property OrigEncoding:integer read FOrigEncoding write FOrigEncoding;
+ property SplitterPosition:integer read FSplitterPosition write FSplitterPosition default 160;
+ property FilterIndex:integer read FFilterIndex write FFilterIndex default 1;
+ property AppTitle:WideString read FAppTitle write FAppTitle;
+ property FontName:WideString read FFontName write FFontName;
+ property FontSize:integer read FFontSize write FFontSize;
+ property MonitorFiles:boolean read FMonitorFiles write FMonitorFiles default true;
+ property Theme:WideString read FTheme write FTheme;
+ property Header:TTntStrings read FHeader write SetHeader;
+ property Footer:TTntStrings read FFooter write SetFooter;
// find replace
- property FindText: WideString read FFindText write FFindText;
- property ReplaceText: WideString read FReplaceText write FReplaceText;
- property FindHistory: WideString read FFindHistory write FFindHistory;
- property ReplaceHistory: WideString read FReplaceHistory write FReplaceHistory;
- property MatchLine: boolean read FMatchLine write FMatchLine;
- property MatchCase: boolean read FMatchCase write FMatchCase;
- property SearchUp: boolean read FSearchUp write FSearchUp;
- property FuzzySearch: boolean read FFuzzySearch write FFuzzySearch;
- property FindInIndex: integer read FFindInIndex write FFindInIndex;
+ property FindText:WideString read FFindText write FFindText;
+ property ReplaceText:WideString read FReplaceText write FReplaceText;
+ property FindHistory:WideString read FFindHistory write FFindHistory;
+ property ReplaceHistory:WideString read FReplaceHistory write FReplaceHistory;
+ property MatchLine:boolean read FMatchLine write FMatchLine;
+ property MatchCase:boolean read FMatchCase write FMatchCase;
+ property SearchUp:boolean read FSearchUp write FSearchUp;
+ property FuzzySearch:boolean read FFuzzySearch write FFuzzySearch;
+ property FindInIndex:integer read FFindInIndex write FFindInIndex;
- property MisMatchItems: WideString read FMisMatchItems write FMisMatchItems;
- property MisMatchLeadingSpaces: boolean read FMisMatchLeadingSpaces write FMisMatchLeadingSpaces;
- property MisMatchTrailingSpaces: boolean read FMisMatchTrailingSpaces write FMisMatchTrailingSpaces;
- property MisMatchEndControl: boolean read FMisMatchEndControl write FMisMatchEndControl;
- property MisMatchIdentical: boolean read FMisMatchIdentical write FMisMatchIdentical;
- property MisMatchEmptyTranslation: boolean read FMisMatchEmptyTranslation write FMisMatchEmptyTranslation;
+ property MisMatchItems:WideString read FMisMatchItems write FMisMatchItems;
+ property MisMatchLeadingSpaces:boolean read FMisMatchLeadingSpaces write FMisMatchLeadingSpaces;
+ property MisMatchTrailingSpaces:boolean read FMisMatchTrailingSpaces write FMisMatchTrailingSpaces;
+ property MisMatchEndControl:boolean read FMisMatchEndControl write FMisMatchEndControl;
+ property MisMatchIdentical:boolean read FMisMatchIdentical write FMisMatchIdentical;
+ property MisMatchEmptyTranslation:boolean read FMisMatchEmptyTranslation write FMisMatchEmptyTranslation;
- property PinCommentWindow: boolean read FPinCommentWindow write FPinCommentWindow default true;
- property ShowFullNameInColumns: boolean read FShowFullNameInColumns write FShowFullNameInColumns default false;
- property Tools: TToolItems read FTools write SetTools;
+ property PinCommentWindow:boolean read FPinCommentWindow write FPinCommentWindow default true;
+ property ShowFullNameInColumns:boolean read FShowFullNameInColumns write FShowFullNameInColumns default false;
+ property Tools:TToolItems read FTools write SetTools;
- property DictIgnoreNonEmpty: boolean read FDictIgnoreNonEmpty write FDictIgnoreNonEmpty;
- property DictEditFilter: Integer read FDictEditFilter write FDictEditFilter;
+ property DictIgnoreNonEmpty:boolean read FDictIgnoreNonEmpty write FDictIgnoreNonEmpty;
+ property DictEditFilter:Integer read FDictEditFilter write FDictEditFilter;
- property ColorUntranslated: TColor read FColorUntranslated write FColorUntranslated;
- property ColorFontUntranslated: TColor read FColorFontUntranslated write FColorFontUntranslated;
+ property ColorUntranslated:TColor read FColorUntranslated write FColorUntranslated;
+ property ColorFontUntranslated:TColor read FColorFontUntranslated write FColorFontUntranslated;
- property ColorEvenRow: TColor read FColorEvenRow write FColorEvenRow;
- property ColorFontEvenRow: TColor read FColorFontEvenRow write FColorFontEvenRow;
- property ColorOddRow: TColor read FColorOddRow write FColorOddRow;
- property ColorFontOddRow: TColor read FColorFontOddRow write FColorFontOddRow;
+ property ColorEvenRow:TColor read FColorEvenRow write FColorEvenRow;
+ property ColorFontEvenRow:TColor read FColorFontEvenRow write FColorFontEvenRow;
+ property ColorOddRow:TColor read FColorOddRow write FColorOddRow;
+ property ColorFontOddRow:TColor read FColorFontOddRow write FColorFontOddRow;
end;
implementation
uses
StrUtils, AppConsts, AppUtils, CommonUtils, TntSysUtils;
-function StrToFontStyles(const S: WideString): TFontStyles;
+function StrToFontStyles(const S:WideString):TFontStyles;
begin
Result := [];
if Pos('B', S) > 0 then
@@ -238,11 +238,11 @@
Include(Result, fsStrikeout);
end;
-function FontStylesToStr(Styles: TFontStyles): WideString;
+function FontStylesToStr(Styles:TFontStyles):WideString;
const
- cStyles: array[TFontStyle] of PWideChar = ('B', 'I', 'U', 'S');
+ cStyles:array[TFontStyle] of PWideChar = ('B', 'I', 'U', 'S');
var
- i: TFontStyle;
+ i:TFontStyle;
begin
Result := '';
for i := Low(cStyles) to High(cStyles) do
@@ -252,7 +252,7 @@
{ TToolItem }
-procedure TToolItem.Assign(Source: TPersistent);
+procedure TToolItem.Assign(Source:TPersistent);
begin
if Source is TToolItem then
AsString := TToolItem(Source).AsString
@@ -260,8 +260,9 @@
inherited;
end;
-function TToolItem.GetAsString: WideString;
-var S: TTntStringlist;
+function TToolItem.GetAsString:WideString;
+var
+ S:TTntStringlist;
begin
S := TTntStringlist.Create;
try
@@ -280,8 +281,9 @@
end;
end;
-procedure TToolItem.SetAsString(const Value: WideString);
-var S: TTntStringlist;
+procedure TToolItem.SetAsString(const Value:WideString);
+var
+ S:TTntStringlist;
begin
S := TTntStringlist.Create;
try
@@ -311,13 +313,14 @@
{ TToolItems }
-function TToolItems.Add: TToolItem;
+function TToolItems.Add:TToolItem;
begin
Result := TToolItem(inherited Add);
end;
-procedure TToolItems.Assign(Source: TPersistent);
-var i: integer;
+procedure TToolItems.Assign(Source:TPersistent);
+var
+ i:integer;
begin
if Source is TToolItems then
begin
@@ -334,8 +337,9 @@
inherited Create(TToolItem);
end;
-procedure TToolItems.Exchange(Index1, Index2: integer);
-var F: TToolItem;
+procedure TToolItems.Exchange(Index1, Index2:integer);
+var
+ F:TToolItem;
begin
F := Add;
F.Assign(Items[Index1]);
@@ -344,12 +348,12 @@
Delete(Count - 1);
end;
-function TToolItems.GetItem(Index: integer): TToolItem;
+function TToolItems.GetItem(Index:integer):TToolItem;
begin
Result := TToolItem(inherited Items[Index]);
end;
-function TToolItems.IndexOf(const Title: WideString): integer;
+function TToolItems.IndexOf(const Title:WideString):integer;
begin
for Result := 0 to Count - 1 do
if WideSameText(Items[Result].Title, Title) then
@@ -357,10 +361,10 @@
Result := -1;
end;
-procedure TToolItems.LoadFromIni(ini: TWideCustomIniFile);
+procedure TToolItems.LoadFromIni(ini:TWideCustomIniFile);
var
- i: integer;
- S: TTntStringlist;
+ i:integer;
+ S:TTntStringlist;
begin
Clear;
S := TTntStringlist.Create;
@@ -373,15 +377,16 @@
end;
end;
-procedure TToolItems.SaveToIni(ini: TWideCustomIniFile);
-var i: integer;
+procedure TToolItems.SaveToIni(ini:TWideCustomIniFile);
+var
+ i:integer;
begin
ini.EraseSection('External Tools');
for i := 0 to Count - 1 do
ini.WriteString('External Tools', IntToStr(i), Items[i].AsString);
end;
-procedure TToolItems.SetItem(Index: integer; const Value: TToolItem);
+procedure TToolItems.SetItem(Index:integer; const Value:TToolItem);
begin
inherited Items[Index] := Value;
end;
@@ -389,14 +394,15 @@
{ TAppOptions }
procedure TAppOptions.ClearWindowInfos;
-var i: integer;
+var
+ i:integer;
begin
for i := 0 to FWindowInfos.Count - 1 do
Dispose(PAppWindowInfo(FWindowInfos.Objects[i]));
FWindowInfos.Clear;
end;
-constructor TAppOptions.Create(const AFilename: WideString);
+constructor TAppOptions.Create(const AFilename:WideString);
resourcestring
sDefault = 'Default';
begin
@@ -432,13 +438,14 @@
inherited;
end;
-procedure TAppOptions.ReadWindowInfos(ini: TWideCustomIniFile);
+procedure TAppOptions.ReadWindowInfos(ini:TWideCustomIniFile);
var
- i: integer;
- S: TTntStringlist;
+ i:integer;
+ S:TTntStringlist;
- procedure DecodeInfo(const Name, Value: WideString);
- var P: PAppWindowInfo;
+ procedure DecodeInfo(const Name, Value:WideString);
+ var
+ P:PAppWindowInfo;
begin
// format of Value: Left;Top;Right;Bottom;WindowState
if (FWindowInfos.IndexOf(Name) < 0) then
@@ -467,9 +474,9 @@
end;
end;
-procedure TAppOptions.LoadFromFile(AFilename: WideString);
+procedure TAppOptions.LoadFromFile(AFilename:WideString);
var
- ini: TWideMemIniFile;
+ ini:TWideMemIniFile;
begin
if AFilename = '' then
AFilename := GetAppStoragePath + 'translator.ini';
@@ -550,11 +557,11 @@
end;
end;
-procedure TAppOptions.WriteWindowInfos(ini: TWideCustomIniFile);
+procedure TAppOptions.WriteWindowInfos(ini:TWideCustomIniFile);
var
- i: integer;
+ i:integer;
- function EncodeInfo(Info: TAppWindowInfo): WideString;
+ function EncodeInfo(Info:TAppWindowInfo):WideString;
begin
// format of value: Left;Top;Right;Bottom;WindowState;
with Info.BoundsRect do
@@ -568,9 +575,9 @@
EncodeInfo(PAppWindowInfo(FWindowInfos.Objects[i])^));
end;
-procedure TAppOptions.SaveToFile(AFilename: WideString);
+procedure TAppOptions.SaveToFile(AFilename:WideString);
var
- ini: TWideMemIniFile;
+ ini:TWideMemIniFile;
begin
if AFilename = '' then
AFilename := GetAppStoragePath + 'translator.ini';
@@ -650,10 +657,10 @@
end;
end;
-function TAppOptions.GetWindowInfo(AForm: TForm): TAppWindowInfo;
+function TAppOptions.GetWindowInfo(AForm:TForm):TAppWindowInfo;
var
- i: integer;
- AName: WideString;
+ i:integer;
+ AName:WideString;
begin
Result.BoundsRect := AForm.BoundsRect;
Result.WindowState := AForm.WindowState;
@@ -673,11 +680,11 @@
end;
end;
-procedure TAppOptions.SetWindowInfo(AForm: TForm; const Value: TAppWindowInfo);
+procedure TAppOptions.SetWindowInfo(AForm:TForm; const Value:TAppWindowInfo);
var
- i: integer;
- P: PAppWindowInfo;
- AName: WideString;
+ i:integer;
+ P:PAppWindowInfo;
+ AName:WideString;
begin
if not SaveFormPos then
Exit;
@@ -707,22 +714,22 @@
end;
end;
-procedure TAppOptions.SetTools(const Value: TToolItems);
+procedure TAppOptions.SetTools(const Value:TToolItems);
begin
FTools.Assign(Value);
end;
-procedure TAppOptions.SetFooter(const Value: TTntStrings);
+procedure TAppOptions.SetFooter(const Value:TTntStrings);
begin
FFooter.Assign(Value);
end;
-procedure TAppOptions.SetHeader(const Value: TTntStrings);
+procedure TAppOptions.SetHeader(const Value:TTntStrings);
begin
FHeader.Assign(Value);
end;
-function TAppOptions.GetOption(const Section, Name: WideString): WideString;
+function TAppOptions.GetOption(const Section, Name:WideString):WideString;
begin
with TWideMemIniFile.Create(Filename) do
try
@@ -732,7 +739,7 @@
end;
end;
-procedure TAppOptions.SetOption(const Section, Name, Value: WideString);
+procedure TAppOptions.SetOption(const Section, Name, Value:WideString);
begin
with TWideMemIniFile.Create(Filename) do
try
Modified: translator/trunk/src/AppUtils.pas
===================================================================
--- translator/trunk/src/AppUtils.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/AppUtils.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -24,43 +24,43 @@
MsgTranslate, AppConsts, AppOptions, TransIntf,
TntClasses, TBXExtItems;
-procedure TBMRULoadFromIni(MRU: TTBXMRUList);
-procedure TBMRUSaveToIni(MRU: TTBXMRUList);
-procedure TBMRULoadFromReg(MRU: TTBXMRUList; RootKey: Cardinal; const Path: WideString);
-procedure TBMRUSaveToReg(MRU: TTBXMRUList; RootKey: Cardinal; const Path: WideString);
+procedure TBMRULoadFromIni(MRU:TTBXMRUList);
+procedure TBMRUSaveToIni(MRU:TTBXMRUList);
+procedure TBMRULoadFromReg(MRU:TTBXMRUList; RootKey:Cardinal; const Path:WideString);
+procedure TBMRUSaveToReg(MRU:TTBXMRUList; RootKey:Cardinal; const Path:WideString);
-function DetectEncoding(const FileName: WideString): TEncoding;
-function GetAppVersion: WideString;
-function GetCurrentYear: Integer;
+function DetectEncoding(const FileName:WideString):TEncoding;
+function GetAppVersion:WideString;
+function GetCurrentYear:Integer;
-function ActionShortCutInUse(AM: TActionList; ShortCut: Word): boolean;
-function FindActionShortCut(AM: TActionList; ShortCut: Word): TCustomAction;
-function RemoveActionShortCut(AM: TActionList; ShortCut: Word): integer;
-function _(const ASection, AMsg: WideString): WideString;
-function MyShortCutToText(ShortCut: TShortCut): WideString;
+function ActionShortCutInUse(AM:TActionList; ShortCut:Word):boolean;
+function FindActionShortCut(AM:TActionList; ShortCut:Word):TCustomAction;
+function RemoveActionShortCut(AM:TActionList; ShortCut:Word):integer;
+function _(const ASection, AMsg:WideString):WideString;
+function MyShortCutToText(ShortCut:TShortCut):WideString;
-function GlobalLanguageFile: TAppLanguage;
-function GlobalAppOptions: TAppOptions;
-function GlobalApplicationServices: IApplicationServices;
+function GlobalLanguageFile:TAppLanguage;
+function GlobalAppOptions:TAppOptions;
+function GlobalApplicationServices:IApplicationServices;
-function GetUserAppDataFolder(const Default: WideString): WideString;
-function GetUserShortcutFile: WideString;
-function GetUserAppOptionsFile: WideString;
-procedure HandleFileCreateException(Sender: TObject; E: Exception; const Filename: WideString);
+function GetUserAppDataFolder(const Default:WideString):WideString;
+function GetUserShortcutFile:WideString;
+function GetUserAppOptionsFile:WideString;
+procedure HandleFileCreateException(Sender:TObject; E:Exception; const Filename:WideString);
-function GetAppStoragePath: WideString;
-function AutoDetectCharacterSet(Stream: TStream): TEncoding; overload;
-function AutoDetectCharacterSet(const Filename: WideString): TEncoding; overload;
-function FileCharSetToEncoding(CharSet: TTntStreamCharSet): TEncoding;
+function GetAppStoragePath:WideString;
+function AutoDetectCharacterSet(Stream:TStream):TEncoding; overload;
+function AutoDetectCharacterSet(const Filename:WideString):TEncoding; overload;
+function FileCharSetToEncoding(CharSet:TTntStreamCharSet):TEncoding;
-procedure FixXPStyles(AControl: TWinControl);
-function GetPluginsFolder: WideString;
+procedure FixXPStyles(AControl:TWinControl);
+function GetPluginsFolder:WideString;
type
- TApplicationServicesFunc = function: IApplicationServices;
+ TApplicationServicesFunc = function:IApplicationServices;
var
- GlobalApplicationServicesFunc: TApplicationServicesFunc = nil;
+ GlobalApplicationServicesFunc:TApplicationServicesFunc = nil;
implementation
uses
@@ -71,24 +71,24 @@
TntWindows, TntSysUtils, TntWideStrUtils;
var
- FLanguageFile: TAppLanguage = nil;
- FAppOptions: TAppOptions = nil;
+ FLanguageFile:TAppLanguage = nil;
+ FAppOptions:TAppOptions = nil;
-function AutoDetectCharacterSet(Stream: TStream): TEncoding;
+function AutoDetectCharacterSet(Stream:TStream):TEncoding;
begin
case TntClasses.AutoDetectCharacterSet(Stream) of
- csAnsi: Result := feAnsi;
- csUnicode: Result := feUnicode;
- csUnicodeSwapped: Result := feUnicodeSwapped;
- csUtf8: Result := feUtf8;
+ csAnsi:Result := feAnsi;
+ csUnicode:Result := feUnicode;
+ csUnicodeSwapped:Result := feUnicodeSwapped;
+ csUtf8:Result := feUtf8;
else
Result := feAnsi;
end;
end;
-function AutoDetectCharacterSet(const Filename: WideString): TEncoding;
+function AutoDetectCharacterSet(const Filename:WideString):TEncoding;
var
- F: TTntFileStream;
+ F:TTntFileStream;
begin
F := TTntFileStream.Create(Filename, fmOpenRead or fmShareDenyNone);
try
@@ -98,32 +98,32 @@
end;
end;
-function FileCharSetToEncoding(CharSet: TTntStreamCharSet): TEncoding;
+function FileCharSetToEncoding(CharSet:TTntStreamCharSet):TEncoding;
begin
case CharSet of
- csUnicode: Result := feUnicode;
- csUnicodeSwapped: Result := feUnicodeSwapped;
- csUtf8: Result := feUtf8;
+ csUnicode:Result := feUnicode;
+ csUnicodeSwapped:Result := feUnicodeSwapped;
+ csUtf8:Result := feUtf8;
else
Result := feAnsi;
end;
end;
-function GlobalLanguageFile: TAppLanguage;
+function GlobalLanguageFile:TAppLanguage;
begin
if FLanguageFile = nil then
FLanguageFile := TAppLanguage.Create('');
Result := FLanguageFile;
end;
-function GlobalAppOptions: TAppOptions;
+function GlobalAppOptions:TAppOptions;
begin
if FAppOptions = nil then
FAppOptions := TAppOptions.Create(GetUserAppOptionsFile);
Result := FAppOptions;
end;
-function GlobalApplicationServices: IApplicationServices;
+function GlobalApplicationServices:IApplicationServices;
begin
if Assigned(GlobalApplicationServicesFunc) then
Result := GlobalApplicationServicesFunc
@@ -131,7 +131,7 @@
Result := nil;
end;
-function GetUserAppDataFolder(const Default: WideString): WideString;
+function GetUserAppDataFolder(const Default:WideString):WideString;
begin
SetLength(Result, MAX_PATH + 1);
// DONE: it seems SHGetFolderPathW in SHFolder doesn't use PWideChar...
@@ -142,7 +142,7 @@
Result := WideString(PWideChar(Result)); // strip excessive characters
end;
-function GetUserShortcutFile: WideString;
+function GetUserShortcutFile:WideString;
begin
Result := GetUserAppDataFolder('');
if (Result <> '') and WideDirectoryExists(Result) then
@@ -154,7 +154,7 @@
Result := WideIncludeTrailingPathDelimiter(Result) + 'translator.alf';
end;
-function GetUserAppOptionsFile: WideString;
+function GetUserAppOptionsFile:WideString;
begin
Result := GetUserAppDataFolder('');
if (Result <> '') and WideDirectoryExists(Result) then
@@ -165,7 +165,7 @@
Result := WideIncludeTrailingPathDelimiter(Result) + 'translator.ini';
end;
-function _(const ASection, AMsg: WideString): WideString;
+function _(const ASection, AMsg:WideString):WideString;
begin
if GlobalLanguageFile <> nil then
Result := GlobalLanguageFile.Translate(ASection, AMsg, AMsg)
@@ -173,9 +173,9 @@
Result := AMsg;
end;
-function WideUpperCaseFirst(const S: WideString): WideString;
+function WideUpperCaseFirst(const S:WideString):WideString;
var
- i: integer;
+ i:integer;
begin
if S = '' then
Result := ''
@@ -188,10 +188,10 @@
Result[i] := WideUpperCase(Result[i])[1];
end;
-function MyShortCutToText(ShortCut: TShortCut): WideString;
+function MyShortCutToText(ShortCut:TShortCut):WideString;
var
- ACtrl, AShift, AAlt: WideString;
- i: integer;
+ ACtrl, AShift, AAlt:WideString;
+ i:integer;
begin
Result := ShortCutToText(ShortCut);
if Pos('+', Result) > 0 then
@@ -216,15 +216,15 @@
Result := WideUpperCaseFirst(Result);
end;
-function DetectEncoding(const FileName: WideString): TEncoding;
+function DetectEncoding(const FileName:WideString):TEncoding;
begin
{ DONE : Fix this later }
Result := AutoDetectCharacterSet(Filename);
end;
-procedure TBMRULoadFromReg(MRU: TTBXMRUList; RootKey: DWORD; const Path: WideString);
+procedure TBMRULoadFromReg(MRU:TTBXMRUList; RootKey:DWORD; const Path:WideString);
var
- ini: TRegIniFile;
+ ini:TRegIniFile;
begin
ini := TRegIniFile.Create('');
try
@@ -236,9 +236,9 @@
end;
end;
-procedure TBMRUSaveToReg(MRU: TTBXMRUList; RootKey: DWORD; const Path: WideString);
+procedure TBMRUSaveToReg(MRU:TTBXMRUList; RootKey:DWORD; const Path:WideString);
var
- ini: TRegIniFile;
+ ini:TRegIniFile;
begin
ini := TRegIniFile.Create('');
try
@@ -250,11 +250,11 @@
end;
end;
-procedure TBMRULoadFromIni(MRU: TTBXMRUList);
+procedure TBMRULoadFromIni(MRU:TTBXMRUList);
var
- ini: TWideMemIniFile;
- i: Integer;
- S: WideString;
+ ini:TWideMemIniFile;
+ i:Integer;
+ S:WideString;
begin
ini := TWideMemIniFile.Create(GetUserAppOptionsFile);
try
@@ -271,10 +271,10 @@
end;
end;
-procedure TBMRUSaveToIni(MRU: TTBXMRUList);
+procedure TBMRUSaveToIni(MRU:TTBXMRUList);
var
- ini: TWideMemIniFile;
- i: Integer;
+ ini:TWideMemIniFile;
+ i:Integer;
begin
ini := TWideMemIniFile.Create(GetUserAppOptionsFile);
try
@@ -291,21 +291,21 @@
end;
end;
-function GetCurrentYear: Integer;
+function GetCurrentYear:Integer;
var
- Y, M, D: Word;
+ Y, M, D:Word;
begin
DecodeDate(Date, Y, M, D);
Result := Y;
end;
-function GetAppVersion: WideString;
+function GetAppVersion:WideString;
var
- FileName: WideString;
- InfoSize, Wnd: DWORD;
- VerBuf: Pointer;
- FI: PVSFixedFileInfo;
- VerSize: DWORD;
+ FileName:WideString;
+ InfoSize, Wnd:DWORD;
+ VerBuf:Pointer;
+ FI:PVSFixedFileInfo;
+ VerSize:DWORD;
begin
Result := '1.0.0.0';
FileName := Application.ExeName;
@@ -323,14 +323,14 @@
end;
end;
-function ActionShortCutInUse(AM: TActionList; ShortCut: Word): boolean;
+function ActionShortCutInUse(AM:TActionList; ShortCut:Word):boolean;
begin
Result := FindActionShortCut(AM, ShortCut) <> nil;
end;
-function FindActionShortCut(AM: TActionList; ShortCut: Word): TCustomAction;
+function FindActionShortCut(AM:TActionList; ShortCut:Word):TCustomAction;
var
- i, j: integer;
+ i, j:integer;
begin
Result := nil;
if ShortCut = 0 then
@@ -348,10 +348,10 @@
Result := nil;
end;
-function RemoveActionShortCut(AM: TActionList; ShortCut: Word): integer;
+function RemoveActionShortCut(AM:TActionList; ShortCut:Word):integer;
var
- Action: TCustomAction;
- i: integer;
+ Action:TCustomAction;
+ i:integer;
begin
Result := 0;
if ShortCut = 0 then
@@ -374,7 +374,7 @@
end;
end;
-procedure HandleFileCreateException(Sender: TObject; E: Exception; const Filename: WideString);
+procedure HandleFileCreateException(Sender:TObject; E:Exception; const Filename:WideString);
begin
if E is EFCreateError then
ErrMsg(WideFormat(_(Sender.ClassName, SFmtErrCreateFile), [Filename]), _(Sender.ClassName, SErrorCaption))
@@ -382,7 +382,7 @@
Application.HandleException(Sender);
end;
-function GetAppStoragePath: WideString;
+function GetAppStoragePath:WideString;
begin
// try to get path to \Documents and Settings\<user>\Application Data
// if that fails, use application install folder
@@ -397,10 +397,10 @@
type
TAccessComboBox = class(TCustomComboBox);
-procedure FixXPStyles(AControl: TWInControl);
+procedure FixXPStyles(AControl:TWInControl);
var
- i: integer;
- WC: TWinControl;
+ i:integer;
+ WC:TWinControl;
begin
if (AControl is TWinControl) then
begin
@@ -420,7 +420,7 @@
end;
end;
-function GetPluginsFolder: WideString;
+function GetPluginsFolder:WideString;
begin
Result := WideIncludeTrailingPathDelimiter(WideExtractFilePath(Application.ExeName)) + 'plugins';
end;
@@ -432,7 +432,7 @@
try
FAppOptions.SaveToFile(GetUserAppOptionsFile);
except
- on E: Exception do
+ on E:Exception do
HandleFileCreateException(FAppOptions, E, GetUserAppOptionsFile);
end;
FreeAndNil(FAppOptions);
@@ -445,4 +445,3 @@
FreeAndNil(FLanguageFile);
end.
-
Modified: translator/trunk/src/ApplicationServices.pas
===================================================================
--- translator/trunk/src/ApplicationServices.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/ApplicationServices.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -7,132 +7,132 @@
type
TApplicationServices = class(TInterfacedObject, IInterface, IApplicationServices)
private
- FForm: TfrmMain;
+ FForm:TfrmMain;
public
- constructor Create(AForm: TfrmMain);
- function BeginUpdate: Integer; safecall;
- function EndUpdate: Integer; safecall;
- function GetAppHandle: Cardinal;
+ constructor Create(AForm:TfrmMain);
+ function BeginUpdate:Integer; safecall;
+ function EndUpdate:Integer; safecall;
+ function GetAppHandle:Cardinal;
function GetMainFormHandle:Cardinal;
- function GetAppOption(const Section: WideString; const Name: WideString; const Default: WideString): WideString; safecall;
+ function GetAppOption(const Section:WideString; const Name:WideString; const Default:WideString):WideString; safecall;
function GetSelectedItem:ITranslationItem;
procedure SetSelectedItem(const Value:ITranslationItem);
-
- function GetDictionaryItems: IDictionaryItems;
- function GetFooter: WideString;
- function GetHeader: WideString;
- function GetItems: ITranslationItems;
- function GetOrphans: ITranslationItems;
- procedure RegisterNotify(const ANotify: INotify); safecall;
- procedure SetAppOption(const Section: WideString;
- const Name: WideString; const Value: WideString); safecall;
- procedure SetFooter(const Value: WideString);
- procedure SetHeader(const Value: WideString);
- function Translate(const Section, Name, Value: WideString): WideString; safecall;
- procedure UnRegisterNotify(const ANotify: INotify); safecall;
+ function GetDictionaryItems:IDictionaryItems;
+ function GetFooter:WideString;
+ function GetHeader:WideString;
+ function GetItems:ITranslationItems;
+ function GetOrphans:ITranslationItems;
+ procedure RegisterNotify(const ANotify:INotify); safecall;
+ procedure SetAppOption(const Section:WideString;
+ const Name:WideString; const Value:WideString); safecall;
+ procedure SetFooter(const Value:WideString);
+ procedure SetHeader(const Value:WideString);
+ function Translate(const Section, Name, Value:WideString):WideString; safecall;
+ procedure UnRegisterNotify(const ANotify:INotify); safecall;
+
end;
implementation
{ TApplicationServices }
-function TApplicationServices.BeginUpdate: Integer;
+function TApplicationServices.BeginUpdate:Integer;
begin
end;
-constructor TApplicationServices.Create(AForm: TfrmMain);
+constructor TApplicationServices.Create(AForm:TfrmMain);
begin
inherited Create;
FForm := AForm;
end;
-function TApplicationServices.EndUpdate: Integer;
+function TApplicationServices.EndUpdate:Integer;
begin
Result := FForm.EndUpdate;
end;
-function TApplicationServices.GetAppHandle: Cardinal;
+function TApplicationServices.GetAppHandle:Cardinal;
begin
Result := FForm.GetAppHandle;
end;
-function TApplicationServices.GetMainFormHandle: Cardinal;
+function TApplicationServices.GetMainFormHandle:Cardinal;
begin
Result := FForm.GetMainFormHandle;
end;
function TApplicationServices.GetAppOption(const Section, Name,
- Default: WideString): WideString;
+ Default:WideString):WideString;
begin
Result := FForm.GetAppOption(Section, Name, Default);
end;
-function TApplicationServices.GetDictionaryItems: IDictionaryItems;
+function TApplicationServices.GetDictionaryItems:IDictionaryItems;
begin
Result := FForm.GetDictionaryItems;
end;
-function TApplicationServices.GetFooter: WideString;
+function TApplicationServices.GetFooter:WideString;
begin
Result := FForm.GetFooter;
end;
-function TApplicationServices.GetHeader: WideString;
+function TApplicationServices.GetHeader:WideString;
begin
Result := FForm.GetHeader;
end;
-function TApplicationServices.GetItems: ITranslationItems;
+function TApplicationServices.GetItems:ITranslationItems;
begin
Result := FForm.GetItems;
end;
-function TApplicationServices.GetOrphans: ITranslationItems;
+function TApplicationServices.GetOrphans:ITranslationItems;
begin
Result := FForm.GetOrphans;
end;
-function TApplicationServices.GetSelectedItem: ITranslationItem;
+function TApplicationServices.GetSelectedItem:ITranslationItem;
begin
Result := FForm.SelectedItem;
end;
-procedure TApplicationServices.RegisterNotify(const ANotify: INotify);
+procedure TApplicationServices.RegisterNotify(const ANotify:INotify);
begin
FForm.RegisterNotify(ANotify);
end;
procedure TApplicationServices.SetAppOption(const Section, Name,
- Value: WideString);
+ Value:WideString);
begin
FForm.SetAppOption(Section, Name, Value);
end;
-procedure TApplicationServices.SetFooter(const Value: WideString);
+procedure TApplicationServices.SetFooter(const Value:WideString);
begin
FForm.SetFooter(Value);
end;
-procedure TApplicationServices.SetHeader(const Value: WideString);
+procedure TApplicationServices.SetHeader(const Value:WideString);
begin
FForm.SetHeader(Value);
end;
-procedure TApplicationServices.SetSelectedItem(const Value: ITranslationItem);
+procedure TApplicationServices.SetSelectedItem(const Value:ITranslationItem);
begin
FForm.SelectedItem := Value;
end;
-function TApplicationServices.Translate(const Section, Name, Value: WideString): WideString; safecall;
+function TApplicationServices.Translate(const Section, Name, Value:WideString):WideString; safecall;
begin
Result := FForm.Translate(Section, Name, Value);
end;
-procedure TApplicationServices.UnRegisterNotify(const ANotify: INotify);
+procedure TApplicationServices.UnRegisterNotify(const ANotify:INotify);
begin
FForm.UnRegisterNotify(ANotify);
end;
Modified: translator/trunk/src/BaseForm.pas
===================================================================
--- translator/trunk/src/BaseForm.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/BaseForm.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -36,11 +36,11 @@
public
{ Public declarations }
procedure AfterConstruction; override;
- function CloseQuery: Boolean; override;
+ function CloseQuery:Boolean; override;
end;
var
- frmBase: TfrmBase;
+ frmBase:TfrmBase;
implementation
uses
@@ -64,7 +64,7 @@
FixXPStyles(self);
end;
-function TfrmBase.CloseQuery: Boolean;
+function TfrmBase.CloseQuery:Boolean;
begin
SaveFormPos;
Result := inherited CloseQuery;
@@ -72,7 +72,7 @@
procedure TfrmBase.LoadFormPos;
var
- W: TAppWindowInfo;
+ W:TAppWindowInfo;
begin
if (Self = Application.MainForm) and IsIconic(Application.Handle) or IsZoomed(Handle) then
ShowWindow(Handle, SW_RESTORE);
@@ -96,7 +96,7 @@
procedure TfrmBase.SaveFormPos;
var
- W: TAppWindowInfo;
+ W:TAppWindowInfo;
begin
W.Name := self.Name;
W.WindowState := WindowState;
@@ -106,4 +106,3 @@
end;
end.
-
Modified: translator/trunk/src/ColorsFrm.pas
===================================================================
--- translator/trunk/src/ColorsFrm.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/ColorsFrm.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -31,27 +31,27 @@
type
TfrmColors = class(TfrmBase)
- btnCancel: TTntButton;
- btnOK: TTntButton;
- cbUntranslated: TColorBox;
- TntLabel1: TTntLabel;
- TntLabel2: TTntLabel;
- cbEvenRows: TColorBox;
- TntLabel3: TTntLabel;
- cbOddRows: TColorBox;
- TntLabel4: TTntLabel;
- cbUntranslatedFont: TColorBox;
- TntLabel5: TTntLabel;
- cbEvenRowFont: TColorBox;
- TntLabel6: TTntLabel;
- cbOddRowFont: TColorBox;
+ btnCancel:TTntButton;
+ btnOK:TTntButton;
+ cbUntranslated:TColorBox;
+ TntLabel1:TTntLabel;
+ TntLabel2:TTntLabel;
+ cbEvenRows:TColorBox;
+ TntLabel3:TTntLabel;
+ cbOddRows:TColorBox;
+ TntLabel4:TTntLabel;
+ cbUntranslatedFont:TColorBox;
+ TntLabel5:TTntLabel;
+ cbEvenRowFont:TColorBox;
+ TntLabel6:TTntLabel;
+ cbOddRowFont:TColorBox;
private
{ Private declarations }
- procedure LoadOptions(Options: TAppOptions);
- procedure SaveOptions(Options: TAppOptions);
+ procedure LoadOptions(Options:TAppOptions);
+ procedure SaveOptions(Options:TAppOptions);
public
{ Public declarations }
- class function Edit(Options: TAppOptions): boolean;
+ class function Edit(Options:TAppOptions):boolean;
end;
implementation
@@ -60,9 +60,9 @@
{ TfrmColors }
-class function TfrmColors.Edit(Options: TAppOptions): boolean;
+class function TfrmColors.Edit(Options:TAppOptions):boolean;
var
- frm: TfrmColors;
+ frm:TfrmColors;
begin
frm := self.Create(Application);
try
@@ -75,7 +75,7 @@
end;
end;
-procedure TfrmColors.LoadOptions(Options: TAppOptions);
+procedure TfrmColors.LoadOptions(Options:TAppOptions);
begin
cbUntranslated.Selected := Options.ColorUntranslated;
cbUntranslatedFont.Selected := Options.ColorFontUntranslated;
@@ -85,7 +85,7 @@
cbOddRowFont.Selected := Options.ColorFontOddRow;
end;
-procedure TfrmColors.SaveOptions(Options: TAppOptions);
+procedure TfrmColors.SaveOptions(Options:TAppOptions);
begin
Options.ColorUntranslated := cbUntranslated.Selected;
Options.ColorFontUntranslated := cbUntranslatedFont.Selected;
Modified: translator/trunk/src/CommentsFrm.pas
===================================================================
--- translator/trunk/src/CommentsFrm.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/CommentsFrm.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -29,51 +29,51 @@
TntStdActns, TntActnList, TB2Item, TBX, SpTBXItem;
type
- TCommentModifiedEvent = procedure(Sender: TObject; const AText: WideString) of object;
+ TCommentModifiedEvent = procedure(Sender:TObject; const AText:WideString) of object;
TfrmComments = class(TfrmBase)
- pnlBack: TTntPanel;
- pnlTrans: TTntPanel;
- lblTrans: TLabel;
- reTranslation: TTntRichEdit;
- pnlOrig: TTntPanel;
- lblOrig: TTntLabel;
- reOriginal: TTntRichEdit;
- StatusBar1: TTntStatusBar;
- alComments: TTntActionList;
- popComments: TSpTBXPopupMenu;
- Undo1: TSpTBXItem;
- N1: TSpTBXItem;
- Cut1: TSpTBXItem;
- Copy1: TSpTBXItem;
- Paste1: TSpTBXItem;
- N2: TSpTBXItem;
- SelectAll1: TSpTBXItem;
- spLocked: TTntSpeedButton;
- acClose: TTntAction;
- EditUndo1: TTntEditUndo;
- EditSelectAll1: TTntEditSelectAll;
- EditPaste1: TTntEditPaste;
- EditCopy1: TTntEditCopy;
- EditCut1: TTntEditCut;
- procedure FormResize(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- procedure acCloseExecute(Sender: TObject);
- procedure reTranslationChange(Sender: TObject);
+ pnlBack:TTntPanel;
+ pnlTrans:TTntPanel;
+ lblTrans:TLabel;
+ reTranslation:TTntRichEdit;
+ pnlOrig:TTntPanel;
+ lblOrig:TTntLabel;
+ reOriginal:TTntRichEdit;
+ StatusBar1:TTntStatusBar;
+ alComments:TTntActionList;
+ popComments:TSpTBXPopupMenu;
+ Undo1:TSpTBXItem;
+ N1:TSpTBXItem;
+ Cut1:TSpTBXItem;
+ Copy1:TSpTBXItem;
+ Paste1:TSpTBXItem;
+ N2:TSpTBXItem;
+ SelectAll1:TSpTBXItem;
+ spLocked:TTntSpeedButton;
+ acClose:TTntAction;
+ EditUndo1:TTntEditUndo;
+ EditSelectAll1:TTntEditSelectAll;
+ EditPaste1:TTntEditPaste;
+ EditCopy1:TTntEditCopy;
+ EditCut1:TTntEditCut;
+ procedure FormResize(Sender:TObject);
+ procedure FormDestroy(Sender:TObject);
+ procedure acCloseExecute(Sender:TObject);
+ procedure reTranslationChange(Sender:TObject);
private
- FOnCommentModified: TCommentModifiedEvent;
- function GetPinned: boolean;
- procedure SetPinned(const Value: boolean);
- procedure SetOnCommentModified(const Value: TCommentModifiedEvent);
+ FOnCommentModified:TCommentModifiedEvent;
+ function GetPinned:boolean;
+ procedure SetPinned(const Value:boolean);
+ procedure SetOnCommentModified(const Value:TCommentModifiedEvent);
{ Private declarations }
public
{ Public declarations }
- procedure SetComments(const Item: ITranslationItem; CommentChars: TTntStrings);
- property Pinned: boolean read GetPinned write SetPinned;
- property OnCommentModified: TCommentModifiedEvent read FOnCommentModified write SetOnCommentModified;
+ procedure SetComments(const Item:ITranslationItem; CommentChars:TTntStrings);
+ property Pinned:boolean read GetPinned write SetPinned;
+ property OnCommentModified:TCommentModifiedEvent read FOnCommentModified write SetOnCommentModified;
end;
var
- frmComments: TfrmComments = nil;
+ frmComments:TfrmComments = nil;
implementation
uses
@@ -81,8 +81,9 @@
{$R *.dfm}
-procedure TfrmComments.FormResize(Sender: TObject);
-var H: integer;
+procedure TfrmComments.FormResize(Sender:TObject);
+var
+ H:integer;
begin
H := pnlBack.Height - pnlOrig.Height - pnlTrans.Height;
if H < 0 then
@@ -90,7 +91,7 @@
reOriginal.Height := H div 2;
end;
-procedure TfrmComments.SetComments(const Item: ITranslationItem; CommentChars: TTntStrings);
+procedure TfrmComments.SetComments(const Item:ITranslationItem; CommentChars:TTntStrings);
// var i: integer;
begin
if Item = nil then
@@ -114,34 +115,34 @@
end;
end;
-procedure TfrmComments.FormDestroy(Sender: TObject);
+procedure TfrmComments.FormDestroy(Sender:TObject);
begin
frmComments := nil;
end;
-function TfrmComments.GetPinned: boolean;
+function TfrmComments.GetPinned:boolean;
begin
Result := spLocked.Down;
end;
-procedure TfrmComments.SetPinned(const Value: boolean);
+procedure TfrmComments.SetPinned(const Value:boolean);
begin
spLocked.Down := Value;
end;
-procedure TfrmComments.acCloseExecute(Sender: TObject);
+procedure TfrmComments.acCloseExecute(Sender:TObject);
begin
Close;
end;
-procedure TfrmComments.reTranslationChange(Sender: TObject);
+procedure TfrmComments.reTranslationChange(Sender:TObject);
begin
if reTranslation.Modified and Assigned(FOnCommentModified) then
FOnCommentModified(self, reTranslation.Text);
end;
procedure TfrmComments.SetOnCommentModified(
- const Value: TCommentModifiedEvent);
+ const Value:TCommentModifiedEvent);
begin
FOnCommentModified := Value;
reTranslation.ReadOnly := not Assigned(FOnCommentModified);
Modified: translator/trunk/src/CommonUtils.pas
===================================================================
--- translator/trunk/src/CommonUtils.pas 2007-08-14 12:34:51 UTC (rev 248)
+++ translator/trunk/src/CommonUtils.pas 2007-08-14 16:29:55 UTC (rev 249)
@@ -22,65 +22,65 @@
uses
Windows, SysUtils, Controls, Classes, TntClasses;
-procedure InfoMsg(const AText, ACaption: WideString);
-procedure AboutMsg(const AText, ACaption: WideString);
-procedure ErrMsg(const AText, ACaption: WideString);
-function YesNo(const AText, ACaption: WideString): boolean;
-function YesNoCancel(const AText, ACaption: WideString): integer;
-function WideMessageBox(hWnd: HWND; lpText, lpCaption: PWideChar; uType: UINT): Integer;
+procedure InfoMsg(const AText, ACaption:WideString);
+procedure AboutMsg(const AText, ACaption:WideString);
+procedure ErrMsg(const AText, ACaption:WideString);
+function YesNo(const AText, ACaption:WideString):boolean;
+function YesNoCancel(const AText, ACaption:WideString):integer;
+function WideMessageBox(hWnd:HWND; lpText, lpCaption:PWideChar; uType:UINT):Integer;
-function GetCmdSwitchValue(const Switch: AnsiString; SwitchChars: TSysCharSet; var Value: AnsiString; IgnoreCase: boolean): boolean;
-function ScreenCursor(ACursor: TCursor): IInterface;
-function WaitCursor: IInterface;
+function GetCmdSwitchValue(const Switch:AnsiString; SwitchChars:TSysCharSet; var Value:AnsiString; IgnoreCase:boolean):boolean;
+function ScreenCursor(ACursor:TCursor):IInterface;
+function WaitCursor:IInterface;
-function StripChars(const S: AnsiString; Ch: TSysCharSet): AnsiString; overload;
-function StripChars(const S: WideString; const Ch: WideString): WideString; overload;
-function SysDir: WideString;
-function WinDir: WideString;
+function StripChars(const S:AnsiString; Ch:TSysCharSet):AnsiString; overload;
+function StripChars(const S:WideString; const Ch:WideString):WideString; overload;
+function SysDir:WideString;
+function WinDir:WideString;
-function MatchesString(const SubStr, Str: WideString; WholeLine, CaseSense, Fuzzy: boolean): boolean;
-function StripKey(const S, StripChars: WideString; ReallyStrip: boolean): WideString;
-procedure StripKeys(Strings: TTntStrings; StripChars: WideString; ReallyStrip: boolean);
-function trimCRLFRight(const S: WideString): WideString;
-function strBetween(const S: WideString; StartChar, EndChar: WideChar): WideString;
-function StrDefault(const S, Default: WideString): WideString;
+function MatchesString(const SubStr, Str:WideString; WholeLine, CaseSense, Fuzzy:boolean):boolean;
+function StripKey(const S, StripChars:WideString; ReallyStrip:boolean):WideString;
+procedure StripKeys(Strings:TTntStrings; StripChars:WideString; ReallyStrip:boolean);
+function trimCRLFRight(const S:WideString):WideString;
+function strBetween(const S:WideString; StartChar, EndChar:WideChar):WideString;
+function StrDefault(const S, Default:WideString):WideString;
-function MyWideDequotedStr(const S: WideString; Quote: WideChar): WideString;
-function AutoWideDequotedStr(const S: WideString): WideString;
-function MyWideQuotedStr(const S: WideString; Quote: WideChar): WideString;
+function MyWideDequotedStr(const S:WideString; Quote:WideChar):WideString;
+function AutoWideDequotedStr(const S:WideString):WideString;
+function MyWideQuotedStr(const S:WideString; Quote:WideChar):WideString;
-function GetMinimizedFilename(const AFilename: WideString; Minimize: boolean): WideString;
-function DoubleQuoteString(const S: WideString; CheckString: boolean = true): WideString;
-function RunProcess(const Filename, Params: WideString; WorkingDir: WideString;
- const WaitUntilTerminated, WaitUntilIdle: Boolean; const ShowCmd: Integer; var ResultCode: Cardinal): Boolean;
-function GetSpecialFolderLocation(const Folder: Integer): WideString;
-function WideSHGetFolderPath(hwnd: HWND; csidl: Integer; hToken: THandle; dwFlags: DWord; pszPath: PWideChar): HRESULT;
-function IsFileOpen(const Filename: WideString): boolean;
+function GetMinimizedFilename(const AFilename:WideString; Minimize:boolean):WideString;
+function DoubleQuoteString(const S:WideString; CheckString:boolean = true):WideString;
+function RunProcess(const Filename, Params:WideString; WorkingDir:WideString;
+ const WaitUntilTerminated, WaitUntilIdle:Boolean; const ShowCmd:Integer; var ResultCode:Cardinal):Boolean;
+function GetSpecialFolderLocation(const Folder:Integer):WideString;
+function WideSHGetFolderPath(hwnd:HWND; csidl:Integer; hToken...
[truncated message content] |