lngcompiler-commits Mailing List for Ritlabs LNG files editor & compiler
Brought to you by:
lovetski,
maximmasiutin
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2004 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Maxim M. <max...@us...> - 2010-07-11 00:37:43
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16790 Modified Files: BigIni.pas LngForm.pas MD5.pas MView.pas Utils.pas WrapStrm.pas XCoder.pas XReader.pas Log Message: Some obsolete unused variables did produce minor compiler warnings. Index: BigIni.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/BigIni.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BigIni.pas 7 Feb 2008 12:21:29 -0000 1.4 --- BigIni.pas 11 Jul 2010 00:37:33 -0000 1.5 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** LngForm.pas 24 Sep 2009 09:25:07 -0000 1.27 --- LngForm.pas 11 Jul 2010 00:37:33 -0000 1.28 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or *************** *** 369,373 **** procedure TNamedStrIndex.Add(AName, AValue, ALng: String); var ! I, J, VL, LL: Integer; begin VL := Length(AValue); --- 369,373 ---- procedure TNamedStrIndex.Add(AName, AValue, ALng: String); var ! I, VL, LL: Integer; begin VL := Length(AValue); *************** *** 424,428 **** var I, J, K, L: Integer; ! S, N, V: String; begin S := AdjustLineBreaks(AText); --- 424,428 ---- var I, J, K, L: Integer; ! S, N: String; begin S := AdjustLineBreaks(AText); *************** *** 1083,1087 **** LastT, T: TLngToken; LLine, LastLine: Integer; - LI: TLngString; CP: String; --- 1083,1086 ---- *************** *** 2465,2472 **** OL: TStringList; CF: TLngForm; - LF: TLngFile; LI, LLI: TLngString; XX: Boolean; ! NS, S, SS: String; begin OL := nil; --- 2464,2470 ---- OL: TStringList; CF: TLngForm; LI, LLI: TLngString; XX: Boolean; ! NS, SS: String; begin OL := nil; *************** *** 2640,2644 **** function NameNotTranslated(Idx: Integer): Boolean; var - I: Integer; S, SS: String; begin --- 2638,2641 ---- *************** *** 3165,3168 **** --- 3162,3166 ---- CheckLngChange; M := nil; + LF := nil; try LL := TStringList.Create; LL.Sorted := True; Index: MD5.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/MD5.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MD5.pas 5 Apr 2002 15:06:22 -0000 1.4 --- MD5.pas 11 Jul 2010 00:37:33 -0000 1.5 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or Index: MView.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/MView.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MView.pas 5 Apr 2002 15:06:22 -0000 1.3 --- MView.pas 11 Jul 2010 00:37:33 -0000 1.4 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or Index: Utils.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/Utils.pas,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Utils.pas 7 Feb 2008 12:21:30 -0000 1.5 --- Utils.pas 11 Jul 2010 00:37:33 -0000 1.6 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or Index: WrapStrm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/WrapStrm.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WrapStrm.pas 5 Apr 2002 15:06:22 -0000 1.3 --- WrapStrm.pas 11 Jul 2010 00:37:33 -0000 1.4 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or Index: XCoder.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/XCoder.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** XCoder.pas 7 Feb 2008 12:21:30 -0000 1.4 --- XCoder.pas 11 Jul 2010 00:37:33 -0000 1.5 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or *************** *** 251,255 **** InBS, CInBS, BS, CBS: Integer; I, J, II, MCd3, BSdMC: Integer; - P4: PI4RecArray; p3: PI3RecArray; --- 251,254 ---- *************** *** 412,416 **** procedure DoDecodeUTF7; ! var P, XP, I, XBS: Integer; B: Boolean; S, Q: String; --- 411,415 ---- procedure DoDecodeUTF7; ! var P, XP, XBS: Integer; B: Boolean; S, Q: String; *************** *** 619,623 **** procedure DoEncodeUTF7; ! var I, J, K: Integer; B: Boolean; --- 618,622 ---- procedure DoEncodeUTF7; ! var I, J: Integer; B: Boolean; *************** *** 711,718 **** function StringToUTF(const S: String; UTF8: Boolean): String; var WStr: PWideChar; - StrSize: Integer; P: PChar; SSize: Integer; - F: Integer; begin WStr := nil; --- 710,715 ---- Index: XReader.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/XReader.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XReader.pas 5 Apr 2002 15:06:22 -0000 1.3 --- XReader.pas 11 Jul 2010 00:37:33 -0000 1.4 *************** *** 4,8 **** lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001 RITLABS S.R.L. This program is free software; you can redistribute it and/or --- 4,8 ---- lngcompiler - Ritlabs LNG files editor & compiler ! Copyright (C) 2001-2010 RITLABS S.R.L. This program is free software; you can redistribute it and/or |
From: Maxim M. <max...@us...> - 2009-09-24 09:25:24
|
Update of /cvsroot/lngcompiler/lngcompiler In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14387 Modified Files: LngForm.pas Log Message: Added Japanese Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** LngForm.pas 30 Jun 2008 14:12:02 -0000 1.26 --- LngForm.pas 24 Sep 2009 09:25:07 -0000 1.27 *************** *** 765,768 **** --- 765,769 ---- DoAdd('Azeri', 37, TURKISH_CHARSET); DoAdd('Korean', 38, HANGEUL_CHARSET); + DoAdd('Japanese', 39, SHIFTJIS_CHARSET); end; *************** *** 1466,1477 **** LngList := TList.Create; Errors := TStringList.Create; - LoadSettings; - // Decompile; - if (fMasterFile = '') or (not FileExists(fMasterFile)) - then begin - bBrowseMasterClick(bBrowseMaster); - if fMasterFile = '' then Halt; - end - else SetMaster(AddFileDir(fMasterFile, WDir)); end; --- 1467,1470 ---- *************** *** 2130,2133 **** --- 2123,2136 ---- if Activated then Exit; Activated := True; + + LoadSettings; + if (fMasterFile = '') or (not FileExists(fMasterFile)) + then begin + bBrowseMasterClick(bBrowseMaster); + if fMasterFile = '' then Halt; + end + else SetMaster(AddFileDir(fMasterFile, WDir)); + + if BatchMode then begin |
From: Maxim M. <max...@us...> - 2008-06-30 14:12:08
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22789 Modified Files: LngForm.pas Log Message: Added support for Korean Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** LngForm.pas 7 Feb 2008 12:21:30 -0000 1.25 --- LngForm.pas 30 Jun 2008 14:12:02 -0000 1.26 *************** *** 763,766 **** --- 763,768 ---- DoAdd('Slovenian', 35, EASTEUROPE_CHARSET); DoAdd('Uzbek', 36, TURKISH_CHARSET); + DoAdd('Azeri', 37, TURKISH_CHARSET); + DoAdd('Korean', 38, HANGEUL_CHARSET); end; |
From: Maxim M. <max...@us...> - 2008-02-07 12:21:36
|
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 |
From: Maxim M. <max...@us...> - 2006-01-25 13:45:10
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2396 Modified Files: LngForm.pas Log Message: Added UZBEK Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** LngForm.pas 15 Jul 2005 14:04:10 -0000 1.23 --- LngForm.pas 25 Jan 2006 13:45:00 -0000 1.24 *************** *** 758,761 **** --- 758,762 ---- DoAdd('Indonesian', 34, ANSI_CHARSET); DoAdd('Slovenian', 35, EASTEUROPE_CHARSET); + DoAdd('Uzbek', 36, TURKISH_CHARSET); end; |
From: Maxim M. <max...@us...> - 2005-07-15 14:04:20
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2267 Modified Files: LngForm.pas Log Message: ... Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** LngForm.pas 13 May 2005 14:37:19 -0000 1.22 --- LngForm.pas 15 Jul 2005 14:04:10 -0000 1.23 *************** *** 756,759 **** --- 756,761 ---- DoAdd('Galician', 32, ANSI_CHARSET); DoAdd('Estonian', 33, BALTIC_CHARSET); + DoAdd('Indonesian', 34, ANSI_CHARSET); + DoAdd('Slovenian', 35, EASTEUROPE_CHARSET); end; |
From: Maxim M. <max...@us...> - 2005-05-13 14:37:28
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22497 Modified Files: LngForm.pas Log Message: Added Galician Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** LngForm.pas 13 Mar 2005 20:11:53 -0000 1.21 --- LngForm.pas 13 May 2005 14:37:19 -0000 1.22 *************** *** 755,758 **** --- 755,759 ---- DoAdd('Hebrew', 31, HEBREW_CHARSET); DoAdd('Galician', 32, ANSI_CHARSET); + DoAdd('Estonian', 33, BALTIC_CHARSET); end; |
From: Maxim M. <max...@us...> - 2005-04-03 18:22:29
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6032 Modified Files: LngForm.dfm Log Message: catalan Index: LngForm.dfm =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.dfm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LngForm.dfm 28 Feb 2005 11:55:16 -0000 1.13 --- LngForm.dfm 3 Apr 2005 18:22:05 -0000 1.14 *************** *** 248,252 **** Style = csDropDownList Anchors = [akLeft, akTop, akRight] ! ItemHeight = 16 TabOrder = 0 OnChange = cbFormChange --- 248,252 ---- Style = csDropDownList Anchors = [akLeft, akTop, akRight] ! ItemHeight = 0 TabOrder = 0 OnChange = cbFormChange |
From: Maxim M. <max...@us...> - 2005-03-13 20:12:04
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10019 Modified Files: LngForm.pas Log Message: was a bug in grab Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** LngForm.pas 28 Feb 2005 17:26:51 -0000 1.20 --- LngForm.pas 13 Mar 2005 20:11:53 -0000 1.21 *************** *** 541,545 **** begin ! LL := Length(AName); Result := 0; E := False; --- 541,545 ---- begin ! LL := Length(AName)+1; Result := 0; E := False; |
From: Maxim M. <max...@us...> - 2005-02-28 17:27:01
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9453/lngcompiler Modified Files: LngForm.pas Log Message: NAMES section is now copied into a Pascal code for easy export Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** LngForm.pas 28 Feb 2005 11:55:16 -0000 1.19 --- LngForm.pas 28 Feb 2005 17:26:51 -0000 1.20 *************** *** 31,34 **** --- 31,39 ---- Grids, StdCtrls, ExtCtrls, ComCtrls, Menus; + const + ExtraID = $FFFFFFFF; + + exidNames = 3; + type TTokenID = (tidID, tidString, tidChar, tidList); *************** *** 128,131 **** --- 133,138 ---- procedure Add(AName, AValue, ALng: String); procedure AddValues(const AText: String); + procedure SaveToStream(AStream: TStream); + procedure LoadFromStream(AStream: TStream; Clean: Boolean = False); function IndexOfName(AName: String; MustExist: Boolean = True): Integer; property Items[Idx: String]: String read GetItem; *************** *** 444,447 **** --- 451,502 ---- end; + procedure TNamedStrIndex.SaveToStream(AStream: TStream); + var + I: Integer; + + procedure WriteStr(const S: String); + var + L: Integer; + begin + L := Length(S); + AStream.Write(L, SizeOf(Integer)); + if L > 0 then AStream.Write(S[1], L); + end; + + begin + AStream.Write(fCount, SizeOf(Integer)); + for I := 0 to fCount-1 do + begin + WriteStr(Names[I]); + WriteStr(Values[I]); + end; + end; + + procedure TNamedStrIndex.LoadFromStream(AStream: TStream; Clean: Boolean = False); + var + I, C: Integer; + + function GetStr(): String; + var + L: Integer; + begin + Result := ''; + L := 0; + AStream.Read(L, SizeOf(Integer)); + if L > 0 then + begin + SetLength(Result, L); + AStream.Read(Result[1], L); + end; + end; + + begin + if Clean then Clear; + C := 0; + AStream.Read(C, SizeOf(Integer)); + for I := 1 to C do + Add(GetStr, GetStr, ''); + end; + function TNamedStrIndex.AllocStr(const Str: String): Integer; var *************** *** 2938,2944 **** end; ! procedure SaveLng(L: TList; aID: Integer); var I, J, K, O, N{, MP}: Integer; ! LF, LLF: TLngForm; LI: TlngItem; LS: TLngString; --- 2993,2999 ---- end; ! procedure SaveLng(L: TList; aID: Integer; StoreN: Boolean = False); var I, J, K, O, N{, MP}: Integer; ! LF, LLF, NF: TLngForm; LI: TlngItem; LS: TLngString; *************** *** 2946,2949 **** --- 3001,3006 ---- WW: Word; XL: TList; + S: String; + SL: TStringList; begin M.Write(aID, SizeOf(Integer)); *************** *** 2952,2956 **** I := L.Count-1; M.Write(I, SizeOf(I)); ! N := 0; LLF := nil; for J := 0 to L.Count-1 do begin --- 3009,3015 ---- I := L.Count-1; M.Write(I, SizeOf(I)); ! N := 0; ! LLF := nil; ! NF := nil; for J := 0 to L.Count-1 do begin *************** *** 2976,2980 **** end; end else ! if LF.Strings <> nil then LLF := LF; end; --- 3035,3040 ---- end; end else ! if LF.Strings <> nil then LLF := LF else ! if LF.Names <> nil then NF := LF; end; *************** *** 3010,3013 **** --- 3070,3114 ---- I := Integer($FFFFFFFF); M.Write(I, SizeOf(I)); + if (NF <> nil) and (NF.Names <> nil) then + begin + M.Write(I, SizeOf(I)); + J := M.Position; + M.Write(I, SizeOf(I)); + I := exidNames; + M.Write(I, SizeOf(I)); + NF.Names.SaveToStream(M); + if StoreN then + begin + K := 0; S := ''; + SL := TStringList.Create; + for I := 0 to NF.Names.Count-1 do + begin + S := S + ' +'+MakeStr(NF.Names[I]+'='+NF.Names.Values[I])+'#13#10'#13#10; + if Length(S) > 1024 then + begin + if SL.Count > 0 then S[1] := ','; + S[2] := ' '; + SL.Add(S); Inc(K); + S := ''; + end; + end; + if S <> '' then + begin + if SL.Count > 0 then S[1] := ','; + S[2] := ' '; + SL.Add(S); + Inc(K); + end; + SL.Insert(0, Format('const'#13#10' cLngNames: Array[1..%d] of String = (', [K])); + SL.Add(');'); + SL.SaveToFile(AddFileDir('EngNames.INC', WDir)); + SL.Free; + end; + K := M.Position; + M.Position := J; + J := K - J; + M.Write(J, SizeOf(Integer)); + M.Position := K; + end; J := M.Position; I := J-O; *************** *** 3049,3053 **** S := 'FBPRPBP'#13#10; M.Write(S[1], Length(S)); ! SaveLng(FormList, 0); for I := 0 to LngList.Count-1 do SaveLng(LngList[I], TLngFile(LngList[I]).LngID); --- 3150,3154 ---- S := 'FBPRPBP'#13#10; M.Write(S[1], Length(S)); ! SaveLng(FormList, 0, True); for I := 0 to LngList.Count-1 do SaveLng(LngList[I], TLngFile(LngList[I]).LngID); |
From: Maxim M. <max...@us...> - 2005-02-28 11:55:27
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9878/lngcompiler Modified Files: LngForm.dfm LngForm.pas Log Message: new section - NAMES - can be edited (but not compiled in) Index: LngForm.dfm =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.dfm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LngForm.dfm 28 Feb 2005 08:24:02 -0000 1.12 --- LngForm.dfm 28 Feb 2005 11:55:16 -0000 1.13 *************** *** 479,484 **** ColCount = 3 FixedCols = 0 ! Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goEditing] TabOrder = 0 ColWidths = ( 140 --- 479,486 ---- ColCount = 3 FixedCols = 0 ! Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goEditing, goThumbTracking] TabOrder = 0 + OnDrawCell = gNamesDrawCell + OnSetEditText = gNamesSetEditText ColWidths = ( 140 *************** *** 498,513 **** Left = 80 Top = 8 ! Width = 105 Height = 25 ! Caption = '&Add' TabOrder = 0 ! end ! object bDelName: TButton ! Left = 296 ! Top = 8 ! Width = 99 ! Height = 25 ! Caption = '&Delete' ! TabOrder = 1 end end --- 500,508 ---- Left = 80 Top = 8 ! Width = 129 Height = 25 ! Caption = '&New ID' TabOrder = 0 ! OnClick = bAddNameClick end end Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** LngForm.pas 28 Feb 2005 08:24:02 -0000 1.18 --- LngForm.pas 28 Feb 2005 11:55:16 -0000 1.19 *************** *** 241,245 **** pnNameButtons: TPanel; bAddName: TButton; - bDelName: TButton; procedure Exit1Click(Sender: TObject); procedure FormCreate(Sender: TObject); --- 241,244 ---- *************** *** 273,276 **** --- 272,280 ---- procedure Savechanges1Click(Sender: TObject); procedure pnNameButtonsResize(Sender: TObject); + procedure gNamesDrawCell(Sender: TObject; ACol, ARow: Integer; + RR: TRect; State: TGridDrawState); + procedure gNamesSetEditText(Sender: TObject; ACol, ARow: Integer; + const Value: String); + procedure bAddNameClick(Sender: TObject); private procedure Decompile; *************** *** 278,281 **** --- 282,286 ---- procedure WMFillForm(var M: TMessage); message WM_User + 78; public + fConvertIds: Boolean; DefDC: THandle; dBmp: TBitmap; *************** *** 292,295 **** --- 297,301 ---- CurNames: TNamedStrIndex; ShadowForm: TList; + NamesModified: Boolean; procedure FillLanguage; procedure FillForm; *************** *** 1033,1036 **** --- 1039,1043 ---- begin + I := 0; F := GetNameRec; repeat *************** *** 1049,1058 **** if T.ID = tidString then begin ! if F.Names.IndexOfName(CP, True) >= 0 then ! begin ! F.Names.Add(CP, T.S, ''); ! end else ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: duplicate identifier "%s"', [LLine+1, CP])); end else // Line numbers should start from "1", not from "0" (hence, "+1") --- 1056,1060 ---- if T.ID = tidString then begin ! F.Names.Add(CP, T.S, ''); end else // Line numbers should start from "1", not from "0" (hence, "+1") *************** *** 1143,1147 **** ctNames: begin ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine+1, Msg])); AnalyzeTokens; Collecting := 3; --- 1145,1149 ---- ctNames: begin ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the NAMES definition', [aLine+1, Msg])); AnalyzeTokens; Collecting := 3; *************** *** 1540,1544 **** gNames.Rows[0][1] := 'English'; gNames.Rows[0][2] := 'National'; ! end; --- 1542,1546 ---- gNames.Rows[0][1] := 'English'; gNames.Rows[0][2] := 'National'; ! NamesModified := False; end; *************** *** 1962,1965 **** --- 1964,1968 ---- eLngFile.Text := F.ReadString('Project', 'Language ID file', eLngFile.Text); eLngFile.Text := F.ReadString('Project', 'Strings IDs file', eLngFile.Text); + fConvertIds := F.ReadBool('Project', 'Convert Names', False); I := 1; repeat *************** *** 1970,1973 **** --- 1973,1978 ---- for I := 0 to gStrings.ColCount-1 do gStrings.ColWidths[I] := F.ReadInteger('Columns', Format('Strings #%d', [I+1]), gStrings.ColWidths[I]); + for I := 0 to gNames.ColCount-1 do + gNames.ColWidths[I] := F.ReadInteger('Columns', Format('Names #%d', [I+1]), gNames.ColWidths[I]); N := F.ReadInteger('Language', 'Count', 0); for I := 1 to N do *************** *** 2029,2032 **** --- 2034,2039 ---- for I := 0 to gStrings.ColCount-1 do F.WriteInteger('Columns', Format('Strings #%d', [I+1]), gStrings.ColWidths[I]); + for I := 0 to gNames.ColCount-1 do + F.WriteInteger('Columns', Format('Names #%d', [I+1]), gNames.ColWidths[I]); N := 0; *************** *** 2381,2384 **** --- 2388,2392 ---- LI, LLI: TLngString; XX: Boolean; + NS, S, SS: String; begin OL := nil; *************** *** 2390,2394 **** begin CF := CurLng[I]; ! if (CF.Name = '') and (CF.Strings <> nil) then begin if XX then --- 2398,2423 ---- begin CF := CurLng[I]; ! if (CF.Name = '') then ! begin ! if (CF.Names <> nil) then ! begin ! if NamesModified then ! begin ! CF.Names.Clear; ! for J := 1 to gNames.RowCount-1 do ! begin ! NS := Trim(gNames.Rows[J][0]); ! if NS <> '' then ! begin ! SS := gNames.Rows[J][2]; ! if SS <> '' then ! CF.Names.Add(NS, SS, ''); ! end; ! end; ! CF.Modified := True; ! NamesModified := False; ! end; ! end else ! if (CF.Strings <> nil) then begin if XX then *************** *** 2428,2431 **** --- 2457,2461 ---- end else FreeList(CF.Strings); end; + end; end; finally *************** *** 2506,2510 **** var B: Boolean; begin ! B := (pcBook.ActivePage = tsForms) or (pcBook.ActivePage = tsStrings); mnNext.Enabled := B; mnPrev.Enabled := B; --- 2536,2540 ---- var B: Boolean; begin ! B := (pcBook.ActivePage = tsForms) or (pcBook.ActivePage = tsStrings) or (pcBook.ActivePage = tsNames); mnNext.Enabled := B; mnPrev.Enabled := B; *************** *** 2524,2535 **** procedure TForm1.mnNextClick(Sender: TObject); label 1; ! var {I,} _RStep, {_CStep,} _F, _R, _C, CI, CR, CC: Integer; ! Reverse: Boolean; S: String; begin Reverse := TComponent(Sender).Tag < 0; if Reverse then _RStep := -1 else _RStep := 1; if pcBook.ActivePage = tsForms then begin --- 2554,2604 ---- procedure TForm1.mnNextClick(Sender: TObject); label 1; ! var I, _RStep, {_CStep,} _F, _R, _C, CI, CR, CC: Integer; ! Reverse, OK: Boolean; S: String; + function NameNotTranslated(Idx: Integer): Boolean; + var + I: Integer; + S, SS: String; + begin + S := gNames.Rows[Idx][2]; + SS := gNames.Rows[Idx][1]; + Result := (S = '') or (SS = S); + if Result then + begin + gNames.Row := Idx; + gNames.Invalidate; + OK := False; + end; + end; + + + begin Reverse := TComponent(Sender).Tag < 0; if Reverse then _RStep := -1 else _RStep := 1; + if pcBook.ActivePage = tsNames then + begin + OK := true; + if Reverse then + begin + for I := gNames.Row-1 downto 1 do + if NameNotTranslated(I) then Break; + if OK then + for I := gNames.RowCount-1 downto gNames.Row do + if NameNotTranslated(I) then Break; + end else + begin + for I := gNames.Row+1 to gNames.RowCount-1 do + if NameNotTranslated(I) then Break; + if OK then + for I := 1 to gNames.Row do + if NameNotTranslated(I) then Break; + end; + if OK then + MessageDlg('It seems like all items are translated...', mtInformation, [mbOk], 0); + end else if pcBook.ActivePage = tsForms then begin *************** *** 2752,2756 **** begin LF := L[J]; ! if (LF.Modified) then begin S := GetLng(L.LngID); --- 2821,2825 ---- begin LF := L[J]; ! if (LF.Modified) or NamesModified then begin S := GetLng(L.LngID); *************** *** 3006,3014 **** X, Y: Integer; begin ! X := pnNameButtons.Width div 2; Y := (X - bAddName.Width) div 2; if Y < 0 then Y := 0; bAddName.Left := Y; ! bDelName.Left := X + Y; end; --- 3075,3151 ---- X, Y: Integer; begin ! X := pnNameButtons.Width;// div 2; Y := (X - bAddName.Width) div 2; if Y < 0 then Y := 0; bAddName.Left := Y; ! //bDelName.Left := X + Y; ! end; ! ! procedure TForm1.gNamesDrawCell(Sender: TObject; ACol, ARow: Integer; ! RR: TRect; State: TGridDrawState); ! var SS: Array[0..2] of String; ! BC, TC: TColor; ! S: String; ! R, R1: TRect; ! begin ! SS[0] := gNames.Rows[ARow][0]; ! SS[1] := gNames.Rows[ARow][1]; ! SS[2] := gNames.Rows[ARow][2]; ! R := Rect(0,0,RR.Right-RR.Left,RR.Bottom-RR.Top); ! if dBmp.Width < R.Right then dBmp.Width := R.Right; ! if dBmp.Height < R.Bottom then dBmp.Height := R.Bottom; ! if ((SS[2] = '') or (SS[1] = SS[2])) and (State = []) then ! begin ! BC := clYellow; ! TC := clBlack; ! end else ! begin ! if gdSelected in State then ! begin ! BC := clHighlight; ! TC := clHighlightText; ! end else ! if gdFixed in State then ! begin ! BC := clBtnFace; ! TC := clBtnText; ! end else ! begin ! BC := clWindow; ! TC := clWindowText; ! end; ! end; ! with dBmp.Canvas do ! begin ! //InflateRect(Rect, 1, 1); ! Font.Assign(gStrings.Font); ! ! Brush.Color := BC; ! FillRect(R); ! ! Font.Color := TC; ! ! S := SS[ACol]; ! if StrScan(PChar(S), #13) <> nil then ! S := AdjustLineBreaks(S); ! ! R1 := R; ! InflateRect(R1, -1, -1); ! DrawText(Handle, PChar(S), Length(S), R1, DT_NOPREFIX or DT_END_ELLIPSIS); ! end; ! gNames.Canvas.CopyRect(RR, dBmp.Canvas, R); ! end; ! ! procedure TForm1.gNamesSetEditText(Sender: TObject; ACol, ARow: Integer; ! const Value: String); ! begin ! gNames.Invalidate; ! NamesModified := True; ! end; ! ! procedure TForm1.bAddNameClick(Sender: TObject); ! begin ! gNames.RowCount := gNames.RowCount+1; ! gNames.Row := gNames.RowCount-1; end; |
From: Maxim M. <max...@us...> - 2005-02-28 08:24:14
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14774/lngcompiler Modified Files: LngForm.dfm LngForm.pas Log Message: New section - NAMES Index: LngForm.dfm =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.dfm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LngForm.dfm 25 Feb 2005 17:20:12 -0000 1.11 --- LngForm.dfm 28 Feb 2005 08:24:02 -0000 1.12 *************** *** 1,7 **** object Form1: TForm1 ! Left = 90 ! Top = 60 ! Width = 705 ! Height = 445 Color = clBtnFace Font.Charset = DEFAULT_CHARSET --- 1,7 ---- object Form1: TForm1 ! Left = 143 ! Top = 112 ! Width = 542 ! Height = 392 Color = clBtnFace Font.Charset = DEFAULT_CHARSET *************** *** 31,37 **** Left = 0 Top = 0 ! Width = 697 ! Height = 391 ! ActivePage = tsGeneral Align = alClient TabOrder = 0 --- 31,37 ---- Left = 0 Top = 0 ! Width = 534 ! Height = 338 ! ActivePage = tsNames Align = alClient TabOrder = 0 *************** *** 43,48 **** Left = 0 Top = 193 ! Width = 689 ! Height = 167 Align = alClient Caption = '&Languages:' --- 43,48 ---- Left = 0 Top = 193 ! Width = 526 ! Height = 114 Align = alClient Caption = '&Languages:' *************** *** 52,57 **** Left = 2 Top = 18 ! Width = 556 ! Height = 147 Align = alClient Columns = < --- 52,57 ---- Left = 2 Top = 18 ! Width = 393 ! Height = 94 Align = alClient Columns = < *************** *** 77,84 **** end object Panel5: TPanel ! Left = 558 Top = 18 Width = 129 ! Height = 147 Align = alRight BevelOuter = bvNone --- 77,84 ---- end object Panel5: TPanel ! Left = 395 Top = 18 Width = 129 ! Height = 94 Align = alRight BevelOuter = bvNone *************** *** 115,119 **** Left = 0 Top = 0 ! Width = 689 Height = 193 Align = alTop --- 115,119 ---- Left = 0 Top = 0 ! Width = 526 Height = 193 Align = alTop *************** *** 121,125 **** TabOrder = 1 DesignSize = ( ! 689 193) object Label5: TLabel --- 121,125 ---- TabOrder = 1 DesignSize = ( ! 526 193) object Label5: TLabel *************** *** 148,152 **** end object bBrowse: TButton ! Left = 580 Top = 27 Width = 96 --- 148,152 ---- end object bBrowse: TButton ! Left = 417 Top = 27 Width = 96 *************** *** 160,164 **** Left = 20 Top = 30 ! Width = 549 Height = 24 Anchors = [akLeft, akTop, akRight] --- 160,164 ---- Left = 20 Top = 30 ! Width = 386 Height = 24 Anchors = [akLeft, akTop, akRight] *************** *** 168,172 **** Left = 20 Top = 89 ! Width = 549 Height = 25 Anchors = [akLeft, akTop, akRight] --- 168,172 ---- Left = 20 Top = 89 ! Width = 386 Height = 25 Anchors = [akLeft, akTop, akRight] *************** *** 177,181 **** end object bBrowseMaster: TButton ! Left = 580 Top = 86 Width = 96 --- 177,181 ---- end object bBrowseMaster: TButton ! Left = 417 Top = 86 Width = 96 *************** *** 187,191 **** end object bBrowseLng: TButton ! Left = 580 Top = 145 Width = 96 --- 187,191 ---- end object bBrowseLng: TButton ! Left = 417 Top = 145 Width = 96 *************** *** 199,203 **** Left = 20 Top = 148 ! Width = 549 Height = 24 Anchors = [akLeft, akTop, akRight] --- 199,203 ---- Left = 20 Top = 148 ! Width = 386 Height = 24 Anchors = [akLeft, akTop, akRight] *************** *** 211,215 **** Left = 0 Top = 277 ! Width = 689 Height = 4 Cursor = crVSplit --- 211,215 ---- Left = 0 Top = 277 ! Width = 526 Height = 4 Cursor = crVSplit *************** *** 219,223 **** Left = 0 Top = 0 ! Width = 689 Height = 70 Align = alTop --- 219,223 ---- Left = 0 Top = 0 ! Width = 526 Height = 70 Align = alTop *************** *** 225,229 **** TabOrder = 0 DesignSize = ( ! 689 70) object Label1: TLabel --- 225,229 ---- TabOrder = 0 DesignSize = ( ! 526 70) object Label1: TLabel *************** *** 244,248 **** Left = 98 Top = 7 ! Width = 576 Height = 24 Style = csDropDownList --- 244,248 ---- Left = 98 Top = 7 ! Width = 413 Height = 24 Style = csDropDownList *************** *** 255,259 **** Left = 98 Top = 37 ! Width = 576 Height = 24 Anchors = [akLeft, akTop, akRight] --- 255,259 ---- Left = 98 Top = 37 ! Width = 413 Height = 24 Anchors = [akLeft, akTop, akRight] *************** *** 264,268 **** Left = 0 Top = 70 ! Width = 689 Height = 207 Align = alTop --- 264,268 ---- Left = 0 Top = 70 ! Width = 526 Height = 207 Align = alTop *************** *** 277,282 **** Left = 0 Top = 281 ! Width = 689 ! Height = 79 Align = alClient TabOrder = 2 --- 277,282 ---- Left = 0 Top = 281 ! Width = 526 ! Height = 26 Align = alClient TabOrder = 2 *************** *** 284,293 **** Left = 297 Top = 32 ! Height = 46 end object pnControlName: TPanel Left = 1 Top = 1 ! Width = 687 Height = 31 Align = alTop --- 284,293 ---- Left = 297 Top = 32 ! Height = 1 end object pnControlName: TPanel Left = 1 Top = 1 ! Width = 524 Height = 31 Align = alTop *************** *** 299,303 **** Top = 32 Width = 296 ! Height = 46 Align = alLeft BevelOuter = bvLowered --- 299,303 ---- Top = 32 Width = 296 ! Height = 1 Align = alLeft BevelOuter = bvLowered *************** *** 317,321 **** Top = 22 Width = 294 ! Height = 23 Align = alClient ReadOnly = True --- 317,321 ---- Top = 22 Width = 294 ! Height = 25 Align = alClient ReadOnly = True *************** *** 328,333 **** Left = 300 Top = 32 ! Width = 388 ! Height = 46 Align = alClient BevelOuter = bvLowered --- 328,333 ---- Left = 300 Top = 32 ! Width = 225 ! Height = 1 Align = alClient BevelOuter = bvLowered *************** *** 336,340 **** Left = 1 Top = 1 ! Width = 386 Height = 21 Align = alTop --- 336,340 ---- Left = 1 Top = 1 ! Width = 223 Height = 21 Align = alTop *************** *** 346,351 **** Left = 1 Top = 22 ! Width = 386 ! Height = 23 Align = alClient ScrollBars = ssVertical --- 346,351 ---- Left = 1 Top = 22 ! Width = 223 ! Height = 25 Align = alClient ScrollBars = ssVertical *************** *** 362,366 **** Left = 0 Top = 198 ! Width = 689 Height = 4 Cursor = crVSplit --- 362,366 ---- Left = 0 Top = 198 ! Width = 526 Height = 4 Cursor = crVSplit *************** *** 370,374 **** Left = 0 Top = 0 ! Width = 689 Height = 198 Align = alTop --- 370,374 ---- Left = 0 Top = 0 ! Width = 526 Height = 198 Align = alTop *************** *** 388,393 **** Left = 0 Top = 202 ! Width = 689 ! Height = 158 Align = alClient TabOrder = 1 --- 388,393 ---- Left = 0 Top = 202 ! Width = 526 ! Height = 105 Align = alClient TabOrder = 1 *************** *** 395,404 **** Left = 297 Top = 32 ! Height = 125 end object pnStringName: TPanel Left = 1 Top = 1 ! Width = 687 Height = 31 Align = alTop --- 395,404 ---- Left = 297 Top = 32 ! Height = 72 end object pnStringName: TPanel Left = 1 Top = 1 ! Width = 524 Height = 31 Align = alTop *************** *** 410,414 **** Top = 32 Width = 296 ! Height = 125 Align = alLeft BevelOuter = bvLowered --- 410,414 ---- Top = 32 Width = 296 ! Height = 72 Align = alLeft BevelOuter = bvLowered *************** *** 428,432 **** Top = 22 Width = 294 ! Height = 102 Align = alClient ReadOnly = True --- 428,432 ---- Top = 22 Width = 294 ! Height = 49 Align = alClient ReadOnly = True *************** *** 439,444 **** Left = 300 Top = 32 ! Width = 388 ! Height = 125 Align = alClient BevelOuter = bvLowered --- 439,444 ---- Left = 300 Top = 32 ! Width = 225 ! Height = 72 Align = alClient BevelOuter = bvLowered *************** *** 447,451 **** Left = 1 Top = 1 ! Width = 386 Height = 21 Align = alTop --- 447,451 ---- Left = 1 Top = 1 ! Width = 223 Height = 21 Align = alTop *************** *** 457,462 **** Left = 1 Top = 22 ! Width = 386 ! Height = 102 Align = alClient ScrollBars = ssVertical --- 457,462 ---- Left = 1 Top = 22 ! Width = 223 ! Height = 49 Align = alClient ScrollBars = ssVertical *************** *** 468,471 **** --- 468,516 ---- end end + object tsNames: TTabSheet + Caption = 'Names' + ImageIndex = 3 + object gNames: TStringGrid + Left = 0 + Top = 0 + Width = 526 + Height = 266 + Align = alClient + ColCount = 3 + FixedCols = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goEditing] + TabOrder = 0 + ColWidths = ( + 140 + 183 + 181) + end + object pnNameButtons: TPanel + Left = 0 + Top = 266 + Width = 526 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + OnResize = pnNameButtonsResize + object bAddName: TButton + Left = 80 + Top = 8 + Width = 105 + Height = 25 + Caption = '&Add' + TabOrder = 0 + end + object bDelName: TButton + Left = 296 + Top = 8 + Width = 99 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + end + end + end end object MainMenu1: TMainMenu Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** LngForm.pas 25 Feb 2005 17:20:13 -0000 1.17 --- LngForm.pas 28 Feb 2005 08:24:02 -0000 1.18 *************** *** 95,98 **** --- 95,139 ---- end; + TStrHashRec = packed record + Name: Integer; + NameLen: Integer; + Value: Integer; + ValueLen: Integer; + Lng: Integer; + LngLen: Integer; + end; + + TStrHashArray = Array of TStrHashRec; + + TNamedStrIndex = class + protected + fItems: TStrHashArray; + fCount: Integer; + fText: PChar; + fTextSize: Integer; + fTextTop: Integer; + fFreeSize: Integer; + function AllocStr(const Str: String): Integer; + function GetItem(Idx: String): String; + function GetName(Idx: Integer): String; + function GetValue(Idx: Integer): String; + function GetLng(Idx: Integer): String; + procedure SetValue(Idx: Integer; V: String); + procedure SetLng(Idx: Integer; V: String); + public + constructor Create; + destructor Destroy; override; + procedure Clear; + procedure Compress; + procedure Add(AName, AValue, ALng: String); + procedure AddValues(const AText: String); + function IndexOfName(AName: String; MustExist: Boolean = True): Integer; + property Items[Idx: String]: String read GetItem; + property Names[Idx: Integer]: String read GetName; default; + property Values[Idx: Integer]: String read GetValue write SetValue; + property Lng[Idx: Integer]: String read GetLng write SetLng; + property Count: Integer read fCount; + end; + TLngItem = class Text: TStringList; *************** *** 105,108 **** --- 146,150 ---- TLngForm = class Items, Strings: TStringList; + Names: TNamedStrIndex; Name: String; Caption: String; *************** *** 195,198 **** --- 237,245 ---- Label6: TLabel; Savechanges1: TMenuItem; + tsNames: TTabSheet; + gNames: TStringGrid; + pnNameButtons: TPanel; + bAddName: TButton; + bDelName: TButton; procedure Exit1Click(Sender: TObject); procedure FormCreate(Sender: TObject); *************** *** 225,231 **** --- 272,280 ---- procedure mErrorsClick(Sender: TObject); procedure Savechanges1Click(Sender: TObject); + procedure pnNameButtonsResize(Sender: TObject); private procedure Decompile; function GetLng(aID: Integer): String; + procedure WMFillForm(var M: TMessage); message WM_User + 78; public DefDC: THandle; *************** *** 241,244 **** --- 290,294 ---- fMasterFile: String; CurLng: TLngFile; + CurNames: TNamedStrIndex; ShadowForm: TList; procedure FillLanguage; *************** *** 271,274 **** --- 321,611 ---- {$R *.DFM} + { TNamedStrIndex } + + constructor TNamedStrIndex.Create; + begin + inherited Create; + SetLength(fItems, 16); + fCount := 0; + fTextSize := 512; + GetMem(fText, fTextSize); + FillChar(fText[0], fTextSize, 0); + fTextTop := 1; // SizeOf(Char) + fFreeSize := 0; + end; + + destructor TNamedStrIndex.Destroy; + begin + SetLength(fItems, 0); + FreeMem(fText); + inherited Destroy; + end; + + procedure TNamedStrIndex.Clear; + begin + FillChar(fItems[0], SizeOf(fItems[0]) * Length(fItems), 0); + fCount := 0; + FillChar(fText[0], fTextSize, 0); + fTextTop := 1; // SizeOf(Char); + end; + + procedure TNamedStrIndex.Add(AName, AValue, ALng: String); + var + I, J, VL, LL: Integer; + begin + VL := Length(AValue); + LL := Length(ALng); + I := IndexOfName(AName, True); + if I >= 0 then + begin + with fItems[I] do + begin + if ValueLen >= VL then + begin + Inc(fFreeSize, ValueLen - VL); + if VL > 0 then Move(AValue[1], fText[Value], VL); // SizeOf(Char) + fText[Value+VL] := #0; + end else + begin + Inc(fFreeSize, ValueLen); + Value := AllocStr(AValue); + end; + ValueLen := VL; + if LngLen >= LL then + begin + Inc(fFreeSize, LngLen - LL); + if LL > 0 then Move(ALng[1], fText[Lng], LL); // SizeOf(Char) + fText[Lng+LL] := #0; + end else + begin + Inc(fFreeSize, LngLen); + Lng := AllocStr(ALng); + end; + LngLen := LL; + end; + end else + begin + I := Abs(I) - 1; + if Length(fItems) <= fCount then + SetLength(fItems, Length(fItems)*2); + if I < fCount then + Move(fItems[I], fItems[I+1], SizeOf(fItems[0]) * (fCount - I)); + Inc(fCount); + with fItems[I] do + begin + Name := AllocStr(AName); + NameLen := Length(AName); + Value := AllocStr(AValue); + ValueLen := VL; + Lng := AllocStr(ALng); + LngLen := LL; + end; + end; + end; + + procedure TNamedStrIndex.AddValues(const AText: String); + var + I, J, K, L: Integer; + S, N, V: String; + begin + S := AdjustLineBreaks(AText); + L := Length(S); + I := 1; + while I < L do + begin + J := I; + while (J <= L) do + case S[J] of + '=': + begin + N := Trim(Copy(S, I, J-I)); + Inc(J); + K := J; + while (K <= L) and (S[K] <> #13) do Inc(K); + if N <> '' then Add(N, Copy(S, J, K-J), ''); + J := K+2; + Break; + end; + #13: + begin + Inc(J, 2); + Break; + end; + else Inc(J); + end; + I := J; + end; + end; + + function TNamedStrIndex.AllocStr(const Str: String): Integer; + var + NewSz, N, L: Integer; + begin + L := Length(Str); + if L = 0 then + begin + Result := 0; + Exit; + end; + Inc(L); + if fFreeSize > fTextSize div 2 then + Compress; + NewSz := fTextTop + L; + if NewSz > fTextSize then + begin + N := fTextSize * 2; + while N < NewSz do N := N * 2; + ReallocMem(fText, N); + fTextSize := N; + end; + Result := fTextTop; + Move(Str[1], fText[Result], L-1); // SizeOf(Char) + Inc(fTextTop, L); + fText[fTextTop-1] := #0; + end; + + function TNamedStrIndex.IndexOfName(AName: String; MustExist: Boolean = True): Integer; + var + I, H, L: Integer; + LL: Integer; + E, OK: Boolean; + + function Cmp(Idx: Integer): Integer; + begin + Result := StrLIComp(PChar(AName), @fText[fItems[Idx].Name], LL); + E := Result = 0; + if E then IndexOfName := Idx + else if Result < 0 then Result := -1 else Result := 1; + end; + + begin + LL := Length(AName); + Result := 0; + E := False; + case fCount of + 0: ; + 1: case Cmp(0) of + 0: E := True; + 1: Result := 1; + end; + else + begin + L := 0; + H := fCount-1; + OK := True; + if Cmp(L) = -1 then OK := False; + if E then Exit; + if Cmp(H) = 1 then + begin + OK := False; + Result := fCount; + end; + if OK and not E then + begin + while (L < Pred(H)) do + begin + I := (L + H) div 2; + case Cmp(I) of + 0: Break; + -1: H := I; + else L := I; + end; + end; + if not E then Result := H; + end; + end; + end; + if not E and MustExist then Result := - (Result + 1); + end; + + function TNamedStrIndex.GetItem(Idx: String): String; + var + I: Integer; + begin + I := IndexOfName(Idx, True); + if I >= 0 then SetString(Result, PChar(@fText[fItems[I].Value]), fItems[I].ValueLen) // SizeOf(Char); + else Result :=''; + end; + + procedure TNamedStrIndex.Compress; + var + I, J, L: Integer; + A: TStrHashArray; + P: PChar; + begin + SetLength(A, 0); + if fFreeSize <= 0 then Exit; + A := fItems; + L := 0; + for I := 0 to fCount-1 do + with fItems[I] do + Inc(L, NameLen + ValueLen + LngLen + 3); + if L < 512 then L := 512; + GetMem(P, L); + P[0] := #0; + J := 1; // SizeOf(Char) + for I := 0 to fCount-1 do + with fItems[I] do + begin + if NameLen > 0 then + begin + Move(fText[Name], P[J], NameLen+1); + A[I].Name := J; + Inc(J, NameLen+1); + end else A[I].Name := 0; + if ValueLen > 0 then + begin + Move(fText[Value], P[J], ValueLen+1); + A[I].Value := J; + Inc(J, ValueLen+1); + end else A[I].Value := 0; + if LngLen > 0 then + begin + Move(fText[Lng], P[J], LngLen+1); + A[I].Lng := J; + Inc(J, LngLen+1); + end else A[I].Lng := 0; + end; + FreeMem(fText); + fText := P; + fTextTop := J; + fTextSize := L; + fItems := A; + fFreeSize := 0; + end; + + function TNamedStrIndex.GetName(Idx: Integer): String; + begin + if (Idx >= 0) and (Idx < Length(fItems)) then SetString(Result, PChar(@fText[fItems[Idx].Name]), fItems[Idx].NameLen) // SizeOf(Char) + else Result := ''; + end; + + function TNamedStrIndex.GetValue(Idx: Integer): String; + begin + if (Idx >= 0) and (Idx < Length(fItems)) then SetString(Result, PChar(@fText[fItems[Idx].Value]), fItems[Idx].ValueLen) // SizeOf(Char) + else Result := ''; + end; + + procedure TNamedStrIndex.SetValue(Idx: Integer; V: String); + begin + if (Idx >= 0) and (Idx < Length(fItems)) then + Add(Names[Idx], V, Lng[Idx]); + end; + + function TNamedStrIndex.GetLng(Idx: Integer): String; + begin + if (Idx >= 0) and (Idx < Length(fItems)) then SetString(Result, PChar(@fText[fItems[Idx].Lng]), fItems[Idx].LngLen) // SizeOf(Char) + else Result := ''; + end; + + procedure TNamedStrIndex.SetLng(Idx: Integer; V: String); + begin + if (Idx >= 0) and (Idx < Length(fItems)) then + Add(Names[Idx], Values[Idx], V); + end; + + + { utility routines } + function CutFileDir(const FName, Dir: String): String; begin *************** *** 419,427 **** B: PChar; BLen, BSize: Integer; ! SL{, XSL}, IDL: TStringList; T: TLngToken; Collecting: Integer; CollectStart: Integer; QC: Char; procedure AnalyzeTokens; --- 756,789 ---- B: PChar; BLen, BSize: Integer; ! SL{, XSL}, IDL, MIL: TStringList; T: TLngToken; Collecting: Integer; CollectStart: Integer; QC: Char; + NF: TLngForm; + + function GetNameRec: TLngForm; + var + I: Integer; + F: TLngForm; + begin + F := nil; + for I := 0 to AForms.Count-1 do + if (TLngForm(AForms[I]).Name = '') and (TLngForm(AForms[I]).Names <> nil) then + begin + F := AForms[I]; + Break; + end; + if F = nil then + begin + F := TLngForm.Create; + F.Name := ''; + F.Caption := ''; + F.Names := TNamedStrIndex.Create; + AForms.Add(F); + end; + Result := F; + end; + procedure AnalyzeTokens; *************** *** 429,433 **** procedure GetForm; var I: Integer; ! F: TLngForm; LastT, T: TLngToken; CT: TLngControlType; --- 791,795 ---- procedure GetForm; var I: Integer; ! F, NF: TLngForm; LastT, T: TLngToken; CT: TLngControlType; *************** *** 466,469 **** --- 828,832 ---- end; F := TLngForm.Create; + NF := GetNameRec; //L := nil; if T.ID = tidID then *************** *** 521,525 **** if LI.Text.Count = 0 then // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: Warning: no strings defined for the control "%s"', [LLine+1, LI.Name])); end; end; --- 884,892 ---- if LI.Text.Count = 0 then // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: Warning: no strings defined for the control "%s"', [LLine+1, LI.Name])) else ! if LI.ControlType = ctMenuItem then ! begin ! NF.Names.Add(LI.Name, LI.Text[0], ''); ! end; end; end; *************** *** 638,644 **** end; begin ! if Collecting = 1 then GetForm ! else GetStrings; end; --- 1005,1080 ---- end; + procedure GetNames(); + var + I: Integer; + F: TLngForm; + LastT, T: TLngToken; + LLine, LastLine: Integer; + LI: TLngString; + CP: String; + + function GetNext: TLngToken; + var T: TLngToken; + begin + Result := nil; + while I < Tokens.Count do + begin + T := Tokens[I]; + Inc(I); + if T.ID <> tidChar then + begin + Result := T; + LastLine := T.Line; + LastT := T; + Break; + end; + end; + end; + + begin + F := GetNameRec; + repeat + T := GetNext; + if T <> nil then + begin + if T.ID = tidID then + begin + CP := T.S; + if (CP <> '') then + begin + LLine := LastLine; + T := GetNext; + if T <> nil then + begin + if T.ID = tidString then + begin + if F.Names.IndexOfName(CP, True) >= 0 then + begin + F.Names.Add(CP, T.S, ''); + end else + // Line numbers should start from "1", not from "0" (hence, "+1") + Errors.Add(Format('Line %5.5d: ERROR: duplicate identifier "%s"', [LLine+1, CP])); + end else + // Line numbers should start from "1", not from "0" (hence, "+1") + Errors.Add(Format('Line %5.5d: ERROR: an identifier found when a string expected', [LastLine+1])); + end else + // Line numbers should start from "1", not from "0" (hence, "+1") + Errors.Add(Format('Line %5.5d: ERROR: undefined identifier (no corresponding string detected)', [LastLine+1])); + end else + // Line numbers should start from "1", not from "0" (hence, "+1") + Errors.Add(Format('Line %5.5d: ERROR: empty names are not allowed', [T.Line+1])); + end else + // Line numbers should start from "1", not from "0" (hence, "+1") + Errors.Add(Format('Line %5.5d: ERROR: unexpected string "%s" when identifier expected', [T.Line+1, T.S])); + end; + until T = nil; + end; + begin ! case Collecting of ! 1: GetForm; ! 2: GetStrings; ! 3: GetNames; ! end; end; *************** *** 669,701 **** if Collecting > 0 then begin ! if Collecting = 1 then Msg := 'FORM' ! else Msg := 'STRINGS'; case CT of ! ctForm: begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the FORM definition', [aLine+1, Msg])); ! AnalyzeTokens; ! Collecting := 1; ! CollectStart := aLine; ! end; ! ctStrings: begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine+1, Msg])); ! AnalyzeTokens; ! Collecting := 2; ! CollectStart := aLine; ! end; ! // Line numbers should start from "1", not from "0" (hence, "+1") ! ctEndStrings: if Collecting = 1 then Errors.Add(Format('Line %5.5d: WARNING: the ENDSTRINGS found when ENDFORM expected', [aLine+1])) ! else begin ! AnalyzeTokens; ! Collecting := 0; ! end; // Line numbers should start from "1", not from "0" (hence, "+1") ! ctEndForm: if Collecting = 2 then Errors.Add(Format('Line %5.5d: WARNING: the ENDFORM found when ENDSTRINGS expected', [aLine+1])) ! else begin ! AnalyzeTokens; ! Collecting := 0; ! end; else begin T := nil; --- 1105,1159 ---- if Collecting > 0 then begin ! case Collecting of ! 1: Msg := 'FORM'; ! 2: Msg := 'STRINGS'; ! else Msg := 'NAMES'; ! end; case CT of ! ctForm: ! begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the FORM definition', [aLine+1, Msg])); ! AnalyzeTokens; ! Collecting := 1; ! CollectStart := aLine; ! end; ! ctEndForm: ! if Collecting <> 1 then Errors.Add(Format('Line %5.5d: WARNING: the ENDFORM found without the FORM', [aLine+1])) ! else ! begin ! AnalyzeTokens; ! Collecting := 0; ! end; ! ctStrings: ! begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine+1, Msg])); ! AnalyzeTokens; ! Collecting := 2; ! CollectStart := aLine; ! end; ! ctEndStrings: ! if Collecting <> 2 then Errors.Add(Format('Line %5.5d: WARNING: the ENDSTRINGS found without the STRINGS', [aLine+1])) ! else ! begin ! AnalyzeTokens; ! Collecting := 0; ! end; ! ctNames: ! begin ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine+1, Msg])); ! AnalyzeTokens; ! Collecting := 3; ! CollectStart := aLine; ! end; // Line numbers should start from "1", not from "0" (hence, "+1") ! ctEndNames: ! if Collecting <> 3 then Errors.Add(Format('Line %5.5d: WARNING: the ENDNAMES found without the NAMES', [aLine+1])) ! else ! begin ! AnalyzeTokens; ! Collecting := 0; ! end; else begin T := nil; *************** *** 741,744 **** --- 1199,1208 ---- FreeList(Tokens); end else + if CT = ctNames then + begin + Collecting := 3; + CollectStart := aLine; + FreeList(Tokens); + end else begin case aID of *************** *** 777,780 **** --- 1241,1245 ---- Tokens := nil; B := nil; + MIL := nil; BSize := 0; Collecting := 0; *************** *** 805,808 **** --- 1270,1276 ---- IDL.AddObject('ENDSTRINGS', Pointer(ctEndStrings)); IDL.AddObject('ACTION', Pointer(ctAction)); + IDL.AddObject('NAMES', Pointer(ctNames)); + IDL.AddObject('ENDNAMES', Pointer(ctEndNames)); + //XSL := TStringList.Create; SL := TStringList.Create; *************** *** 887,890 **** --- 1355,1381 ---- SL.Free; IDL.Free; + NF := GetNameRec; + if NF <> nil then + begin + I := AForms.IndexOf(NF); + if I >= 0 then + begin + AForms.Delete(I); + AForms.Add(NF); + end; + end; + { + if NF <> nil then + begin + MIL := TStringList.Create; + for I := 0 to NF.Names.Count-1 do + begin + MIL.Add(Format(' %-40s %s', [NF.Names[I], MakeStr(NF.Names.Values[I])])); + end; + MIL.Sorted := True; + MIL.SaveToFile('menus.lnc'); + MIL.Free; + end; + } end; *************** *** 923,926 **** --- 1414,1433 ---- F: TLngForm; LS: TLngString; + NF, LNF: TLngForm; + S, SS: String; + + function FindNames(L: TList): TLngForm; + var + I: Integer; + begin + Result := nil; + if L = nil then Exit; + for I := 0 to L.Count-1 do + begin + Result := L[I]; + if (Result.Name = '') and (Result.Names <> nil) then Exit; + end; + Result := nil; + end; function WorkStrings(L: TStringList): Boolean; *************** *** 961,964 **** --- 1468,1474 ---- cbForm.Sorted := True; gStrings.RowCount := 2; + gNames.RowCount := 2; + NF := FindNames(FormList); + LNF := FindNames(CurLng); for I := 0 to FormList.Count-1 do begin *************** *** 980,984 **** gStrings.Rows[J][2] := LS.S; end; ! end; end; if cbForm.Items.Count > 0 then --- 1490,1495 ---- gStrings.Rows[J][2] := LS.S; end; ! end else ! if F.Names <> nil then NF := F; end; if cbForm.Items.Count > 0 then *************** *** 992,995 **** --- 1503,1544 ---- if gStrings.RowCount > 1 then gStrings.Col := 2; CalcRowHeights(gStrings); + + gNames.DefaultRowHeight := gStrings.DefaultRowHeight; + if CurNames = nil then CurNames := TNamedStrIndex.Create + else CurNames.Clear; + + gNames.Rows[1][0] := ''; + gNames.Rows[1][1] := ''; + gNames.Rows[1][2] := ''; + if NF <> nil then + begin + for I := 0 to NF.Names.Count-1 do + begin + S := NF.Names[I]; + if LNF <> nil then SS := LNF.Names.Items[S] else SS := ''; + CurNames.Add(S, NF.Names.Values[I], SS); + end; + end; + if LNF <> nil then + begin + for I := 0 to LNF.Names.Count-1 do + begin + S := LNF.Names[I]; + if NF <> nil then J := NF.Names.IndexOfName(S, True) + else J := -1; + if J < 0 then CurNames.Add(S, '', LNF.Names.Values[I]); + end; + end; + gNames.RowCount := CurNames.Count+1; + for I := 0 to CurNames.Count-1 do + begin + gNames.Rows[I+1][0] := CurNames[I]; + gNames.Rows[I+1][1] := CurNames.Values[I]; + gNames.Rows[I+1][2] := CurNames.Lng[I]; + end; + gNames.Rows[0][0] := 'Name ID'; + gNames.Rows[0][1] := 'English'; + gNames.Rows[0][2] := 'National'; + end; *************** *** 1116,1120 **** --- 1665,1675 ---- procedure TForm1.cbFormChange(Sender: TObject); begin + PostMessage(Handle, WM_User+78, 0, 0); + end; + + procedure TForm1.WMFillForm(var M: TMessage); + begin FillForm; + inherited; end; *************** *** 1791,1794 **** --- 2346,2351 ---- if AllowChange and (L <> CurLng) then begin + UpdateForm; + CurForm := nil; CheckLngChange; CurLng := L; *************** *** 1804,1807 **** --- 2361,2365 ---- tsForms.Font.Assign(F); tsStrings.Font.Assign(F); + tsNames.Font.Assign(F); finally F.Free; *************** *** 1809,1813 **** FillLanguage; cbForm.ItemIndex := 0; ! FillForm; gForm.Col := 2; gStrings.Col := 2; --- 2367,2371 ---- FillLanguage; cbForm.ItemIndex := 0; ! PostMessage(Handle, WM_User + 78, 0, 0); gForm.Col := 2; gStrings.Col := 2; *************** *** 2126,2129 **** --- 2684,2696 ---- end; WriteLn('ENDSTRINGS'#13#10); + end else + if LF.Names <> nil then + begin + WriteLn('NAMES'); + for I := 0 to LF.Names.Count-1 do + begin + WriteLn(Format(' %-40s %s', [LF.Names[I], MakeStr(LF.Names.Values[I])])); + end; + WriteLn('ENDNAMES'#13#10); end; end; *************** *** 2435,2438 **** --- 3002,3016 ---- end; + procedure TForm1.pnNameButtonsResize(Sender: TObject); + var + X, Y: Integer; + begin + X := pnNameButtons.Width div 2; + Y := (X - bAddName.Width) div 2; + if Y < 0 then Y := 0; + bAddName.Left := Y; + bDelName.Left := X + Y; + end; + initialization WDir := ExtractFilePath(ExpandFileName(ParamStr(0))); |
From: Maxim M. <max...@us...> - 2005-02-25 17:20:24
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7719/lngcompiler Modified Files: LngForm.dfm LngForm.pas Log Message: wip: grabbing for names Index: LngForm.dfm =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.dfm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LngForm.dfm 18 May 2002 16:14:40 -0000 1.10 --- LngForm.dfm 25 Feb 2005 17:20:12 -0000 1.11 *************** *** 32,39 **** Top = 0 Width = 697 ! Height = 399 ActivePage = tsGeneral Align = alClient - TabIndex = 0 TabOrder = 0 OnChanging = pcBookChanging --- 32,38 ---- Top = 0 Width = 697 ! Height = 391 ActivePage = tsGeneral Align = alClient TabOrder = 0 OnChanging = pcBookChanging *************** *** 45,49 **** Top = 193 Width = 689 ! Height = 175 Align = alClient Caption = '&Languages:' --- 44,48 ---- Top = 193 Width = 689 ! Height = 167 Align = alClient Caption = '&Languages:' *************** *** 54,58 **** Top = 18 Width = 556 ! Height = 155 Align = alClient Columns = < --- 53,57 ---- Top = 18 Width = 556 ! Height = 147 Align = alClient Columns = < *************** *** 81,85 **** Top = 18 Width = 129 ! Height = 155 Align = alRight BevelOuter = bvNone --- 80,84 ---- Top = 18 Width = 129 ! Height = 147 Align = alRight BevelOuter = bvNone *************** *** 249,253 **** Style = csDropDownList Anchors = [akLeft, akTop, akRight] ! ItemHeight = 0 TabOrder = 0 OnChange = cbFormChange --- 248,252 ---- Style = csDropDownList Anchors = [akLeft, akTop, akRight] ! ItemHeight = 16 TabOrder = 0 OnChange = cbFormChange *************** *** 279,283 **** Top = 281 Width = 689 ! Height = 87 Align = alClient TabOrder = 2 --- 278,282 ---- Top = 281 Width = 689 ! Height = 79 Align = alClient TabOrder = 2 *************** *** 285,291 **** Left = 297 Top = 32 ! Width = 3 ! Height = 44 ! Cursor = crHSplit end object pnControlName: TPanel --- 284,288 ---- Left = 297 Top = 32 ! Height = 46 end object pnControlName: TPanel *************** *** 302,306 **** Top = 32 Width = 296 ! Height = 44 Align = alLeft BevelOuter = bvLowered --- 299,303 ---- Top = 32 Width = 296 ! Height = 46 Align = alLeft BevelOuter = bvLowered *************** *** 320,324 **** Top = 22 Width = 294 ! Height = 21 Align = alClient ReadOnly = True --- 317,321 ---- Top = 22 Width = 294 ! Height = 23 Align = alClient ReadOnly = True *************** *** 332,336 **** Top = 32 Width = 388 ! Height = 44 Align = alClient BevelOuter = bvLowered --- 329,333 ---- Top = 32 Width = 388 ! Height = 46 Align = alClient BevelOuter = bvLowered *************** *** 350,354 **** Top = 22 Width = 386 ! Height = 21 Align = alClient ScrollBars = ssVertical --- 347,351 ---- Top = 22 Width = 386 ! Height = 23 Align = alClient ScrollBars = ssVertical *************** *** 392,396 **** Top = 202 Width = 689 ! Height = 156 Align = alClient TabOrder = 1 --- 389,393 ---- Top = 202 Width = 689 ! Height = 158 Align = alClient TabOrder = 1 *************** *** 398,404 **** Left = 297 Top = 32 ! Width = 3 ! Height = 123 ! Cursor = crHSplit end object pnStringName: TPanel --- 395,399 ---- Left = 297 Top = 32 ! Height = 125 end object pnStringName: TPanel *************** *** 415,419 **** Top = 32 Width = 296 ! Height = 123 Align = alLeft BevelOuter = bvLowered --- 410,414 ---- Top = 32 Width = 296 ! Height = 125 Align = alLeft BevelOuter = bvLowered *************** *** 433,437 **** Top = 22 Width = 294 ! Height = 100 Align = alClient ReadOnly = True --- 428,432 ---- Top = 22 Width = 294 ! Height = 102 Align = alClient ReadOnly = True *************** *** 445,449 **** Top = 32 Width = 388 ! Height = 123 Align = alClient BevelOuter = bvLowered --- 440,444 ---- Top = 32 Width = 388 ! Height = 125 Align = alClient BevelOuter = bvLowered *************** *** 463,467 **** Top = 22 Width = 386 ! Height = 100 Align = alClient ScrollBars = ssVertical --- 458,462 ---- Top = 22 Width = 386 ! Height = 102 Align = alClient ScrollBars = ssVertical Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LngForm.pas 29 Nov 2004 15:54:42 -0000 1.16 --- LngForm.pas 25 Feb 2005 17:20:13 -0000 1.17 *************** *** 56,60 **** id_ctEndForm, id_ctEndStrings, ! idAction ); --- 56,62 ---- id_ctEndForm, id_ctEndStrings, ! idAction, ! id_ctNames, ! id_ctEndNames ); *************** *** 80,84 **** ctEndForm, ctEndStrings, ! ctAction ); --- 82,88 ---- ctEndForm, ctEndStrings, ! ctAction, ! ctNames, ! ctEndNames ); |
From: Maxim M. <max...@us...> - 2004-11-29 15:55:06
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13972 Modified Files: LngForm.pas Log Message: Added Galician. Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** LngForm.pas 14 Sep 2004 07:41:06 -0000 1.15 --- LngForm.pas 29 Nov 2004 15:54:42 -0000 1.16 *************** *** 350,354 **** DoAdd('Croatian', 28, EASTEUROPE_CHARSET); DoAdd('Chinese (Traditional)', 29, CHINESEBIG5_CHARSET); ! DoAdd('Hebrew', 30, HEBREW_CHARSET); end; --- 350,356 ---- DoAdd('Croatian', 28, EASTEUROPE_CHARSET); DoAdd('Chinese (Traditional)', 29, CHINESEBIG5_CHARSET); ! DoAdd('Catalan', 30, ANSI_CHARSET); ! DoAdd('Hebrew', 31, HEBREW_CHARSET); ! DoAdd('Galician', 32, ANSI_CHARSET); end; |
From: Maxim M. <max...@us...> - 2004-09-14 07:41:14
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30560 Modified Files: LngForm.pas Log Message: new language Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** LngForm.pas 14 Jan 2004 13:51:41 -0000 1.14 --- LngForm.pas 14 Sep 2004 07:41:06 -0000 1.15 *************** *** 350,353 **** --- 350,354 ---- DoAdd('Croatian', 28, EASTEUROPE_CHARSET); DoAdd('Chinese (Traditional)', 29, CHINESEBIG5_CHARSET); + DoAdd('Hebrew', 30, HEBREW_CHARSET); end; |
From: Maxim M. <max...@us...> - 2004-01-14 13:51:44
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1:/tmp/cvs-serv1117 Modified Files: LngForm.pas Log Message: Chinese (Traditional) was invalid. Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LngForm.pas 9 Jan 2004 17:51:19 -0000 1.13 --- LngForm.pas 14 Jan 2004 13:51:41 -0000 1.14 *************** *** 347,352 **** DoAdd('Greek' ,25, GREEK_CHARSET); DoAdd('Serbian (Cyr)',26, RUSSIAN_CHARSET); ! DoAdd('Croatian', 27, EASTEUROPE_CHARSET); ! DoAdd('Chinese (Traditional)', 28, CHINESEBIG5_CHARSET); end; --- 347,353 ---- DoAdd('Greek' ,25, GREEK_CHARSET); DoAdd('Serbian (Cyr)',26, RUSSIAN_CHARSET); ! DoAdd('Slovak', 27, EASTEUROPE_CHARSET); ! DoAdd('Croatian', 28, EASTEUROPE_CHARSET); ! DoAdd('Chinese (Traditional)', 29, CHINESEBIG5_CHARSET); end; |
From: Maxim M. <max...@us...> - 2004-01-09 17:51:22
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1:/tmp/cvs-serv11302 Modified Files: LngForm.pas Log Message: Added "Traditional Chinese" Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LngForm.pas 14 Oct 2003 15:15:59 -0000 1.12 --- LngForm.pas 9 Jan 2004 17:51:19 -0000 1.13 *************** *** 338,342 **** DoAdd('Portuguese', 16, ANSI_CHARSET); DoAdd('Lithuanian', 17, BALTIC_CHARSET); ! DoAdd('Chinese', 18, DEFAULT_CHARSET); DoAdd('French', 19, ANSI_CHARSET); DoAdd('Norwegian', 20, ANSI_CHARSET); --- 338,342 ---- DoAdd('Portuguese', 16, ANSI_CHARSET); DoAdd('Lithuanian', 17, BALTIC_CHARSET); ! DoAdd('Chinese (Simplified)', 18, GB2312_CHARSET); DoAdd('French', 19, ANSI_CHARSET); DoAdd('Norwegian', 20, ANSI_CHARSET); *************** *** 348,351 **** --- 348,352 ---- DoAdd('Serbian (Cyr)',26, RUSSIAN_CHARSET); DoAdd('Croatian', 27, EASTEUROPE_CHARSET); + DoAdd('Chinese (Traditional)', 28, CHINESEBIG5_CHARSET); end; |
From: Maxim M. <max...@us...> - 2003-10-14 15:16:09
|
Update of /cvsroot/lngcompiler/lngcompiler In directory sc8-pr-cvs1:/tmp/cvs-serv24549 Modified Files: LngForm.pas Log Message: Support for Croatian Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LngForm.pas 4 Jul 2002 11:09:10 -0000 1.11 --- LngForm.pas 14 Oct 2003 15:15:59 -0000 1.12 *************** *** 347,350 **** --- 347,351 ---- DoAdd('Greek' ,25, GREEK_CHARSET); DoAdd('Serbian (Cyr)',26, RUSSIAN_CHARSET); + DoAdd('Croatian', 27, EASTEUROPE_CHARSET); end; |
From: Maxim M. <max...@us...> - 2002-07-04 11:09:13
|
Update of /cvsroot/lngcompiler/lngcompiler In directory usw-pr-cvs1:/tmp/cvs-serv17637 Modified Files: LngForm.pas Log Message: Fixed modified-flag checking. Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LngForm.pas 15 Jun 2002 16:22:42 -0000 1.10 --- LngForm.pas 4 Jul 2002 11:09:10 -0000 1.11 *************** *** 878,881 **** --- 878,882 ---- IDL.Free; end; + end; *************** *** 1158,1162 **** LI := Pointer(OL.Objects[I]); LLI := Pointer(LF.Items.Objects[I]); ! if LI.Text.Count <> LLI.Text.Count then LF.Modified := True else for J := 0 to LI.Text.Count-1 do if LI.Text[J] <> LLI.Text[J] then --- 1159,1166 ---- LI := Pointer(OL.Objects[I]); LLI := Pointer(LF.Items.Objects[I]); ! if LI.Text.Count <> LLI.Text.Count then ! begin ! LF.Modified := True ! end else for J := 0 to LI.Text.Count-1 do if LI.Text[J] <> LLI.Text[J] then *************** *** 1802,1810 **** procedure TForm1.CheckLngChange; ! var I,J{,K}: Integer; ! OL: TStringList; ! //CF: TLngForm; ! LI, LLI: TLngString; ! XX: Boolean; begin OL := nil; --- 1806,1816 ---- procedure TForm1.CheckLngChange; ! var ! I,J{,K}: Integer; ! OL: TStringList; ! CF: TLngForm; ! LF: TLngFile; ! LI, LLI: TLngString; ! XX: Boolean; begin OL := nil; *************** *** 1814,1825 **** XX := True; for I := 0 to CurLng.Count-1 do ! with TLngForm(CurLng[I]) do ! if (Name = '') and (Strings <> nil) then begin if XX then begin XX := False; ! OL.Assign(Strings); ! Strings.Clear; for J := 1 to gStrings.RowCount-1 do begin --- 1820,1832 ---- XX := True; for I := 0 to CurLng.Count-1 do ! begin ! CF := CurLng[I]; ! if (CF.Name = '') and (CF.Strings <> nil) then begin if XX then begin XX := False; ! OL.Assign(CF.Strings); ! CF.Strings.Clear; for J := 1 to gStrings.RowCount-1 do begin *************** *** 1827,1853 **** LI.Name := gStrings.Rows[J][0]; LI.S := gStrings.Rows[J][2]; ! Strings.AddObject(AnsiUpperCase(LI.Name), LI); end; ! if OL.Count <> Strings.Count ! then Modified := True else begin for J := 0 to OL.Count-1 do ! if OL[J] = Strings[J] then begin LI := Pointer(OL.Objects[J]); ! LLI := Pointer(Strings.Objects[J]); if LI.S <> LLI.S then begin ! Modified := True; Break; end; end else begin ! Modified := True; Break; end; end; ! end else FreeList(Strings); end; finally FreeList(OL); --- 1834,1864 ---- LI.Name := gStrings.Rows[J][0]; LI.S := gStrings.Rows[J][2]; ! CF.Strings.AddObject(AnsiUpperCase(LI.Name), LI); end; ! if OL.Count <> CF.Strings.Count ! then ! begin ! CF.Modified := True ! end else begin for J := 0 to OL.Count-1 do ! if OL[J] = CF.Strings[J] then begin LI := Pointer(OL.Objects[J]); ! LLI := Pointer(CF.Strings.Objects[J]); if LI.S <> LLI.S then begin ! CF.Modified := True; Break; end; end else begin ! CF.Modified := True; Break; end; end; ! end else FreeList(CF.Strings); end; + end; finally FreeList(OL); *************** *** 2143,2147 **** procedure TForm1.Savechanges1Click(Sender: TObject); begin ! SaveChanges(); end; --- 2154,2158 ---- procedure TForm1.Savechanges1Click(Sender: TObject); begin ! SaveChanges; end; |
From: Andrew K. L. <lov...@us...> - 2002-06-15 16:22:45
|
Update of /cvsroot/lngcompiler/lngcompiler In directory usw-pr-cvs1:/tmp/cvs-serv19979/lngcompiler Modified Files: LngForm.pas Log Message: Error messages now display the line numbers starting from 1, not from "0". Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LngForm.pas 18 May 2002 16:14:40 -0000 1.9 --- LngForm.pas 15 Jun 2002 16:22:42 -0000 1.10 *************** *** 451,455 **** if T = nil then begin ! Errors.Add(Format('Line %5.5d: WARNING: no FORM data collected', [CollectStart])); Exit; end; --- 451,456 ---- if T = nil then begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: no FORM data collected', [CollectStart+1])); Exit; end; *************** *** 460,464 **** if (T.S = '') or (T.S[1] in ['0'..'9']) then begin ! Errors.Add(Format('Line %5.5d: ERROR: a form name cannot start with a digit or be empty', [T.Line])); F.Free; Exit; --- 461,466 ---- if (T.S = '') or (T.S[1] in ['0'..'9']) then begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: a form name cannot start with a digit or be empty', [T.Line+1])); F.Free; Exit; *************** *** 468,472 **** if (T <> nil) and (T.ID = tidString) then try ! if T.S = '' then Errors.Add(Format('Line %5.5d: WARNING: no FORM caption found', [T.Line])); F.Caption := T.S; AForms.Add(F); --- 470,475 ---- if (T <> nil) and (T.ID = tidString) then try ! // Line numbers should start from "1", not from "0" (hence, "+1") ! if T.S = '' then Errors.Add(Format('Line %5.5d: WARNING: no FORM caption found', [T.Line+1])); F.Caption := T.S; AForms.Add(F); *************** *** 486,495 **** if (CP = '') or (CP[1] in ['0'..'9']) then begin ! Errors.Add(Format('Line %5.5d: ERROR: control name cannot start with a digit', [LastLine])); end else begin if F.Items.IndexOf(CP) >= 0 then begin ! Errors.Add(Format('Line %5.5d: ERROR: duplicate control name: %s', [LastLine, T.S])); end else begin --- 489,500 ---- if (CP = '') or (CP[1] in ['0'..'9']) then begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: control name cannot start with a digit', [LastLine+1])); end else begin if F.Items.IndexOf(CP) >= 0 then begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: duplicate control name: %s', [LastLine+1, T.S])); end else begin *************** *** 505,518 **** until (T = nil) or (T.ID <> tidString); if LI.Text.Count = 0 then ! Errors.Add(Format('Line %5.5d: Warning: no strings defined for the control "%s"', [LLine, LI.Name])); end; end; end else begin ! Errors.Add(Format('Line %5.5d: ERROR: the name of a control must be an ID, not a string', [T.Line])); end; end else begin ! Errors.Add(Format('Line %5.5d: ERROR: cannot find the control name', [LastLine])); end; end; --- 510,526 ---- until (T = nil) or (T.ID <> tidString); if LI.Text.Count = 0 then ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: Warning: no strings defined for the control "%s"', [LLine+1, LI.Name])); end; end; end else begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: the name of a control must be an ID, not a string', [T.Line+1])); end; end else begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: cannot find the control name', [LastLine+1])); end; end; *************** *** 521,530 **** end else begin ! Errors.Add(Format('Line %5.5d: ERROR: cannot find the form caption', [LastLine])); F.Free; end; end else begin ! Errors.Add(Format('Line %5.5d: ERROR: the name of a form must be an ID, not a string', [T.Line])); F.Free; end; --- 529,540 ---- end else begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: cannot find the form caption', [LastLine+1])); F.Free; end; end else begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: the name of a form must be an ID, not a string', [T.Line+1])); F.Free; end; *************** *** 600,612 **** F.Strings.AddObject(UpperCase(CP), LI); end else ! Errors.Add(Format('Line %5.5d: ERROR: duplicate identifier "%s"', [LLine, CP])); end else ! Errors.Add(Format('Line %5.5d: ERROR: an identifier found when a string expected', [LastLine])); end else ! Errors.Add(Format('Line %5.5d: ERROR: undefined identifier (no corresponding string detected)', [LastLine])); end else ! Errors.Add(Format('Line %5.5d: ERROR: an identifier cannot start with a digit', [T.Line])); end else ! Errors.Add(Format('Line %5.5d: ERROR: unexpected string "%s" when identifier expected', [T.Line, T.S])); end; until T = nil; --- 610,627 ---- F.Strings.AddObject(UpperCase(CP), LI); end else ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: duplicate identifier "%s"', [LLine+1, CP])); end else ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: an identifier found when a string expected', [LastLine+1])); end else ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: undefined identifier (no corresponding string detected)', [LastLine+1])); end else ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: an identifier cannot start with a digit', [T.Line+1])); end else ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: ERROR: unexpected string "%s" when identifier expected', [T.Line+1, T.S])); end; until T = nil; *************** *** 648,652 **** case CT of ctForm: begin ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the FORM definition', [aLine, Msg])); AnalyzeTokens; Collecting := 1; --- 663,668 ---- case CT of ctForm: begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the FORM definition', [aLine+1, Msg])); AnalyzeTokens; Collecting := 1; *************** *** 654,668 **** end; ctStrings: begin ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine, Msg])); AnalyzeTokens; Collecting := 2; CollectStart := aLine; end; ! ctEndStrings: if Collecting = 1 then Errors.Add(Format('Line %5.5d: WARNING: the ENDSTRINGS found when ENDFORM expected', [aLine])) else begin AnalyzeTokens; Collecting := 0; end; ! ctEndForm: if Collecting = 2 then Errors.Add(Format('Line %5.5d: WARNING: the ENDFORM found when ENDSTRINGS expected', [aLine])) else begin AnalyzeTokens; --- 670,687 ---- end; ctStrings: begin ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine+1, Msg])); AnalyzeTokens; Collecting := 2; CollectStart := aLine; end; ! // Line numbers should start from "1", not from "0" (hence, "+1") ! ctEndStrings: if Collecting = 1 then Errors.Add(Format('Line %5.5d: WARNING: the ENDSTRINGS found when ENDFORM expected', [aLine+1])) else begin AnalyzeTokens; Collecting := 0; end; ! // Line numbers should start from "1", not from "0" (hence, "+1") ! ctEndForm: if Collecting = 2 then Errors.Add(Format('Line %5.5d: WARNING: the ENDFORM found when ENDSTRINGS expected', [aLine+1])) else begin AnalyzeTokens; *************** *** 718,722 **** else Msg := 'Symbol'; end; ! Errors.Add(Format('Line %5.5d: WARNING: unexpectected %s while FORM or STRINGS expected', [aLine, Msg])); end; end; --- 737,742 ---- else Msg := 'Symbol'; end; ! // Line numbers should start from "1", not from "0" (hence, "+1") ! Errors.Add(Format('Line %5.5d: WARNING: unexpectected %s while FORM or STRINGS expected', [aLine+1, Msg])); end; end; |
From: Maxim M. <max...@us...> - 2002-05-18 16:14:43
|
Update of /cvsroot/lngcompiler/lngcompiler In directory usw-pr-cvs1:/tmp/cvs-serv3302 Modified Files: LngForm.dfm LngForm.pas Log Message: Support for "TAction" component; Changed shortcuts for Save and Compile to Alt+S and Alt+C. Index: LngForm.dfm =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.dfm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LngForm.dfm 5 Apr 2002 18:47:32 -0000 1.9 --- LngForm.dfm 18 May 2002 16:14:40 -0000 1.10 *************** *** 481,490 **** object Savechanges1: TMenuItem Caption = '&Save changes' ! ShortCut = 16467 OnClick = Savechanges1Click end object Save1: TMenuItem Caption = '&Compile LNG' ! ShortCut = 16451 OnClick = Save1Click end --- 481,490 ---- object Savechanges1: TMenuItem Caption = '&Save changes' ! ShortCut = 32851 OnClick = Savechanges1Click end object Save1: TMenuItem Caption = '&Compile LNG' ! ShortCut = 32835 OnClick = Save1Click end Index: LngForm.pas =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** LngForm.pas 5 Apr 2002 16:16:21 -0000 1.8 --- LngForm.pas 18 May 2002 16:14:40 -0000 1.9 *************** *** 51,55 **** idComboBox, idToolbar97, ! idMemo ); --- 51,60 ---- idComboBox, idToolbar97, ! idMemo, ! id_ctForm, ! id_ctStrings, ! id_ctEndForm, ! id_ctEndStrings, ! idAction ); *************** *** 74,78 **** ctStrings, ctEndForm, ! ctEndStrings ); --- 79,84 ---- ctStrings, ctEndForm, ! ctEndStrings, ! ctAction ); *************** *** 768,771 **** --- 774,778 ---- IDL.AddObject('ENDFORM', Pointer(ctEndForm)); IDL.AddObject('ENDSTRINGS', Pointer(ctEndStrings)); + IDL.AddObject('ACTION', Pointer(ctAction)); //XSL := TStringList.Create; SL := TStringList.Create; *************** *** 1261,1265 **** ctToolbar: S := 'Toolbar'; ctMemo: S := 'Memo'; ! else S := 'unknown'; end; gForm.Rows[I][1] := '<'+S+'>'; --- 1268,1273 ---- ctToolbar: S := 'Toolbar'; ctMemo: S := 'Memo'; ! ctAction: S := 'Action'; ! else S := 'unknown'; end; gForm.Rows[I][1] := '<'+S+'>'; *************** *** 1665,1668 **** --- 1673,1677 ---- idToolbar97: S := 'Toolbar'; idMemo: S := 'Memo'; + idAction: S := 'Action'; else S := 'UnknownControl'; end; *************** *** 2054,2058 **** ctToolbar: S := 'Toolbar'; ctMemo: S := 'Memo'; ! else S := 'Unknown' end; S := ' ' + S + ' ' + LI.Name + ' '; --- 2063,2068 ---- ctToolbar: S := 'Toolbar'; ctMemo: S := 'Memo'; ! ctAction: S := 'Action'; ! else S := 'Unknown' end; S := ' ' + S + ' ' + LI.Name + ' '; |
From: Andrew K. L. <lov...@us...> - 2002-04-10 18:35:54
|
Update of /cvsroot/lngcompiler/lngcompiler In directory usw-pr-cvs1:/tmp/cvs-serv26104/lngcompiler Modified Files: LngCmp.txt Log Message: Added tip about editing the LNC files with external editor. Index: LngCmp.txt =================================================================== RCS file: /cvsroot/lngcompiler/lngcompiler/LngCmp.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LngCmp.txt 7 Apr 2002 18:53:13 -0000 1.2 --- LngCmp.txt 10 Apr 2002 07:39:38 -0000 1.3 *************** *** 40,43 **** --- 40,51 ---- + Tips: + + You can use any text editor to edit the LNC files: they are plain text + files. This is useful if you want to quickly find a particular message, + caption or word. Don't forget to close LNG Compiler before you start + editing in an external editor. + + Latest version with sources (Borland Delphi 2.0-6.0) can be found at https://sourceforge.net/projects/lngcompiler/ |