Changeset 556 for Common


Ignore:
Timestamp:
Feb 10, 2022, 11:56:40 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
Location:
Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r555 r556  
    6868function OccurenceOfChar(What: Char; Where: string): Integer;
    6969procedure OpenWebPage(URL: string);
     70procedure OpenEmail(Email: string);
    7071procedure OpenFileInShell(FileName: string);
    7172function PosFromIndex(SubStr: string; Text: string;
     
    8384function SplitString(var Text: string; Count: Word): string;
    8485function StripTags(const S: string): string;
    85 function TryHexToInt(Data: string; var Value: Integer): Boolean;
    86 function TryBinToInt(Data: string; var Value: Integer): Boolean;
     86function TryHexToInt(Data: string; out Value: Integer): Boolean;
     87function TryBinToInt(Data: string; out Value: Integer): Boolean;
    8788procedure SortStrings(Strings: TStrings);
    8889
     
    246247end;
    247248
    248 function TryHexToInt(Data: string; var Value: Integer): Boolean;
     249function TryHexToInt(Data: string; out Value: Integer): Boolean;
    249250var
    250251  I: Integer;
     
    262263end;
    263264
    264 function TryBinToInt(Data: string; var Value: Integer): Boolean;
     265function TryBinToInt(Data: string; out Value: Integer): Boolean;
    265266var
    266267  I: Integer;
     
    473474begin
    474475  OpenURL(URL);
     476end;
     477
     478procedure OpenEmail(Email: string);
     479begin
     480  OpenURL('mailto:' + Email);
    475481end;
    476482
  • Common/ULastOpenedList.pas

    r518 r556  
    8484destructor TLastOpenedList.Destroy;
    8585begin
    86   Items.Free;
     86  FreeAndNil(Items);
    8787  inherited;
    8888end;
     
    9494begin
    9595  if Assigned(MenuItem) then begin
    96     MenuItem.Clear;
     96    while MenuItem.Count > Items.Count do
     97      MenuItem.Delete(MenuItem.Count - 1);
     98    while MenuItem.Count < Items.Count do begin
     99      NewMenuItem := TMenuItem.Create(MenuItem);
     100      MenuItem.Add(NewMenuItem);
     101    end;
    97102    for I := 0 to Items.Count - 1 do begin
    98       NewMenuItem := TMenuItem.Create(MenuItem);
    99       NewMenuItem.Caption := Items[I];
    100       NewMenuItem.OnClick := ClickAction;
    101       MenuItem.Add(NewMenuItem);
     103      MenuItem.Items[I].Caption := Items[I];
     104      MenuItem.Items[I].OnClick := ClickAction;
    102105    end;
    103106  end;
Note: See TracChangeset for help on using the changeset viewer.