Changeset 41


Ignore:
Timestamp:
May 8, 2019, 11:54:23 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Build under Lazarus 2.0.
  • Modified: Used .lrj files instead of .lrt files.
  • Modified: Removed TemplateGenerics package.
Location:
trunk
Files:
8 added
5 deleted
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/CoolDisk.lpi

    r40 r41  
    22<CONFIG>
    33  <ProjectOptions>
    4     <Version Value="9"/>
     4    <Version Value="11"/>
    55    <General>
    66      <SessionStorage Value="InProjectDir"/>
     
    1818      <OutDir Value="Languages"/>
    1919    </i18n>
    20     <VersionInfo>
    21       <StringTable ProductVersion=""/>
    22     </VersionInfo>
    23     <BuildModes Count="4">
     20    <BuildModes Count="2">
    2421      <Item1 Name="Debug" Default="True"/>
    2522      <Item2 Name="Release">
     
    3229            <IncludeFiles Value="$(ProjOutDir)"/>
    3330            <OtherUnitFiles Value="Forms"/>
    34             <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     31            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    3532          </SearchPaths>
    3633          <Parsing>
     
    6158        </CompilerOptions>
    6259      </Item2>
    63       <Item3 Name="Windows 32-bit">
    64         <CompilerOptions>
    65           <Version Value="11"/>
    66           <Target>
    67             <Filename Value="lib/$(TargetCPU)-$(TargetOS)/CoolDisk"/>
    68           </Target>
    69           <SearchPaths>
    70             <IncludeFiles Value="$(ProjOutDir)"/>
    71             <OtherUnitFiles Value="Forms"/>
    72             <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    73           </SearchPaths>
    74           <Parsing>
    75             <SyntaxOptions>
    76               <SyntaxMode Value="Delphi"/>
    77               <CStyleOperator Value="False"/>
    78               <AllowLabel Value="False"/>
    79               <CPPInline Value="False"/>
    80             </SyntaxOptions>
    81           </Parsing>
    82           <CodeGeneration>
    83             <SmartLinkUnit Value="True"/>
    84             <TargetCPU Value="i386"/>
    85             <TargetOS Value="win32"/>
    86             <Optimizations>
    87               <OptimizationLevel Value="3"/>
    88             </Optimizations>
    89           </CodeGeneration>
    90           <Linking>
    91             <Debugging>
    92               <GenerateDebugInfo Value="False"/>
    93             </Debugging>
    94             <LinkSmart Value="True"/>
    95             <Options>
    96               <Win32>
    97                 <GraphicApplication Value="True"/>
    98               </Win32>
    99             </Options>
    100           </Linking>
    101         </CompilerOptions>
    102       </Item3>
    103       <Item4 Name="Windows 64-bit">
    104         <CompilerOptions>
    105           <Version Value="11"/>
    106           <Target>
    107             <Filename Value="lib/$(TargetCPU)-$(TargetOS)/CoolDisk"/>
    108           </Target>
    109           <SearchPaths>
    110             <IncludeFiles Value="$(ProjOutDir)"/>
    111             <OtherUnitFiles Value="Forms"/>
    112             <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    113           </SearchPaths>
    114           <Parsing>
    115             <SyntaxOptions>
    116               <SyntaxMode Value="Delphi"/>
    117               <CStyleOperator Value="False"/>
    118               <AllowLabel Value="False"/>
    119               <CPPInline Value="False"/>
    120             </SyntaxOptions>
    121           </Parsing>
    122           <CodeGeneration>
    123             <SmartLinkUnit Value="True"/>
    124             <TargetCPU Value="x86_64"/>
    125             <TargetOS Value="win64"/>
    126             <Optimizations>
    127               <OptimizationLevel Value="3"/>
    128             </Optimizations>
    129           </CodeGeneration>
    130           <Linking>
    131             <Debugging>
    132               <GenerateDebugInfo Value="False"/>
    133             </Debugging>
    134             <LinkSmart Value="True"/>
    135             <Options>
    136               <Win32>
    137                 <GraphicApplication Value="True"/>
    138               </Win32>
    139             </Options>
    140           </Linking>
    141         </CompilerOptions>
    142       </Item4>
     60      <SharedMatrixOptions Count="2">
     61        <Item1 ID="307887130071" Targets="Common, CoolTranslator" Modes="Debug" Value="-g -gl -gh -CirotR -O1"/>
     62        <Item2 ID="977980535563" Targets="Common, CoolTranslator" Modes="Release" Value="-CX -XX -O3"/>
     63      </SharedMatrixOptions>
    14364    </BuildModes>
    14465    <PublishOptions>
     
    14667    </PublishOptions>
    14768    <RunParams>
    148       <local>
    149         <FormatVersion Value="1"/>
    150       </local>
     69      <FormatVersion Value="2"/>
     70      <Modes Count="1">
     71        <Mode0 Name="default"/>
     72      </Modes>
    15173    </RunParams>
    152     <RequiredPackages Count="6">
     74    <RequiredPackages Count="5">
    15375      <Item1>
    15476        <PackageName Value="CoolTranslator"/>
     
    15981      </Item2>
    16082      <Item3>
    161         <PackageName Value="TemplateGenerics"/>
    162         <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/>
     83        <PackageName Value="Common"/>
     84        <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
    16385      </Item3>
    16486      <Item4>
    165         <PackageName Value="Common"/>
    166         <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
     87        <PackageName Value="tachartlazaruspkg"/>
    16788      </Item4>
    16889      <Item5>
    169         <PackageName Value="tachartlazaruspkg"/>
     90        <PackageName Value="LCL"/>
    17091      </Item5>
    171       <Item6>
    172         <PackageName Value="LCL"/>
    173       </Item6>
    17492    </RequiredPackages>
    17593    <Units Count="14">
     
    261179      <IncludeFiles Value="$(ProjOutDir)"/>
    262180      <OtherUnitFiles Value="Forms"/>
    263       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     181      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    264182    </SearchPaths>
    265183    <Parsing>
     
    281199    </CodeGeneration>
    282200    <Linking>
     201      <Debugging>
     202        <UseHeaptrc Value="True"/>
     203      </Debugging>
    283204      <Options>
    284205        <Win32>
  • trunk/CoolDisk.lpr

    r34 r41  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, tachartlazaruspkg, UProject,
    11   UConfig, UBlockMap, UDriveScan, Common, TemplateGenerics, UFormProject,
     11  UConfig, UBlockMap, UDriveScan, Common, UFormProject,
    1212  UPhysDrive, UCore, UFileStreamEx, CoolTranslator, UFormMain, UFormBenchmark,
    1313  UFormOperation;
  • trunk/Forms/UFormAbout.lfm

    r37 r41  
    11object FormAbout: TFormAbout
    22  Left = 562
    3   Height = 335
     3  Height = 502
    44  Top = 339
    5   Width = 533
     5  Width = 800
    66  Caption = 'About'
    7   ClientHeight = 335
    8   ClientWidth = 533
     7  ClientHeight = 502
     8  ClientWidth = 800
     9  DesignTimePPI = 144
    910  OnCreate = FormCreate
    1011  OnShow = FormShow
    1112  Position = poScreenCenter
    12   LCLVersion = '1.6.2.0'
     13  LCLVersion = '2.0.0.4'
    1314  object LabelDescription: TLabel
    14     Left = 20
    15     Height = 50
    16     Top = 108
    17     Width = 493
     15    Left = 30
     16    Height = 26
     17    Top = 162
     18    Width = 740
    1819    Align = alTop
    19     BorderSpacing.Around = 20
     20    BorderSpacing.Around = 30
    2021    Caption = 'CoolDisk is helpful GUI application for various disk surface operations.'
    2122    ParentColor = False
     23    ParentFont = False
    2224    WordWrap = True
    2325  end
    2426  object ButtonClose: TButton
    25     Left = 420
    26     Height = 25
    27     Top = 295
    28     Width = 93
     27    Left = 630
     28    Height = 38
     29    Top = 442
     30    Width = 140
    2931    Anchors = [akRight, akBottom]
    3032    Caption = 'Close'
    3133    ModalResult = 1
     34    ParentFont = False
    3235    TabOrder = 0
    3336  end
    3437  object LabelContent: TLabel
    35     Left = 20
    36     Height = 25
    37     Top = 178
    38     Width = 493
     38    Left = 30
     39    Height = 26
     40    Top = 218
     41    Width = 740
    3942    Align = alTop
    40     BorderSpacing.Around = 20
     43    BorderSpacing.Around = 30
    4144    Caption = '   '
    4245    ParentColor = False
     46    ParentFont = False
    4347  end
    4448  object ButtonHomePage: TButton
    45     Left = 16
    46     Height = 25
    47     Top = 295
    48     Width = 176
     49    Left = 24
     50    Height = 38
     51    Top = 442
     52    Width = 264
    4953    Anchors = [akLeft, akBottom]
    5054    Caption = 'Home page'
    5155    OnClick = ButtonHomePageClick
     56    ParentFont = False
    5257    TabOrder = 1
    5358  end
    5459  object Panel1: TPanel
    5560    Left = 0
    56     Height = 88
     61    Height = 132
    5762    Top = 0
    58     Width = 533
     63    Width = 800
    5964    Align = alTop
    6065    BevelOuter = bvNone
    61     ClientHeight = 88
    62     ClientWidth = 533
     66    ClientHeight = 132
     67    ClientWidth = 800
     68    ParentFont = False
    6369    TabOrder = 2
    6470    object Image1: TImage
    65       Left = 24
    66       Height = 66
    67       Top = 16
    68       Width = 69
     71      Left = 36
     72      Height = 99
     73      Top = 24
     74      Width = 104
    6975      Picture.Data = {
    7076        1754506F727461626C654E6574776F726B47726170686963B30C000089504E47
     
    175181    object LabelAppName: TLabel
    176182      Left = 104
    177       Height = 54
     183      Height = 83
    178184      Top = 16
    179       Width = 167
     185      Width = 261
    180186      Align = alCustom
    181       BorderSpacing.Around = 20
     187      BorderSpacing.Around = 30
    182188      Caption = 'Cool Disk'
    183       Font.Height = -40
     189      Font.Height = -60
    184190      ParentColor = False
    185191      ParentFont = False
  • trunk/Forms/UFormBenchmark.lfm

    r22 r41  
    11object FormBenchmark: TFormBenchmark
    22  Left = 874
    3   Height = 711
    4   Top = 372
    5   Width = 773
     3  Height = 1066
     4  Top = 316
     5  Width = 1160
    66  Caption = 'Benchmark'
    7   ClientHeight = 711
    8   ClientWidth = 773
    9   LCLVersion = '1.7'
     7  ClientHeight = 1066
     8  ClientWidth = 1160
     9  DesignTimePPI = 144
     10  LCLVersion = '2.0.0.4'
    1011  object Chart1: TChart
    11     Left = 24
    12     Height = 656
    13     Top = 40
    14     Width = 728
     12    Left = 36
     13    Height = 984
     14    Top = 60
     15    Width = 1092
    1516    AxisList = <   
    1617      item
     18        Marks.LabelBrush.Style = bsClear
    1719        Minors = <>
    1820        Title.LabelFont.Orientation = 900
     21        Title.LabelBrush.Style = bsClear
    1922      end   
    2023      item
    2124        Alignment = calBottom
     25        Marks.LabelBrush.Style = bsClear
    2226        Minors = <>
     27        Title.LabelBrush.Style = bsClear
    2328      end>
    2429    Foot.Brush.Color = clBtnFace
  • trunk/Forms/UFormMain.lfm

    r34 r41  
    11object FormMain: TFormMain
    2   Left = 433
    3   Height = 1072
    4   Top = 204
    5   Width = 1703
     2  Left = 221
     3  Height = 1108
     4  Top = 169
     5  Width = 1654
    66  Caption = 'CoolDisk'
    7   ClientHeight = 1040
    8   ClientWidth = 1703
     7  ClientHeight = 1074
     8  ClientWidth = 1654
     9  DesignTimePPI = 144
    910  Menu = MainMenu1
    1011  OnClose = FormClose
     
    1314  OnDestroy = FormDestroy
    1415  OnShow = FormShow
    15   LCLVersion = '1.6.0.4'
     16  LCLVersion = '2.0.0.4'
    1617  object ToolBar1: TToolBar
    1718    Left = 0
    18     Height = 26
     19    Height = 39
    1920    Top = 0
    20     Width = 1703
     21    Width = 1654
    2122    Images = Core.ImageList1
     23    ParentFont = False
    2224    TabOrder = 0
    2325    object ToolButton1: TToolButton
     
    2729    end
    2830    object ToolButton2: TToolButton
    29       Left = 24
     31      Left = 36
    3032      Top = 2
    3133      Action = AScanStop
    3234    end
    3335    object ToolButton3: TToolButton
    34       Left = 47
     36      Left = 71
    3537      Top = 2
    3638      Action = AScanContinue
     
    3941  object Panel2: TPanel
    4042    Left = 0
    41     Height = 1014
    42     Top = 26
    43     Width = 592
     43    Height = 1035
     44    Top = 39
     45    Width = 888
    4446    Align = alLeft
    4547    BevelOuter = bvNone
    46     ClientHeight = 1014
    47     ClientWidth = 592
     48    ClientHeight = 1035
     49    ClientWidth = 888
     50    ParentFont = False
    4851    TabOrder = 1
    4952    object Panel3: TPanel
    5053      Left = 0
    51       Height = 379
     54      Height = 568
    5255      Top = 0
    53       Width = 592
     56      Width = 888
    5457      Align = alTop
    5558      BevelOuter = bvNone
    56       ClientHeight = 379
    57       ClientWidth = 592
     59      ClientHeight = 568
     60      ClientWidth = 888
     61      ParentFont = False
    5862      TabOrder = 0
    5963      object Label1: TLabel
    60         Left = 16
    61         Height = 24
    62         Top = 179
     64        Left = 24
     65        Height = 26
     66        Top = 268
    6367        Width = 96
    6468        Caption = 'Sector size:'
    6569        ParentColor = False
     70        ParentFont = False
    6671      end
    6772      object LabelSectorSize: TLabel
    68         Left = 257
    69         Height = 24
    70         Top = 179
    71         Width = 10
    72         Caption = '  '
    73         ParentColor = False
     73        Left = 386
     74        Height = 26
     75        Top = 268
     76        Width = 10
     77        Caption = '  '
     78        ParentColor = False
     79        ParentFont = False
    7480      end
    7581      object LabelSectorCount: TLabel
    76         Left = 257
    77         Height = 24
    78         Top = 208
    79         Width = 10
    80         Caption = '  '
    81         ParentColor = False
     82        Left = 386
     83        Height = 26
     84        Top = 312
     85        Width = 10
     86        Caption = '  '
     87        ParentColor = False
     88        ParentFont = False
    8289      end
    8390      object Label2: TLabel
    84         Left = 16
    85         Height = 24
    86         Top = 208
     91        Left = 24
     92        Height = 26
     93        Top = 312
    8794        Width = 113
    8895        Caption = 'Sector count:'
    8996        ParentColor = False
     97        ParentFont = False
    9098      end
    9199      object LabelBlockCurrent: TLabel
    92         Left = 257
    93         Height = 24
    94         Top = 240
    95         Width = 10
    96         Caption = '  '
    97         ParentColor = False
     100        Left = 386
     101        Height = 26
     102        Top = 360
     103        Width = 10
     104        Caption = '  '
     105        ParentColor = False
     106        ParentFont = False
    98107      end
    99108      object Label3: TLabel
    100         Left = 16
    101         Height = 24
    102         Top = 240
     109        Left = 24
     110        Height = 26
     111        Top = 360
    103112        Width = 127
    104113        Caption = 'Current sector:'
    105114        ParentColor = False
     115        ParentFont = False
    106116      end
    107117      object Label4: TLabel
    108         Left = 16
    109         Height = 24
    110         Top = 272
     118        Left = 24
     119        Height = 26
     120        Top = 408
    111121        Width = 154
    112122        Caption = 'Damaged sectors:'
    113123        ParentColor = False
     124        ParentFont = False
    114125      end
    115126      object LabelBlockDamaged: TLabel
    116         Left = 257
    117         Height = 24
    118         Top = 268
    119         Width = 10
    120         Caption = '  '
    121         ParentColor = False
     127        Left = 386
     128        Height = 26
     129        Top = 402
     130        Width = 10
     131        Caption = '  '
     132        ParentColor = False
     133        ParentFont = False
    122134      end
    123135      object Label5: TLabel
    124         Left = 16
    125         Height = 24
    126         Top = 300
     136        Left = 24
     137        Height = 26
     138        Top = 450
    127139        Width = 115
    128140        Caption = 'Elapsed time:'
    129141        ParentColor = False
     142        ParentFont = False
    130143      end
    131144      object LabelElapsedTime: TLabel
    132         Left = 257
    133         Height = 24
    134         Top = 296
    135         Width = 10
    136         Caption = '  '
    137         ParentColor = False
     145        Left = 386
     146        Height = 26
     147        Top = 444
     148        Width = 10
     149        Caption = '  '
     150        ParentColor = False
     151        ParentFont = False
    138152      end
    139153      object Label6: TLabel
    140         Left = 16
    141         Height = 24
    142         Top = 328
     154        Left = 24
     155        Height = 26
     156        Top = 492
    143157        Width = 135
    144158        Caption = 'Estimated time:'
    145159        ParentColor = False
     160        ParentFont = False
    146161      end
    147162      object LabelEstimatedTime: TLabel
    148         Left = 258
    149         Height = 24
    150         Top = 324
    151         Width = 10
    152         Caption = '  '
    153         ParentColor = False
     163        Left = 387
     164        Height = 26
     165        Top = 486
     166        Width = 10
     167        Caption = '  '
     168        ParentColor = False
     169        ParentFont = False
    154170      end
    155171      object Label7: TLabel
    156         Left = 16
    157         Height = 24
    158         Top = 148
     172        Left = 24
     173        Height = 26
     174        Top = 222
    159175        Width = 153
    160176        Caption = 'Sectors per Block:'
    161177        ParentColor = False
     178        ParentFont = False
    162179      end
    163180      object LabelSectorPerBlock: TLabel
    164         Left = 257
    165         Height = 24
    166         Top = 144
    167         Width = 10
    168         Caption = '  '
    169         ParentColor = False
     181        Left = 386
     182        Height = 26
     183        Top = 216
     184        Width = 10
     185        Caption = '  '
     186        ParentColor = False
     187        ParentFont = False
    170188      end
    171189      object LabelIOSpeed: TLabel
    172         Left = 257
    173         Height = 24
    174         Top = 352
    175         Width = 10
    176         Caption = '  '
    177         ParentColor = False
     190        Left = 386
     191        Height = 26
     192        Top = 528
     193        Width = 10
     194        Caption = '  '
     195        ParentColor = False
     196        ParentFont = False
    178197      end
    179198      object Label8: TLabel
    180         Left = 16
    181         Height = 24
    182         Top = 356
     199        Left = 24
     200        Height = 26
     201        Top = 534
    183202        Width = 88
    184203        Caption = 'I/O speed:'
    185204        ParentColor = False
     205        ParentFont = False
    186206      end
    187207      object Label10: TLabel
    188         Left = 16
    189         Height = 24
    190         Top = 116
     208        Left = 24
     209        Height = 26
     210        Top = 174
    191211        Width = 38
    192212        Caption = 'Size:'
    193213        ParentColor = False
     214        ParentFont = False
    194215      end
    195216      object LabelSize: TLabel
    196         Left = 257
    197         Height = 24
    198         Top = 112
    199         Width = 10
    200         Caption = '  '
    201         ParentColor = False
     217        Left = 386
     218        Height = 26
     219        Top = 168
     220        Width = 10
     221        Caption = '  '
     222        ParentColor = False
     223        ParentFont = False
    202224      end
    203225      object ButtonScan: TButton
    204         Left = 16
    205         Height = 25
    206         Top = 72
    207         Width = 75
     226        Left = 24
     227        Height = 38
     228        Top = 108
     229        Width = 112
    208230        Action = AScanStart
     231        ParentFont = False
    209232        TabOrder = 0
    210233      end
    211234      object ButtonScan1: TButton
    212         Left = 464
    213         Height = 25
    214         Top = 24
    215         Width = 120
     235        Left = 696
     236        Height = 38
     237        Top = 36
     238        Width = 180
    216239        Action = AProjectOptions
    217240        Anchors = [akTop, akRight]
     241        ParentFont = False
    218242        TabOrder = 1
    219243      end
    220244      object ButtonScan2: TButton
    221         Left = 104
    222         Height = 25
    223         Top = 72
    224         Width = 75
     245        Left = 156
     246        Height = 38
     247        Top = 108
     248        Width = 112
    225249        Action = AScanStop
     250        ParentFont = False
    226251        TabOrder = 2
    227252      end
    228253      object Button2: TButton
    229         Left = 192
    230         Height = 25
    231         Top = 72
    232         Width = 107
     254        Left = 288
     255        Height = 38
     256        Top = 108
     257        Width = 160
    233258        Action = AScanContinue
     259        ParentFont = False
    234260        TabOrder = 3
    235261      end
    236262      object Button3: TButton
    237         Left = 312
    238         Height = 25
    239         Top = 72
    240         Width = 112
     263        Left = 468
     264        Height = 38
     265        Top = 108
     266        Width = 168
    241267        Action = AOperationOptions
     268        ParentFont = False
    242269        TabOrder = 4
    243270      end
    244271      object ComboBoxDrive: TComboBox
    245         Left = 8
    246         Height = 38
    247         Top = 16
    248         Width = 440
     272        Left = 12
     273        Height = 42
     274        Top = 24
     275        Width = 660
    249276        Anchors = [akTop, akLeft, akRight]
    250277        ItemHeight = 0
    251278        OnChange = ComboBoxDriveChange
     279        ParentFont = False
    252280        Style = csDropDownList
    253281        TabOrder = 5
     
    257285      Cursor = crVSplit
    258286      Left = 0
    259       Height = 5
    260       Top = 379
    261       Width = 592
     287      Height = 8
     288      Top = 568
     289      Width = 888
    262290      Align = alTop
    263291      ResizeAnchor = akTop
     
    265293    object Panel4: TPanel
    266294      Left = 0
    267       Height = 630
    268       Top = 384
    269       Width = 592
     295      Height = 459
     296      Top = 576
     297      Width = 888
    270298      Align = alClient
    271299      BevelOuter = bvNone
    272       ClientHeight = 630
    273       ClientWidth = 592
     300      ClientHeight = 459
     301      ClientWidth = 888
     302      ParentFont = False
    274303      TabOrder = 2
    275304      object ListView1: TListView
    276         Left = 16
    277         Height = 533
    278         Top = 48
    279         Width = 569
     305        Left = 24
     306        Height = 313
     307        Top = 72
     308        Width = 854
    280309        Anchors = [akTop, akLeft, akRight, akBottom]
    281310        Columns = <       
    282311          item
    283312            Caption = 'Name'
    284             Width = 200
     313            Width = 300
    285314          end       
    286315          item
    287316            Caption = 'Time start'
     317            Width = 225
     318          end       
     319          item
     320            Caption = 'Time end'
     321            Width = 225
     322          end       
     323          item
     324            Caption = 'First sector'
    288325            Width = 150
    289326          end       
    290327          item
    291             Caption = 'Time end'
    292             Width = 150
    293           end       
    294           item
    295             Caption = 'First sector'
    296             Width = 100
    297           end       
    298           item
    299328            Caption = 'Last sector'
    300             Width = 347
     329            Width = 520
    301330          end>
    302331        OwnerData = True
     332        ParentFont = False
    303333        PopupMenu = PopupMenu1
    304334        ReadOnly = True
     
    310340      end
    311341      object Label11: TLabel
    312         Left = 16
    313         Height = 24
    314         Top = 16
     342        Left = 24
     343        Height = 26
     344        Top = 24
    315345        Width = 100
    316346        Caption = 'Operations:'
    317347        ParentColor = False
     348        ParentFont = False
    318349      end
    319350      object Button1: TButton
    320         Left = 19
    321         Height = 25
    322         Top = 592
    323         Width = 104
     351        Left = 28
     352        Height = 38
     353        Top = 401
     354        Width = 156
    324355        Action = AOperationAdd
    325356        Anchors = [akLeft, akBottom]
     357        ParentFont = False
    326358        TabOrder = 1
    327359      end
    328360      object Button4: TButton
    329         Left = 144
    330         Height = 25
    331         Top = 592
    332         Width = 115
     361        Left = 216
     362        Height = 38
     363        Top = 401
     364        Width = 172
    333365        Action = AOperationRemove
    334366        Anchors = [akLeft, akBottom]
     367        ParentFont = False
    335368        TabOrder = 2
    336369      end
     
    338371  end
    339372  object Splitter1: TSplitter
    340     Left = 592
    341     Height = 1014
    342     Top = 26
    343     Width = 5
     373    Left = 888
     374    Height = 1035
     375    Top = 39
     376    Width = 8
    344377  end
    345378  object PageControl1: TPageControl
    346     Left = 597
    347     Height = 1014
    348     Top = 26
    349     Width = 1106
     379    Left = 896
     380    Height = 1035
     381    Top = 39
     382    Width = 758
    350383    ActivePage = TabSheetSpeed
    351384    Align = alClient
     385    ParentFont = False
    352386    TabIndex = 1
    353387    TabOrder = 3
    354388    object TabSheetSectors: TTabSheet
    355389      Caption = 'Sector map'
    356       ClientHeight = 972
    357       ClientWidth = 1100
     390      ClientHeight = 995
     391      ClientWidth = 748
     392      ParentFont = False
    358393      object Image1: TImage
    359394        Left = 4
     
    362397        Width = 1092
    363398        Align = alClient
    364         BorderSpacing.Around = 4
     399        BorderSpacing.Around = 6
    365400        OnResize = Image1Resize
    366401      end
     
    368403    object TabSheetSpeed: TTabSheet
    369404      Caption = 'Transfer speed'
    370       ClientHeight = 972
    371       ClientWidth = 1100
     405      ClientHeight = 995
     406      ClientWidth = 748
     407      ParentFont = False
    372408      object ChartSpeed: TChart
    373         Left = 4
    374         Height = 964
    375         Top = 4
    376         Width = 1092
     409        Left = 6
     410        Height = 983
     411        Top = 6
     412        Width = 736
    377413        AxisList = <       
    378414          item
    379415            Marks.Format = '%0:.9g MB/s'
     416            Marks.LabelBrush.Style = bsClear
    380417            Marks.Style = smsCustom
    381418            Minors = <>
    382419            Range.UseMin = True
    383420            Title.LabelFont.Orientation = 900
     421            Title.LabelBrush.Style = bsClear
    384422          end       
    385423          item
    386424            Alignment = calBottom
     425            Marks.LabelBrush.Style = bsClear
    387426            Minors = <>
     427            Title.LabelBrush.Style = bsClear
    388428          end>
    389429        Foot.Brush.Color = clBtnFace
     
    395435        )
    396436        Align = alClient
    397         BorderSpacing.Around = 4
     437        BorderSpacing.Around = 6
    398438        object ChartSpeedLineSeriesAvg: TLineSeries
    399439          LinePen.Color = clGreen
     
    411451    Interval = 500
    412452    OnTimer = Timer1Timer
    413     left = 672
    414     top = 224
     453    left = 1008
     454    top = 336
    415455  end
    416456  object ActionList1: TActionList
    417457    Images = Core.ImageList1
    418     left = 672
    419     top = 291
     458    left = 1008
     459    top = 437
    420460    object AScanStart: TAction
    421461      Caption = 'Start'
     
    487527  end
    488528  object OpenDialog1: TOpenDialog
    489     left = 672
    490     top = 360
     529    left = 1008
     530    top = 540
    491531  end
    492532  object SaveDialog1: TSaveDialog
    493     left = 672
    494     top = 432
     533    left = 1008
     534    top = 648
    495535  end
    496536  object MainMenu1: TMainMenu
    497537    Images = Core.ImageList1
    498     left = 672
    499     top = 504
     538    left = 1008
     539    top = 756
    500540    object MenuItem1: TMenuItem
    501541      Caption = 'File'
     
    567607  object LastOpenedList1: TLastOpenedList
    568608    MaxCount = 10
    569     left = 672
    570     top = 144
     609    left = 1008
     610    top = 216
    571611  end
    572612  object PopupMenu1: TPopupMenu
    573     left = 320
    574     top = 664
     613    left = 432
     614    top = 792
    575615    object MenuItem18: TMenuItem
    576616      Action = AOperationAdd
  • trunk/Forms/UFormMain.pas

    r34 r41  
    171171  SModifiedFlag = '(modified)';
    172172  SNewProject = 'New project';
    173   SSelectDriveForScan = 'Select drive for scan';
    174173  SOpenStoredProject = 'Open stored scan project';
    175174  SSaveProject = 'Save scan project';
     
    227226procedure TFormMain.FormCreate(Sender: TObject);
    228227begin
    229   PrefixMultiplier := TPrefixMultiplier.Create;
     228  PrefixMultiplier := TPrefixMultiplier.Create(nil);
    230229end;
    231230
     
    588587procedure TFormMain.SaveConfig;
    589588begin
    590   Core.XMLConfig1.SetValue('DriveName', LastDriveName);
     589  Core.XMLConfig1.SetValue('DriveName', UnicodeString(LastDriveName));
    591590  LastOpenedList1.SaveToXMLConfig(Core.XMLConfig1, 'RecentProjects');
    592591  Core.XMLConfig1.SetValue('ShowToolBar', ShowToolBar);
     
    595594procedure TFormMain.LoadConfig;
    596595begin
    597   LastDriveName := Core.XMLConfig1.GetValue('DriveName', '');
     596  LastDriveName := string(Core.XMLConfig1.GetValue('DriveName', UnicodeString('')));
    598597  LastOpenedList1.LoadFromXMLConfig(Core.XMLConfig1, 'RecentProjects');
    599598  ShowToolBar := Core.XMLConfig1.GetValue('ShowToolBar', False);
  • trunk/Forms/UFormOperation.lfm

    r29 r41  
    11object FormOperation: TFormOperation
    22  Left = 558
    3   Height = 482
     3  Height = 723
    44  Top = 480
    5   Width = 725
     5  Width = 1088
    66  Caption = 'Operation settings'
    7   ClientHeight = 482
    8   ClientWidth = 725
    9   LCLVersion = '1.7'
     7  ClientHeight = 723
     8  ClientWidth = 1088
     9  DesignTimePPI = 144
     10  LCLVersion = '2.0.0.4'
    1011  object ButtonOk: TButton
    11     Left = 559
    12     Height = 25
    13     Top = 427
    14     Width = 75
     12    Left = 838
     13    Height = 38
     14    Top = 640
     15    Width = 112
    1516    Caption = 'Ok'
    1617    ModalResult = 1
     18    ParentFont = False
    1719    TabOrder = 0
    1820  end
    1921  object ButtonCancel: TButton
    20     Left = 448
    21     Height = 25
    22     Top = 424
    23     Width = 75
     22    Left = 672
     23    Height = 38
     24    Top = 636
     25    Width = 112
    2426    Caption = 'Cancel'
    2527    ModalResult = 2
     28    ParentFont = False
    2629    TabOrder = 1
    2730  end
    2831  object ComboBoxRunMode: TComboBox
    29     Left = 16
    30     Height = 34
    31     Top = 16
    32     Width = 247
     32    Left = 24
     33    Height = 38
     34    Top = 24
     35    Width = 370
    3336    ItemHeight = 0
    3437    ItemIndex = 0
     
    3841    )
    3942    OnChange = ComboBoxRunModeChange
     43    ParentFont = False
    4044    Style = csDropDownList
    4145    TabOrder = 2
     
    4347  end
    4448  object Label9: TLabel
    45     Left = 16
    46     Height = 24
    47     Top = 200
    48     Width = 172
     49    Left = 24
     50    Height = 26
     51    Top = 300
     52    Width = 161
    4953    Caption = 'Write byte pattern:'
    5054    ParentColor = False
     55    ParentFont = False
    5156  end
    5257  object EditPattern: TEdit
    53     Left = 232
    54     Height = 34
    55     Top = 192
    56     Width = 80
     58    Left = 348
     59    Height = 43
     60    Top = 288
     61    Width = 120
     62    ParentFont = False
    5763    TabOrder = 3
    5864    Text = '0xff'
    5965  end
    6066  object Label2: TLabel
    61     Left = 24
    62     Height = 24
    63     Top = 64
    64     Width = 105
     67    Left = 36
     68    Height = 26
     69    Top = 96
     70    Width = 100
    6571    Caption = 'First sector:'
    6672    ParentColor = False
     73    ParentFont = False
    6774  end
    6875  object SpinEditFirstSector: TSpinEdit
    69     Left = 192
    70     Height = 34
    71     Top = 64
    72     Width = 162
     76    Left = 288
     77    Height = 43
     78    Top = 96
     79    Width = 243
    7380    MaxValue = 100000
    7481    OnChange = SpinEditFirstSectorChange
     82    ParentFont = False
    7583    TabOrder = 4
    7684    Value = 1
    7785  end
    7886  object SpinEditLastSector: TSpinEdit
    79     Left = 192
    80     Height = 34
    81     Top = 104
    82     Width = 162
     87    Left = 288
     88    Height = 43
     89    Top = 156
     90    Width = 243
    8391    MaxValue = 100000
    8492    OnChange = SpinEditLastSectorChange
     93    ParentFont = False
    8594    TabOrder = 5
    8695    Value = 1
    8796  end
    8897  object Label3: TLabel
    89     Left = 24
    90     Height = 24
    91     Top = 104
    92     Width = 81
     98    Left = 36
     99    Height = 26
     100    Top = 156
     101    Width = 77
    93102    Caption = 'Last size:'
    94103    ParentColor = False
     104    ParentFont = False
    95105  end
    96106  object CheckBoxRandomPattern: TCheckBox
    97     Left = 16
    98     Height = 28
    99     Top = 160
    100     Width = 174
     107    Left = 24
     108    Height = 30
     109    Top = 240
     110    Width = 165
    101111    Caption = 'Random pattern'
    102112    OnChange = CheckBoxRandomPatternChange
     113    ParentFont = False
    103114    TabOrder = 6
    104115  end
  • trunk/Forms/UFormProject.lfm

    r31 r41  
    11object FormProject: TFormProject
    22  Left = 537
    3   Height = 392
     3  Height = 588
    44  Top = 440
    5   Width = 612
     5  Width = 918
    66  Caption = 'Project settings'
    7   ClientHeight = 392
    8   ClientWidth = 612
    9   LCLVersion = '1.7'
     7  ClientHeight = 588
     8  ClientWidth = 918
     9  DesignTimePPI = 144
     10  LCLVersion = '2.0.0.4'
    1011  object SpinEditSectorSize: TSpinEdit
    11     Left = 224
    12     Height = 34
    13     Top = 152
    14     Width = 101
     12    Left = 336
     13    Height = 43
     14    Top = 228
     15    Width = 152
    1516    MaxValue = 63
    1617    OnChange = SpinEditSectorSizeChange
     18    ParentFont = False
    1719    TabOrder = 0
    1820    Value = 1
    1921  end
    2022  object Label1: TLabel
    21     Left = 16
    22     Height = 24
    23     Top = 160
    24     Width = 101
     23    Left = 24
     24    Height = 26
     25    Top = 240
     26    Width = 96
    2527    Caption = 'Sector size:'
    2628    ParentColor = False
     29    ParentFont = False
    2730  end
    2831  object Button1: TButton
    29     Left = 326
    30     Height = 25
    31     Top = 280
    32     Width = 75
     32    Left = 489
     33    Height = 38
     34    Top = 420
     35    Width = 112
    3336    Caption = 'Ok'
    3437    ModalResult = 1
     38    ParentFont = False
    3539    TabOrder = 1
    3640  end
    3741  object Button2: TButton
    38     Left = 224
    39     Height = 25
    40     Top = 280
    41     Width = 75
     42    Left = 336
     43    Height = 38
     44    Top = 420
     45    Width = 112
    4246    Caption = 'Cancel'
    4347    ModalResult = 2
     48    ParentFont = False
    4449    TabOrder = 2
    4550  end
    4651  object EditName: TEdit
    47     Left = 192
    48     Height = 34
    49     Top = 8
    50     Width = 240
     52    Left = 288
     53    Height = 43
     54    Top = 12
     55    Width = 360
     56    ParentFont = False
    5157    TabOrder = 3
    5258  end
    5359  object Label2: TLabel
    54     Left = 16
    55     Height = 24
    56     Top = 16
    57     Width = 60
     60    Left = 24
     61    Height = 26
     62    Top = 24
     63    Width = 56
    5864    Caption = 'Name:'
    5965    ParentColor = False
     66    ParentFont = False
    6067  end
    6168  object ComboBoxDrive: TComboBox
    62     Left = 192
    63     Height = 38
    64     Top = 56
    65     Width = 384
     69    Left = 288
     70    Height = 42
     71    Top = 84
     72    Width = 576
    6673    ItemHeight = 0
     74    ParentFont = False
    6775    Style = csDropDownList
    6876    TabOrder = 4
    6977  end
    7078  object Label3: TLabel
    71     Left = 16
    72     Height = 24
    73     Top = 64
    74     Width = 53
     79    Left = 24
     80    Height = 26
     81    Top = 96
     82    Width = 49
    7583    Caption = 'Drive:'
    7684    ParentColor = False
     85    ParentFont = False
    7786  end
    7887  object Label4: TLabel
    79     Left = 16
    80     Height = 24
    81     Top = 112
    82     Width = 119
     88    Left = 24
     89    Height = 26
     90    Top = 168
     91    Width = 113
    8392    Caption = 'Sector count:'
    8493    ParentColor = False
     94    ParentFont = False
    8595  end
    8696  object LabelSectorCount: TLabel
    87     Left = 192
    88     Height = 24
    89     Top = 112
     97    Left = 288
     98    Height = 26
     99    Top = 168
    90100    Width = 15
    91101    Caption = '   '
    92102    ParentColor = False
     103    ParentFont = False
    93104  end
    94105  object Label5: TLabel
    95     Left = 192
    96     Height = 24
    97     Top = 160
    98     Width = 22
     106    Left = 288
     107    Height = 26
     108    Top = 240
     109    Width = 20
    99110    Caption = '2^'
    100111    ParentColor = False
     112    ParentFont = False
    101113  end
    102114  object Label6: TLabel
    103     Left = 341
    104     Height = 24
    105     Top = 160
    106     Width = 11
     115    Left = 512
     116    Height = 26
     117    Top = 240
     118    Width = 10
    107119    Caption = '='
    108120    ParentColor = False
     121    ParentFont = False
    109122  end
    110123end
  • trunk/Forms/UFormSettings.lfm

    r34 r41  
    11object FormSettings: TFormSettings
    22  Left = 404
    3   Height = 327
     3  Height = 490
    44  Top = 574
    5   Width = 554
     5  Width = 831
    66  ActiveControl = ButtonOk
    77  Caption = 'Settings'
    8   ClientHeight = 327
    9   ClientWidth = 554
    10   Constraints.MinHeight = 327
    11   Constraints.MinWidth = 554
     8  ClientHeight = 490
     9  ClientWidth = 831
     10  Constraints.MinHeight = 490
     11  Constraints.MinWidth = 831
     12  DesignTimePPI = 144
    1213  OnCreate = FormCreate
    1314  OnShow = FormShow
    1415  Position = poMainFormCenter
    15   LCLVersion = '1.6.0.4'
     16  LCLVersion = '2.0.0.4'
    1617  object ButtonOk: TButton
    17     Left = 444
    18     Height = 25
    19     Top = 284
    20     Width = 75
     18    Left = 667
     19    Height = 38
     20    Top = 425
     21    Width = 112
    2122    Anchors = [akRight, akBottom]
    2223    Caption = 'Ok'
    2324    ModalResult = 1
     25    ParentFont = False
    2426    TabOrder = 0
    2527  end
    2628  object ButtonCancel: TButton
    27     Left = 322
    28     Height = 25
    29     Top = 284
    30     Width = 75
     29    Left = 483
     30    Height = 38
     31    Top = 425
     32    Width = 112
    3133    Anchors = [akRight, akBottom]
    3234    Caption = 'Cancel'
    3335    ModalResult = 2
     36    ParentFont = False
    3437    TabOrder = 1
    3538  end
    3639  object PageControl1: TPageControl
    37     Left = 4
    38     Height = 264
    39     Top = 4
    40     Width = 546
     40    Left = 6
     41    Height = 425
     42    Top = 6
     43    Width = 819
    4144    ActivePage = TabSheetGeneral
    4245    Align = alTop
    4346    Anchors = [akTop, akLeft, akRight, akBottom]
    44     BorderSpacing.Around = 4
     47    BorderSpacing.Around = 6
     48    ParentFont = False
    4549    TabIndex = 0
    4650    TabOrder = 2
    4751    object TabSheetGeneral: TTabSheet
    4852      Caption = 'General'
    49       ClientHeight = 222
    50       ClientWidth = 540
     53      ClientHeight = 385
     54      ClientWidth = 809
     55      ParentFont = False
    5156      object Label1: TLabel
    52         Left = 20
    53         Height = 24
    54         Top = 26
     57        Left = 30
     58        Height = 26
     59        Top = 39
    5560        Width = 88
    5661        Caption = 'Language:'
    5762        ParentColor = False
     63        ParentFont = False
    5864      end
    5965      object ComboBoxLanguage: TComboBox
    60         Left = 178
    61         Height = 38
    62         Top = 24
    63         Width = 196
     66        Left = 267
     67        Height = 42
     68        Top = 36
     69        Width = 294
    6470        ItemHeight = 0
     71        ParentFont = False
    6572        Style = csDropDownList
    6673        TabOrder = 0
     
    6976    object TabSheetDebug: TTabSheet
    7077      Caption = 'Debug'
    71       ClientHeight = 222
    72       ClientWidth = 540
     78      ClientHeight = 385
     79      ClientWidth = 809
     80      ParentFont = False
    7381      object CheckBoxDevelMode: TCheckBox
    74         Left = 16
    75         Height = 27
    76         Top = 136
    77         Width = 514
     82        Left = 24
     83        Height = 40
     84        Top = 204
     85        Width = 503
    7886        Anchors = [akTop, akLeft, akRight]
    7987        AutoSize = False
    8088        Caption = 'Developer mode'
     89        ParentFont = False
    8190        TabOrder = 0
    8291      end
    8392      object Label4: TLabel
    84         Left = 14
     93        Left = 21
    8594        Height = 24
    86         Top = 67
     95        Top = 100
    8796        Width = 35
    8897        Caption = 'DPI:'
    8998        ParentColor = False
     99        ParentFont = False
    90100      end
    91101      object SpinEditX: TSpinEdit
    92         Left = 104
     102        Left = 156
    93103        Height = 34
    94         Top = 64
    95         Width = 96
     104        Top = 96
     105        Width = 144
    96106        MaxValue = 500
    97107        MinValue = 20
     108        ParentFont = False
    98109        TabOrder = 1
    99110        Value = 50
    100111      end
    101112      object SpinEditY: TSpinEdit
    102         Left = 232
     113        Left = 348
    103114        Height = 34
    104         Top = 64
    105         Width = 90
     115        Top = 96
     116        Width = 135
    106117        MaxValue = 500
    107118        MinValue = 20
     119        ParentFont = False
    108120        TabOrder = 2
    109121        Value = 20
    110122      end
    111123      object Label5: TLabel
    112         Left = 208
     124        Left = 312
    113125        Height = 24
    114         Top = 67
     126        Top = 100
    115127        Width = 10
    116128        Caption = 'x'
    117129        ParentColor = False
     130        ParentFont = False
    118131      end
    119132      object CheckBox2: TCheckBox
    120         Left = 16
    121         Height = 24
    122         Top = 32
    123         Width = 510
     133        Left = 24
     134        Height = 36
     135        Top = 48
     136        Width = 497
    124137        Anchors = [akTop, akLeft, akRight]
    125138        AutoSize = False
    126139        Caption = 'Automatic DPI'
    127140        OnChange = CheckBox2Change
     141        ParentFont = False
    128142        TabOrder = 3
    129143      end
  • trunk/Languages/CoolDisk.po

    r34 r41  
    2121
    2222#: tformabout.labelcontent.caption
     23msgctxt "tformabout.labelcontent.caption"
    2324msgid "   "
    2425msgstr ""
     
    2627#: tformabout.labeldescription.caption
    2728msgid "CoolDisk is helpful GUI application for various disk surface operations."
     29msgstr ""
     30
     31#: tformbenchmark.caption
     32msgid "Benchmark"
    2833msgstr ""
    2934
     
    106111
    107112#: tformmain.label1.caption
     113msgctxt "tformmain.label1.caption"
    108114msgid "Sector size:"
    109115msgstr ""
     
    118124
    119125#: tformmain.label2.caption
     126msgctxt "tformmain.label2.caption"
    120127msgid "Sector count:"
    121128msgstr ""
     
    214221msgstr ""
    215222
    216 #: tformmain.menuitem12.caption
    217 msgctxt "tformmain.menuitem12.caption"
    218 msgid "-"
    219 msgstr ""
    220 
    221 #: tformmain.menuitem14.caption
    222 msgctxt "TFORMMAIN.MENUITEM14.CAPTION"
    223 msgid "-"
    224 msgstr ""
    225 
    226223#: tformmain.menuitem16.caption
    227224msgid "View"
     
    252249msgstr ""
    253250
     251#: tformoperation.buttoncancel.caption
     252msgctxt "tformoperation.buttoncancel.caption"
     253msgid "Cancel"
     254msgstr ""
     255
     256#: tformoperation.buttonok.caption
     257msgctxt "tformoperation.buttonok.caption"
     258msgid "Ok"
     259msgstr ""
     260
     261#: tformoperation.caption
     262msgid "Operation settings"
     263msgstr ""
     264
     265#: tformoperation.checkboxrandompattern.caption
     266msgid "Random pattern"
     267msgstr ""
     268
     269#: tformoperation.comboboxrunmode.text
     270msgid "Read test"
     271msgstr ""
     272
     273#: tformoperation.editpattern.text
     274msgid "0xff"
     275msgstr ""
     276
     277#: tformoperation.label2.caption
     278msgid "First sector:"
     279msgstr ""
     280
     281#: tformoperation.label3.caption
     282msgid "Last size:"
     283msgstr ""
     284
     285#: tformoperation.label9.caption
     286msgid "Write byte pattern:"
     287msgstr ""
     288
     289#: tformproject.button1.caption
     290msgctxt "tformproject.button1.caption"
     291msgid "Ok"
     292msgstr ""
     293
     294#: tformproject.button2.caption
     295msgctxt "tformproject.button2.caption"
     296msgid "Cancel"
     297msgstr ""
     298
     299#: tformproject.caption
     300msgid "Project settings"
     301msgstr ""
     302
     303#: tformproject.label1.caption
     304msgctxt "tformproject.label1.caption"
     305msgid "Sector size:"
     306msgstr ""
     307
     308#: tformproject.label2.caption
     309msgid "Name:"
     310msgstr ""
     311
     312#: tformproject.label3.caption
     313msgid "Drive:"
     314msgstr ""
     315
     316#: tformproject.label4.caption
     317msgctxt "tformproject.label4.caption"
     318msgid "Sector count:"
     319msgstr ""
     320
     321#: tformproject.label5.caption
     322msgid "2^"
     323msgstr ""
     324
     325#: tformproject.label6.caption
     326msgid "="
     327msgstr ""
     328
     329#: tformproject.labelsectorcount.caption
     330msgctxt "tformproject.labelsectorcount.caption"
     331msgid "   "
     332msgstr ""
     333
    254334#: tformsettings.buttoncancel.caption
     335msgctxt "tformsettings.buttoncancel.caption"
    255336msgid "Cancel"
    256337msgstr ""
    257338
    258339#: tformsettings.buttonok.caption
     340msgctxt "tformsettings.buttonok.caption"
    259341msgid "Ok"
    260342msgstr ""
    261343
    262344#: tformsettings.caption
    263 msgctxt "TFORMSETTINGS.CAPTION"
     345msgctxt "tformsettings.caption"
    264346msgid "Settings"
    265347msgstr ""
     
    353435msgstr ""
    354436
    355 #: uformmain.sselectdriveforscan
    356 msgid "Select drive for scan"
    357 msgstr ""
    358 
    359437#: uphysdrive.sminsectorsize
    360438msgid "Minimum sector size is 1"
  • trunk/Packages/Common/Common.lpk

    r40 r41  
    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"/>
     
    3760      <Item5>
    3861        <Filename Value="UPrefixMultiplier.pas"/>
     62        <HasRegisterProc Value="True"/>
    3963        <UnitName Value="UPrefixMultiplier"/>
    4064      </Item5>
     
    106130        <UnitName Value="UScaleDPI"/>
    107131      </Item20>
     132      <Item21>
     133        <Filename Value="UTheme.pas"/>
     134        <HasRegisterProc Value="True"/>
     135        <UnitName Value="UTheme"/>
     136      </Item21>
     137      <Item22>
     138        <Filename Value="UStringTable.pas"/>
     139        <UnitName Value="UStringTable"/>
     140      </Item22>
    108141    </Files>
    109142    <i18n>
     
    112145      <EnableI18NForLFM Value="True"/>
    113146    </i18n>
    114     <RequiredPkgs Count="3">
     147    <RequiredPkgs Count="2">
    115148      <Item1>
    116149        <PackageName Value="LCL"/>
    117150      </Item1>
    118151      <Item2>
    119         <PackageName Value="TemplateGenerics"/>
    120       </Item2>
    121       <Item3>
    122152        <PackageName Value="FCL"/>
    123153        <MinVersion Major="1" Valid="True"/>
    124       </Item3>
     154      </Item2>
    125155    </RequiredPkgs>
    126156    <UsageOptions>
  • trunk/Packages/Common/Common.pas

    r33 r41  
    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
     
    1820begin
    1921  RegisterUnit('UDebugLog', @UDebugLog.Register);
     22  RegisterUnit('UPrefixMultiplier', @UPrefixMultiplier.Register);
    2023  RegisterUnit('ULastOpenedList', @ULastOpenedList.Register);
    2124  RegisterUnit('UJobProgressView', @UJobProgressView.Register);
     
    2528  RegisterUnit('UFindFile', @UFindFile.Register);
    2629  RegisterUnit('UScaleDPI', @UScaleDPI.Register);
     30  RegisterUnit('UTheme', @UTheme.Register);
    2731end;
    2832
  • trunk/Packages/Common/Languages/UJobProgressView.po

    r40 r41  
    1414msgstr ""
    1515
    16 #: ujobprogressview.soperations
    17 msgid "Operations"
    18 msgstr ""
    19 
    2016#: ujobprogressview.spleasewait
    2117msgid "Please wait..."
  • trunk/Packages/Common/Languages/UThreading.po

    r4 r41  
    33
    44#: uthreading.scurrentthreadnotfound
     5#, fuzzy,badformat
    56msgid "Current thread ID %d not found in virtual thread list."
    67msgstr "Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8"
  • trunk/Packages/Common/UApplicationInfo.pas

    r4 r41  
    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.
  • trunk/Packages/Common/UCommon.pas

    r40 r41  
    2727    unfNameServicePrincipal = 10,  // Generalized service principal name
    2828    unfDNSDomainName = 11);
     29
     30  TFilterMethod = function (FileName: string): Boolean of object;
     31  TFileNameMethod = procedure (FileName: string) of object;
    2932
    3033var
     
    6366procedure OpenWebPage(URL: string);
    6467procedure OpenFileInShell(FileName: string);
    65 procedure ExecuteProgram(CommandLine: string);
     68procedure ExecuteProgram(Executable: string; Parameters: array of string);
    6669procedure FreeThenNil(var Obj);
    6770function RemoveQuotes(Text: string): string;
     
    7174function MergeArray(A, B: array of string): TArrayOfString;
    7275function LoadFileToStr(const FileName: TFileName): AnsiString;
     76procedure SaveStringToFile(S, FileName: string);
     77procedure SearchFiles(AList: TStrings; Dir: string;
     78  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
     79function GetStringPart(var Text: string; Separator: string): string;
     80function StripTags(const S: string): string;
     81function PosFromIndex(SubStr: string; Text: string;
     82  StartIndex: Integer): Integer;
     83function PosFromIndexReverse(SubStr: string; Text: string;
     84  StartIndex: Integer): Integer;
     85procedure CopyStringArray(Dest: TStringArray; Source: array of string);
    7386
    7487
     
    98111  I: Integer;
    99112begin
     113  Result := '';
    100114  for I := 1 to Length(Source) do begin
    101115    Result := Result + LowerCase(IntToHex(Ord(Source[I]), 2));
     
    112126  Path := IncludeTrailingPathDelimiter(APath);
    113127
    114   Find := FindFirst(UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);
     128  Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec);
    115129  while Find = 0 do begin
    116     DeleteFile(Path + UTF8Encode(SearchRec.Name));
     130    DeleteFile(Path + SearchRec.Name);
    117131
    118132    Find := SysUtils.FindNext(SearchRec);
     
    429443end;
    430444
    431 procedure ExecuteProgram(CommandLine: string);
     445procedure ExecuteProgram(Executable: string; Parameters: array of string);
    432446var
    433447  Process: TProcess;
     448  I: Integer;
    434449begin
    435450  try
    436451    Process := TProcess.Create(nil);
    437     Process.CommandLine := CommandLine;
     452    Process.Executable := Executable;
     453    for I := 0 to Length(Parameters) - 1 do
     454      Process.Parameters.Add(Parameters[I]);
    438455    Process.Options := [poNoConsole];
    439456    Process.Execute;
     
    456473procedure OpenFileInShell(FileName: string);
    457474begin
    458   ExecuteProgram('cmd.exe /c start "' + FileName + '"');
     475  ExecuteProgram('cmd.exe', ['/c', 'start', FileName]);
    459476end;
    460477
     
    511528end;
    512529
     530function DefaultSearchFilter(const FileName: string): Boolean;
     531begin
     532  Result := True;
     533end;
     534
     535procedure SaveStringToFile(S, FileName: string);
     536var
     537  F: TextFile;
     538begin
     539  AssignFile(F, FileName);
     540  try
     541    ReWrite(F);
     542    Write(F, S);
     543  finally
     544    CloseFile(F);
     545  end;
     546end;
     547
     548procedure SearchFiles(AList: TStrings; Dir: string;
     549  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
     550var
     551  SR: TSearchRec;
     552begin
     553  Dir := IncludeTrailingPathDelimiter(Dir);
     554  if FindFirst(Dir + '*', faAnyFile, SR) = 0 then
     555    try
     556      repeat
     557        if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or
     558          not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue;
     559        if Assigned(FileNameMethod) then
     560          FileNameMethod(Dir + SR.Name);
     561        AList.Add(Dir + SR.Name);
     562        if (SR.Attr and faDirectory) <> 0 then
     563          SearchFiles(AList, Dir + SR.Name, FilterMethod);
     564      until FindNext(SR) <> 0;
     565    finally
     566      FindClose(SR);
     567    end;
     568end;
     569
     570function GetStringPart(var Text: string; Separator: string): string;
     571var
     572  P: Integer;
     573begin
     574  P := Pos(Separator, Text);
     575  if P > 0 then begin
     576    Result := Copy(Text, 1, P - 1);
     577    Delete(Text, 1, P - 1 + Length(Separator));
     578  end else begin
     579    Result := Text;
     580    Text := '';
     581  end;
     582  Result := Trim(Result);
     583  Text := Trim(Text);
     584end;
     585
     586function StripTags(const S: string): string;
     587var
     588  Len: Integer;
     589
     590  function ReadUntil(const ReadFrom: Integer; const C: Char): Integer;
     591  var
     592    J: Integer;
     593  begin
     594    for J := ReadFrom to Len do
     595      if (S[j] = C) then
     596      begin
     597        Result := J;
     598        Exit;
     599      end;
     600    Result := Len + 1;
     601  end;
     602
     603var
     604  I, APos: Integer;
     605begin
     606  Len := Length(S);
     607  I := 0;
     608  Result := '';
     609  while (I <= Len) do begin
     610    Inc(I);
     611    APos := ReadUntil(I, '<');
     612    Result := Result + Copy(S, I, APos - i);
     613    I := ReadUntil(APos + 1, '>');
     614  end;
     615end;
     616
     617function PosFromIndex(SubStr: string; Text: string;
     618  StartIndex: Integer): Integer;
     619var
     620  I, MaxLen: SizeInt;
     621  Ptr: PAnsiChar;
     622begin
     623  Result := 0;
     624  if (StartIndex < 1) or (StartIndex > Length(Text) - Length(SubStr)) then Exit;
     625  if Length(SubStr) > 0 then begin
     626    MaxLen := Length(Text) - Length(SubStr) + 1;
     627    I := StartIndex;
     628    Ptr := @Text[StartIndex];
     629    while (I <= MaxLen) do begin
     630      if (SubStr[1] = Ptr^) and (CompareByte(Substr[1], Ptr^, Length(SubStr)) = 0) then begin
     631        Result := I;
     632        Exit;
     633      end;
     634      Inc(I);
     635      Inc(Ptr);
     636    end;
     637  end;
     638end;
     639
     640function PosFromIndexReverse(SubStr: string; Text: string;
     641  StartIndex: Integer): Integer;
     642var
     643  I: SizeInt;
     644  Ptr: PAnsiChar;
     645begin
     646  Result := 0;
     647  if (StartIndex < 1) or (StartIndex > Length(Text)) then Exit;
     648  if Length(SubStr) > 0 then begin
     649    I := StartIndex;
     650    Ptr := @Text[StartIndex];
     651    while (I > 0) do begin
     652      if (SubStr[1] = Ptr^) and (CompareByte(Substr[1], Ptr^, Length(SubStr)) = 0) then begin
     653        Result := I;
     654        Exit;
     655      end;
     656      Dec(I);
     657      Dec(Ptr);
     658    end;
     659  end;
     660end;
     661
     662procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     663var
     664  I: Integer;
     665begin
     666  SetLength(Dest, Length(Source));
     667  for I := 0 to Length(Dest) - 1 do
     668    Dest[I] := Source[I];
     669end;
    513670
    514671
  • trunk/Packages/Common/UDebugLog.pas

    r4 r41  
    66
    77uses
    8   Classes, SysUtils, FileUtil, SpecializedList, SyncObjs;
     8  Classes, SysUtils, FileUtil, fgl, SyncObjs;
    99
    1010type
     
    2929    procedure SetMaxCount(const AValue: Integer);
    3030  public
    31     Items: TListObject;
     31    Items: TFPGObjectList<TDebugLogItem>;
    3232    Lock: TCriticalSection;
    3333    procedure Add(Text: string; Group: string = '');
     
    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;
     
    117117begin
    118118  inherited;
    119   Items := TListObject.Create;
     119  Items := TFPGObjectList<TDebugLogItem>.Create;
    120120  Lock := TCriticalSection.Create;
    121121  MaxCount := 100;
  • trunk/Packages/Common/UFindFile.pas

    r40 r41  
    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
  • trunk/Packages/Common/UJobProgressView.lfm

    r40 r41  
    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 = '2.0.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
     
    223241    Interval = 100
    224242    OnTimer = TimerUpdateTimer
    225     left = 264
     243    left = 320
    226244    top = 8
    227245  end
  • trunk/Packages/Common/UJobProgressView.pas

    r40 r41  
    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';
    169177
    170178procedure Register;
     
    172180  RegisterComponents('Common', [TJobProgressView]);
    173181end;
     182
     183{ TJobThread }
    174184
    175185procedure TJobThread.Execute;
     
    190200end;
    191201
    192 procedure TJobProgressView.AddJob(Title: string; Method: TJobProgressViewMethod;
    193   NoThreaded: Boolean = False; WaitFor: Boolean = False);
     202{ TFormJobProgressView }
     203
     204procedure TFormJobProgressView.UpdateHeight;
    194205var
    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);
     206  H: Integer;
     207  PanelOperationsVisible: Boolean;
     208  PanelOperationsHeight: Integer;
     209  PanelProgressVisible: Boolean;
     210  PanelProgressTotalVisible: Boolean;
     211  PanelLogVisible: Boolean;
     212  MemoLogHeight: Integer = 200;
     213  I: Integer;
     214  ItemRect: TRect;
     215  MaxH: Integer;
     216begin
     217    H := PanelOperationsTitle.Height;
     218    PanelOperationsVisible := JobProgressView.Jobs.Count > 0;
     219    if PanelOperationsVisible <> PanelOperations.Visible then
     220      PanelOperations.Visible := PanelOperationsVisible;
     221    if ListViewJobs.Items.Count > 0 then begin
     222      Maxh := 0;
     223      for I := 0 to ListViewJobs.Items.Count - 1 do
     224      begin
     225        ItemRect := ListViewJobs.Items[i].DisplayRect(drBounds);
     226        Maxh := Max(Maxh, ItemRect.Top + (ItemRect.Bottom - ItemRect.Top));
     227      end;
     228      PanelOperationsHeight := Scale96ToScreen(12) + Maxh;
     229    end else PanelOperationsHeight := Scale96ToScreen(8);
     230    if PanelOperationsHeight <> PanelOperations.Height then
     231      PanelOperations.Height := PanelOperationsHeight;
     232    if PanelOperationsVisible then
     233      H := H + PanelOperations.Height;
     234
     235    PanelProgressVisible := (JobProgressView.Jobs.Count > 0) and not JobProgressView.Finished;
     236    if PanelProgressVisible <> PanelProgress.Visible then
     237      PanelProgress.Visible := PanelProgressVisible;
     238    if PanelProgressVisible then
     239      H := H + PanelProgress.Height;
     240    PanelProgressTotalVisible := (JobProgressView.Jobs.Count > 1) and not JobProgressView.Finished;
     241    if PanelProgressTotalVisible <> PanelProgressTotal.Visible then
     242      PanelProgressTotal.Visible := PanelProgressTotalVisible;
     243    if PanelProgressTotalVisible then
     244      H := H + PanelProgressTotal.Height;
     245    Constraints.MinHeight := H;
     246    PanelLogVisible := MemoLog.Lines.Count > 0;
     247    if PanelLogVisible <> PanelLog.Visible then
     248      PanelLog.Visible := PanelLogVisible;
     249    if PanelLogVisible then
     250      H := H + Scale96ToScreen(MemoLogHeight);
     251    if PanelText.Visible then
     252      H := H + PanelText.Height;
     253    if Height <> H then begin
     254      Height := H;
     255      Top := (Screen.Height - H) div 2;
     256    end;
     257end;
     258
     259procedure TFormJobProgressView.TimerUpdateTimer(Sender: TObject);
     260var
     261  ProgressBarPartVisible: Boolean;
     262  ProgressBarTotalVisible: Boolean;
     263begin
     264  JobProgressView.UpdateProgress;
     265  if Visible and (not ProgressBarPart.Visible) and
     266  Assigned(JobProgressView.CurrentJob) and
     267  (JobProgressView.CurrentJob.Progress.Value > 0) then begin
     268    ProgressBarPartVisible := True;
     269    if ProgressBarPartVisible <> ProgressBarPart.Visible then
     270      ProgressBarPart.Visible := ProgressBarPartVisible;
     271    ProgressBarTotalVisible := True;
     272    if ProgressBarTotalVisible <> ProgressBarTotal.Visible then
     273      ProgressBarTotal.Visible := ProgressBarTotalVisible;
     274  end;
     275  if not Visible then begin
     276    TimerUpdate.Interval := UpdateInterval;
     277    if not JobProgressView.OwnerDraw then Show;
     278  end;
     279  if Assigned(JobProgressView.CurrentJob) then begin
     280    LabelText.Caption := JobProgressView.CurrentJob.Progress.Text;
     281    if LabelText.Caption <> '' then begin
     282      PanelText.Visible := True;
     283      UpdateHeight;
     284    end;
     285  end;
     286end;
     287
     288procedure TFormJobProgressView.FormDestroy(Sender:TObject);
     289begin
     290end;
     291
     292procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem);
     293begin
     294  if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then
     295  with TJob(JobProgressView.Jobs[Item.Index]) do begin
     296    Item.Caption := Title;
     297    if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1
     298      else if Finished then Item.ImageIndex := 0
     299      else Item.ImageIndex := 2;
     300    Item.Data := JobProgressView.Jobs[Item.Index];
     301  end;
     302end;
     303
     304procedure TFormJobProgressView.FormClose(Sender: TObject;
     305  var CloseAction: TCloseAction);
     306begin
     307end;
     308
     309procedure TFormJobProgressView.FormCreate(Sender: TObject);
     310begin
     311  Caption := SPleaseWait;
     312  try
     313    //Animate1.FileName := ExtractFileDir(UTF8Encode(Application.ExeName)) +
     314    //  DirectorySeparator + 'horse.avi';
     315    //Animate1.Active := True;
     316  except
     317
     318  end;
     319end;
     320
     321procedure TFormJobProgressView.ReloadJobList;
     322begin
     323  // Workaround for not showing first line
     324  //Form.ListViewJobs.Items.Count := Jobs.Count + 1;
     325  //Form.ListViewJobs.Refresh;
     326
     327  if ListViewJobs.Items.Count <> JobProgressView.Jobs.Count then
     328    ListViewJobs.Items.Count := JobProgressView.Jobs.Count;
     329  ListViewJobs.Refresh;
     330  Application.ProcessMessages;
     331  UpdateHeight;
     332end;
     333
     334procedure TFormJobProgressView.FormShow(Sender: TObject);
     335begin
     336  ReloadJobList;
     337end;
     338
     339procedure TFormJobProgressView.FormHide(Sender: TObject);
     340begin
     341  JobProgressView.Jobs.Clear;
     342  ReloadJobList;
     343end;
     344
     345procedure TFormJobProgressView.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     346begin
     347  CanClose := JobProgressView.Finished;
     348  JobProgressView.Terminate := True;
     349  Caption := SPleaseWait + STerminate;
     350end;
     351
     352
     353{ TJobProgressView }
     354
     355function TJobProgressView.AddJob(Title: string; Method: TJobProgressViewMethod;
     356  NoThreaded: Boolean = False; WaitFor: Boolean = False): TJob;
     357begin
     358  Result := TJob.Create;
     359  Result.ProgressView := Self;
     360  Result.Title := Title;
     361  Result.Method := Method;
     362  Result.NoThreaded := NoThreaded;
     363  Result.WaitFor := WaitFor;
     364  Result.Progress.Max := 100;
     365  Result.Progress.Reset;
     366  Result.Progress.OnChange := JobProgressChange;
     367  Jobs.Add(Result);
    207368  //ReloadJobList;
    208369end;
    209370
    210 procedure TJobProgressView.Start(AAutoClose: Boolean = True);
    211 begin
    212   AutoClose := AAutoClose;
    213   StartJobs;
    214 end;
    215 
    216 procedure TJobProgressView.StartJobs;
     371procedure TJobProgressView.Start;
    217372var
    218373  I: Integer;
     
    229384    Form.MemoLog.Clear;
    230385
     386    Form.PanelText.Visible := False;
    231387    Form.LabelEstimatedTimePart.Visible := False;
    232388    Form.LabelEstimatedTimeTotal.Visible := False;
     
    258414      Form.ProgressBarPart.Visible := False;
    259415      //Show;
    260       ReloadJobList;
     416      Form.ReloadJobList;
    261417      Application.ProcessMessages;
    262418      if NoThreaded then begin
     
    296452    //if Visible then Hide;
    297453    Form.MemoLog.Lines.Assign(Log);
    298     if (Form.MemoLog.Lines.Count = 0) and AutoClose then begin
     454    if (Form.MemoLog.Lines.Count = 0) and FAutoClose then begin
    299455      Form.Hide;
    300456    end;
    301     Clear;
     457    if not Form.Visible then Clear;
    302458    Form.Caption := SFinished;
    303459    //LabelEstimatedTimePart.Visible := False;
    304460    Finished := True;
    305461    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;
     462    Form.ReloadJobList;
    347463  end;
    348464end;
     
    352468  if Assigned(FOnOwnerDraw) then
    353469    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;
    410470end;
    411471
     
    426486    Sleep(Quantum);
    427487  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;
    435488end;
    436489
     
    490543end;
    491544
    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 
    505545constructor TJobProgressView.Create(TheOwner: TComponent);
    506546begin
    507547  inherited;
    508548  if not (csDesigning in ComponentState) then begin
    509     Form := TFormJobProgressView.Create(Self);
    510     Form.JobProgressView := Self;
    511   end;
    512   Jobs := TObjectList.Create;
     549    FForm := TFormJobProgressView.Create(Self);
     550    FForm.JobProgressView := Self;
     551  end;
     552  Jobs := TJobs.Create;
    513553  Log := TStringList.Create;
    514554  //PanelOperationsTitle.Height := 80;
    515   ShowDelay := 0; //1000; // ms
     555  AutoClose := True;
     556  ShowDelay := 0;
    516557end;
    517558
     
    519560begin
    520561  Jobs.Clear;
     562  Log.Clear;
    521563  //ReloadJobList;
    522564end;
     
    528570  inherited;
    529571end;
     572
     573{ TProgress }
    530574
    531575procedure TProgress.SetMax(const AValue: Integer);
     
    536580    if FMax < 1 then FMax := 1;
    537581    if FValue >= FMax then FValue := FMax;
     582  finally
     583    FLock.Release;
     584  end;
     585end;
     586
     587procedure TProgress.SetText(AValue: string);
     588begin
     589  try
     590    FLock.Acquire;
     591    if FText = AValue then Exit;
     592    FText := AValue;
    538593  finally
    539594    FLock.Release;
     
    563618end;
    564619
    565 { TProgress }
    566 
    567620procedure TProgress.Increment;
    568621begin
  • trunk/Packages/Common/ULastOpenedList.pas

    r4 r41  
    66
    77uses
    8   Classes, SysUtils, Registry, URegistry, Menus, XMLConf;
     8  Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;
    99
    1010type
     
    3030    procedure SaveToXMLConfig(XMLConfig: TXMLConfig; Path: string);
    3131    procedure AddItem(FileName: string);
     32    function GetFirstFileName: string;
    3233  published
    3334    property MaxCount: Integer read FMaxCount write SetMaxCount;
     
    139140    OpenKey(Context.Key, True);
    140141    for I := 0 to Items.Count - 1 do
    141       WriteString('File' + IntToStr(I), UTF8Decode(Items[I]));
     142      WriteString('File' + IntToStr(I), Items[I]);
    142143  finally
    143144    Free;
     
    153154begin
    154155  with XMLConfig do begin
    155     Count := GetValue(Path + '/Count', 0);
     156    Count := GetValue(DOMString(Path + '/Count'), 0);
    156157    if Count > MaxCount then Count := MaxCount;
    157158    Items.Clear;
    158159    for I := 0 to Count - 1 do begin
    159       Value := GetValue(Path + '/File' + IntToStr(I), '');
     160      Value := string(GetValue(DOMString(Path + '/File' + IntToStr(I)), ''));
    160161      if Trim(Value) <> '' then Items.Add(Value);
    161162    end;
     
    170171begin
    171172  with XMLConfig do begin
    172     SetValue(Path + '/Count', Items.Count);
     173    SetValue(DOMString(Path + '/Count'), Items.Count);
    173174    for I := 0 to Items.Count - 1 do
    174       SetValue(Path + '/File' + IntToStr(I), Items[I]);
     175      SetValue(DOMString(Path + '/File' + IntToStr(I)), DOMString(Items[I]));
    175176    Flush;
    176177  end;
     
    185186end;
    186187
     188function TLastOpenedList.GetFirstFileName: string;
     189begin
     190  if Items.Count > 0 then Result := Items[0]
     191    else Result := '';
     192end;
     193
    187194end.
    188195
  • trunk/Packages/Common/UListViewSort.pas

    r40 r41  
    99uses
    1010  {$IFDEF Windows}Windows, CommCtrl, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils,
    11   Controls, DateUtils, Dialogs, SpecializedList, Forms, Grids, StdCtrls, ExtCtrls,
     11  Controls, DateUtils, Dialogs, fgl, Forms, Grids, StdCtrls, ExtCtrls,
    1212  LclIntf, LMessages, LclType, LResources;
    1313
     
    5252    {$ENDIF}
    5353  public
    54     List: TListObject;
    55     Source: TListObject;
     54    List: TFPGObjectList<TObject>;
     55    Source: TFPGObjectList<TObject>;
    5656    constructor Create(AOwner: TComponent); override;
    5757    destructor Destroy; override;
     
    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;
     
    9898  end;
    9999
     100  { TListViewEx }
     101
     102  TListViewEx = class(TWinControl)
     103  private
     104    FFilter: TListViewFilter;
     105    FListView: TListView;
     106    FListViewSort: TListViewSort;
     107    procedure ResizeHanlder;
     108  public
     109    constructor Create(TheOwner: TComponent); override;
     110    destructor Destroy; override;
     111  published
     112    property ListView: TListView read FListView write FListView;
     113    property ListViewSort: TListViewSort read FListViewSort write FListViewSort;
     114    property Filter: TListViewFilter read FFilter write FFilter;
     115    property Visible;
     116  end;
     117
    100118procedure Register;
    101119
     
    105123procedure Register;
    106124begin
    107   RegisterComponents('Common', [TListViewSort, TListViewFilter]);
     125  RegisterComponents('Common', [TListViewSort, TListViewFilter, TListViewEx]);
     126end;
     127
     128{ TListViewEx }
     129
     130procedure TListViewEx.ResizeHanlder;
     131begin
     132end;
     133
     134constructor TListViewEx.Create(TheOwner: TComponent);
     135begin
     136  inherited Create(TheOwner);
     137  Filter := TListViewFilter.Create(Self);
     138  Filter.Parent := Self;
     139  Filter.Align := alBottom;
     140  ListView := TListView.Create(Self);
     141  ListView.Parent := Self;
     142  ListView.Align := alClient;
     143  ListViewSort := TListViewSort.Create(Self);
     144  ListViewSort.ListView := ListView;
     145end;
     146
     147destructor TListViewEx.Destroy;
     148begin
     149  inherited Destroy;
    108150end;
    109151
    110152{ TListViewFilter }
    111153
    112 procedure TListViewFilter.DoOnKeyUp(Sender: TObject; var Key: Word;
     154procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word;
    113155  Shift: TShiftState);
    114156begin
     
    117159end;
    118160
    119 procedure TListViewFilter.DoOnResize(Sender: TObject);
     161procedure TListViewFilter.GridDoOnResize(Sender: TObject);
    120162begin
    121163  FStringGrid1.DefaultRowHeight := FStringGrid1.Height;
     
    135177  FStringGrid1.Options := [goFixedHorzLine, goFixedVertLine, goVertLine,
    136178    goHorzLine, goRangeSelect, goEditing, goAlwaysShowEditor, goSmoothScroll];
    137   FStringGrid1.OnKeyUp := DoOnKeyUp;
    138   FStringGrid1.OnResize := DoOnResize;
     179  FStringGrid1.OnKeyUp := GridDoOnKeyUp;
     180  FStringGrid1.OnResize := GridDoOnResize;
    139181end;
    140182
     
    142184var
    143185  I: Integer;
     186  R: TRect;
    144187begin
    145188  with FStringGrid1 do begin
    146     //Columns.Clear;
    147189    while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1);
    148190    while Columns.Count < ListView.Columns.Count do Columns.Add;
    149191    for I := 0 to ListView.Columns.Count - 1 do begin
    150192      Columns[I].Width := ListView.Columns[I].Width;
     193      if Selection.Left = I then begin
     194        R := CellRect(I, 0);
     195        Editor.Left := R.Left + 2;
     196        Editor.Width := R.Width - 4;
     197      end;
    151198    end;
    152199  end;
     
    197244  if AMsg.Msg = WM_NOTIFY then
    198245  begin
    199     Code := PHDNotify(vMsgNotify.NMHdr)^.Hdr.Code;
     246    Code := NMHDR(PHDNotify(vMsgNotify.NMHdr)^.Hdr).Code;
    200247    case Code of
    201248      HDN_ENDTRACKA, HDN_ENDTRACKW:
     
    272319end;
    273320
     321var
     322  ListViewSortCompare: TCompareEvent;
     323
     324function ListViewCompare(const Item1, Item2: TObject): Integer;
     325begin
     326  Result := ListViewSortCompare(Item1, Item2);
     327end;
     328
    274329procedure TListViewSort.Sort(Compare: TCompareEvent);
    275330begin
     331  // TODO: Because TFLGObjectList compare handler is not class method,
     332  // it is necessary to use simple function compare handler with local variable
     333  ListViewSortCompare := Compare;
    276334  if (List.Count > 0) then
    277     List.Sort(Compare);
     335    List.Sort(ListViewCompare);
    278336end;
    279337
     
    338396begin
    339397  inherited;
    340   List := TListObject.Create;
    341   List.OwnsObjects := False;
     398  List := TFPGObjectList<TObject>.Create;
     399  List.FreeObjects := False;
    342400end;
    343401
     
    353411  TP1: TPoint;
    354412  XBias, YBias: Integer;
    355   OldColor: TColor;
     413  PenColor: TColor;
     414  BrushColor: TColor;
    356415  BiasTop, BiasLeft: Integer;
    357416  Rect1: TRect;
     
    365424  Item.Left := 0;
    366425  GetCheckBias(XBias, YBias, BiasTop, BiasLeft, ListView);
    367   OldColor := ListView.Canvas.Pen.Color;
     426  PenColor := ListView.Canvas.Pen.Color;
     427  BrushColor := ListView.Canvas.Brush.Color;
    368428  //TP1 := Item.GetPosition;
    369429  lRect := Item.DisplayRect(drBounds); // Windows 7 workaround
     
    377437  ItemLeft := Item.Left;
    378438  ItemLeft := 23; // Windows 7 workaround
    379  
     439
    380440  Rect1.Left := ItemLeft - CheckWidth - BiasLeft + 1 + XBias;
    381441  //ShowMessage(IntToStr(Tp1.Y) + ', ' + IntToStr(BiasTop) + ', ' + IntToStr(XBias));
     
    408468  end;
    409469  //ListView.Canvas.Brush.Color := ListView.Color;
    410   ListView.Canvas.Brush.Color := clWindow;
    411   ListView.Canvas.Pen.Color := OldColor;
     470  ListView.Canvas.Brush.Color := BrushColor;
     471  ListView.Canvas.Pen.Color := PenColor;
    412472end;
    413473
     
    476536    FHeaderHandle := ListView_GetHeader(FListView.Handle);
    477537    for I := 0 to FListView.Columns.Count - 1 do begin
     538      {$push}{$warn 5057 off}
    478539      FillChar(Item, SizeOf(THDItem), 0);
     540      {$pop}
    479541      Item.Mask := HDI_FORMAT;
    480542      Header_GetItem(FHeaderHandle, I, Item);
  • trunk/Packages/Common/UMemory.pas

    r4 r41  
    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(PByte(@FData) + Position)^, Memory.Size);
     115end;
     116
     117procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory);
     118begin
     119  Move(PByte(PByte(@FData) + Position)^, Memory.FData, Memory.Size);
     120end;
     121
    110122end.
    111123
  • trunk/Packages/Common/UPersistentForm.pas

    r40 r41  
    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;
  • trunk/Packages/Common/UPool.pas

    r4 r41  
    66
    77uses
    8   Classes, SysUtils, syncobjs, SpecializedList, UThreading;
     8  Classes, SysUtils, syncobjs, fgl, UThreading;
    99
    1010type
     
    2222    function NewItemObject: TObject; virtual;
    2323  public
    24     Items: TListObject;
    25     FreeItems: TListObject;
     24    Items: TFPGObjectList<TObject>;
     25    FreeItems: TFPGObjectList<TObject>;
    2626    function Acquire: TObject; virtual;
    2727    procedure Release(Item: TObject); virtual;
     
    185185begin
    186186  inherited;
    187   Items := TListObject.Create;
    188   FreeItems := TListObject.Create;
    189   FreeItems.OwnsObjects := False;
     187  Items := TFPGObjectList<TObject>.Create;
     188  FreeItems := TFPGObjectList<TObject>.Create;
     189  FreeItems.FreeObjects := False;
    190190  FReleaseEvent := TEvent.Create(nil, False, False, '');
    191191end;
  • trunk/Packages/Common/UPrefixMultiplier.pas

    r40 r41  
    2121  { TPrefixMultiplier }
    2222
    23   TPrefixMultiplier = class
     23  TPrefixMultiplier = class(TComponent)
    2424  private
    25     function TruncateDigits(Value:Double;Digits:Integer=3):Double;
     25    function TruncateDigits(Value: Double; Digits: Integer = 3): Double;
    2626  public
    2727    function Add(Value: Double; PrefixMultipliers: TPrefixMultiplierDef;
     
    7272  );
    7373
     74procedure Register;
     75
     76
    7477implementation
     78
     79procedure Register;
     80begin
     81  RegisterComponents('Common', [TPrefixMultiplier]);
     82end;
    7583
    7684{ TPrefixMultiplier }
     
    92100end;
    93101
    94 function TPrefixMultiplier.Add(Value:Double;PrefixMultipliers:TPrefixMultiplierDef
    95   ;UnitText:string;Digits:Integer):string;
     102function TPrefixMultiplier.Add(Value: Double; PrefixMultipliers: TPrefixMultiplierDef
     103  ; UnitText:string; Digits: Integer): string;
    96104var
    97105  I: Integer;
  • trunk/Packages/Common/URegistry.pas

    r4 r41  
    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
     
    3229    procedure SetCurrentContext(AValue: TRegistryContext);
    3330  public
     31    function ReadChar(const Name: string): Char;
     32    procedure WriteChar(const Name: string; Value: Char);
    3433    function ReadBoolWithDefault(const Name: string;
    3534      DefaultValue: Boolean): Boolean;
    3635    function ReadIntegerWithDefault(const Name: string; DefaultValue: Integer): Integer;
    3736    function ReadStringWithDefault(const Name: string; DefaultValue: string): string;
     37    function ReadCharWithDefault(const Name: string; DefaultValue: Char): Char;
    3838    function ReadFloatWithDefault(const Name: string;
    3939      DefaultValue: Double): Double;
     
    4343  end;
    4444
    45 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;
    46 
     45const
     46  RegistryRootHKEY: array[TRegistryRoot] of HKEY = (HKEY_CLASSES_ROOT,
     47    HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA,
     48    HKEY_CURRENT_CONFIG, HKEY_DYN_DATA);
    4749
    4850implementation
    4951
    50 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;
    51 begin
    52   Result.RootKey := RootKey;
    53   Result.Key := Key;
    54 end;
    5552
    5653{ TRegistryContext }
     
    5956begin
    6057  Result := (A.Key = B.Key) and (A.RootKey = B.RootKey);
     58end;
     59
     60function TRegistryContext.Create(RootKey: TRegistryRoot; Key: string): TRegistryContext;
     61begin
     62  Result.RootKey := RegistryRootHKEY[RootKey];
     63  Result.Key := Key;
     64end;
     65
     66function TRegistryContext.Create(RootKey: HKEY; Key: string): TRegistryContext;
     67begin
     68  Result.RootKey := RootKey;
     69  Result.Key := Key;
    6170end;
    6271
     
    7988    else begin
    8089      WriteString(Name, DefaultValue);
     90      Result := DefaultValue;
     91    end;
     92end;
     93
     94function TRegistryEx.ReadCharWithDefault(const Name: string; DefaultValue: Char
     95  ): Char;
     96begin
     97  if ValueExists(Name) then Result := ReadChar(Name)
     98    else begin
     99      WriteChar(Name, DefaultValue);
    81100      Result := DefaultValue;
    82101    end;
     
    131150end;
    132151
     152function TRegistryEx.ReadChar(const Name: string): Char;
     153var
     154  S: string;
     155begin
     156  S := ReadString(Name);
     157  if Length(S) > 0 then Result := S[1]
     158    else Result := #0;
     159end;
     160
     161procedure TRegistryEx.WriteChar(const Name: string; Value: Char);
     162begin
     163  WriteString(Name, Value);
     164end;
     165
    133166function TRegistryEx.ReadBoolWithDefault(const Name: string;
    134167  DefaultValue: Boolean): Boolean;
  • trunk/Packages/Common/UResetableThread.pas

    r4 r41  
    156156  FThread.Name := 'ResetableThread';
    157157  FThread.Parent := Self;
    158   FThread.Resume;
     158  FThread.Start;
    159159end;
    160160
  • trunk/Packages/Common/UScaleDPI.pas

    r40 r41  
    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 begin
     288  //OldAnchors: TAnchors;
     289  //OldAutoSize: Boolean;
     290begin
     291  //if not (Control is TCustomPage) then
     292  // Resize childs first
     293  if Control is TWinControl then begin
     294    WinControl := TWinControl(Control);
     295    if WinControl.ControlCount > 0 then begin
     296      for I := 0 to WinControl.ControlCount - 1 do begin
     297        if WinControl.Controls[I] is TControl then begin
     298          ScaleControl(WinControl.Controls[I], FromDPI);
     299        end;
     300      end;
     301    end;
     302  end;
     303
    289304  //if Control is TMemo then Exit;
    290305  //if Control is TForm then
     
    316331        MinWidth := ScaleX(MinWidth, FromDPI.X);
    317332        MinHeight := ScaleY(MinHeight, FromDPI.Y);
    318         Width := ScaleX(Width, FromDPI.X);
     333        // Workaround to bad band width auto sizing
     334        //Width := ScaleX(Width, FromDPI.X);
     335        Width := ScaleX(Control.Width + 28, FromDPI.X);
    319336        //Control.Invalidate;
    320337      end;
     338    // Workaround for bad autosizing of coolbar
     339    if AutoSize then begin
     340      AutoSize := False;
     341      Height := ScaleY(Height, FromDPI.Y);
     342      AutoSize := True;
     343    end;
    321344    EndUpdate;
    322345  end;
     
    330353  end;
    331354
    332   //if not (Control is TCustomPage) then
    333   if Control is TWinControl then begin
    334     WinControl := TWinControl(Control);
    335     if WinControl.ControlCount > 0 then begin
    336       for I := 0 to WinControl.ControlCount - 1 do begin
    337         if WinControl.Controls[I] is TControl then begin
    338           ScaleControl(WinControl.Controls[I], FromDPI);
    339         end;
    340       end;
    341     end;
    342   end;
    343355  //if Control is TForm then
    344356  //  Control.EnableAutoSizing;
  • trunk/Packages/Common/UThreading.pas

    r4 r41  
    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
  • trunk/Packages/Common/UURI.pas

    r4 r41  
    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, ':');
  • trunk/Packages/Common/UXMLUtils.pas

    r32 r41  
    77uses
    88  {$IFDEF WINDOWS}Windows,{$ENDIF}
    9   Classes, SysUtils, DateUtils, XMLRead, XMLWrite, 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);
     
    2121function ReadString(Node: TDOMNode; Name: string; DefaultValue: string): string;
    2222function ReadDateTime(Node: TDOMNode; Name: string; DefaultValue: TDateTime): TDateTime;
     23procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
    2324
    2425
    2526implementation
     27
     28procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
     29var
     30  Parser: TDOMParser;
     31  Src: TXMLInputSource;
     32  InFile: TFileStream;
     33begin
     34  try
     35    InFile := TFileStream.Create(FileName, fmOpenRead);
     36    Src := TXMLInputSource.Create(InFile);
     37    Parser := TDOMParser.Create;
     38    Parser.Options.PreserveWhitespace := True;
     39    Parser.Parse(Src, Doc);
     40  finally
     41    Src.Free;
     42    Parser.Free;
     43    InFile.Free;
     44  end;
     45end;
    2646
    2747function GetTimeZoneBias: Integer;
     
    3050  TimeZoneInfo: TTimeZoneInformation;
    3151begin
     52  {$push}{$warn 5057 off}
    3253  case GetTimeZoneInformation(TimeZoneInfo) of
    33   TIME_ZONE_ID_STANDARD: Result := TimeZoneInfo.Bias + TimeZoneInfo.StandardBias;
    34   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;
    3556  else
    3657    Result := 0;
    3758  end;
     59  {$pop}
    3860end;
    3961{$ELSE}
     
    4567function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean;
    4668var
    47   I, J: Integer;
     69  I: Integer;
    4870  Matched: Boolean;
    4971begin
     
    99121      if Pos('Z', XMLDateTime) > 0 then
    100122        LeftCutString(XMLDateTime, Part, 'Z');
    101       SecondFraction := StrToFloat('0' + DecimalSeparator + Part);
     123      SecondFraction := StrToFloat('0' + DefaultFormatSettings.DecimalSeparator + Part);
    102124      Millisecond := Trunc(SecondFraction * 1000);
    103125    end else begin
     
    118140end;
    119141
    120 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;
     142function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string;
    121143const
    122144  Neg: array[Boolean] of string =  ('+', '-');
     
    139161  NewNode: TDOMNode;
    140162begin
    141   NewNode := Node.OwnerDocument.CreateElement(Name);
    142   NewNode.TextContent := IntToStr(Value);
     163  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     164  NewNode.TextContent := DOMString(IntToStr(Value));
    143165  Node.AppendChild(NewNode);
    144166end;
     
    148170  NewNode: TDOMNode;
    149171begin
    150   NewNode := Node.OwnerDocument.CreateElement(Name);
    151   NewNode.TextContent := IntToStr(Value);
     172  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     173  NewNode.TextContent := DOMString(IntToStr(Value));
    152174  Node.AppendChild(NewNode);
    153175end;
     
    157179  NewNode: TDOMNode;
    158180begin
    159   NewNode := Node.OwnerDocument.CreateElement(Name);
    160   NewNode.TextContent := BoolToStr(Value);
     181  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     182  NewNode.TextContent := DOMString(BoolToStr(Value));
    161183  Node.AppendChild(NewNode);
    162184end;
     
    166188  NewNode: TDOMNode;
    167189begin
    168   NewNode := Node.OwnerDocument.CreateElement(Name);
    169   NewNode.TextContent := Value;
     190  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     191  NewNode.TextContent := DOMString(Value);
    170192  Node.AppendChild(NewNode);
    171193end;
     
    175197  NewNode: TDOMNode;
    176198begin
    177   NewNode := Node.OwnerDocument.CreateElement(Name);
    178   NewNode.TextContent := DateTimeToXMLTime(Value);
     199  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     200  NewNode.TextContent := DOMString(DateTimeToXMLTime(Value));
    179201  Node.AppendChild(NewNode);
    180202end;
     
    185207begin
    186208  Result := DefaultValue;
    187   NewNode := Node.FindNode(Name);
    188   if Assigned(NewNode) then
    189     Result := StrToInt(NewNode.TextContent);
     209  NewNode := Node.FindNode(DOMString(Name));
     210  if Assigned(NewNode) then
     211    Result := StrToInt(string(NewNode.TextContent));
    190212end;
    191213
     
    195217begin
    196218  Result := DefaultValue;
    197   NewNode := Node.FindNode(Name);
    198   if Assigned(NewNode) then
    199     Result := StrToInt64(NewNode.TextContent);
     219  NewNode := Node.FindNode(DOMString(Name));
     220  if Assigned(NewNode) then
     221    Result := StrToInt64(string(NewNode.TextContent));
    200222end;
    201223
     
    205227begin
    206228  Result := DefaultValue;
    207   NewNode := Node.FindNode(Name);
    208   if Assigned(NewNode) then
    209     Result := StrToBool(NewNode.TextContent);
     229  NewNode := Node.FindNode(DOMString(Name));
     230  if Assigned(NewNode) then
     231    Result := StrToBool(string(NewNode.TextContent));
    210232end;
    211233
     
    215237begin
    216238  Result := DefaultValue;
    217   NewNode := Node.FindNode(Name);
    218   if Assigned(NewNode) then
    219     Result := NewNode.TextContent;
     239  NewNode := Node.FindNode(DOMString(Name));
     240  if Assigned(NewNode) then
     241    Result := string(NewNode.TextContent);
    220242end;
    221243
     
    226248begin
    227249  Result := DefaultValue;
    228   NewNode := Node.FindNode(Name);
    229   if Assigned(NewNode) then
    230     Result := XMLTimeToDateTime(NewNode.TextContent);
     250  NewNode := Node.FindNode(DOMString(Name));
     251  if Assigned(NewNode) then
     252    Result := XMLTimeToDateTime(string(NewNode.TextContent));
    231253end;
    232254
  • trunk/Packages/CoolTranslator

    • Property svn:ignore set to
      lib
  • trunk/Packages/CoolTranslator/CoolTranslator.lpk

    r40 r41  
    1 <?xml version="1.0"?>
     1<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    33  <Package Version="4">
    44    <PathDelim Value="\"/>
    55    <Name Value="CoolTranslator"/>
     6    <Type Value="RunAndDesignTime"/>
    67    <AddToProjectUsesSection Value="True"/>
    78    <Author Value="Chronos (robie@centrum.cz)"/>
    89    <CompilerOptions>
    9       <Version Value="10"/>
     10      <Version Value="11"/>
    1011      <PathDelim Value="\"/>
    1112      <SearchPaths>
    12         <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     13        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    1314      </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>
    1433      <Other>
    15         <CompilerPath Value="$(CompPath)"/>
     34        <CompilerMessages>
     35          <IgnoredMessages idx5024="True"/>
     36        </CompilerMessages>
    1637      </Other>
    1738    </CompilerOptions>
     
    3859      <OutDir Value="Languages"/>
    3960    </i18n>
    40     <Type Value="RunAndDesignTime"/>
    4161    <RequiredPkgs Count="2">
    4262      <Item1>
  • trunk/Packages/CoolTranslator/UCoolTranslator.pas

    r40 r41  
    127127  I, J: Integer;
    128128  Po: TPoFile;
     129  Item: TPOFileItem;
    129130begin
    130131  TranslateComponentRecursive(Application);
     
    136137    with TPoFile(FPoFiles[I]) do
    137138      for J := 0 to Items.Count - 1 do
    138       with TPoFileItem(Items[J]) do
    139         Po.Add(IdentifierLow, Original, Translation, Comments, Context,
     139      with TPoFileItem(Items[J]) do begin
     140        Item := nil;
     141        Po.FillItem(Item, IdentifierLow, Original, Translation, Comments, Context,
    140142          Flags, PreviousID);
     143      end;
    141144    Translations.TranslateResourceStrings(Po);
    142145  finally
     
    197200  PropInfo: PPropInfo;
    198201  PropList: PPropList;
    199   Excludes: TComponentExcludes;
    200202begin
    201203  Count := GetTypeData(Component.ClassInfo)^.PropCount;
     
    250252          if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then
    251253          //if not IsExcluded(Component, PropInfo^.Name) then
    252               SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetWideStrProp(Component, PropInfo)));
     254              SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, string(GetWideStrProp(Component, PropInfo))));
    253255        end;
    254256        tkClass: begin
     
    295297  Result := FPOFilesFolder;
    296298  if Copy(Result, 1, 1) <> DirectorySeparator then
    297     Result := ExtractFileDir(UTF8Encode(Application.ExeName)) +
     299    Result := ExtractFileDir(Application.ExeName) +
    298300      DirectorySeparator + Result;
    299301end;
     
    412414        Lang := ParamStr(i + 1);
    413415  end;
    414   if Lang = '' then
    415     LCLGetLanguageIDs(Lang, T);
     416  if Lang = '' then begin
     417    T := '';
     418    LazGetLanguageIDs(Lang, T);
     419  end;
    416420
    417421  if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin
     
    429433function TCoolTranslator.FindLocaleFileName(LCExt: string): string;
    430434var
    431   T: string;
    432435  Lang: string;
    433436begin
  • trunk/UCore.lfm

    r34 r41  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 539
    6   HorizontalOffset = 763
    7   VerticalOffset = 511
    8   Width = 769
     5  Height = 809
     6  HorizontalOffset = 1145
     7  VerticalOffset = 573
     8  Width = 1154
     9  PPI = 144
    910  object PersistentForm1: TPersistentForm
    1011    MinVisiblePart = 50
    1112    EntireVisible = False
    12     left = 224
    13     top = 208
     13    left = 336
     14    top = 312
    1415  end
    1516  object ImageList1: TImageList
    16     left = 224
    17     top = 136
     17    left = 336
     18    top = 204
    1819  end
    1920  object XMLConfig1: TXMLConfig
     
    2122    RootName = 'CONFIG'
    2223    ReadOnly = False
    23     left = 424
    24     top = 136
     24    left = 636
     25    top = 204
    2526  end
    2627  object CoolTranslator1: TCoolTranslator
    2728    POFilesFolder = 'Languages'
    28     left = 88
    29     top = 128
     29    left = 132
     30    top = 192
    3031  end
    3132  object ApplicationInfo1: TApplicationInfo
     
    3637    VersionSuffix = 'alfa'
    3738    CompanyName = 'Chronosoft'
    38     HomePage = 'http://svn.zdechov.net/svn/CoolDisk'
     39    HomePage = 'https://app.zdechov.net/CoolDisk'
    3940    AuthorsName = 'Chronos'
    4041    EmailContact = 'robie@centrum.cz'
    4142    AppName = 'CoolDisk'
    42     ReleaseDate = 42714
     43    ReleaseDate = 43593
    4344    RegistryKey = '\Software\Chronosoft\CoolDisk'
    4445    RegistryRoot = rrKeyCurrentUser
    4546    License = 'CC0'
    46     left = 88
    47     top = 56
     47    left = 132
     48    top = 84
    4849  end
    4950  object ScaleDPI1: TScaleDPI
    5051    AutoDetect = False
    51     left = 88
    52     top = 200
     52    left = 132
     53    top = 300
    5354  end
    5455end
  • trunk/UCore.pas

    r37 r41  
    5858procedure TCore.LoadConfig;
    5959begin
    60   RegistryContext := RegContext(HKEY(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey);
     60  RegistryContext := TRegistryContext.Create(ApplicationInfo1.RegistryRoot, ApplicationInfo1.RegistryKey);
    6161  PersistentForm1.RegistryContext := RegistryContext;
    6262  XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml';
    6363  ForceDirectories(ExtractFileDir(XMLConfig1.Filename));
    6464
    65   CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', ''));
     65  CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(string(XMLConfig1.GetValue('Language', unicodestring(''))));
    6666end;
    6767
    6868procedure TCore.SaveConfig;
    6969begin
    70   XMLConfig1.SetValue('Language', CoolTranslator1.Language.Code);
     70  XMLConfig1.SetValue('Language', UnicodeString(CoolTranslator1.Language.Code));
    7171end;
    7272
  • trunk/UDriveScan.pas

    r31 r41  
    125125implementation
    126126
    127 uses
    128   UFileStreamEx;
    129 
    130127resourcestring
    131128  SUnknownRunMode = 'Unknown run mode';
  • trunk/UPhysDrive.pas

    r37 r41  
    107107  PrefixMultiplier: TPrefixMultiplier;
    108108begin
    109   PrefixMultiplier := TPrefixMultiplier.Create;
     109  PrefixMultiplier := TPrefixMultiplier.Create(nil);
    110110  try
    111111    while Strings.Count > Count do
Note: See TracChangeset for help on using the changeset viewer.