Changeset 515 for Common


Ignore:
Timestamp:
Jun 5, 2018, 11:02:54 AM (6 years ago)
Author:
chronos
Message:
Location:
Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r510 r515  
    7373function LoadFileToStr(const FileName: TFileName): AnsiString;
    7474procedure SearchFiles(AList: TStrings; Dir: string;
    75   FilterMethod: TFilterMethodMethod);
     75  FilterMethod: TFilterMethodMethod = nil);
    7676function GetStringPart(var Text: string; Separator: string): string;
    7777
     
    524524
    525525procedure SearchFiles(AList: TStrings; Dir: string;
    526   FilterMethod: TFilterMethodMethod);
     526  FilterMethod: TFilterMethodMethod = nil);
    527527var
    528528  SR: TSearchRec;
     
    532532    try
    533533      repeat
    534         if (SR.Name = '.') or (SR.Name = '..') or not FilterMethod(SR.Name) or
    535           not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name) then Continue;
     534        if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or
     535          not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue;
    536536        AList.Add(Dir + SR.Name);
    537537        if (SR.Attr and faDirectory) <> 0 then
  • Common/UPersistentForm.pas

    r510 r515  
    88
    99uses
    10   Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls;
     10  Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls,
     11  ExtCtrls;
    1112
    1213type
     
    7172  end;
    7273
     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
    7392  if Control is TWinControl then begin
    7493    WinControl := TWinControl(Control);
     
    95114      for I := 0 to TListView(Control).Columns.Count - 1 do begin
    96115        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);
    97132      end;
    98133    finally
  • Common/UTheme.pas

    r509 r515  
    158158        ApplyTheme(TPageControl(Component).Pages[I]);
    159159    end;
     160
     161    if Control is TCoolBar then begin
     162      (Control as TCoolBar).Themed := False;
     163    end;
    160164  end;
    161165end;
Note: See TracChangeset for help on using the changeset viewer.