Changeset 167


Ignore:
Timestamp:
Aug 9, 2018, 3:43:27 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Update Common package.
  • Fixed: Remember forms dimensions after application restart.
Location:
branches/generator
Files:
2 added
32 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms

    • Property svn:ignore
      •  

        old new  
        11*.lrj
         2*.lrt
  • branches/generator/Forms/UFormGrammer.lfm

    r136 r167  
    77  ClientHeight = 346
    88  ClientWidth = 548
     9  DesignTimePPI = 120
     10  OnClose = FormClose
    911  OnShow = FormShow
    10   LCLVersion = '1.8.0.4'
     12  LCLVersion = '1.8.2.0'
    1113  object Label1: TLabel
    1214    Left = 15
    13     Height = 23
     15    Height = 20
    1416    Top = 22
    15     Width = 75
     17    Width = 63
    1618    Caption = 'Start rule:'
    1719    ParentColor = False
     
    1921  object ComboBoxStartRule: TComboBox
    2022    Left = 168
    21     Height = 37
     23    Height = 28
    2224    Top = 22
    2325    Width = 272
    24     ItemHeight = 0
     26    ItemHeight = 20
    2527    Style = csDropDownList
    2628    TabOrder = 0
     
    4850  object Label2: TLabel
    4951    Left = 16
    50     Height = 23
     52    Height = 20
    5153    Top = 80
    52     Width = 130
     54    Width = 113
    5355    Caption = 'White space rule:'
    5456    ParentColor = False
     
    5658  object ComboBoxWhiteSpaceRule: TComboBox
    5759    Left = 168
    58     Height = 37
     60    Height = 28
    5961    Top = 72
    6062    Width = 272
    61     ItemHeight = 0
     63    ItemHeight = 20
    6264    Style = csDropDownList
    6365    TabOrder = 3
  • branches/generator/Forms/UFormGrammer.pas

    r136 r167  
    2020    Label1: TLabel;
    2121    Label2: TLabel;
     22    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2223    procedure FormShow(Sender: TObject);
    2324  private
     
    3637{$R *.lfm}
    3738
     39uses
     40  UCore;
     41
    3842{ TFormGrammer }
    3943
    4044procedure TFormGrammer.FormShow(Sender: TObject);
    4145begin
     46  Core.PersistentForm1.Load(Self);
     47end;
     48
     49procedure TFormGrammer.FormClose(Sender: TObject; var CloseAction: TCloseAction
     50  );
     51begin
     52  Core.PersistentForm1.Save(Self);
    4253end;
    4354
  • branches/generator/Forms/UFormLookupTable.lfm

    r137 r167  
    77  ClientHeight = 273
    88  ClientWidth = 595
    9   LCLVersion = '1.8.0.4'
     9  DesignTimePPI = 120
     10  OnClose = FormClose
     11  OnShow = FormShow
     12  LCLVersion = '1.8.2.0'
    1013  object Label1: TLabel
    1114    Left = 15
    12     Height = 23
     15    Height = 20
    1316    Top = 17
    14     Width = 49
     17    Width = 43
    1518    Caption = 'Name:'
    1619    ParentColor = False
     
    1821  object EditName: TEdit
    1922    Left = 120
    20     Height = 33
     23    Height = 28
    2124    Top = 8
    2225    Width = 160
  • branches/generator/Forms/UFormLookupTable.pas

    r137 r167  
    1818    EditName: TEdit;
    1919    Label1: TLabel;
     20    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     21    procedure FormShow(Sender: TObject);
    2022  private
    2123
     
    3234{$R *.lfm}
    3335
     36uses
     37  UCore;
     38
    3439{ TFormLookupTable }
     40
     41procedure TFormLookupTable.FormClose(Sender: TObject;
     42  var CloseAction: TCloseAction);
     43begin
     44  Core.PersistentForm1.Save(Self);
     45end;
     46
     47procedure TFormLookupTable.FormShow(Sender: TObject);
     48begin
     49  Core.PersistentForm1.Load(Self);
     50end;
    3551
    3652procedure TFormLookupTable.LoadData(LookupTable: TLookupTable);
  • branches/generator/Forms/UFormMain.lfm

    r137 r167  
    55  Width = 1050
    66  Caption = 'Language generator'
    7   ClientHeight = 647
     7  ClientHeight = 653
    88  ClientWidth = 1050
     9  DesignTimePPI = 120
    910  Menu = MainMenu1
    1011  OnClose = FormClose
    1112  OnCloseQuery = FormCloseQuery
    1213  OnShow = FormShow
    13   LCLVersion = '1.8.0.4'
     14  LCLVersion = '1.8.2.0'
     15  WindowState = wsMaximized
    1416  object CoolBar1: TCoolBar
    1517    Left = 0
     
    8385  object PageControl1: TPageControl
    8486    Left = 0
    85     Height = 612
     87    Height = 618
    8688    Top = 35
    8789    Width = 1050
     
    110112    object TabSheetEbnf: TTabSheet
    111113      Caption = 'EBNF'
    112       ClientHeight = 571
    113       ClientWidth = 1044
     114      ClientHeight = 585
     115      ClientWidth = 1042
    114116      object MemoEbnf: TMemo
    115117        Left = 0
    116         Height = 571
    117         Top = 0
    118         Width = 1044
     118        Height = 585
     119        Top = 0
     120        Width = 1042
    119121        Align = alClient
    120122        ReadOnly = True
  • branches/generator/Forms/UFormMain.pas

    r162 r167  
    152152procedure TFormMain.FormShow(Sender: TObject);
    153153begin
    154   Core.PersistentForm1.Load(Self, True);
    155154  Core.Initialize;
     155  Core.PersistentForm1.Load(Self);
    156156  PageControl1.TabIndex := 0;
    157157  ReloadMemo;
  • branches/generator/Forms/UFormRule.lfm

    r131 r167  
    88  ClientHeight = 514
    99  ClientWidth = 663
     10  DesignTimePPI = 120
     11  OnClose = FormClose
    1012  OnCreate = FormCreate
    1113  OnDestroy = FormDestroy
    1214  OnShow = FormShow
    13   LCLVersion = '1.8.0.4'
     15  LCLVersion = '1.8.2.0'
    1416  object ButtonOk: TButton
    1517    Left = 376
     
    3436  object Label1: TLabel
    3537    Left = 16
    36     Height = 23
     38    Height = 20
    3739    Top = 16
    38     Width = 49
     40    Width = 43
    3941    Caption = 'Name:'
    4042    ParentColor = False
     
    8183  object EditName: TEdit
    8284    Left = 135
    83     Height = 33
     85    Height = 28
    8486    Top = 11
    8587    Width = 433
     
    8890  object CheckBoxCreateNode: TCheckBox
    8991    Left = 16
    90     Height = 27
     92    Height = 24
    9193    Top = 48
    92     Width = 173
     94    Width = 152
    9395    Caption = 'Create source node'
    9496    TabOrder = 4
     
    9698  object Label2: TLabel
    9799    Left = 312
    98     Height = 23
     100    Height = 20
    99101    Top = 52
    100     Width = 42
     102    Width = 37
    101103    Caption = 'Level:'
    102104    ParentColor = False
     
    104106  object ComboBoxLevel: TComboBox
    105107    Left = 376
    106     Height = 37
     108    Height = 28
    107109    Top = 48
    108110    Width = 125
    109     ItemHeight = 0
     111    ItemHeight = 20
    110112    Style = csDropDownList
    111113    TabOrder = 5
  • branches/generator/Forms/UFormRule.pas

    r129 r167  
    2626    TabSheet2: TTabSheet;
    2727    TabSheetUsedBy: TTabSheet;
     28    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2829    procedure FormCreate(Sender: TObject);
    2930    procedure FormDestroy(Sender: TObject);
     
    4849{$R *.lfm}
    4950
     51uses
     52  UCore;
     53
    5054{ TFormRule }
    5155
     
    5458  EditName.SetFocus;
    5559  PageControl1.TabIndex := 0;  // Select first tab by default
     60  Core.PersistentForm1.Load(Self);
    5661end;
    5762
     
    8590end;
    8691
     92procedure TFormRule.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     93begin
     94  Core.PersistentForm1.Save(Self);
     95end;
     96
    8797procedure TFormRule.FormDestroy(Sender: TObject);
    8898begin
  • branches/generator/Forms/UFormRuleItem.lfm

    r137 r167  
    11object FormRuleItem: TFormRuleItem
    22  Left = 474
    3   Height = 400
     3  Height = 517
    44  Top = 386
    5   Width = 656
     5  Width = 719
    66  Caption = 'Rule item'
    7   ClientHeight = 400
    8   ClientWidth = 656
     7  ClientHeight = 517
     8  ClientWidth = 719
     9  DesignTimePPI = 120
    910  OnClose = FormClose
    1011  OnCreate = FormCreate
    1112  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    13   LCLVersion = '1.8.0.4'
     14  LCLVersion = '1.8.2.0'
    1415  object ButtonCancel: TButton
    1516    Left = 176
    1617    Height = 25
    17     Top = 362
     18    Top = 479
    1819    Width = 75
    1920    Anchors = [akLeft, akBottom]
     
    2526    Left = 352
    2627    Height = 25
    27     Top = 362
     28    Top = 479
    2829    Width = 75
    2930    Anchors = [akLeft, akBottom]
     
    3435  object ComboBoxType: TComboBox
    3536    Left = 160
    36     Height = 33
     37    Height = 28
    3738    Top = 16
    3839    Width = 400
    39     ItemHeight = 0
     40    ItemHeight = 20
    4041    Items.Strings = (
    4142      'Terminal'
     
    5051  object Label2: TLabel
    5152    Left = 16
    52     Height = 23
     53    Height = 20
    5354    Top = 24
    54     Width = 40
     55    Width = 35
    5556    Caption = 'Type:'
    5657    ParentColor = False
     
    5859  object PageControl1: TPageControl
    5960    Left = 16
    60     Height = 266
     61    Height = 383
    6162    Top = 88
    62     Width = 632
     63    Width = 695
    6364    ActivePage = TabSheetNonTerminal
    6465    Anchors = [akTop, akLeft, akRight, akBottom]
     
    8990    object TabSheetNonTerminal: TTabSheet
    9091      Caption = 'NonTerminal'
    91       ClientHeight = 260
    92       ClientWidth = 626
     92      ClientHeight = 375
     93      ClientWidth = 687
    9394      object LabelNonTerminal: TLabel
    9495        Left = 8
    95         Height = 23
     96        Height = 20
    9697        Top = 8
    97         Width = 105
     98        Width = 92
    9899        Caption = 'Non-terminal:'
    99100        ParentColor = False
     
    101102      object ListBoxNonTerminals: TListBox
    102103        Left = 8
    103         Height = 210
     104        Height = 325
    104105        Top = 40
    105         Width = 304
    106         Anchors = [akTop, akLeft, akRight, akBottom]
     106        Width = 328
     107        Anchors = [akTop, akLeft, akBottom]
    107108        ItemHeight = 0
    108109        ScrollWidth = 302
    109110        TabOrder = 0
    110         TopIndex = -1
    111111      end
    112112      object CheckBoxLookupTable: TCheckBox
    113113        Left = 352
    114         Height = 27
     114        Height = 24
    115115        Top = 8
    116         Width = 152
     116        Width = 136
    117117        Caption = 'Use lookup table'
    118118        OnChange = CheckBoxLookupTableChange
     
    121121      object ListBoxLookupTable: TListBox
    122122        Left = 352
    123         Height = 176
     123        Height = 291
    124124        Top = 40
    125         Width = 248
     125        Width = 309
    126126        Anchors = [akTop, akLeft, akRight, akBottom]
    127127        ItemHeight = 0
    128128        ScrollWidth = 246
    129129        TabOrder = 2
    130         TopIndex = -1
    131130      end
    132131      object Label1: TLabel
    133132        Left = 352
    134         Height = 23
    135         Top = 224
    136         Width = 90
     133        Height = 20
     134        Top = 341
     135        Width = 78
     136        Anchors = [akLeft, akBottom]
    137137        Caption = 'Item action:'
    138138        ParentColor = False
     
    140140      object ComboBoxLookupTableAction: TComboBox
    141141        Left = 464
    142         Height = 35
    143         Top = 224
     142        Height = 28
     143        Top = 341
    144144        Width = 134
    145         ItemHeight = 0
     145        Anchors = [akLeft, akBottom]
     146        ItemHeight = 20
    146147        ItemIndex = 0
    147148        Items.Strings = (
     
    197198  object CheckBoxOptional: TCheckBox
    198199    Left = 16
    199     Height = 27
    200     Top = 56
    201     Width = 90
     200    Height = 24
     201    Top = 56
     202    Width = 82
    202203    Caption = 'Optional'
    203204    TabOrder = 4
     
    205206  object CheckBoxRepetitive: TCheckBox
    206207    Left = 184
    207     Height = 27
    208     Top = 56
    209     Width = 99
     208    Height = 24
     209    Top = 56
     210    Width = 91
    210211    Caption = 'Repetitive'
    211212    TabOrder = 5
     
    213214  object CheckBoxAnyExcept: TCheckBox
    214215    Left = 344
    215     Height = 27
    216     Top = 56
    217     Width = 106
     216    Height = 24
     217    Top = 56
     218    Width = 97
    218219    Caption = 'Any except'
    219220    TabOrder = 6
     
    221222  object CheckBoxEscapedString: TCheckBox
    222223    Left = 488
    223     Height = 27
    224     Top = 56
    225     Width = 144
     224    Height = 24
     225    Top = 56
     226    Width = 126
    226227    Caption = 'Escaped strings'
    227228    TabOrder = 7
  • branches/generator/Packages/Common/Common.lpk

    r114 r167  
    1111      <PathDelim Value="\"/>
    1212      <SearchPaths>
    13         <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     13        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    1414      </SearchPaths>
     15      <Parsing>
     16        <SyntaxOptions>
     17          <SyntaxMode Value="Delphi"/>
     18          <CStyleOperator Value="False"/>
     19          <AllowLabel Value="False"/>
     20          <CPPInline Value="False"/>
     21        </SyntaxOptions>
     22      </Parsing>
     23      <CodeGeneration>
     24        <Optimizations>
     25          <OptimizationLevel Value="0"/>
     26        </Optimizations>
     27      </CodeGeneration>
     28      <Linking>
     29        <Debugging>
     30          <GenerateDebugInfo Value="False"/>
     31        </Debugging>
     32      </Linking>
     33      <Other>
     34        <CompilerMessages>
     35          <IgnoredMessages idx5024="True"/>
     36        </CompilerMessages>
     37      </Other>
    1538    </CompilerOptions>
    1639    <Description Value="Various libraries"/>
    1740    <License Value="GNU/GPL"/>
    1841    <Version Minor="7"/>
    19     <Files Count="20">
     42    <Files Count="22">
    2043      <Item1>
    2144        <Filename Value="StopWatch.pas"/>
     
    106129        <UnitName Value="UScaleDPI"/>
    107130      </Item20>
     131      <Item21>
     132        <Filename Value="UTheme.pas"/>
     133        <HasRegisterProc Value="True"/>
     134        <UnitName Value="UTheme"/>
     135      </Item21>
     136      <Item22>
     137        <Filename Value="UStringTable.pas"/>
     138        <UnitName Value="UStringTable"/>
     139      </Item22>
    108140    </Files>
    109141    <i18n>
  • branches/generator/Packages/Common/Common.pas

    r114 r167  
    55unit Common;
    66
     7{$warn 5023 off : no warning about unused units}
    78interface
    89
     
    1112  UMemory, UResetableThread, UPool, ULastOpenedList, URegistry,
    1213  UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter, UListViewSort,
    13   UPersistentForm, UFindFile, UScaleDPI, LazarusPackageIntf;
     14  UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable,
     15  LazarusPackageIntf;
    1416
    1517implementation
     
    2527  RegisterUnit('UFindFile', @UFindFile.Register);
    2628  RegisterUnit('UScaleDPI', @UScaleDPI.Register);
     29  RegisterUnit('UTheme', @UTheme.Register);
    2730end;
    2831
  • branches/generator/Packages/Common/Languages/UJobProgressView.cs.po

    r126 r167  
    2525
    2626#: ujobprogressview.soperations
    27 msgid "Operations"
     27#, fuzzy
     28#| msgid "Operations"
     29msgid "Operations:"
    2830msgstr "Operace"
    2931
  • branches/generator/Packages/Common/Languages/UJobProgressView.po

    r114 r167  
    1515
    1616#: ujobprogressview.soperations
    17 msgid "Operations"
     17msgid "Operations:"
    1818msgstr ""
    1919
  • branches/generator/Packages/Common/UApplicationInfo.pas

    r114 r167  
    66
    77uses
    8   SysUtils, Registry, Classes, Forms, URegistry;
     8  SysUtils, Classes, Forms, URegistry, Controls;
    99
    1010type
     
    1414  TApplicationInfo = class(TComponent)
    1515  private
     16    FDescription: TCaption;
    1617    FIdentification: Byte;
    1718    FLicense: string;
     
    3334    constructor Create(AOwner: TComponent); override;
    3435    property Version: string read GetVersion;
     36    function GetRegistryContext: TRegistryContext;
    3537  published
    3638    property Identification: Byte read FIdentification write FIdentification;
     
    4547    property EmailContact: string read FEmailContact write FEmailContact;
    4648    property AppName: string read FAppName write FAppName;
     49    property Description: string read FDescription write FDescription;
    4750    property ReleaseDate: TDateTime read FReleaseDate write FReleaseDate;
    4851    property RegistryKey: string read FRegistryKey write FRegistryKey;
     
    5457
    5558implementation
    56                        
     59
    5760procedure Register;
    5861begin
     
    7982end;
    8083
     84function TApplicationInfo.GetRegistryContext: TRegistryContext;
     85begin
     86  Result := TRegistryContext.Create(RegistryRoot, RegistryKey);
     87end;
     88
    8189end.
  • branches/generator/Packages/Common/UCommon.pas

    r114 r167  
    2828    unfDNSDomainName = 11);
    2929
     30  TFilterMethodMethod = function (FileName: string): Boolean of object;
    3031var
    3132  ExceptionHandler: TExceptionEvent;
     
    6364procedure OpenWebPage(URL: string);
    6465procedure OpenFileInShell(FileName: string);
    65 procedure ExecuteProgram(CommandLine: string);
     66procedure ExecuteProgram(Executable: string; Parameters: array of string);
    6667procedure FreeThenNil(var Obj);
    6768function RemoveQuotes(Text: string): string;
     
    7172function MergeArray(A, B: array of string): TArrayOfString;
    7273function LoadFileToStr(const FileName: TFileName): AnsiString;
     74procedure SearchFiles(AList: TStrings; Dir: string;
     75  FilterMethod: TFilterMethodMethod = nil);
     76function GetStringPart(var Text: string; Separator: string): string;
     77function PosFromIndex(SubStr: string; Text: string;
     78  StartIndex: Integer): Integer;
     79function PosFromIndexReverse(SubStr: string; Text: string;
     80  StartIndex: Integer): Integer;
    7381
    7482
     
    112120  Path := IncludeTrailingPathDelimiter(APath);
    113121
    114   Find := FindFirst(UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);
     122  Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec);
    115123  while Find = 0 do begin
    116     DeleteFile(Path + UTF8Encode(SearchRec.Name));
     124    DeleteFile(Path + SearchRec.Name);
    117125
    118126    Find := SysUtils.FindNext(SearchRec);
     
    429437end;
    430438
    431 procedure ExecuteProgram(CommandLine: string);
     439procedure ExecuteProgram(Executable: string; Parameters: array of string);
    432440var
    433441  Process: TProcess;
     442  I: Integer;
    434443begin
    435444  try
    436445    Process := TProcess.Create(nil);
    437     Process.CommandLine := CommandLine;
     446    Process.Executable := Executable;
     447    for I := 0 to Length(Parameters) - 1 do
     448      Process.Parameters.Add(Parameters[I]);
    438449    Process.Options := [poNoConsole];
    439450    Process.Execute;
     
    456467procedure OpenFileInShell(FileName: string);
    457468begin
    458   ExecuteProgram('cmd.exe /c start "' + FileName + '"');
     469  ExecuteProgram('cmd.exe', ['/c', 'start', FileName]);
    459470end;
    460471
     
    511522end;
    512523
    513 
     524function DefaultSearchFilter(const FileName: string): Boolean;
     525begin
     526  Result := True;
     527end;
     528
     529procedure SearchFiles(AList: TStrings; Dir: string;
     530  FilterMethod: TFilterMethodMethod = nil);
     531var
     532  SR: TSearchRec;
     533begin
     534  Dir := IncludeTrailingPathDelimiter(Dir);
     535  if FindFirst(Dir + '*', faAnyFile, SR) = 0 then
     536    try
     537      repeat
     538        if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or
     539          not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue;
     540        AList.Add(Dir + SR.Name);
     541        if (SR.Attr and faDirectory) <> 0 then
     542          SearchFiles(AList, Dir + SR.Name, FilterMethod);
     543      until FindNext(SR) <> 0;
     544    finally
     545      FindClose(SR);
     546    end;
     547end;
     548
     549function GetStringPart(var Text: string; Separator: string): string;
     550var
     551  P: Integer;
     552begin
     553  P := Pos(Separator, Text);
     554  if P > 0 then begin
     555    Result := Copy(Text, 1, P - 1);
     556    Delete(Text, 1, P - 1 + Length(Separator));
     557  end else begin
     558    Result := Text;
     559    Text := '';
     560  end;
     561  Result := Trim(Result);
     562  Text := Trim(Text);
     563end;
     564
     565function PosFromIndex(SubStr: string; Text: string;
     566  StartIndex: Integer): Integer;
     567var
     568  I, MaxLen: SizeInt;
     569  Ptr: PAnsiChar;
     570begin
     571  Result := 0;
     572  if (StartIndex < 1) or (StartIndex > Length(Text) - Length(SubStr)) then Exit;
     573  if Length(SubStr) > 0 then begin
     574    MaxLen := Length(Text) - Length(SubStr) + 1;
     575    I := StartIndex;
     576    Ptr := @Text[StartIndex];
     577    while (I <= MaxLen) do begin
     578      if (SubStr[1] = Ptr^) and (CompareByte(Substr[1], Ptr^, Length(SubStr)) = 0) then begin
     579        Result := I;
     580        Exit;
     581      end;
     582      Inc(I);
     583      Inc(Ptr);
     584    end;
     585  end;
     586end;
     587
     588function PosFromIndexReverse(SubStr: string; Text: string;
     589  StartIndex: Integer): Integer;
     590var
     591  I: SizeInt;
     592  Ptr: PAnsiChar;
     593begin
     594  Result := 0;
     595  if (StartIndex < 1) or (StartIndex > Length(Text)) then Exit;
     596  if Length(SubStr) > 0 then begin
     597    I := StartIndex;
     598    Ptr := @Text[StartIndex];
     599    while (I > 0) do begin
     600      if (SubStr[1] = Ptr^) and (CompareByte(Substr[1], Ptr^, Length(SubStr)) = 0) then begin
     601        Result := I;
     602        Exit;
     603      end;
     604      Dec(I);
     605      Dec(Ptr);
     606    end;
     607  end;
     608end;
    514609
    515610initialization
  • branches/generator/Packages/Common/UDebugLog.pas

    r114 r167  
    104104    if ExtractFileDir(FileName) <> '' then
    105105      ForceDirectories(ExtractFileDir(FileName));
    106     if FileExists(FileName) then LogFile := TFileStream.Create(UTF8Decode(FileName), fmOpenWrite)
    107       else LogFile := TFileStream.Create(UTF8Decode(FileName), fmCreate);
     106    if FileExists(FileName) then LogFile := TFileStream.Create(FileName, fmOpenWrite)
     107      else LogFile := TFileStream.Create(FileName, fmCreate);
    108108    LogFile.Seek(0, soFromEnd);
    109109    Text := FormatDateTime('hh:nn:ss.zzz', Now) + ': ' + Text + LineEnding;
  • branches/generator/Packages/Common/UFindFile.pas

    r114 r167  
    2424
    2525uses
    26   SysUtils, Classes, Graphics, Controls, Forms, Dialogs, FileCtrl;
     26  SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
    2727
    2828type
     
    117117  Attr := 0;
    118118  if ffaReadOnly in FileAttr then Attr := Attr + faReadOnly;
    119   if ffaHidden in FileAttr then Attr := Attr + faHidden;
    120   if ffaSysFile in FileAttr then Attr := Attr + faSysFile;
    121   if ffaVolumeID in FileAttr then Attr := Attr + faVolumeID;
     119  if ffaHidden in FileAttr then Attr := Attr + 2; //faHidden; use constant to avoid platform warning
     120  if ffaSysFile in FileAttr then Attr := Attr + 4; //faSysFile; use constant to avoid platform warning
     121  // Deprecated: if ffaVolumeID in FileAttr then Attr := Attr + faVolumeID;
    122122  if ffaDirectory in FileAttr then Attr := Attr + faDirectory;
    123123  if ffaArchive in FileAttr then Attr := Attr + faArchive;
    124124  if ffaAnyFile in FileAttr then Attr := Attr + faAnyFile;
    125125
    126   if SysUtils.FindFirst(UTF8Decode(inPath + FileMask), Attr, Rec) = 0 then
     126  if SysUtils.FindFirst(inPath + FileMask, Attr, Rec) = 0 then
    127127  try
    128128    repeat
    129       s.Add(inPath + UTF8Encode(Rec.Name));
     129      s.Add(inPath + Rec.Name);
    130130    until SysUtils.FindNext(Rec) <> 0;
    131131  finally
     
    135135  If not InSubFolders then Exit;
    136136
    137   if SysUtils.FindFirst(UTF8Decode(inPath + FilterAll), faDirectory, Rec) = 0 then
     137  if SysUtils.FindFirst(inPath + FilterAll, faDirectory, Rec) = 0 then
    138138  try
    139139    repeat
    140140      if ((Rec.Attr and faDirectory) > 0) and (Rec.Name <> '.')
    141141      and (Rec.Name <> '..') then
    142         FileSearch(IncludeTrailingBackslash(inPath + UTF8Encode(Rec.Name)));
     142        FileSearch(IncludeTrailingBackslash(inPath + Rec.Name));
    143143    until SysUtils.FindNext(Rec) <> 0;
    144144  finally
  • branches/generator/Packages/Common/UJobProgressView.lfm

    r114 r167  
    11object FormJobProgressView: TFormJobProgressView
    22  Left = 467
    3   Height = 246
     3  Height = 345
    44  Top = 252
    5   Width = 328
     5  Width = 539
    66  BorderIcons = [biSystemMenu]
    7   ClientHeight = 246
    8   ClientWidth = 328
    9   Font.Height = -11
    10   Font.Name = 'MS Sans Serif'
     7  ClientHeight = 345
     8  ClientWidth = 539
     9  DesignTimePPI = 120
    1110  OnClose = FormClose
    1211  OnCloseQuery = FormCloseQuery
    1312  OnCreate = FormCreate
    1413  OnDestroy = FormDestroy
     14  OnHide = FormHide
     15  OnShow = FormShow
    1516  Position = poScreenCenter
    16   LCLVersion = '1.6.0.4'
     17  LCLVersion = '1.8.2.0'
    1718  object PanelOperationsTitle: TPanel
    1819    Left = 0
    19     Height = 24
     20    Height = 32
    2021    Top = 0
    21     Width = 328
    22     Align = alTop
    23     BevelOuter = bvNone
    24     ClientHeight = 24
    25     ClientWidth = 328
     22    Width = 539
     23    Align = alTop
     24    BevelOuter = bvNone
     25    ClientHeight = 32
     26    ClientWidth = 539
    2627    FullRepaint = False
    2728    TabOrder = 0
    2829    object LabelOperation: TLabel
    2930      Left = 8
    30       Height = 13
     31      Height = 20
    3132      Top = 8
    32       Width = 66
     33      Width = 76
    3334      Caption = 'Operations:'
    34       Font.Height = -11
    35       Font.Name = 'MS Sans Serif'
    36       Font.Style = [fsBold]
    3735      ParentColor = False
    3836      ParentFont = False
     
    4139  object PanelLog: TPanel
    4240    Left = 0
    43     Height = 122
    44     Top = 124
    45     Width = 328
     41    Height = 133
     42    Top = 212
     43    Width = 539
    4644    Align = alClient
    4745    BevelOuter = bvSpace
    48     ClientHeight = 122
    49     ClientWidth = 328
     46    ClientHeight = 133
     47    ClientWidth = 539
    5048    TabOrder = 1
    5149    object MemoLog: TMemo
    5250      Left = 8
    53       Height = 106
     51      Height = 117
    5452      Top = 8
    55       Width = 312
     53      Width = 523
    5654      Anchors = [akTop, akLeft, akRight, akBottom]
    5755      ReadOnly = True
     
    6260  object PanelProgress: TPanel
    6361    Left = 0
    64     Height = 38
    65     Top = 50
    66     Width = 328
    67     Align = alTop
    68     BevelOuter = bvNone
    69     ClientHeight = 38
    70     ClientWidth = 328
     62    Height = 54
     63    Top = 106
     64    Width = 539
     65    Align = alTop
     66    BevelOuter = bvNone
     67    ClientHeight = 54
     68    ClientWidth = 539
    7169    TabOrder = 2
    7270    object ProgressBarPart: TProgressBar
    73       Left = 8
    74       Height = 17
    75       Top = 16
    76       Width = 312
     71      Left = 10
     72      Height = 24
     73      Top = 24
     74      Width = 523
    7775      Anchors = [akTop, akLeft, akRight]
    7876      TabOrder = 0
     
    8078    object LabelEstimatedTimePart: TLabel
    8179      Left = 8
    82       Height = 13
     80      Height = 20
    8381      Top = -2
    84       Width = 71
     82      Width = 103
    8583      Caption = 'Estimated time:'
    8684      ParentColor = False
     
    8987  object PanelOperations: TPanel
    9088    Left = 0
    91     Height = 26
    92     Top = 24
    93     Width = 328
    94     Align = alTop
    95     BevelOuter = bvNone
    96     ClientHeight = 26
    97     ClientWidth = 328
     89    Height = 42
     90    Top = 64
     91    Width = 539
     92    Align = alTop
     93    BevelOuter = bvNone
     94    ClientHeight = 42
     95    ClientWidth = 539
    9896    FullRepaint = False
    9997    TabOrder = 3
    10098    object ListViewJobs: TListView
    10199      Left = 8
    102       Height = 16
     100      Height = 32
    103101      Top = 5
    104       Width = 312
     102      Width = 523
    105103      Anchors = [akTop, akLeft, akRight, akBottom]
    106104      AutoWidthLastColumn = True
     
    109107      Columns = <     
    110108        item
    111           Width = 312
     109          Width = 523
    112110        end>
    113111      OwnerData = True
     
    122120  object PanelProgressTotal: TPanel
    123121    Left = 0
    124     Height = 36
    125     Top = 88
    126     Width = 328
    127     Align = alTop
    128     BevelOuter = bvNone
    129     ClientHeight = 36
    130     ClientWidth = 328
     122    Height = 52
     123    Top = 160
     124    Width = 539
     125    Align = alTop
     126    BevelOuter = bvNone
     127    ClientHeight = 52
     128    ClientWidth = 539
    131129    TabOrder = 4
    132130    object LabelEstimatedTimeTotal: TLabel
    133131      Left = 8
    134       Height = 13
     132      Height = 20
    135133      Top = 0
    136       Width = 97
     134      Width = 141
    137135      Caption = 'Total estimated time:'
    138136      ParentColor = False
     
    140138    object ProgressBarTotal: TProgressBar
    141139      Left = 8
    142       Height = 16
    143       Top = 16
    144       Width = 312
     140      Height = 24
     141      Top = 24
     142      Width = 523
    145143      Anchors = [akTop, akLeft, akRight]
    146144      TabOrder = 0
     145    end
     146  end
     147  object PanelText: TPanel
     148    Left = 0
     149    Height = 32
     150    Top = 32
     151    Width = 539
     152    Align = alTop
     153    BevelOuter = bvNone
     154    ClientHeight = 32
     155    ClientWidth = 539
     156    TabOrder = 5
     157    object LabelText: TLabel
     158      Left = 8
     159      Height = 24
     160      Top = 8
     161      Width = 525
     162      Anchors = [akTop, akLeft, akRight]
     163      AutoSize = False
     164      ParentColor = False
    147165    end
    148166  end
  • branches/generator/Packages/Common/UJobProgressView.pas

    r114 r167  
    77uses
    88  SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs,
    9   Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading,
     9  Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,
    1010  DateUtils;
    1111
     
    1313  EstimatedTimeShowTreshold = 4;
    1414  EstimatedTimeShowTresholdTotal = 1;
    15   MemoLogHeight = 200;
    1615  UpdateInterval = 100; // ms
    1716
     
    2423    FLock: TCriticalSection;
    2524    FOnChange: TNotifyEvent;
     25    FText: string;
    2626    FValue: Integer;
    2727    FMax: Integer;
    2828    procedure SetMax(const AValue: Integer);
     29    procedure SetText(AValue: string);
    2930    procedure SetValue(const AValue: Integer);
    3031  public
     
    3536    property Value: Integer read FValue write SetValue;
    3637    property Max: Integer read FMax write SetMax;
     38    property Text: string read FText write SetText;
    3739    property OnChange: TNotifyEvent read FOnChange write FOnChange;
    3840  end;
     
    6971  end;
    7072
     73  TJobs = class(TObjectList)
     74  end;
     75
    7176  TJobThread = class(TListedThread)
    7277    procedure Execute; override;
     
    8085  TFormJobProgressView = class(TForm)
    8186    ImageList1: TImageList;
     87    LabelText: TLabel;
    8288    Label2: TLabel;
    8389    LabelOperation: TLabel;
     
    8692    ListViewJobs: TListView;
    8793    MemoLog: TMemo;
     94    PanelText: TPanel;
    8895    PanelProgressTotal: TPanel;
    8996    PanelOperationsTitle: TPanel;
     
    94101    ProgressBarTotal: TProgressBar;
    95102    TimerUpdate: TTimer;
     103    procedure FormHide(Sender: TObject);
     104    procedure FormShow(Sender: TObject);
     105    procedure ReloadJobList;
    96106    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    97107    procedure FormDestroy(Sender: TObject);
     
    100110    procedure FormCreate(Sender: TObject);
    101111    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     112    procedure UpdateHeight;
    102113  public
    103114    JobProgressView: TJobProgressView;
     
    118129    TotalStartTime: TDateTime;
    119130    Log: TStringList;
     131    FForm: TFormJobProgressView;
    120132    procedure SetTerminate(const AValue: Boolean);
    121133    procedure UpdateProgress;
    122     procedure ReloadJobList;
    123     procedure StartJobs;
    124     procedure UpdateHeight;
    125134    procedure JobProgressChange(Sender: TObject);
    126135  public
    127     Form: TFormJobProgressView;
    128     Jobs: TObjectList; // TListObject<TJob>
     136    Jobs: TJobs;
    129137    CurrentJob: TJob;
    130138    CurrentJobIndex: Integer;
     
    132140    destructor Destroy; override;
    133141    procedure Clear;
    134     procedure AddJob(Title: string; Method: TJobProgressViewMethod;
    135       NoThreaded: Boolean = False; WaitFor: Boolean = False);
    136     procedure Start(AAutoClose: Boolean = True);
     142    function AddJob(Title: string; Method: TJobProgressViewMethod;
     143      NoThreaded: Boolean = False; WaitFor: Boolean = False): TJob;
     144    procedure Start;
    137145    procedure Stop;
    138146    procedure TermSleep(Delay: Integer);
     147    property Form: TFormJobProgressView read FForm;
    139148    property Terminate: Boolean read FTerminate write SetTerminate;
    140149  published
     
    166175  STotalEstimatedTime = 'Total estimated time: %s';
    167176  SFinished = 'Finished';
    168   SOperations = 'Operations';
     177  SOperations = 'Operations:';
    169178
    170179procedure Register;
     
    172181  RegisterComponents('Common', [TJobProgressView]);
    173182end;
     183
     184{ TJobThread }
    174185
    175186procedure TJobThread.Execute;
     
    190201end;
    191202
    192 procedure TJobProgressView.AddJob(Title: string; Method: TJobProgressViewMethod;
    193   NoThreaded: Boolean = False; WaitFor: Boolean = False);
     203{ TFormJobProgressView }
     204
     205procedure TFormJobProgressView.UpdateHeight;
    194206var
    195   NewJob: TJob;
    196 begin
    197   NewJob := TJob.Create;
    198   NewJob.ProgressView := Self;
    199   NewJob.Title := Title;
    200   NewJob.Method := Method;
    201   NewJob.NoThreaded := NoThreaded;
    202   NewJob.WaitFor := WaitFor;
    203   NewJob.Progress.Max := 100;
    204   NewJob.Progress.Reset;
    205   NewJob.Progress.OnChange := JobProgressChange;
    206   Jobs.Add(NewJob);
     207  H: Integer;
     208  PanelOperationsVisible: Boolean;
     209  PanelOperationsHeight: Integer;
     210  PanelProgressVisible: Boolean;
     211  PanelProgressTotalVisible: Boolean;
     212  PanelLogVisible: Boolean;
     213  MemoLogHeight: Integer = 200;
     214  I: Integer;
     215  ItemRect: TRect;
     216  MaxH: Integer;
     217begin
     218    H := PanelOperationsTitle.Height;
     219    PanelOperationsVisible := JobProgressView.Jobs.Count > 0;
     220    if PanelOperationsVisible <> PanelOperations.Visible then
     221      PanelOperations.Visible := PanelOperationsVisible;
     222    if ListViewJobs.Items.Count > 0 then begin
     223      Maxh := 0;
     224      for I := 0 to ListViewJobs.Items.Count - 1 do
     225      begin
     226        ItemRect := ListViewJobs.Items[i].DisplayRect(drBounds);
     227        Maxh := Max(Maxh, ItemRect.Top + (ItemRect.Bottom - ItemRect.Top));
     228      end;
     229      PanelOperationsHeight := Scale96ToScreen(12) + Maxh;
     230    end else PanelOperationsHeight := Scale96ToScreen(8);
     231    if PanelOperationsHeight <> PanelOperations.Height then
     232      PanelOperations.Height := PanelOperationsHeight;
     233    if PanelOperationsVisible then
     234      H := H + PanelOperations.Height;
     235
     236    PanelProgressVisible := (JobProgressView.Jobs.Count > 0) and not JobProgressView.Finished;
     237    if PanelProgressVisible <> PanelProgress.Visible then
     238      PanelProgress.Visible := PanelProgressVisible;
     239    if PanelProgressVisible then
     240      H := H + PanelProgress.Height;
     241    PanelProgressTotalVisible := (JobProgressView.Jobs.Count > 1) and not JobProgressView.Finished;
     242    if PanelProgressTotalVisible <> PanelProgressTotal.Visible then
     243      PanelProgressTotal.Visible := PanelProgressTotalVisible;
     244    if PanelProgressTotalVisible then
     245      H := H + PanelProgressTotal.Height;
     246    Constraints.MinHeight := H;
     247    PanelLogVisible := MemoLog.Lines.Count > 0;
     248    if PanelLogVisible <> PanelLog.Visible then
     249      PanelLog.Visible := PanelLogVisible;
     250    if PanelLogVisible then
     251      H := H + Scale96ToScreen(MemoLogHeight);
     252    if PanelText.Visible then
     253      H := H + PanelText.Height;
     254    if Height <> H then begin
     255      Height := H;
     256      Top := (Screen.Height - H) div 2;
     257    end;
     258end;
     259
     260procedure TFormJobProgressView.TimerUpdateTimer(Sender: TObject);
     261var
     262  ProgressBarPartVisible: Boolean;
     263  ProgressBarTotalVisible: Boolean;
     264begin
     265  JobProgressView.UpdateProgress;
     266  if Visible and (not ProgressBarPart.Visible) and
     267  Assigned(JobProgressView.CurrentJob) and
     268  (JobProgressView.CurrentJob.Progress.Value > 0) then begin
     269    ProgressBarPartVisible := True;
     270    if ProgressBarPartVisible <> ProgressBarPart.Visible then
     271      ProgressBarPart.Visible := ProgressBarPartVisible;
     272    ProgressBarTotalVisible := True;
     273    if ProgressBarTotalVisible <> ProgressBarTotal.Visible then
     274      ProgressBarTotal.Visible := ProgressBarTotalVisible;
     275  end;
     276  if not Visible then begin
     277    TimerUpdate.Interval := UpdateInterval;
     278    if not JobProgressView.OwnerDraw then Show;
     279  end;
     280  if Assigned(JobProgressView.CurrentJob) then begin
     281    LabelText.Caption := JobProgressView.CurrentJob.Progress.Text;
     282    if LabelText.Caption <> '' then begin
     283      PanelText.Visible := True;
     284      UpdateHeight;
     285    end;
     286  end;
     287end;
     288
     289procedure TFormJobProgressView.FormDestroy(Sender:TObject);
     290begin
     291end;
     292
     293procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem);
     294begin
     295  if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then
     296  with TJob(JobProgressView.Jobs[Item.Index]) do begin
     297    Item.Caption := Title;
     298    if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1
     299      else if Finished then Item.ImageIndex := 0
     300      else Item.ImageIndex := 2;
     301    Item.Data := JobProgressView.Jobs[Item.Index];
     302  end;
     303end;
     304
     305procedure TFormJobProgressView.FormClose(Sender: TObject;
     306  var CloseAction: TCloseAction);
     307begin
     308end;
     309
     310procedure TFormJobProgressView.FormCreate(Sender: TObject);
     311begin
     312  Caption := SPleaseWait;
     313  try
     314    //Animate1.FileName := ExtractFileDir(UTF8Encode(Application.ExeName)) +
     315    //  DirectorySeparator + 'horse.avi';
     316    //Animate1.Active := True;
     317  except
     318
     319  end;
     320end;
     321
     322procedure TFormJobProgressView.ReloadJobList;
     323begin
     324  // Workaround for not showing first line
     325  //Form.ListViewJobs.Items.Count := Jobs.Count + 1;
     326  //Form.ListViewJobs.Refresh;
     327
     328  if ListViewJobs.Items.Count <> JobProgressView.Jobs.Count then
     329    ListViewJobs.Items.Count := JobProgressView.Jobs.Count;
     330  ListViewJobs.Refresh;
     331  Application.ProcessMessages;
     332  UpdateHeight;
     333end;
     334
     335procedure TFormJobProgressView.FormShow(Sender: TObject);
     336begin
     337  ReloadJobList;
     338end;
     339
     340procedure TFormJobProgressView.FormHide(Sender: TObject);
     341begin
     342  JobProgressView.Jobs.Clear;
     343  ReloadJobList;
     344end;
     345
     346procedure TFormJobProgressView.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     347begin
     348  CanClose := JobProgressView.Finished;
     349  JobProgressView.Terminate := True;
     350  Caption := SPleaseWait + STerminate;
     351end;
     352
     353
     354{ TJobProgressView }
     355
     356function TJobProgressView.AddJob(Title: string; Method: TJobProgressViewMethod;
     357  NoThreaded: Boolean = False; WaitFor: Boolean = False): TJob;
     358begin
     359  Result := TJob.Create;
     360  Result.ProgressView := Self;
     361  Result.Title := Title;
     362  Result.Method := Method;
     363  Result.NoThreaded := NoThreaded;
     364  Result.WaitFor := WaitFor;
     365  Result.Progress.Max := 100;
     366  Result.Progress.Reset;
     367  Result.Progress.OnChange := JobProgressChange;
     368  Jobs.Add(Result);
    207369  //ReloadJobList;
    208370end;
    209371
    210 procedure TJobProgressView.Start(AAutoClose: Boolean = True);
    211 begin
    212   AutoClose := AAutoClose;
    213   StartJobs;
    214 end;
    215 
    216 procedure TJobProgressView.StartJobs;
     372procedure TJobProgressView.Start;
    217373var
    218374  I: Integer;
     
    229385    Form.MemoLog.Clear;
    230386
     387    Form.PanelText.Visible := False;
    231388    Form.LabelEstimatedTimePart.Visible := False;
    232389    Form.LabelEstimatedTimeTotal.Visible := False;
     
    258415      Form.ProgressBarPart.Visible := False;
    259416      //Show;
    260       ReloadJobList;
     417      Form.ReloadJobList;
    261418      Application.ProcessMessages;
    262419      if NoThreaded then begin
     
    296453    //if Visible then Hide;
    297454    Form.MemoLog.Lines.Assign(Log);
    298     if (Form.MemoLog.Lines.Count = 0) and AutoClose then begin
     455    if (Form.MemoLog.Lines.Count = 0) and FAutoClose then begin
    299456      Form.Hide;
    300457    end;
    301     Clear;
     458    if not Form.Visible then Clear;
    302459    Form.Caption := SFinished;
    303460    //LabelEstimatedTimePart.Visible := False;
    304461    Finished := True;
    305462    CurrentJobIndex := -1;
    306     ReloadJobList;
    307   end;
    308 end;
    309 
    310 procedure TJobProgressView.UpdateHeight;
    311 var
    312   H: Integer;
    313   PanelOperationsVisible: Boolean;
    314   PanelOperationsHeight: Integer;
    315   PanelProgressVisible: Boolean;
    316   PanelProgressTotalVisible: Boolean;
    317   PanelLogVisible: Boolean;
    318 begin
    319   with Form do begin
    320   H := PanelOperationsTitle.Height;
    321   PanelOperationsVisible := Jobs.Count > 0;
    322   if PanelOperationsVisible <> PanelOperations.Visible then
    323     PanelOperations.Visible := PanelOperationsVisible;
    324   PanelOperationsHeight := 8 + 18 * Jobs.Count;
    325   if PanelOperationsHeight <> PanelOperations.Height then
    326     PanelOperations.Height := PanelOperationsHeight;
    327   if PanelOperationsVisible then
    328     H := H + PanelOperations.Height;
    329 
    330   PanelProgressVisible := (Jobs.Count > 0) and not Finished;
    331   if PanelProgressVisible <> PanelProgress.Visible then
    332     PanelProgress.Visible := PanelProgressVisible;
    333   if PanelProgressVisible then
    334     H := H + PanelProgress.Height;
    335   PanelProgressTotalVisible := (Jobs.Count > 1) and not Finished;
    336   if PanelProgressTotalVisible <> PanelProgressTotal.Visible then
    337     PanelProgressTotal.Visible := PanelProgressTotalVisible;
    338   if PanelProgressTotalVisible then
    339     H := H + PanelProgressTotal.Height;
    340   Constraints.MinHeight := H;
    341   PanelLogVisible := MemoLog.Lines.Count > 0;
    342   if PanelLogVisible <> PanelLog.Visible then
    343     PanelLog.Visible := PanelLogVisible;
    344   if PanelLogVisible then
    345     H := H + MemoLogHeight;
    346   if Height <> H then Height := H;
     463    Form.ReloadJobList;
    347464  end;
    348465end;
     
    352469  if Assigned(FOnOwnerDraw) then
    353470    FOnOwnerDraw(Self);
    354 end;
    355 
    356 procedure TFormJobProgressView.TimerUpdateTimer(Sender: TObject);
    357 var
    358   ProgressBarPartVisible: Boolean;
    359   ProgressBarTotalVisible: Boolean;
    360 begin
    361   JobProgressView.UpdateProgress;
    362   if Visible and (not ProgressBarPart.Visible) and
    363   Assigned(JobProgressView.CurrentJob) and
    364   (JobProgressView.CurrentJob.Progress.Value > 0) then begin
    365     ProgressBarPartVisible := True;
    366     if ProgressBarPartVisible <> ProgressBarPart.Visible then
    367       ProgressBarPart.Visible := ProgressBarPartVisible;
    368     ProgressBarTotalVisible := True;
    369     if ProgressBarTotalVisible <> ProgressBarTotal.Visible then
    370       ProgressBarTotal.Visible := ProgressBarTotalVisible;
    371   end;
    372   if not Visible then begin
    373     TimerUpdate.Interval := UpdateInterval;
    374     if not JobProgressView.OwnerDraw then Show;
    375   end;
    376 end;
    377 
    378 procedure TFormJobProgressView.FormDestroy(Sender:TObject);
    379 begin
    380 end;
    381 
    382 procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem);
    383 begin
    384   if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then
    385   with TJob(JobProgressView.Jobs[Item.Index]) do begin
    386     Item.Caption := Title;
    387     if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1
    388       else if Finished then Item.ImageIndex := 0
    389       else Item.ImageIndex := 2;
    390     Item.Data := JobProgressView.Jobs[Item.Index];
    391   end;
    392 end;
    393 
    394 procedure TFormJobProgressView.FormClose(Sender: TObject;
    395   var CloseAction: TCloseAction);
    396 begin
    397   ListViewJobs.Clear;
    398 end;
    399 
    400 procedure TFormJobProgressView.FormCreate(Sender: TObject);
    401 begin
    402   Caption := SPleaseWait;
    403   try
    404     //Animate1.FileName := ExtractFileDir(UTF8Encode(Application.ExeName)) +
    405     //  DirectorySeparator + 'horse.avi';
    406     //Animate1.Active := True;
    407   except
    408 
    409   end;
    410471end;
    411472
     
    426487    Sleep(Quantum);
    427488  end;
    428 end;
    429 
    430 procedure TFormJobProgressView.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    431 begin
    432   CanClose := JobProgressView.Finished;
    433   JobProgressView.Terminate := True;
    434   Caption := SPleaseWait + STerminate;
    435489end;
    436490
     
    490544end;
    491545
    492 procedure TJobProgressView.ReloadJobList;
    493 begin
    494   UpdateHeight;
    495   // Workaround for not showing first line
    496   Form.ListViewJobs.Items.Count := Jobs.Count + 1;
    497   Form.ListViewJobs.Refresh;
    498 
    499   if Form.ListViewJobs.Items.Count <> Jobs.Count then
    500     Form.ListViewJobs.Items.Count := Jobs.Count;
    501   Form.ListViewJobs.Refresh;
    502   //Application.ProcessMessages;
    503 end;
    504 
    505546constructor TJobProgressView.Create(TheOwner: TComponent);
    506547begin
    507548  inherited;
    508549  if not (csDesigning in ComponentState) then begin
    509     Form := TFormJobProgressView.Create(Self);
    510     Form.JobProgressView := Self;
    511   end;
    512   Jobs := TObjectList.Create;
     550    FForm := TFormJobProgressView.Create(Self);
     551    FForm.JobProgressView := Self;
     552  end;
     553  Jobs := TJobs.Create;
    513554  Log := TStringList.Create;
    514555  //PanelOperationsTitle.Height := 80;
    515   ShowDelay := 0; //1000; // ms
     556  AutoClose := True;
     557  ShowDelay := 0;
    516558end;
    517559
     
    519561begin
    520562  Jobs.Clear;
     563  Log.Clear;
    521564  //ReloadJobList;
    522565end;
     
    528571  inherited;
    529572end;
     573
     574{ TProgress }
    530575
    531576procedure TProgress.SetMax(const AValue: Integer);
     
    536581    if FMax < 1 then FMax := 1;
    537582    if FValue >= FMax then FValue := FMax;
     583  finally
     584    FLock.Release;
     585  end;
     586end;
     587
     588procedure TProgress.SetText(AValue: string);
     589begin
     590  try
     591    FLock.Acquire;
     592    if FText = AValue then Exit;
     593    FText := AValue;
    538594  finally
    539595    FLock.Release;
     
    563619end;
    564620
    565 { TProgress }
    566 
    567621procedure TProgress.Increment;
    568622begin
  • branches/generator/Packages/Common/UListViewSort.pas

    r114 r167  
    8181    FOnChange: TNotifyEvent;
    8282    FStringGrid1: TStringGrid;
    83     procedure DoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    84     procedure DoOnResize(Sender: TObject);
     83    procedure GridDoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     84    procedure GridDoOnResize(Sender: TObject);
    8585  public
    8686    constructor Create(AOwner: TComponent); override;
     
    110110{ TListViewFilter }
    111111
    112 procedure TListViewFilter.DoOnKeyUp(Sender: TObject; var Key: Word;
     112procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word;
    113113  Shift: TShiftState);
    114114begin
     
    117117end;
    118118
    119 procedure TListViewFilter.DoOnResize(Sender: TObject);
     119procedure TListViewFilter.GridDoOnResize(Sender: TObject);
    120120begin
    121121  FStringGrid1.DefaultRowHeight := FStringGrid1.Height;
     
    135135  FStringGrid1.Options := [goFixedHorzLine, goFixedVertLine, goVertLine,
    136136    goHorzLine, goRangeSelect, goEditing, goAlwaysShowEditor, goSmoothScroll];
    137   FStringGrid1.OnKeyUp := DoOnKeyUp;
    138   FStringGrid1.OnResize := DoOnResize;
     137  FStringGrid1.OnKeyUp := GridDoOnKeyUp;
     138  FStringGrid1.OnResize := GridDoOnResize;
    139139end;
    140140
     
    142142var
    143143  I: Integer;
     144  R: TRect;
    144145begin
    145146  with FStringGrid1 do begin
    146     //Columns.Clear;
    147147    while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1);
    148148    while Columns.Count < ListView.Columns.Count do Columns.Add;
    149149    for I := 0 to ListView.Columns.Count - 1 do begin
    150150      Columns[I].Width := ListView.Columns[I].Width;
     151      if Selection.Left = I then begin
     152        R := CellRect(I, 0);
     153        Editor.Left := R.Left + 2;
     154        Editor.Width := R.Width - 4;
     155      end;
    151156    end;
    152157  end;
     
    197202  if AMsg.Msg = WM_NOTIFY then
    198203  begin
    199     Code := PHDNotify(vMsgNotify.NMHdr)^.Hdr.Code;
     204    Code := NMHDR(PHDNotify(vMsgNotify.NMHdr)^.Hdr).Code;
    200205    case Code of
    201206      HDN_ENDTRACKA, HDN_ENDTRACKW:
     
    353358  TP1: TPoint;
    354359  XBias, YBias: Integer;
    355   OldColor: TColor;
     360  PenColor: TColor;
     361  BrushColor: TColor;
    356362  BiasTop, BiasLeft: Integer;
    357363  Rect1: TRect;
     
    365371  Item.Left := 0;
    366372  GetCheckBias(XBias, YBias, BiasTop, BiasLeft, ListView);
    367   OldColor := ListView.Canvas.Pen.Color;
     373  PenColor := ListView.Canvas.Pen.Color;
     374  BrushColor := ListView.Canvas.Brush.Color;
    368375  //TP1 := Item.GetPosition;
    369376  lRect := Item.DisplayRect(drBounds); // Windows 7 workaround
     
    377384  ItemLeft := Item.Left;
    378385  ItemLeft := 23; // Windows 7 workaround
    379  
     386
    380387  Rect1.Left := ItemLeft - CheckWidth - BiasLeft + 1 + XBias;
    381388  //ShowMessage(IntToStr(Tp1.Y) + ', ' + IntToStr(BiasTop) + ', ' + IntToStr(XBias));
     
    408415  end;
    409416  //ListView.Canvas.Brush.Color := ListView.Color;
    410   ListView.Canvas.Brush.Color := clWindow;
    411   ListView.Canvas.Pen.Color := OldColor;
     417  ListView.Canvas.Brush.Color := BrushColor;
     418  ListView.Canvas.Pen.Color := PenColor;
    412419end;
    413420
     
    476483    FHeaderHandle := ListView_GetHeader(FListView.Handle);
    477484    for I := 0 to FListView.Columns.Count - 1 do begin
     485      {$push}{$warn 5057 off}
    478486      FillChar(Item, SizeOf(THDItem), 0);
     487      {$pop}
    479488      Item.Mask := HDI_FORMAT;
    480489      Header_GetItem(FHeaderHandle, I, Item);
  • branches/generator/Packages/Common/UMemory.pas

    r114 r167  
    2424    constructor Create;
    2525    destructor Destroy; override;
     26    procedure WriteMemory(Position: Integer; Memory: TMemory);
     27    procedure ReadMemory(Position: Integer; Memory: TMemory);
    2628    property Data: PByte read FData;
    2729    property Size: Integer read FSize write SetSize;
     
    108110end;
    109111
     112procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory);
     113begin
     114  Move(Memory.FData, PByte(@FData + Position)^, Memory.Size);
     115end;
     116
     117procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory);
     118begin
     119  Move(PByte(@FData + Position)^, Memory.FData, Memory.Size);
     120end;
     121
    110122end.
    111123
  • branches/generator/Packages/Common/UPersistentForm.pas

    r114 r167  
    88
    99uses
    10   Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls;
     10  Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls,
     11  ExtCtrls;
    1112
    1213type
     
    5657  I: Integer;
    5758  WinControl: TWinControl;
    58   Count: Integer;
    5959begin
    6060  if Control is TListView then begin
     
    7272  end;
    7373
     74  if (Control is TPanel) then begin
     75    with Form, TRegistryEx.Create do
     76    try
     77      RootKey := RegistryContext.RootKey;
     78      OpenKey(RegistryContext.Key + '\Forms\' + Form.Name + '\' + Control.Name, True);
     79      if (TPanel(Control).Align = alRight) or (TPanel(Control).Align = alLeft) then begin
     80        if ValueExists('Width') then
     81          TPanel(Control).Width := ReadInteger('Width');
     82      end;
     83      if (TPanel(Control).Align = alTop) or (TPanel(Control).Align = alBottom) then begin
     84        if ValueExists('Height') then
     85          TPanel(Control).Height := ReadInteger('Height');
     86      end;
     87    finally
     88      Free;
     89    end;
     90  end;
     91
    7492  if Control is TWinControl then begin
    7593    WinControl := TWinControl(Control);
     
    96114      for I := 0 to TListView(Control).Columns.Count - 1 do begin
    97115        WriteInteger('ColWidth' + IntToStr(I), TListView(Control).Columns[I].Width);
     116      end;
     117    finally
     118      Free;
     119    end;
     120  end;
     121
     122  if (Control is TPanel) then begin
     123    with Form, TRegistryEx.Create do
     124    try
     125      RootKey := RegistryContext.RootKey;
     126      OpenKey(RegistryContext.Key + '\Forms\' + Form.Name + '\' + Control.Name, True);
     127      if (TPanel(Control).Align = alRight) or (TPanel(Control).Align = alLeft) then begin
     128        WriteInteger('Width', TPanel(Control).Width);
     129      end;
     130      if (TPanel(Control).Align = alTop) or (TPanel(Control).Align = alBottom) then begin
     131        WriteInteger('Height', TPanel(Control).Height);
    98132      end;
    99133    finally
     
    217251
    218252procedure TPersistentForm.Load(Form: TForm; DefaultMaximized: Boolean = False);
    219 var
    220   LoadDefaults: Boolean;
    221253begin
    222254  Self.Form := Form;
     
    230262
    231263  if not EqualRect(FormNormalSize, FormRestoredSize) or
    232     (LoadDefaults and DefaultMaximized) then begin
     264    DefaultMaximized then begin
    233265    // Restore to maximized state
    234266    Form.WindowState := wsNormal;
  • branches/generator/Packages/Common/URegistry.pas

    r114 r167  
    99
    1010type
    11   TRegistryRoot = (rrKeyClassesRoot = HKEY($80000000),
    12     rrKeyCurrentUser = HKEY($80000001),
    13     rrKeyLocalMachine = HKEY($80000002),
    14     rrKeyUsers = HKEY($80000003),
    15     rrKeyPerformanceData = HKEY($80000004),
    16     rrKeyCurrentConfig = HKEY($80000005),
    17     rrKeyDynData = HKEY($80000006));
     11  TRegistryRoot = (rrKeyClassesRoot, rrKeyCurrentUser, rrKeyLocalMachine,
     12    rrKeyUsers, rrKeyPerformanceData, rrKeyCurrentConfig, rrKeyDynData);
    1813
    1914  { TRegistryContext }
     
    2318    Key: string;
    2419    class operator Equal(A, B: TRegistryContext): Boolean;
     20    function Create(RootKey: TRegistryRoot; Key: string): TRegistryContext; overload;
     21    function Create(RootKey: HKEY; Key: string): TRegistryContext; overload;
    2522  end;
    2623
     
    4340  end;
    4441
    45 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;
    46 
     42const
     43  RegistryRootHKEY: array[TRegistryRoot] of HKEY = (HKEY_CLASSES_ROOT,
     44    HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA,
     45    HKEY_CURRENT_CONFIG, HKEY_DYN_DATA);
    4746
    4847implementation
    4948
    50 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;
    51 begin
    52   Result.RootKey := RootKey;
    53   Result.Key := Key;
    54 end;
    5549
    5650{ TRegistryContext }
     
    5953begin
    6054  Result := (A.Key = B.Key) and (A.RootKey = B.RootKey);
     55end;
     56
     57function TRegistryContext.Create(RootKey: TRegistryRoot; Key: string): TRegistryContext;
     58begin
     59  Result.RootKey := RegistryRootHKEY[RootKey];
     60  Result.Key := Key;
     61end;
     62
     63function TRegistryContext.Create(RootKey: HKEY; Key: string): TRegistryContext;
     64begin
     65  Result.RootKey := RootKey;
     66  Result.Key := Key;
    6167end;
    6268
  • branches/generator/Packages/Common/UResetableThread.pas

    r114 r167  
    156156  FThread.Name := 'ResetableThread';
    157157  FThread.Parent := Self;
    158   FThread.Resume;
     158  FThread.Start;
    159159end;
    160160
  • branches/generator/Packages/Common/UScaleDPI.pas

    r114 r167  
    215215  I: Integer;
    216216begin
     217  ImgList.BeginUpdate;
    217218  NewWidth := ScaleX(ImgList.Width, FromDPI.X);
    218219  NewHeight := ScaleY(ImgList.Height, FromDPI.Y);
     
    248249    Temp[i].Free;
    249250  end;
     251  ImgList.EndUpdate;
    250252end;
    251253
     
    284286  WinControl: TWinControl;
    285287  ToolBarControl: TToolBar;
    286   OldAnchors: TAnchors;
    287   OldAutoSize: Boolean;
     288  //OldAnchors: TAnchors;
     289  //OldAutoSize: Boolean;
    288290begin
    289291  //if Control is TMemo then Exit;
     
    316318        MinWidth := ScaleX(MinWidth, FromDPI.X);
    317319        MinHeight := ScaleY(MinHeight, FromDPI.Y);
    318         Width := ScaleX(Width, FromDPI.X);
     320        // Workaround to bad band width auto sizing
     321        //Width := ScaleX(Width, FromDPI.X);
     322        Width := ScaleX(Control.Width + 28, FromDPI.X);
    319323        //Control.Invalidate;
    320324      end;
     325    // Workaround for bad autosizing of coolbar
     326    if AutoSize then begin
     327      AutoSize := False;
     328      Height := ScaleY(Height, FromDPI.Y);
     329      AutoSize := True;
     330    end;
    321331    EndUpdate;
    322332  end;
  • branches/generator/Packages/Common/UThreading.pas

    r114 r167  
    3030    Name: string;
    3131    procedure Execute; virtual; abstract;
    32     procedure Resume; virtual; abstract;
    33     procedure Suspend; virtual; abstract;
    3432    procedure Start; virtual; abstract;
    3533    procedure Terminate; virtual; abstract;
     
    8179    procedure Sleep(Delay: Integer); override;
    8280    procedure Execute; override;
    83     procedure Resume; override;
    84     procedure Suspend; override;
    8581    procedure Start; override;
    8682    procedure Terminate; override;
     
    134130    Thread.FreeOnTerminate := False;
    135131    Thread.Method := Method;
    136     Thread.Resume;
     132    Thread.Start;
    137133    while (Thread.State = ttsRunning) or (Thread.State = ttsReady) do begin
    138134      if MainThreadID = ThreadID then Application.ProcessMessages;
     
    155151    Thread.Method := Method;
    156152    Thread.OnFinished := CallBack;
    157     Thread.Resume;
     153    Thread.Start;
    158154    //if Thread.State = ttsExceptionOccured then
    159155    //  raise Exception.Create(Thread.ExceptionMessage);
     
    313309procedure TListedThread.Execute;
    314310begin
    315 end;
    316 
    317 procedure TListedThread.Resume;
    318 begin
    319   FThread.Resume;
    320 end;
    321 
    322 procedure TListedThread.Suspend;
    323 begin
    324   FThread.Suspend;
    325311end;
    326312
  • branches/generator/Packages/Common/UURI.pas

    r114 r167  
    8989function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    9090var
    91   I, J: Integer;
     91  I: Integer;
    9292  Matched: Boolean;
    9393begin
     
    113113function RightCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    114114var
    115   I, J: Integer;
     115  I: Integer;
    116116  Matched: Boolean;
    117117begin
     
    202202
    203203procedure TURI.SetAsString(Value: string);
    204 var
    205   HostAddr: string;
    206   HostPort: string;
    207204begin
    208205  LeftCutString(Value, Scheme, ':');
  • branches/generator/Packages/Common/UXMLUtils.pas

    r136 r167  
    77uses
    88  {$IFDEF WINDOWS}Windows,{$ENDIF}
    9   Classes, SysUtils, DateUtils, XMLRead, DOM;
     9  Classes, SysUtils, DateUtils, DOM, XMLRead;
    1010
    1111function XMLTimeToDateTime(XMLDateTime: string): TDateTime;
    12 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;
     12function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string;
    1313procedure WriteInteger(Node: TDOMNode; Name: string; Value: Integer);
    1414procedure WriteInt64(Node: TDOMNode; Name: string; Value: Int64);
     
    5050  TimeZoneInfo: TTimeZoneInformation;
    5151begin
     52  {$push}{$warn 5057 off}
    5253  case GetTimeZoneInformation(TimeZoneInfo) of
    53   TIME_ZONE_ID_STANDARD: Result := TimeZoneInfo.Bias + TimeZoneInfo.StandardBias;
    54   TIME_ZONE_ID_DAYLIGHT: Result := TimeZoneInfo.Bias + TimeZoneInfo.DaylightBias;
     54    TIME_ZONE_ID_STANDARD: Result := TimeZoneInfo.Bias + TimeZoneInfo.StandardBias;
     55    TIME_ZONE_ID_DAYLIGHT: Result := TimeZoneInfo.Bias + TimeZoneInfo.DaylightBias;
    5556  else
    5657    Result := 0;
    5758  end;
     59  {$pop}
    5860end;
    5961{$ELSE}
     
    6567function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    6668var
    67   I, J: Integer;
     69  I: Integer;
    6870  Matched: Boolean;
    6971begin
     
    119121      if Pos('Z', XMLDateTime) > 0 then
    120122        LeftCutString(XMLDateTime, Part, 'Z');
    121       SecondFraction := StrToFloat('0' + DecimalSeparator + Part);
     123      SecondFraction := StrToFloat('0' + DefaultFormatSettings.DecimalSeparator + Part);
    122124      Millisecond := Trunc(SecondFraction * 1000);
    123125    end else begin
     
    138140end;
    139141
    140 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;
     142function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string;
    141143const
    142144  Neg: array[Boolean] of string =  ('+', '-');
     
    159161  NewNode: TDOMNode;
    160162begin
    161   NewNode := Node.OwnerDocument.CreateElement(Name);
    162   NewNode.TextContent := IntToStr(Value);
     163  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     164  NewNode.TextContent := DOMString(IntToStr(Value));
    163165  Node.AppendChild(NewNode);
    164166end;
     
    168170  NewNode: TDOMNode;
    169171begin
    170   NewNode := Node.OwnerDocument.CreateElement(Name);
    171   NewNode.TextContent := IntToStr(Value);
     172  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     173  NewNode.TextContent := DOMString(IntToStr(Value));
    172174  Node.AppendChild(NewNode);
    173175end;
     
    177179  NewNode: TDOMNode;
    178180begin
    179   NewNode := Node.OwnerDocument.CreateElement(Name);
    180   NewNode.TextContent := BoolToStr(Value);
     181  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     182  NewNode.TextContent := DOMString(BoolToStr(Value));
    181183  Node.AppendChild(NewNode);
    182184end;
     
    186188  NewNode: TDOMNode;
    187189begin
    188   NewNode := Node.OwnerDocument.CreateElement(Name);
    189   NewNode.TextContent := Value;
     190  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     191  NewNode.TextContent := DOMString(Value);
    190192  Node.AppendChild(NewNode);
    191193end;
     
    195197  NewNode: TDOMNode;
    196198begin
    197   NewNode := Node.OwnerDocument.CreateElement(Name);
    198   NewNode.TextContent := DateTimeToXMLTime(Value);
     199  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     200  NewNode.TextContent := DOMString(DateTimeToXMLTime(Value));
    199201  Node.AppendChild(NewNode);
    200202end;
     
    205207begin
    206208  Result := DefaultValue;
    207   NewNode := Node.FindNode(Name);
    208   if Assigned(NewNode) then
    209     Result := StrToInt(NewNode.TextContent);
     209  NewNode := Node.FindNode(DOMString(Name));
     210  if Assigned(NewNode) then
     211    Result := StrToInt(string(NewNode.TextContent));
    210212end;
    211213
     
    215217begin
    216218  Result := DefaultValue;
    217   NewNode := Node.FindNode(Name);
    218   if Assigned(NewNode) then
    219     Result := StrToInt64(NewNode.TextContent);
     219  NewNode := Node.FindNode(DOMString(Name));
     220  if Assigned(NewNode) then
     221    Result := StrToInt64(string(NewNode.TextContent));
    220222end;
    221223
     
    225227begin
    226228  Result := DefaultValue;
    227   NewNode := Node.FindNode(Name);
    228   if Assigned(NewNode) then
    229     Result := StrToBool(NewNode.TextContent);
     229  NewNode := Node.FindNode(DOMString(Name));
     230  if Assigned(NewNode) then
     231    Result := StrToBool(string(NewNode.TextContent));
    230232end;
    231233
     
    235237begin
    236238  Result := DefaultValue;
    237   NewNode := Node.FindNode(Name);
    238   if Assigned(NewNode) then
    239     Result := NewNode.TextContent;
     239  NewNode := Node.FindNode(DOMString(Name));
     240  if Assigned(NewNode) then
     241    Result := string(NewNode.TextContent);
    240242end;
    241243
     
    246248begin
    247249  Result := DefaultValue;
    248   NewNode := Node.FindNode(Name);
    249   if Assigned(NewNode) then
    250     Result := XMLTimeToDateTime(NewNode.TextContent);
     250  NewNode := Node.FindNode(DOMString(Name));
     251  if Assigned(NewNode) then
     252    Result := XMLTimeToDateTime(string(NewNode.TextContent));
    251253end;
    252254
  • branches/generator/UCore.lfm

    r131 r167  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 733
    6   HorizontalOffset = 491
    7   VerticalOffset = 287
    8   Width = 1180
     5  Height = 562
     6  HorizontalOffset = 384
     7  VerticalOffset = 276
     8  Width = 865
     9  PPI = 120
    910  object ImageList1: TImageList
    10     left = 540
    11     top = 304
     11    left = 256
     12    top = 136
    1213    Bitmap = {
    1314      4C690B0000001000000010000000000000000000000000000000000000000000
     
    369370    MinVisiblePart = 50
    370371    EntireVisible = False
    371     left = 341
    372     top = 154
     372    left = 408
     373    top = 144
    373374  end
    374375  object XMLConfig1: TXMLConfig
     
    376377    RootName = 'CONFIG'
    377378    ReadOnly = False
    378     left = 251
    379     top = 328
     379    left = 96
     380    top = 128
     381  end
     382  object ApplicationInfo1: TApplicationInfo
     383    Identification = 1
     384    VersionMajor = 1
     385    VersionMinor = 0
     386    VersionBugFix = 0
     387    AppName = 'Generator'
     388    ReleaseDate = 0
     389    RegistryKey = '\Software\Chronosoft\Generator'
     390    RegistryRoot = rrKeyCurrentUser
     391    License = 'CC)'
     392    left = 192
     393    top = 259
    380394  end
    381395end
  • branches/generator/UCore.pas

    r131 r167  
    77uses
    88  Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UGrammer,
    9   UPersistentForm, ULastOpenedList;
     9  UPersistentForm, ULastOpenedList, UApplicationInfo;
    1010
    1111type
     
    1414
    1515  TCore = class(TDataModule)
     16    ApplicationInfo1: TApplicationInfo;
    1617    ImageList1: TImageList;
    1718    PersistentForm1: TPersistentForm;
     
    6970procedure TCore.Initialize;
    7071begin
     72  PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext;
    7173  LoadConfig;
    7274  FormMain.LoadConfig(XMLConfig1);
  • branches/generator/generator.lpi

    r137 r167  
    151151        <IsPartOfProject Value="True"/>
    152152        <ComponentName Value="FormLookupTables"/>
     153        <HasResources Value="True"/>
    153154        <ResourceBaseClass Value="Form"/>
    154155      </Unit10>
     
    157158        <IsPartOfProject Value="True"/>
    158159        <ComponentName Value="FormLookupTable"/>
     160        <HasResources Value="True"/>
    159161        <ResourceBaseClass Value="Form"/>
    160162      </Unit11>
Note: See TracChangeset for help on using the changeset viewer.