mirror of
https://github.com/CloudDelphi/Router4Delphi.git
synced 2025-12-19 16:53:43 +01:00
Compare commits
No commits in common. "master" and "1.0.6" have entirely different histories.
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 92 KiB |
@ -30,10 +30,7 @@ begin
|
|||||||
for lIndex := Self.ControlCount - 1 downto 0 do
|
for lIndex := Self.ControlCount - 1 downto 0 do
|
||||||
begin
|
begin
|
||||||
if (Self.Controls[lIndex] is TForm) then
|
if (Self.Controls[lIndex] is TForm) then
|
||||||
begin
|
|
||||||
(Self.Controls[lIndex] as TForm).Close;
|
(Self.Controls[lIndex] as TForm).Close;
|
||||||
(Self.Controls[lIndex] as TForm).parent := nil;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@ type
|
|||||||
FInstanteObject : iRouter4DComponent;
|
FInstanteObject : iRouter4DComponent;
|
||||||
FListCacheOrder : TList<String>;
|
FListCacheOrder : TList<String>;
|
||||||
FIndexCache : Integer;
|
FIndexCache : Integer;
|
||||||
FMaxCacheHistory : Integer;
|
|
||||||
procedure CreateInstancePersistent( aPath : String);
|
procedure CreateInstancePersistent( aPath : String);
|
||||||
//procedure CacheKeyNotify(Sender: TObject; const Key: string; Action: TCollectionNotification);
|
//procedure CacheKeyNotify(Sender: TObject; const Key: string; Action: TCollectionNotification);
|
||||||
public
|
public
|
||||||
@ -73,7 +72,6 @@ type
|
|||||||
function InstanteObject : iRouter4DComponent;
|
function InstanteObject : iRouter4DComponent;
|
||||||
function GoBack : String;
|
function GoBack : String;
|
||||||
function BreadCrumb(aDelimiter: char = '/') : String;
|
function BreadCrumb(aDelimiter: char = '/') : String;
|
||||||
function addCacheHistory(aKey : String) : TRouter4DHistory;
|
|
||||||
function IndexCache : Integer;
|
function IndexCache : Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -227,21 +225,6 @@ begin
|
|||||||
FListCache2.Add(aKey, CachePersistent);
|
FListCache2.Add(aKey, CachePersistent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRouter4DHistory.addCacheHistory(aKey: String): TRouter4DHistory;
|
|
||||||
var
|
|
||||||
I: Integer;
|
|
||||||
begin
|
|
||||||
Result := Self;
|
|
||||||
for I := Pred(FListCacheOrder.Count) downto Succ(FIndexCache) do
|
|
||||||
FListCacheOrder.Delete(I);
|
|
||||||
|
|
||||||
if FListCacheOrder.Count > FMaxCacheHistory then
|
|
||||||
FListCacheOrder.Delete(0);
|
|
||||||
|
|
||||||
FListCacheOrder.Add(aKey);
|
|
||||||
FIndexCache := Pred(FListCacheOrder.Count);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TRouter4DHistory.AddHistory(aKey: String; aObject: TPersistentClass;
|
function TRouter4DHistory.AddHistory(aKey: String; aObject: TPersistentClass;
|
||||||
aSBKey : String; isVisible: Boolean): iRouter4DComponent;
|
aSBKey : String; isVisible: Boolean): iRouter4DComponent;
|
||||||
var
|
var
|
||||||
@ -261,8 +244,6 @@ constructor TRouter4DHistory.Create;
|
|||||||
begin
|
begin
|
||||||
FListCache := TObjectDictionary<String, TObject>.Create;
|
FListCache := TObjectDictionary<String, TObject>.Create;
|
||||||
FListCache2 := TDictionary<String, TCachePersistent>.Create;
|
FListCache2 := TDictionary<String, TCachePersistent>.Create;
|
||||||
FListCacheOrder := TList<String>.Create;
|
|
||||||
FMaxCacheHistory := 10;
|
|
||||||
{$IFDEF HAS_FMX}
|
{$IFDEF HAS_FMX}
|
||||||
FListCacheContainer := TObjectDictionary<String, TFMXObject>.Create;
|
FListCacheContainer := TObjectDictionary<String, TFMXObject>.Create;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -294,7 +275,6 @@ begin
|
|||||||
FListCache.Free;
|
FListCache.Free;
|
||||||
FListCache2.Free;
|
FListCache2.Free;
|
||||||
FListCacheContainer.Free;
|
FListCacheContainer.Free;
|
||||||
FListCacheOrder.Free;
|
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,6 @@ type
|
|||||||
function &To ( aPatch : String; aProps : TProps; aKey : String = '') : iRouter4DLink; overload;
|
function &To ( aPatch : String; aProps : TProps; aKey : String = '') : iRouter4DLink; overload;
|
||||||
function &To ( aPatch : String; aNameContainer : String) : iRouter4DLink; overload;
|
function &To ( aPatch : String; aNameContainer : String) : iRouter4DLink; overload;
|
||||||
function IndexLink ( aPatch : String ) : iRouter4DLink;
|
function IndexLink ( aPatch : String ) : iRouter4DLink;
|
||||||
function GoBack : iRouter4DLink;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
iRouter4DRender = interface
|
iRouter4DRender = interface
|
||||||
|
|||||||
@ -38,7 +38,6 @@ type
|
|||||||
function &To ( aPatch : String) : iRouter4DLink; overload;
|
function &To ( aPatch : String) : iRouter4DLink; overload;
|
||||||
function &To ( aPatch : String; aProps : TProps; aKey : String = '') : iRouter4DLink; overload;
|
function &To ( aPatch : String; aProps : TProps; aKey : String = '') : iRouter4DLink; overload;
|
||||||
function &To ( aPatch : String; aNameContainer : String) : iRouter4DLink; overload;
|
function &To ( aPatch : String; aNameContainer : String) : iRouter4DLink; overload;
|
||||||
function GoBack : iRouter4DLink;
|
|
||||||
function IndexLink ( aPatch : String ) : iRouter4DLink;
|
function IndexLink ( aPatch : String ) : iRouter4DLink;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -67,7 +66,6 @@ begin
|
|||||||
aComponent
|
aComponent
|
||||||
.AddObject(
|
.AddObject(
|
||||||
Router4DHistory
|
Router4DHistory
|
||||||
.addCacheHistory(aPatch)
|
|
||||||
.GetHistory(aPatch)
|
.GetHistory(aPatch)
|
||||||
.Render
|
.Render
|
||||||
);
|
);
|
||||||
@ -87,7 +85,6 @@ begin
|
|||||||
aComponent
|
aComponent
|
||||||
.AddObject(
|
.AddObject(
|
||||||
Router4DHistory
|
Router4DHistory
|
||||||
.addCacheHistory(aPatch)
|
|
||||||
.GetHistory(aPatch)
|
.GetHistory(aPatch)
|
||||||
.Render
|
.Render
|
||||||
);
|
);
|
||||||
@ -114,7 +111,6 @@ begin
|
|||||||
aContainer
|
aContainer
|
||||||
.AddObject(
|
.AddObject(
|
||||||
Router4DHistory
|
Router4DHistory
|
||||||
.addCacheHistory(aPatch)
|
|
||||||
.GetHistory(aPatch)
|
.GetHistory(aPatch)
|
||||||
.Render
|
.Render
|
||||||
);
|
);
|
||||||
@ -135,26 +131,6 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRouter4DLink.GoBack : iRouter4DLink;
|
|
||||||
begin
|
|
||||||
Result := Self;
|
|
||||||
{$IFDEF HAS_FMX}
|
|
||||||
Router4DHistory.MainRouter.RemoveObject(0);
|
|
||||||
{$ELSE}
|
|
||||||
Router4DHistory.MainRouter.RemoveObject;
|
|
||||||
{$ENDIF}
|
|
||||||
Router4DHistory.InstanteObject.UnRender;
|
|
||||||
Router4DHistory
|
|
||||||
.MainRouter
|
|
||||||
.AddObject(
|
|
||||||
Router4DHistory
|
|
||||||
.GetHistory(Router4DHistory.GoBack)
|
|
||||||
.Render
|
|
||||||
);
|
|
||||||
|
|
||||||
if Assigned(FAnimation) then
|
|
||||||
FAnimation(Router4DHistory.MainRouter);
|
|
||||||
end;
|
|
||||||
function TRouter4DLink.IndexLink(aPatch: String): iRouter4DLink;
|
function TRouter4DLink.IndexLink(aPatch: String): iRouter4DLink;
|
||||||
begin
|
begin
|
||||||
Result := Self;
|
Result := Self;
|
||||||
@ -190,7 +166,6 @@ begin
|
|||||||
.MainRouter
|
.MainRouter
|
||||||
.AddObject(
|
.AddObject(
|
||||||
Router4DHistory
|
Router4DHistory
|
||||||
.addCacheHistory(aPatch)
|
|
||||||
.GetHistory(aPatch)
|
.GetHistory(aPatch)
|
||||||
.Render
|
.Render
|
||||||
);
|
);
|
||||||
@ -213,7 +188,6 @@ begin
|
|||||||
.MainRouter
|
.MainRouter
|
||||||
.AddObject(
|
.AddObject(
|
||||||
Router4DHistory
|
Router4DHistory
|
||||||
.addCacheHistory(aPatch)
|
|
||||||
.GetHistory(aPatch)
|
.GetHistory(aPatch)
|
||||||
.Render
|
.Render
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user