Changeset 69


Ignore:
Timestamp:
Dec 10, 2021, 11:40:17 AM (3 years ago)
Author:
chronos
Message:
  • Added: Remember last count value used in Generate contact form.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormGenerate.lfm

    r62 r69  
    1414  object Label1: TLabel
    1515    Left = 19
    16     Height = 25
     16    Height = 24
    1717    Top = 19
    18     Width = 52
     18    Width = 55
    1919    Caption = 'Count:'
    2020    ParentColor = False
     
    2323  object SpinEditCount: TSpinEdit
    2424    Left = 155
    25     Height = 33
     25    Height = 42
    2626    Top = 18
    2727    Width = 152
  • trunk/Forms/UFormGenerate.pas

    r62 r69  
    5959  );
    6060begin
     61  Core.GenerateCount := SpinEditCount.Value;
    6162  Core.PersistentForm1.Save(Self);
    6263end;
     
    7172begin
    7273  Core.PersistentForm1.Load(Self);
     74  SpinEditCount.Value := Core.GenerateCount;
    7375  UpdateInterface;
    7476end;
  • trunk/Packages/Common/UTheme.pas

    r21 r69  
    55uses
    66  Classes, SysUtils, Graphics, ComCtrls, Controls, ExtCtrls, Menus, StdCtrls,
    7   Spin, Forms, Contnrs, Grids;
     7  Spin, Forms, fgl, Grids;
    88
    99type
     
    1919  { TThemes }
    2020
    21   TThemes = class(TObjectList)
     21  TThemes = class(TFPGObjectList<TTheme>)
    2222    function AddNew(Name: string): TTheme;
    2323    function FindByName(Name: string): TTheme;
     
    7474procedure TThemes.LoadToStrings(Strings: TStrings);
    7575var
    76   Theme: TTheme;
     76  I: Integer;
    7777begin
    78   Strings.Clear;
    79   for Theme in Self do
    80     Strings.AddObject(Theme.Name, Theme);
     78  Strings.BeginUpdate;
     79  try
     80    while Strings.Count < Count do Strings.Add('');
     81    while Strings.Count > Count do Strings.Delete(Strings.Count - 1);
     82    for I := 0 to Count - 1 do begin
     83      Strings[I] := Items[I].Name;
     84      Strings.Objects[I] := Items[I];
     85    end;
     86  finally
     87    Strings.EndUpdate;
     88  end;
    8189end;
    8290
     
    123131destructor TThemeManager.Destroy;
    124132begin
    125   Themes.Free;
    126   inherited Destroy;
     133  FreeAndNil(Themes);
     134  inherited;
    127135end;
    128136
  • trunk/UCore.pas

    r66 r69  
    8888    LastContactTabIndex: Integer;
    8989    LastContactFileName: string;
     90    GenerateCount: Integer;
    9091    ToolbarVisible: Boolean;
    9192    function GetProfileImage: TImage;
     
    484485    LastContactFileName := ReadStringWithDefault('LastContactFileName', '');
    485486    LastSplitDir := ReadStringWithDefault('LastSplitDir', '');
     487    GenerateCount := ReadIntegerWithDefault('GenerateCount', 1);
    486488  finally
    487489    Free;
     
    508510    WriteString('LastContactFileName', LastContactFileName);
    509511    WriteString('LastSplitDir', LastSplitDir);
     512    WriteInteger('GenerateCount', GenerateCount);
    510513  finally
    511514    Free;
Note: See TracChangeset for help on using the changeset viewer.