Update of /cvsroot/lngcompiler/lngcompiler
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12748
Modified Files:
BigIni.pas LngForm.dfm LngForm.pas Utils.pas XCoder.pas
Log Message:
Added BATCH command line option
Index: BigIni.pas
===================================================================
RCS file: /cvsroot/lngcompiler/lngcompiler/BigIni.pas,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BigIni.pas 5 Apr 2002 15:06:22 -0000 1.3
--- BigIni.pas 7 Feb 2008 12:21:29 -0000 1.4
***************
*** 160,164 ****
property FileName: string read FFileName write SetFileName;
property EraseSectionCallback: TEraseSectionCallback read FEraseSectionCallback write FEraseSectionCallback;
- published
end;
--- 160,163 ----
***************
*** 185,189 ****
{ -------------------------------------------------------------------------- }
implementation
! uses Utils, xReader, WrapStrm;
{ -------------------------------------------------------------------------- }
{........................................................................... }
--- 184,188 ----
{ -------------------------------------------------------------------------- }
implementation
! uses Windows, Utils, xReader, WrapStrm;
{ -------------------------------------------------------------------------- }
{........................................................................... }
Index: LngForm.dfm
===================================================================
RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.dfm,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** LngForm.dfm 3 Apr 2005 18:22:05 -0000 1.14
--- LngForm.dfm 7 Feb 2008 12:21:30 -0000 1.15
***************
*** 2,7 ****
Left = 143
Top = 112
! Width = 542
! Height = 392
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
--- 2,7 ----
Left = 143
Top = 112
! ClientHeight = 346
! ClientWidth = 534
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
***************
*** 14,17 ****
--- 14,18 ----
Position = poScreenCenter
Scaled = False
+ OnActivate = FormActivate
OnClose = FormClose
OnCloseQuery = FormCloseQuery
***************
*** 32,43 ****
Top = 0
Width = 534
! Height = 338
ActivePage = tsNames
Align = alClient
TabOrder = 0
OnChanging = pcBookChanging
object tsGeneral: TTabSheet
Caption = 'General'
ImageIndex = 2
object gbLng: TGroupBox
Left = 0
--- 33,49 ----
Top = 0
Width = 534
! Height = 346
ActivePage = tsNames
Align = alClient
TabOrder = 0
OnChanging = pcBookChanging
+ ExplicitHeight = 338
object tsGeneral: TTabSheet
Caption = 'General'
ImageIndex = 2
+ ExplicitLeft = 0
+ ExplicitTop = 0
+ ExplicitWidth = 0
+ ExplicitHeight = 0
object gbLng: TGroupBox
Left = 0
***************
*** 208,211 ****
--- 214,221 ----
object tsForms: TTabSheet
Caption = 'Forms'
+ ExplicitLeft = 0
+ ExplicitTop = 0
+ ExplicitWidth = 0
+ ExplicitHeight = 0
object Splitter3: TSplitter
Left = 0
***************
*** 278,284 ****
Top = 281
Width = 526
! Height = 26
Align = alClient
TabOrder = 2
object Splitter4: TSplitter
Left = 297
--- 288,295 ----
Top = 281
Width = 526
! Height = 34
Align = alClient
TabOrder = 2
+ ExplicitHeight = 26
object Splitter4: TSplitter
Left = 297
***************
*** 359,362 ****
--- 370,377 ----
Caption = 'Strings'
ImageIndex = 1
+ ExplicitLeft = 0
+ ExplicitTop = 0
+ ExplicitWidth = 0
+ ExplicitHeight = 0
object Splitter2: TSplitter
Left = 0
***************
*** 471,474 ****
--- 486,493 ----
Caption = 'Names'
ImageIndex = 3
+ ExplicitLeft = 0
+ ExplicitTop = 0
+ ExplicitWidth = 0
+ ExplicitHeight = 0
object gNames: TStringGrid
Left = 0
Index: LngForm.pas
===================================================================
RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** LngForm.pas 25 Jan 2006 13:45:00 -0000 1.24
--- LngForm.pas 7 Feb 2008 12:21:30 -0000 1.25
***************
*** 284,292 ****
--- 284,295 ----
const Value: String);
procedure bAddNameClick(Sender: TObject);
+ procedure FormActivate(Sender: TObject);
private
procedure Decompile;
function GetLng(aID: Integer): String;
procedure WMFillForm(var M: TMessage); message WM_User + 78;
+ procedure CompileLng;
public
+ Activated: Boolean;
fConvertIds: Boolean;
DefDC: THandle;
***************
*** 326,329 ****
--- 329,333 ----
Form1: TForm1;
WDir: String = '';
+ BatchMode: Boolean;
implementation
***************
*** 2120,2123 ****
--- 2124,2138 ----
end;
+ procedure TForm1.FormActivate(Sender: TObject);
+ begin
+ if Activated then Exit;
+ Activated := True;
+ if BatchMode then
+ begin
+ CompileLng;
+ PostMessage(Handle, WM_CLOSE, 0, 0);
+ end;
+ end;
+
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
***************
*** 2232,2235 ****
--- 2247,2251 ----
var D: TForm2;
begin
+ if BatchMode then Exit;
D := nil;
try
***************
*** 2975,2978 ****
--- 2991,3000 ----
procedure TForm1.Save1Click(Sender: TObject);
+ begin
+ if MessageDlg('Generate the Language file?', mtConfirmation, [mbYes, mbNo], 0) <> mrYes then Exit;
+ CompileLng;
+ end;
+
+ procedure TForm1.CompileLng;
var M: TMemoryStream;
S: String;
***************
*** 3127,3131 ****
begin
- if MessageDlg('Generate the Language file?', mtConfirmation, [mbYes, mbNo], 0) <> mrYes then Exit;
S := AddFileDir(eLngFile.Text, WDir);
if not FileExists(S) then
--- 3149,3152 ----
***************
*** 3173,3177 ****
procedure TForm1.mErrorsClick(Sender: TObject);
begin
! Showerrors;
end;
--- 3194,3198 ----
procedure TForm1.mErrorsClick(Sender: TObject);
begin
! ShowErrors;
end;
***************
*** 3256,3259 ****
--- 3277,3281 ----
initialization
+ BatchMode := AnsiCompareText(ParamStr(1), 'BATCH') = 0;
WDir := ExtractFilePath(ExpandFileName(ParamStr(0)));
if (WDir <> '') and (WDir[Length(WDir)] <> '\') then WDir := WDir + '\';
Index: Utils.pas
===================================================================
RCS file: /cvsroot/lngcompiler/lngcompiler/Utils.pas,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Utils.pas 5 Apr 2002 15:06:22 -0000 1.4
--- Utils.pas 7 Feb 2008 12:21:30 -0000 1.5
***************
*** 251,255 ****
procedure SetStatus(N: Integer);
function GetPos: LongInt; virtual;
! function GetSize: LongInt; virtual;
procedure SetSize(N: LongInt); {$IFNDEF VER90}override;{$ELSE}virtual;{$ENDIF}
procedure SetPos(N: LongInt); virtual;
--- 251,255 ----
procedure SetStatus(N: Integer);
function GetPos: LongInt; virtual;
! function GetSize: Int64; override;
procedure SetSize(N: LongInt); {$IFNDEF VER90}override;{$ELSE}virtual;{$ENDIF}
procedure SetPos(N: LongInt); virtual;
***************
*** 273,277 ****
property Handle: hFile read F write F;
property Position: Longint read GetPos write SetPos;
! property Size: Longint read GetSize;
property OnError: TOnDosStreamError read fOnError write fOnError;
end;
--- 273,277 ----
property Handle: hFile read F write F;
property Position: Longint read GetPos write SetPos;
! property Size: Int64 read GetSize;
property OnError: TOnDosStreamError read fOnError write fOnError;
end;
***************
*** 287,291 ****
procedure SetPos(N: LongInt); override;
function GetPos: LongInt; override;
! function GetSize: LongInt; override;
public
constructor Create(const Fn: String; Mode: TFileOpenFlags; AFailOnError: Boolean; ABufSize: Integer);
--- 287,291 ----
procedure SetPos(N: LongInt); override;
function GetPos: LongInt; override;
! function GetSize: Int64; override;
public
constructor Create(const Fn: String; Mode: TFileOpenFlags; AFailOnError: Boolean; ABufSize: Integer);
***************
*** 2789,2793 ****
function GetBoundary: string;
begin
! Result := Format('----------%x%x%x%x', [Random(300),Random(500),Random(600),(GetTickCount and $FFFFFF) xor Random(MaxInt div 2)])
end;
--- 2789,2793 ----
function GetBoundary: string;
begin
! Result := Format('----------%x%x%x%x', [Random(300),Random(500),Random(600),(DWORD(GetTickCount) and $FFFFFF) xor DWORD(Random(MaxInt div 2))])
end;
Index: XCoder.pas
===================================================================
RCS file: /cvsroot/lngcompiler/lngcompiler/XCoder.pas,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** XCoder.pas 5 Apr 2002 15:06:22 -0000 1.3
--- XCoder.pas 7 Feb 2008 12:21:30 -0000 1.4
***************
*** 172,176 ****
function TMimeCoder.Encode;
var
! I,J,K,L: Integer;
S: String;
begin
--- 172,176 ----
function TMimeCoder.Encode;
var
! I,K,L: Integer;
S: String;
begin
|