diff --git a/.gitignore b/.gitignore index 9532800..acd27c1 100644 --- a/.gitignore +++ b/.gitignore @@ -66,4 +66,4 @@ __recovery/ *.stat # Boss dependency manager vendor folder https://github.com/HashLoad/boss -modules/ +modules/ \ No newline at end of file diff --git a/ProjectGroup1.groupproj b/ProjectGroup1.groupproj new file mode 100644 index 0000000..ef74e0c --- /dev/null +++ b/ProjectGroup1.groupproj @@ -0,0 +1,72 @@ + + + {7038A3EC-BD85-4AA8-B65E-783D12D02F7F} + + + + + + + + + + + + + + + + + Default.Personality.12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 995e560..97ee0fc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Router4Delphi -Framework para Criação de Rotas de Telas para FMX +Framework para Criação de Rotas de Telas para FMX e VCL -O Router4Delphi tem o objetivo de facilitar a chamada de telas e embed de Layouts em aplicações FMX, reduzindo o acoplamento das telas de dando mais dinâmismo e práticidade na construção de interfaces ricas em Delphi +O Router4Delphi tem o objetivo de facilitar a chamada de telas e embed de Layouts em aplicações FMX, e Panels em aplicações VCL, reduzindo o acoplamento das telas de dando mais dinâmismo e práticidade na construção de interfaces ricas em Delphi ## Instalação @@ -13,14 +13,16 @@ Para utilizar o Router4Delphi para criar suas rotas, você deve realizar a uses ## Criação de uma Tela para Roteamento -Para que o sistema de Rotas funcione você deve criar um novo formulário FMX e Implementar a Interface iRouter4DComponent ela pertence a unit Router4D.Interfaces portanto a mesma deve ser incluida nas suas Units. +Para que o sistema de Rotas funcione você deve criar um novo formulário FMX ou VCL e Implementar a Interface iRouter4DComponent ela pertence a unit Router4D.Interfaces portanto a mesma deve ser incluida nas suas Units. -Toda a construção das telas baseadas em rotas utilizar TLayouts para embedar as chamadas das telas, dessa forma é preciso que sua nova tela tenha um TLayout principal e todos os demais componentes devem ser incluídos dentro desse layout. +Toda a construção das telas baseadas em rotas utilizar TLayouts e TPanels para embedar as chamadas das telas, dessa forma é preciso que sua nova tela tenha um TLayout ou um TPanel principal e todos os demais componentes devem ser incluídos dentro desse layout ou panel. A Implementação da Interface iRouter4DComponent requer a declaração de dois métodos ( Render e UnRender ), o Render é chamado sempre que uma rota aciona a tela, e o UnRender sempre que ela saí de exibição. Abaixo o Código de uma tela simples implementando a interface iRouter4DComponent e pronta para ser utilizada. +#### Exemplo em FMX + Crie um Novo Formulario na sua Aplicação, inclua nele um Layout alinhado AlClient e implemente os métodos como abaixo. ```delphi @@ -357,4 +359,3 @@ TRouter4D .ItemHeigth(60) .RenderToListBox; ``` - diff --git a/Router4Delphi.dpk b/Router4Delphi.dpk index 224658b..066db10 100644 --- a/Router4Delphi.dpk +++ b/Router4Delphi.dpk @@ -36,22 +36,24 @@ requires DbxCommonDriver, FireDAC, FireDACCommonDriver, - FireDACCommon; + FireDACCommon, + vcl; contains + DuckListU in 'src\DuckListU.pas', + EventBus.Core in 'src\EventBus.Core.pas', + EventBus.Subscribers in 'src\EventBus.Subscribers.pas', + ObjectsMappers in 'src\ObjectsMappers.pas', Router4D.History in 'src\Router4D.History.pas', Router4D.Interfaces in 'src\Router4D.Interfaces.pas', Router4D.Link in 'src\Router4D.Link.pas', Router4D in 'src\Router4D.pas', Router4D.Props in 'src\Router4D.Props.pas', + Router4D.Render in 'src\Router4D.Render.pas', Router4D.Switch in 'src\Router4D.Switch.pas', Router4D.Utils in 'src\Router4D.Utils.pas', - DuckListU in 'src\DuckListU.pas', - EventBus.Core in 'src\EventBus.Core.pas', - EventBus.Subscribers in 'src\EventBus.Subscribers.pas', - ObjectsMappers in 'src\ObjectsMappers.pas', RTTIUtilsU in 'src\RTTIUtilsU.pas', - Router4D.Sidebar in 'src\Router4D.Sidebar.pas', - Router4D.Render in 'src\Router4D.Render.pas'; + Router4D.Helper in 'src\Router4D.Helper.pas', + Router4D.Sidebar in 'src\Router4D.Sidebar.pas'; end. diff --git a/Router4Delphi.dproj b/Router4Delphi.dproj index 46ce556..36a460f 100644 --- a/Router4Delphi.dproj +++ b/Router4Delphi.dproj @@ -1,8 +1,8 @@  - {3810FA8C-A44A-4F47-AEB3-80819D3485B2} + {AC59E0D2-C9EA-4482-B4D9-D663FB283EB2} Router4Delphi.dpk - 19.0 + 18.8 FMX True Debug @@ -103,20 +103,22 @@ + + + + + + - - - - + - Cfg_2 Base @@ -138,13 +140,6 @@ Router4Delphi.dpk - - False - False - False - True - False - @@ -161,7 +156,7 @@ true - + Router4Delphi.bpl true @@ -533,63 +528,267 @@ 0 - + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -614,7 +813,6 @@ - 1 @@ -715,6 +913,12 @@ + + False + False + True + False + 12 diff --git a/Router4Delphi.dproj.local b/Router4Delphi.dproj.local index 741add1..d576f03 100644 --- a/Router4Delphi.dproj.local +++ b/Router4Delphi.dproj.local @@ -1,32 +1,2 @@  - - - 2020/07/13 22:38:51.000.784,=rtl.dcp - 2020/07/13 22:38:58.000.612,C:\Users\thuli\Documents\Embarcadero\Studio\Projects\Router4Delphi.dproj=C:\Users\thuli\Documents\Embarcadero\Studio\Projects\Package1.dproj - 2020/07/13 22:39:07.000.751,D:\Projetos\Frameworks\Router4Delphi\Router4Delphi.dproj=C:\Users\thuli\Documents\Embarcadero\Studio\Projects\Router4Delphi.dproj - 2020/07/13 22:39:18.000.950,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.pas - 2020/07/13 22:39:18.000.846,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.History.pas - 2020/07/13 22:39:18.000.879,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Interfaces.pas - 2020/07/13 22:39:18.000.985,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Props.pas - 2020/07/13 22:39:18.000.922,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Link.pas - 2020/07/13 22:39:19.000.075,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Utils.pas - 2020/07/13 22:39:19.000.046,=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Switch.pas - 2020/07/13 22:39:42.000.878,=D:\Projetos\Frameworks\Router4Delphi\src\EventBus.Core.pas - 2020/07/13 22:39:42.000.911,=D:\Projetos\Frameworks\Router4Delphi\src\EventBus.Subscribers.pas - 2020/07/13 22:39:42.000.975,=D:\Projetos\Frameworks\Router4Delphi\src\ObjectsMappers.pas - 2020/07/13 22:39:42.000.838,=D:\Projetos\Frameworks\Router4Delphi\src\DuckListU.pas - 2020/07/13 22:39:43.000.018,=D:\Projetos\Frameworks\Router4Delphi\src\RTTIUtilsU.pas - 2020/07/13 22:39:54.000.821,=FireDAC.dcp - 2020/07/13 22:39:54.000.880,=FireDACCommonDriver.dcp - 2020/07/13 22:39:54.000.735,=dbrtl.dcp - 2020/07/13 22:39:54.000.681,=soaprtl.dcp - 2020/07/13 22:39:54.000.780,=DbxCommonDriver.dcp - 2020/07/13 22:39:54.000.598,=xmlrtl.dcp - 2020/07/13 22:39:54.000.644,=fmx.dcp - 2020/07/13 22:39:54.000.918,=FireDACCommon.dcp - 2020/07/14 20:23:48.000.027,=D:\Projetos\Frameworks\Router4Delphi\Unit1.pas - 2020/07/14 20:23:58.000.724,D:\Projetos\Frameworks\Router4Delphi\Unit1.pas=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Sidebar.pas - 2020/07/14 20:52:39.000.123,=D:\Projetos\Frameworks\Router4Delphi\Unit1.pas - 2020/07/14 20:52:54.000.533,D:\Projetos\Frameworks\Router4Delphi\Unit1.pas=D:\Projetos\Frameworks\Router4Delphi\src\Router4D.Render.pas - - + diff --git a/Router4Delphi.identcache b/Router4Delphi.identcache index 5dea59e..1d66d65 100644 Binary files a/Router4Delphi.identcache and b/Router4Delphi.identcache differ diff --git a/Samples/FMX/Demo/Router4DelphiDemo.View.Principal.fmx b/Samples/FMX/Demo/Router4DelphiDemo.View.Principal.fmx new file mode 100644 index 0000000..6e484f8 --- /dev/null +++ b/Samples/FMX/Demo/Router4DelphiDemo.View.Principal.fmx @@ -0,0 +1,11 @@ +object Form2: TForm2 + Left = 0 + Top = 0 + Caption = 'Form2' + ClientHeight = 537 + ClientWidth = 921 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 +end diff --git a/Samples/FMX/Demo/Router4DelphiDemo.View.Principal.pas b/Samples/FMX/Demo/Router4DelphiDemo.View.Principal.pas new file mode 100644 index 0000000..1bcdd55 --- /dev/null +++ b/Samples/FMX/Demo/Router4DelphiDemo.View.Principal.pas @@ -0,0 +1,24 @@ +unit Router4DelphiDemo.View.Principal; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs; + +type + TForm2 = class(TForm) + private + { Private declarations } + public + { Public declarations } + end; + +var + Form2: TForm2; + +implementation + +{$R *.fmx} + +end. diff --git a/Samples/FMX/Demo/Router4DelphiDemo.dpr b/Samples/FMX/Demo/Router4DelphiDemo.dpr new file mode 100644 index 0000000..fe5e276 --- /dev/null +++ b/Samples/FMX/Demo/Router4DelphiDemo.dpr @@ -0,0 +1,19 @@ +program Router4DelphiDemo; + +uses + System.StartUpCopy, + FMX.Forms, + Router4DelphiDemo.View.Principal in 'Views\Router4DelphiDemo.View.Principal.pas' {ViewPrincipal}, + Router4DelphiDemo.Views.Layouts.Main in 'Views\Layouts\Router4DelphiDemo.Views.Layouts.Main.pas' {MainLayout}, + Router4DelphiDemo.View.Components.Sidebar in 'Views\Components\Router4DelphiDemo.View.Components.Sidebar.pas' {ComponentSideBar}, + Router4DelphiDemo.View.Router in 'Views\Routers\Router4DelphiDemo.View.Router.pas', + Router4DelphiDemo.View.Pages.Index in 'Views\Pages\Router4DelphiDemo.View.Pages.Index.pas' {PageIndex}, + Router4DelphiDemo.View.Pages.Cadastros in 'Views\Pages\Router4DelphiDemo.View.Pages.Cadastros.pas' {PageCadastros}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TViewPrincipal, ViewPrincipal); + Application.Run; +end. diff --git a/Samples/FMX/Demo/Router4DelphiDemo.dproj b/Samples/FMX/Demo/Router4DelphiDemo.dproj new file mode 100644 index 0000000..fbef35e --- /dev/null +++ b/Samples/FMX/Demo/Router4DelphiDemo.dproj @@ -0,0 +1,910 @@ + + + {4B24F7C2-9744-436B-9B23-4088395571E2} + 19.0 + FMX + True + Debug + Win32 + 32787 + Application + Router4DelphiDemo.dpr + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + true + true + true + true + true + true + true + true + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + Router4DelphiDemo + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar + + + DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;emsedge;fmx;FireDACIBDriver;fmxdae;vcledge;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;IWBootstrapD104;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;Intraweb_15_D10_4;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;TBGWebCharts;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;IWBootstrap4D104;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;emsedge;fmx;FireDACIBDriver;fmxdae;vcledge;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + true + PerMonitorV2 + true + 1033 + + + true + PerMonitorV2 + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + PerMonitorV2 + + + true + PerMonitorV2 + + + + MainSource + + +
ViewPrincipal
+ fmx +
+ +
MainLayout
+ fmx +
+ +
ComponentSideBar
+ fmx +
+ + +
PageIndex
+ fmx +
+ +
PageCadastros
+ fmx +
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Application + + + + Router4DelphiDemo.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + True + True + False + False + False + False + False + True + True + + + + + true + + + + + true + + + + + true + + + + + Router4DelphiDemo.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + classes + 1 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + 12 + + + + +
diff --git a/Samples/FMX/Demo/Router4DelphiDemo.res b/Samples/FMX/Demo/Router4DelphiDemo.res new file mode 100644 index 0000000..40531bb Binary files /dev/null and b/Samples/FMX/Demo/Router4DelphiDemo.res differ diff --git a/Samples/FMX/Demo/Views/Components/Router4DelphiDemo.View.Components.Sidebar.fmx b/Samples/FMX/Demo/Views/Components/Router4DelphiDemo.View.Components.Sidebar.fmx new file mode 100644 index 0000000..7922064 --- /dev/null +++ b/Samples/FMX/Demo/Views/Components/Router4DelphiDemo.View.Components.Sidebar.fmx @@ -0,0 +1,60 @@ +object ComponentSideBar: TComponentSideBar + Left = 0 + Top = 0 + Caption = 'Form4' + ClientHeight = 480 + ClientWidth = 640 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + object Rectangle1: TRectangle + Align = Contents + Fill.Color = xFF36414A + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + Stroke.Kind = None + end + object ListBox1: TListBox + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + StyleLookup = 'transparentlistboxstyle' + OnClick = ListBox1Click + DisableFocusEffect = True + ItemHeight = 60.000000000000000000 + DefaultItemStyles.ItemStyle = '' + DefaultItemStyles.GroupHeaderStyle = '' + DefaultItemStyles.GroupFooterStyle = '' + Viewport.Width = 640.000000000000000000 + Viewport.Height = 480.000000000000000000 + object ListBoxItem1: TListBoxItem + TextSettings.Font.Size = 15.000000000000000000 + TextSettings.FontColor = claWhite + StyledSettings = [Family, Style, Other] + Padding.Left = 15.000000000000000000 + Size.Width = 640.000000000000000000 + Size.Height = 60.000000000000000000 + Size.PlatformDefault = False + Text = 'Home' + end + object ListBoxItem2: TListBoxItem + TextSettings.Font.Size = 15.000000000000000000 + TextSettings.FontColor = claWhite + StyledSettings = [Family, Style, Other] + Position.Y = 60.000000000000000000 + Size.Width = 640.000000000000000000 + Size.Height = 60.000000000000000000 + Size.PlatformDefault = False + Text = 'Cadastros' + end + end + end +end diff --git a/Samples/FMX/Demo/Views/Components/Router4DelphiDemo.View.Components.Sidebar.pas b/Samples/FMX/Demo/Views/Components/Router4DelphiDemo.View.Components.Sidebar.pas new file mode 100644 index 0000000..bdc4095 --- /dev/null +++ b/Samples/FMX/Demo/Views/Components/Router4DelphiDemo.View.Components.Sidebar.pas @@ -0,0 +1,39 @@ +unit Router4DelphiDemo.View.Components.Sidebar; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Layouts, + FMX.ListBox, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Objects; + +type + TComponentSideBar = class(TForm) + Layout1: TLayout; + ListBox1: TListBox; + ListBoxItem1: TListBoxItem; + ListBoxItem2: TListBoxItem; + Rectangle1: TRectangle; + procedure ListBox1Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ComponentSideBar: TComponentSideBar; + +implementation + +uses + Router4D; + +{$R *.fmx} + +procedure TComponentSideBar.ListBox1Click(Sender: TObject); +begin + TRouter4D.Link.&To(ListBox1.Items[ListBox1.ItemIndex]) +end; + +end. diff --git a/Samples/FMX/Demo/Views/Layouts/Router4DelphiDemo.Views.Layouts.Main.fmx b/Samples/FMX/Demo/Views/Layouts/Router4DelphiDemo.Views.Layouts.Main.fmx new file mode 100644 index 0000000..bb0a977 --- /dev/null +++ b/Samples/FMX/Demo/Views/Layouts/Router4DelphiDemo.Views.Layouts.Main.fmx @@ -0,0 +1,56 @@ +object MainLayout: TMainLayout + Left = 0 + Top = 0 + Caption = 'Form3' + ClientHeight = 577 + ClientWidth = 860 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object LayoutIndex: TLayout + Align = Contents + Size.Width = 860.000000000000000000 + Size.Height = 577.000000000000000000 + Size.PlatformDefault = False + object Layout1: TLayout + Align = Top + Size.Width = 860.000000000000000000 + Size.Height = 65.000000000000000000 + Size.PlatformDefault = False + object Rectangle1: TRectangle + Align = Contents + Fill.Color = xFF2D2F32 + Size.Width = 860.000000000000000000 + Size.Height = 65.000000000000000000 + Size.PlatformDefault = False + Stroke.Kind = None + end + object Label1: TLabel + Align = Left + StyledSettings = [Family, Style] + Margins.Left = 15.000000000000000000 + Position.X = 15.000000000000000000 + Size.Width = 554.000000000000000000 + Size.Height = 65.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 25.000000000000000000 + TextSettings.FontColor = claWhite + Text = 'Layout Principal' + end + end + object Layout2: TLayout + Align = Left + Position.Y = 65.000000000000000000 + Size.Width = 225.000000000000000000 + Size.Height = 512.000000000000000000 + Size.PlatformDefault = False + end + object Layout3: TLayout + Align = Client + Size.Width = 635.000000000000000000 + Size.Height = 512.000000000000000000 + Size.PlatformDefault = False + end + end +end diff --git a/Samples/FMX/Demo/Views/Layouts/Router4DelphiDemo.Views.Layouts.Main.pas b/Samples/FMX/Demo/Views/Layouts/Router4DelphiDemo.Views.Layouts.Main.pas new file mode 100644 index 0000000..1353915 --- /dev/null +++ b/Samples/FMX/Demo/Views/Layouts/Router4DelphiDemo.Views.Layouts.Main.pas @@ -0,0 +1,61 @@ +unit Router4DelphiDemo.Views.Layouts.Main; + +interface + +uses + System.SysUtils, + System.Types, + System.UITypes, + System.Classes, + System.Variants, + FMX.Types, + FMX.Controls, + FMX.Forms, + FMX.Graphics, + FMX.Dialogs, + FMX.Layouts, + FMX.Controls.Presentation, + FMX.StdCtrls, + Router4D.Interfaces, FMX.Objects; + +type + TMainLayout = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Layout2: TLayout; + Layout3: TLayout; + Label1: TLabel; + LayoutIndex: TLayout; + Rectangle1: TRectangle; + private + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + end; + +var + MainLayout: TMainLayout; + +implementation + +uses + Router4DelphiDemo.View.Pages.Index, + Router4D, + Router4DelphiDemo.View.Components.Sidebar; + +{$R *.fmx} + +{ TMainLayout } + +function TMainLayout.Render: TFMXObject; +begin + Result := LayoutIndex; + TRouter4D.Render.SetElement(Layout3); + + Layout2.RemoveObject(0); + Layout2.AddObject( + TComponentSideBar.Create(Self).Layout1 + ) +end; + +end. diff --git a/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Cadastros.fmx b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Cadastros.fmx new file mode 100644 index 0000000..2aae809 --- /dev/null +++ b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Cadastros.fmx @@ -0,0 +1,27 @@ +object PageCadastros: TPageCadastros + Left = 0 + Top = 0 + Caption = 'Form2' + ClientHeight = 480 + ClientWidth = 640 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + object Label1: TLabel + Align = Client + StyledSettings = [Family, Style, FontColor] + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 30.000000000000000000 + TextSettings.HorzAlign = Center + Text = 'Cadastros' + end + end +end diff --git a/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Cadastros.pas b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Cadastros.pas new file mode 100644 index 0000000..c52d845 --- /dev/null +++ b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Cadastros.pas @@ -0,0 +1,36 @@ +unit Router4DelphiDemo.View.Pages.Cadastros; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, + FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, + Router4D.Interfaces; + +type + TPageCadastros = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Label1: TLabel; + private + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + end; + +var + PageCadastros: TPageCadastros; + +implementation + +{$R *.fmx} + +{ TForm2 } + +function TPageCadastros.Render: TFMXObject; +begin + Result := Layout1; +end; + +end. diff --git a/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Index.fmx b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Index.fmx new file mode 100644 index 0000000..736b05f --- /dev/null +++ b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Index.fmx @@ -0,0 +1,27 @@ +object PageIndex: TPageIndex + Left = 0 + Top = 0 + Caption = 'Form5' + ClientHeight = 609 + ClientWidth = 940 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Contents + Size.Width = 940.000000000000000000 + Size.Height = 609.000000000000000000 + Size.PlatformDefault = False + object Label1: TLabel + Align = Client + StyledSettings = [Family, Style, FontColor] + Size.Width = 940.000000000000000000 + Size.Height = 609.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 30.000000000000000000 + TextSettings.HorzAlign = Center + Text = 'Home' + end + end +end diff --git a/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Index.pas b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Index.pas new file mode 100644 index 0000000..8ef997b --- /dev/null +++ b/Samples/FMX/Demo/Views/Pages/Router4DelphiDemo.View.Pages.Index.pas @@ -0,0 +1,47 @@ +unit Router4DelphiDemo.View.Pages.Index; + +interface + +uses + System.SysUtils, + System.Types, + System.UITypes, + System.Classes, + System.Variants, + FMX.Types, + FMX.Controls, + FMX.Forms, + FMX.Graphics, + FMX.Dialogs, + FMX.Layouts, + Router4D.Interfaces, FMX.Controls.Presentation, FMX.StdCtrls; + +type + TPageIndex = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Label1: TLabel; + private + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + end; + +var + PageIndex: TPageIndex; + +implementation + +uses + Router4D, + Router4DelphiDemo.Views.Layouts.Main; + +{$R *.fmx} + +function TPageIndex.Render: TFMXObject; +begin + Result := Layout1; + //TRouter4D.Render.GetElement(Layout1); +end; + +end. diff --git a/Samples/FMX/Demo/Views/Router4DelphiDemo.View.Principal.fmx b/Samples/FMX/Demo/Views/Router4DelphiDemo.View.Principal.fmx new file mode 100644 index 0000000..250be62 --- /dev/null +++ b/Samples/FMX/Demo/Views/Router4DelphiDemo.View.Principal.fmx @@ -0,0 +1,18 @@ +object ViewPrincipal: TViewPrincipal + Left = 0 + Top = 0 + Caption = 'Form2' + ClientHeight = 612 + ClientWidth = 925 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnCreate = FormCreate + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Contents + Size.Width = 925.000000000000000000 + Size.Height = 612.000000000000000000 + Size.PlatformDefault = False + end +end diff --git a/Samples/FMX/Demo/Views/Router4DelphiDemo.View.Principal.pas b/Samples/FMX/Demo/Views/Router4DelphiDemo.View.Principal.pas new file mode 100644 index 0000000..31b1fb0 --- /dev/null +++ b/Samples/FMX/Demo/Views/Router4DelphiDemo.View.Principal.pas @@ -0,0 +1,36 @@ +unit Router4DelphiDemo.View.Principal; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Layouts; + +type + TViewPrincipal = class(TForm) + Layout1: TLayout; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ViewPrincipal: TViewPrincipal; + +implementation + +uses + Router4D, + Router4DelphiDemo.Views.Layouts.Main, + Router4DelphiDemo.View.Router; + +{$R *.fmx} + +procedure TViewPrincipal.FormCreate(Sender: TObject); +begin + TRouter4D.Render.SetElement(Layout1, Layout1); +end; + +end. diff --git a/Samples/FMX/Demo/Views/Routers/Router4DelphiDemo.View.Router.pas b/Samples/FMX/Demo/Views/Routers/Router4DelphiDemo.View.Router.pas new file mode 100644 index 0000000..873d9b8 --- /dev/null +++ b/Samples/FMX/Demo/Views/Routers/Router4DelphiDemo.View.Router.pas @@ -0,0 +1,45 @@ +unit Router4DelphiDemo.View.Router; + +interface + +type + TRouters = class + private + public + constructor Create; + destructor Destroy; override; + end; + +var + Routers : TRouters; + +implementation + +uses + Router4D, + Router4DelphiDemo.View.Pages.Index, + Router4DelphiDemo.Views.Layouts.Main, + Router4DelphiDemo.View.Pages.Cadastros; + +{ TRouters } + +constructor TRouters.Create; +begin + TRouter4D.Switch.Router('Home', TPageIndex); + TRouter4D.Switch.Router('Cadastros', TPageCadastros); + TRouter4D.Switch.Router('main', TMainLayout); +end; + +destructor TRouters.Destroy; +begin + + inherited; +end; + +initialization + Routers := TRouters.Create; + +finalization + Routers.Free; + +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Components.Button01.fmx b/Samples/FMX/SimpleDemo/SimpleDemo.View.Components.Button01.fmx new file mode 100644 index 0000000..5e2f102 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Components.Button01.fmx @@ -0,0 +1,47 @@ +object ComponentButton01: TComponentButton01 + Left = 0 + Top = 0 + Caption = 'Form1' + ClientHeight = 480 + ClientWidth = 640 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnCreate = FormCreate + DesignerMasterStyle = 0 + object Layout1: TLayout + Position.X = 232.000000000000000000 + Position.Y = 120.000000000000000000 + Size.Width = 121.000000000000000000 + Size.Height = 81.000000000000000000 + Size.PlatformDefault = False + object Line1: TLine + Align = Bottom + LineType = Bottom + Position.Y = 80.000000000000000000 + Size.Width = 121.000000000000000000 + Size.Height = 1.000000000000000000 + Size.PlatformDefault = False + Stroke.Thickness = 5.000000000000000000 + end + object Label1: TLabel + Align = Contents + StyledSettings = [Family, Style, FontColor] + Size.Width = 121.000000000000000000 + Size.Height = 81.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 20.000000000000000000 + TextSettings.HorzAlign = Center + Text = 'Button' + end + object SpeedButton1: TSpeedButton + Align = Contents + Opacity = 0.000000000000000000 + Size.Width = 121.000000000000000000 + Size.Height = 81.000000000000000000 + Size.PlatformDefault = False + Text = 'SpeedButton1' + OnClick = SpeedButton1Click + end + end +end diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Components.Button01.pas b/Samples/FMX/SimpleDemo/SimpleDemo.View.Components.Button01.pas new file mode 100644 index 0000000..b216709 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Components.Button01.pas @@ -0,0 +1,85 @@ +unit SimpleDemo.View.Components.Button01; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, + FMX.Controls.Presentation, FMX.StdCtrls, FMX.Objects, FMX.Layouts, + Router4D.Interfaces, + Router4D.Props; + +type + TComponentButton01 = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Line1: TLine; + Label1: TLabel; + SpeedButton1: TSpeedButton; + procedure FormCreate(Sender: TObject); + procedure SpeedButton1Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + procedure UnRender; + [Subscribe] + procedure Props ( aValue : TProps); + function createButton(aLabel : String) : TFMXObject; + end; + +var + ComponentButton01: TComponentButton01; + +implementation + +{$R *.fmx} + +{ TComponentButton01 } + +function TComponentButton01.createButton(aLabel: String): TFMXObject; +begin + Result := Layout1; + Label1.Text := aLabel; + Layout1.Align := TAlignLayout.Left; + Line1.Visible := False; + Self.TagString := aLabel; +end; + +procedure TComponentButton01.FormCreate(Sender: TObject); +begin + GlobalEventBus.RegisterSubscriber(Self); +end; + +procedure TComponentButton01.Props(aValue: TProps); +begin + Line1.Visible := False; + + if (aValue.PropString = Label1.Text) and + (aValue.Key = 'Button01') then + Line1.Visible := True; + + aValue.Free; +end; + +function TComponentButton01.Render: TFMXObject; +begin + Result := Layout1; +end; + +procedure TComponentButton01.SpeedButton1Click(Sender: TObject); +begin + Line1.Visible := True; + GlobalEventBus.Post( + TProps.Create + .PropString(Label1.Text) + .Key('Button01') + ); +end; + +procedure TComponentButton01.UnRender; +begin + // +end; + +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.Sub.fmx b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.Sub.fmx new file mode 100644 index 0000000..6183324 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.Sub.fmx @@ -0,0 +1,27 @@ +object SubCadastros: TSubCadastros + Left = 0 + Top = 0 + Caption = 'Form1' + ClientHeight = 480 + ClientWidth = 640 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + object Label1: TLabel + Align = Contents + StyledSettings = [Family, Style, FontColor] + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 30.000000000000000000 + TextSettings.HorzAlign = Center + Text = 'Sub-Cadastros' + end + end +end diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.Sub.pas b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.Sub.pas new file mode 100644 index 0000000..9d4e29a --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.Sub.pas @@ -0,0 +1,45 @@ +unit SimpleDemo.View.Page.Cadastros.Sub; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, + FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, + Router4D.Interfaces; + +type + TSubCadastros = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Label1: TLabel; + private + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + procedure UnRender; + end; + +var + SubCadastros: TSubCadastros; + +implementation + +uses + Router4D.History; + +{$R *.fmx} + +{ TSubCadastros } + +function TSubCadastros.Render: TFMXObject; +begin + Result := Layout1; +end; + +procedure TSubCadastros.UnRender; +begin + // +end; + +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.fmx b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.fmx new file mode 100644 index 0000000..ec1abf1 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.fmx @@ -0,0 +1,74 @@ +object PageCadastros: TPageCadastros + Left = 0 + Top = 0 + Caption = 'Form3' + ClientHeight = 480 + ClientWidth = 640 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnCreate = FormCreate + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + object Layout2: TLayout + Align = Left + Size.Width = 177.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + Visible = False + object Rectangle1: TRectangle + Align = Contents + Fill.Color = xFF36414A + Size.Width = 177.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + Stroke.Kind = None + end + end + object Layout3: TLayout + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 399.000000000000000000 + Size.PlatformDefault = False + object Label1: TLabel + Align = Contents + StyledSettings = [Family, Style, FontColor] + Size.Width = 640.000000000000000000 + Size.Height = 399.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 30.000000000000000000 + TextSettings.HorzAlign = Center + Text = 'Cadastros' + end + object Button1: TButton + Anchors = [] + Position.X = 243.682922363281300000 + Position.Y = 215.990631103515600000 + Size.Width = 145.000000000000000000 + Size.Height = 41.000000000000000000 + Size.PlatformDefault = False + Text = 'Voltar para Home' + OnClick = Button1Click + end + object Edit1: TEdit + Touch.InteractiveGestures = [LongTap, DoubleTap] + Anchors = [] + Position.X = 243.682922363281300000 + Position.Y = 257.240631103515600000 + Size.Width = 145.000000000000000000 + Size.Height = 25.000000000000000000 + Size.PlatformDefault = False + end + end + object Layout4: TLayout + Align = Top + Size.Width = 640.000000000000000000 + Size.Height = 81.000000000000000000 + Size.PlatformDefault = False + end + end +end diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.pas b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.pas new file mode 100644 index 0000000..622f81f --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Cadastros.pas @@ -0,0 +1,114 @@ +unit SimpleDemo.View.Page.Cadastros; + +interface + +uses + System.SysUtils, + System.Types, + System.UITypes, + System.Classes, + System.Variants, + FMX.Types, + FMX.Controls, + FMX.Forms, + FMX.Graphics, + FMX.Dialogs, + FMX.Controls.Presentation, + FMX.StdCtrls, + FMX.Layouts, + Router4D.Interfaces, + Router4D.Props, FMX.Edit, FMX.Objects; + +type + TPageCadastros = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Label1: TLabel; + Button1: TButton; + Edit1: TEdit; + Layout2: TLayout; + Layout3: TLayout; + Rectangle1: TRectangle; + Layout4: TLayout; + procedure Button1Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + procedure CreateMenuSuperior; + procedure CreateRouters; + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + procedure UnRender; + [Subscribe] + procedure Props ( aValue : TProps); + end; + +var + PageCadastros: TPageCadastros; + +implementation + +uses + Router4D, SimpleDemo.View.Page.Cadastros.Sub, SimpleDemo.View.Page.Principal, + SimpleDemo.View.Components.Button01; + +{$R *.fmx} + +{ TPageCadastros } + +procedure TPageCadastros.Button1Click(Sender: TObject); +begin + TRouter4D.Link.&To('Inicio'); +end; + +procedure TPageCadastros.FormCreate(Sender: TObject); +begin + CreateRouters; + CreateMenuSuperior; +end; + +procedure TPageCadastros.Props(aValue: TProps); +begin + if (aValue.PropString <> '') and (aValue.Key = 'TelaCadastro') then + Label1.Text := aValue.PropString; + + aValue.Free; +end; + +procedure TPageCadastros.CreateRouters; +begin + TRouter4D.Switch.Router('Clientes', TPagePrincipal, 'cadastros'); + TRouter4D.Switch.Router('Fornecedores', TSubCadastros, 'cadastros'); + TRouter4D.Switch.Router('Produtos', TSubCadastros, 'cadastros'); +end; + +procedure TPageCadastros.CreateMenuSuperior; +begin + Layout4.AddObject( + TComponentButton01.Create(Self) + .createButton('Clientes') + ); + + Layout4.AddObject( + TComponentButton01.Create(Self) + .createButton('Produtos') + ); + + Layout4.AddObject( + TComponentButton01.Create(Self) + .createButton('Fornecedores') + ); +end; + +function TPageCadastros.Render: TFMXObject; +begin + Label1.Text := 'Cadastros'; + Result := Layout1; +end; + +procedure TPageCadastros.UnRender; +begin + // +end; + +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Principal.fmx b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Principal.fmx new file mode 100644 index 0000000..fe00aa9 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Principal.fmx @@ -0,0 +1,47 @@ +object PagePrincipal: TPagePrincipal + Left = 0 + Top = 0 + Caption = 'Form3' + ClientHeight = 480 + ClientWidth = 640 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Client + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + object Label1: TLabel + Align = Client + StyledSettings = [Family, Style, FontColor] + Size.Width = 640.000000000000000000 + Size.Height = 480.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 30.000000000000000000 + TextSettings.HorzAlign = Center + Text = 'Home' + end + object Button1: TButton + Anchors = [] + Position.X = 240.000000000000000000 + Position.Y = 264.000000000000000000 + Size.Width = 169.000000000000000000 + Size.Height = 33.000000000000000000 + Size.PlatformDefault = False + Text = 'Cadastros Simples' + OnClick = Button1Click + end + object Button2: TButton + Anchors = [] + Position.X = 240.000000000000000000 + Position.Y = 304.000000000000000000 + Size.Width = 169.000000000000000000 + Size.Height = 33.000000000000000000 + Size.PlatformDefault = False + Text = 'Cadastros com Props' + OnClick = Button2Click + end + end +end diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Principal.pas b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Principal.pas new file mode 100644 index 0000000..135f72a --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Page.Principal.pas @@ -0,0 +1,69 @@ +unit SimpleDemo.View.Page.Principal; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, + FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, + Router4D.Interfaces; + +type + TPagePrincipal = class(TForm, iRouter4DComponent) + Layout1: TLayout; + Label1: TLabel; + Button1: TButton; + Button2: TButton; + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + function Render : TFMXObject; + procedure UnRender; + end; + +var + PagePrincipal: TPagePrincipal; + +implementation + +uses + Router4D, + Router4D.Props; + +{$R *.fmx} + +{ TPagePrincipal } + +procedure TPagePrincipal.Button1Click(Sender: TObject); +begin + TRouter4D.Link.&To('Cadastros'); +end; + +procedure TPagePrincipal.Button2Click(Sender: TObject); +begin + TRouter4D.Link + .&To( + 'Cadastros', + TProps + .Create + .PropString( + 'Olá Router4D, Seu Cadastro Recebeu as Props' + ) + .Key('TelaCadastro') + ); +end; + +function TPagePrincipal.Render: TFMXObject; +begin + Result := Layout1; +end; + +procedure TPagePrincipal.UnRender; +begin + // +end; + +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Principal.fmx b/Samples/FMX/SimpleDemo/SimpleDemo.View.Principal.fmx new file mode 100644 index 0000000..266c1a1 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Principal.fmx @@ -0,0 +1,71 @@ +object Form2: TForm2 + Left = 0 + Top = 0 + Caption = 'Form2' + ClientHeight = 586 + ClientWidth = 875 + FormFactor.Width = 320 + FormFactor.Height = 480 + FormFactor.Devices = [Desktop] + OnShow = FormShow + DesignerMasterStyle = 0 + object Layout1: TLayout + Align = Client + Size.Width = 875.000000000000000000 + Size.Height = 586.000000000000000000 + Size.PlatformDefault = False + object Layout2: TLayout + Align = Top + Size.Width = 875.000000000000000000 + Size.Height = 50.000000000000000000 + Size.PlatformDefault = False + object Rectangle1: TRectangle + Align = Contents + Fill.Color = xFF36414A + Size.Width = 875.000000000000000000 + Size.Height = 50.000000000000000000 + Size.PlatformDefault = False + Stroke.Kind = None + end + object Label1: TLabel + Align = Contents + StyledSettings = [Family, Style] + Margins.Right = 10.000000000000000000 + Size.Width = 865.000000000000000000 + Size.Height = 50.000000000000000000 + Size.PlatformDefault = False + TextSettings.Font.Size = 15.000000000000000000 + TextSettings.FontColor = claWhite + TextSettings.HorzAlign = Trailing + Text = 'Router4D - SimpleDemo' + end + end + object Layout4: TLayout + Align = Client + Size.Width = 705.000000000000000000 + Size.Height = 536.000000000000000000 + Size.PlatformDefault = False + end + object Layout3: TLayout + Align = Left + Position.Y = 50.000000000000000000 + Size.Width = 170.000000000000000000 + Size.Height = 536.000000000000000000 + Size.PlatformDefault = False + object Rectangle2: TRectangle + Align = Contents + Fill.Color = xFF2D2F32 + Size.Width = 170.000000000000000000 + Size.Height = 536.000000000000000000 + Size.PlatformDefault = False + Stroke.Kind = None + end + object Layout5: TLayout + Align = Client + Size.Width = 170.000000000000000000 + Size.Height = 536.000000000000000000 + Size.PlatformDefault = False + end + end + end +end diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.View.Principal.pas b/Samples/FMX/SimpleDemo/SimpleDemo.View.Principal.pas new file mode 100644 index 0000000..8915fd7 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.View.Principal.pas @@ -0,0 +1,79 @@ +unit SimpleDemo.View.Principal; + +interface + +uses + System.SysUtils, + System.Types, + System.UITypes, + System.Classes, + System.Variants, + FMX.Types, + FMX.Controls, + FMX.Forms, + FMX.Graphics, + FMX.Dialogs, + FMX.Controls.Presentation, + FMX.StdCtrls, + FMX.ListBox, + FMX.Layouts, + FMX.Objects, FMX.Edit, FMX.SearchBox, FMX.MultiView; + +type + TForm2 = class(TForm) + Layout1: TLayout; + Layout2: TLayout; + Layout3: TLayout; + Layout4: TLayout; + Rectangle1: TRectangle; + Rectangle2: TRectangle; + Label1: TLabel; + Layout5: TLayout; + procedure FormShow(Sender: TObject); + private + procedure RegisterRouters; + procedure createSideBar; + { Private declarations } + public + { Public declarations } + end; + +var + Form2: TForm2; + +implementation + +uses + Router4D, + SimpleDemo.View.Page.Cadastros, + SimpleDemo.View.Page.Principal; + +{$R *.fmx} + +procedure TForm2.FormShow(Sender: TObject); +begin + RegisterRouters; + TRouter4D.Render.SetElement(Layout4, Layout1); +end; + +procedure TForm2.RegisterRouters; +begin + TRouter4D.Switch.Router('Inicio', TPagePrincipal); + TRouter4D.Switch.Router('Cadastros', TPageCadastros); + TRouter4D.Switch.Router('Configuracoes', TPageCadastros); + createSideBar; +end; + +procedure TForm2.createSideBar; +begin + TRouter4D + .SideBar + .MainContainer(Layout5) + .LinkContainer(Layout4) + .FontSize(15) + .FontColor(4294967295) + .ItemHeigth(60) + .RenderToListBox; +end; + +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.dpr b/Samples/FMX/SimpleDemo/SimpleDemo.dpr new file mode 100644 index 0000000..a78e4b5 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.dpr @@ -0,0 +1,19 @@ +program SimpleDemo; + +uses + System.StartUpCopy, + FMX.Forms, + SimpleDemo.View.Principal in 'SimpleDemo.View.Principal.pas' {Form2}, + SimpleDemo.View.Page.Principal in 'SimpleDemo.View.Page.Principal.pas' {PagePrincipal}, + SimpleDemo.View.Page.Cadastros in 'SimpleDemo.View.Page.Cadastros.pas' {PageCadastros}, + SimpleDemo.View.Page.Cadastros.Sub in 'SimpleDemo.View.Page.Cadastros.Sub.pas' {SubCadastros}, + SimpleDemo.View.Components.Button01 in 'SimpleDemo.View.Components.Button01.pas' {ComponentButton01}; + +{$R *.res} + +begin + ReportMemoryLeaksOnShutdown := True; + Application.Initialize; + Application.CreateForm(TForm2, Form2); + Application.Run; +end. diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.dproj b/Samples/FMX/SimpleDemo/SimpleDemo.dproj new file mode 100644 index 0000000..3ff4b34 --- /dev/null +++ b/Samples/FMX/SimpleDemo/SimpleDemo.dproj @@ -0,0 +1,904 @@ + + + {3AD0DA23-7F3C-401B-92FF-B74A312EBB37} + 19.0 + FMX + True + Debug + Win32 + 32787 + Application + SimpleDemo.dpr + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + true + true + true + true + true + true + true + true + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + SimpleDemo + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar + + + DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar + + + DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;emsedge;fmx;FireDACIBDriver;fmxdae;vcledge;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;IWBootstrapD104;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;Intraweb_15_D10_4;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;TBGWebCharts;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;IWBootstrap4D104;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;emsedge;fmx;FireDACIBDriver;fmxdae;vcledge;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + true + PerMonitorV2 + true + 1033 + + + true + PerMonitorV2 + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + PerMonitorV2 + + + true + PerMonitorV2 + + + + MainSource + + +
Form2
+ fmx +
+ +
PagePrincipal
+ fmx +
+ +
PageCadastros
+ fmx +
+ +
SubCadastros
+ fmx +
+ +
ComponentButton01
+ fmx +
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Application + + + + SimpleDemo.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + True + True + True + True + + + + + true + + + + + true + + + + + true + + + + + SimpleDemo.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + classes + 1 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + 12 + + + + +
diff --git a/Samples/FMX/SimpleDemo/SimpleDemo.res b/Samples/FMX/SimpleDemo/SimpleDemo.res new file mode 100644 index 0000000..c0b549e Binary files /dev/null and b/Samples/FMX/SimpleDemo/SimpleDemo.res differ diff --git a/Samples/VCL/Main.dfm b/Samples/VCL/Main.dfm new file mode 100644 index 0000000..780d095 --- /dev/null +++ b/Samples/VCL/Main.dfm @@ -0,0 +1,41 @@ +object fMain: TfMain + Left = 0 + Top = 0 + Caption = 'fMain' + ClientHeight = 678 + ClientWidth = 1178 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object pnlBackground: TPanel + Left = 0 + Top = 0 + Width = 1178 + Height = 678 + Align = alClient + TabOrder = 0 + object pnlMain: TPanel + Left = 1 + Top = 1 + Width = 192 + Height = 676 + Align = alLeft + TabOrder = 0 + end + object pnlEmbed: TPanel + Left = 193 + Top = 1 + Width = 984 + Height = 676 + Align = alClient + TabOrder = 1 + end + end +end diff --git a/Samples/VCL/Main.pas b/Samples/VCL/Main.pas new file mode 100644 index 0000000..aa3855a --- /dev/null +++ b/Samples/VCL/Main.pas @@ -0,0 +1,57 @@ +unit Main; + +interface + +uses + Winapi.Windows, + Winapi.Messages, + System.SysUtils, + System.Variants, + System.Classes, + Vcl.Graphics, + Vcl.Controls, + Vcl.Forms, + Vcl.Dialogs, + Vcl.ExtCtrls, + Router4D, + View.Page.Main.Cadastro, + Vcl.StdCtrls; + +type + TfMain = class(TForm) + pnlBackground: TPanel; + pnlMain: TPanel; + pnlEmbed: TPanel; + procedure FormCreate(Sender: TObject); + private + procedure RegisterRouters; + public + { Public declarations } + end; + +var + fMain: TfMain; + +implementation + +{$R *.dfm} + +uses + View.Page.Customer, + View.Page.Product; + +procedure TfMain.FormCreate(Sender: TObject); +begin + RegisterRouters; + TRouter4D.Render.SetElement(pnlEmbed, pnlBackground); +end; + +procedure TfMain.RegisterRouters; +begin + TRouter4D.Switch.Router('Start', TfViewPageMainCadastro); + TRouter4D.Switch.Router('Product', TfViewPageProduct); + TRouter4D.Switch.Router('Customer', TfViewPageCustomer); +end; + +end. + diff --git a/Samples/VCL/Router.dpr b/Samples/VCL/Router.dpr new file mode 100644 index 0000000..b005de3 --- /dev/null +++ b/Samples/VCL/Router.dpr @@ -0,0 +1,19 @@ +program Router; + +uses + Vcl.Forms, + Main in 'Main.pas' {fMain}, + View.Page.Main.Cadastro in 'pages\View.Page.Main.Cadastro.pas' {fViewPageMainCadastro}, + View.Page.Template in 'pages\View.Page.Template.pas' {fViewPageTemplate}, + View.Page.Product in 'pages\View.Page.Product.pas' {fViewPageProduct}, + View.Page.Customer in 'pages\View.Page.Customer.pas' {fViewPageCustomer}; + +{$R *.res} + +begin + ReportMemoryLeaksOnShutdown := True; + Application.Initialize; + Application.MainFormOnTaskbar := True; + Application.CreateForm(TfMain, fMain); + Application.Run; +end. diff --git a/Samples/VCL/Router.dproj b/Samples/VCL/Router.dproj new file mode 100644 index 0000000..fbe6103 --- /dev/null +++ b/Samples/VCL/Router.dproj @@ -0,0 +1,986 @@ + + + {9FEAC6BC-4355-42BF-B09D-4FDF02CFA779} + 18.8 + VCL + Router.dpr + True + Debug + Win32 + 1 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + Router + + + DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;StyleControls_dxe103Rio;vclFireDAC;IndySystem;AqEdit;AqButton;ZComponent;ZCore;tethering;svnui;AqEnterAsTab;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;ZDbc;TeeDB;FireDAC;vcltouch;vcldb;bindcompfmx;svn;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;inetdb;FMXTee;soaprtl;DbxCommonDriver;FmxTeeUI;ibxpress;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;ibxbindings;fmxobj;vclwinx;vclib;rtl;Tee;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;ZParseSql;bindcomp;appanalytics;dsnap;ZPlain;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;TeeUI;Weather;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;AqComboBox;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + + + DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;StyleControls_dxe103Rio;vclFireDAC;IndySystem;ZComponent;ZCore;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;ZDbc;TeeDB;FireDAC;vcltouch;vcldb;bindcompfmx;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;inetdb;FMXTee;soaprtl;DbxCommonDriver;FmxTeeUI;ibxpress;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;ibxbindings;fmxobj;vclwinx;vclib;rtl;Tee;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;ZParseSql;bindcomp;appanalytics;dsnap;ZPlain;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;TeeUI;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + true + PerMonitorV2 + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + PerMonitorV2 + + + + MainSource + + +
fMain
+ dfm +
+ +
fViewPageMainCadastro
+ dfm +
+ +
fViewPageTemplate
+ dfm +
+ +
fViewPageProduct
+ dfm +
+ +
fViewPageCustomer
+ dfm +
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Application + + + + Router.dpr + + + + + + Router.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + classes + 1 + + + classes + 1 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + True + False + + + 12 + + + + +
diff --git a/Samples/VCL/Router.res b/Samples/VCL/Router.res new file mode 100644 index 0000000..750406a Binary files /dev/null and b/Samples/VCL/Router.res differ diff --git a/Samples/VCL/pages/View.Page.Customer.dfm b/Samples/VCL/pages/View.Page.Customer.dfm new file mode 100644 index 0000000..d56040c --- /dev/null +++ b/Samples/VCL/pages/View.Page.Customer.dfm @@ -0,0 +1,26 @@ +inherited fViewPageCustomer: TfViewPageCustomer + Caption = 'fViewPageCustomer' + PixelsPerInch = 96 + TextHeight = 13 + inherited pnlBackground: TPanel + ExplicitWidth = 715 + ExplicitHeight = 463 + inherited lblTitle: TLabel + Width = 242 + Caption = 'Cadastro de Clientes' + ExplicitWidth = 242 + end + inherited btnBack: TButton + TabOrder = 1 + ExplicitTop = 415 + end + object edt1: TEdit + Left = 16 + Top = 120 + Width = 121 + Height = 21 + TabOrder = 0 + Text = 'edt1' + end + end +end diff --git a/Samples/VCL/pages/View.Page.Customer.pas b/Samples/VCL/pages/View.Page.Customer.pas new file mode 100644 index 0000000..a582019 --- /dev/null +++ b/Samples/VCL/pages/View.Page.Customer.pas @@ -0,0 +1,36 @@ +unit View.Page.Customer; + +interface + +uses + Winapi.Windows, + Winapi.Messages, + System.SysUtils, + System.Variants, + System.Classes, + Vcl.Graphics, + Vcl.Controls, + Vcl.Forms, + Vcl.Dialogs, + View.Page.Template, + Vcl.ExtCtrls, + Vcl.StdCtrls; + +type + TfViewPageCustomer = class(TfViewPageTemplate) + edt1: TEdit; + private + { Private declarations } + public + { Public declarations } + end; + +var + fViewPageCustomer: TfViewPageCustomer; + +implementation + +{$R *.dfm} + +end. + diff --git a/Samples/VCL/pages/View.Page.Main.Cadastro.dfm b/Samples/VCL/pages/View.Page.Main.Cadastro.dfm new file mode 100644 index 0000000..9cb10b4 --- /dev/null +++ b/Samples/VCL/pages/View.Page.Main.Cadastro.dfm @@ -0,0 +1,62 @@ +object fViewPageMainCadastro: TfViewPageMainCadastro + Left = 0 + Top = 0 + Align = alClient + BorderStyle = bsNone + Caption = 'fViewPageMainCadastro' + ClientHeight = 484 + ClientWidth = 799 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object pnlAll: TPanel + Left = 0 + Top = 0 + Width = 799 + Height = 484 + Align = alClient + TabOrder = 0 + object btnProduct: TButton + Left = 24 + Top = 32 + Width = 153 + Height = 25 + Caption = 'Product' + TabOrder = 0 + OnClick = btnProductClick + end + object btnProductProp: TButton + Left = 24 + Top = 63 + Width = 153 + Height = 25 + Caption = 'Product With Prop' + TabOrder = 1 + OnClick = btnProductPropClick + end + object btnCustomer: TButton + Left = 24 + Top = 104 + Width = 153 + Height = 25 + Caption = 'Customer' + TabOrder = 2 + OnClick = btnCustomerClick + end + object btnCustomerWithProps: TButton + Left = 24 + Top = 135 + Width = 153 + Height = 25 + Caption = 'Customer With Prop' + TabOrder = 3 + OnClick = btnCustomerWithPropsClick + end + end +end diff --git a/Samples/VCL/pages/View.Page.Main.Cadastro.pas b/Samples/VCL/pages/View.Page.Main.Cadastro.pas new file mode 100644 index 0000000..c399916 --- /dev/null +++ b/Samples/VCL/pages/View.Page.Main.Cadastro.pas @@ -0,0 +1,93 @@ +unit View.Page.Main.Cadastro; + +interface + +uses + Winapi.Windows, + Winapi.Messages, + System.SysUtils, + System.Variants, + System.Classes, + Vcl.Graphics, + Vcl.Controls, + Vcl.Forms, + Vcl.Dialogs, + Vcl.ExtCtrls, + Router4D.Interfaces, + Vcl.StdCtrls, Router4D, Router4D.Props; + +type + TfViewPageMainCadastro = class(TForm, iRouter4DComponent) + pnlAll: TPanel; + btnProduct: TButton; + btnProductProp: TButton; + btnCustomer: TButton; + btnCustomerWithProps: TButton; + procedure btnProductClick(Sender: TObject); + procedure btnProductPropClick(Sender: TObject); + procedure btnCustomerClick(Sender: TObject); + procedure btnCustomerWithPropsClick(Sender: TObject); + private + function Render: TForm; + procedure UnRender; + public + { Public declarations } + end; + +var + fViewPageMainCadastro: TfViewPageMainCadastro; + +implementation + +{$R *.dfm} + +procedure TfViewPageMainCadastro.btnCustomerClick(Sender: TObject); +begin + TRouter4D.Link.&To('Customer'); +end; + +procedure TfViewPageMainCadastro.btnCustomerWithPropsClick(Sender: TObject); +begin + TRouter4D.Link + .&To( + 'Customer', + TProps + .Create + .PropString( + 'Olá Customer, Seu Cadastro Recebeu as Props' + ) + .Key('TelaCadastro') + ); +end; + +procedure TfViewPageMainCadastro.btnProductClick(Sender: TObject); +begin + TRouter4D.Link.&To('Product'); +end; + +procedure TfViewPageMainCadastro.btnProductPropClick(Sender: TObject); +begin + TRouter4D.Link + .&To( + 'Product', + TProps + .Create + .PropString( + 'Olá Product, Seu Cadastro Recebeu as Props' + ) + .Key('TelaCadastro') + ); +end; + +function TfViewPageMainCadastro.Render: TForm; +begin + Result := Self; +end; + +procedure TfViewPageMainCadastro.UnRender; +begin + +end; + +end. + diff --git a/Samples/VCL/pages/View.Page.Product.dfm b/Samples/VCL/pages/View.Page.Product.dfm new file mode 100644 index 0000000..a1d1eef --- /dev/null +++ b/Samples/VCL/pages/View.Page.Product.dfm @@ -0,0 +1,12 @@ +inherited fViewPageProduct: TfViewPageProduct + Caption = 'fViewPageProduct' + PixelsPerInch = 96 + TextHeight = 13 + inherited pnlBackground: TPanel + ExplicitWidth = 715 + ExplicitHeight = 463 + inherited btnBack: TButton + ExplicitTop = 415 + end + end +end diff --git a/Samples/VCL/pages/View.Page.Product.pas b/Samples/VCL/pages/View.Page.Product.pas new file mode 100644 index 0000000..6a021b0 --- /dev/null +++ b/Samples/VCL/pages/View.Page.Product.pas @@ -0,0 +1,35 @@ +unit View.Page.Product; + +interface + +uses + Winapi.Windows, + Winapi.Messages, + System.SysUtils, + System.Variants, + System.Classes, + Vcl.Graphics, + Vcl.Controls, + Vcl.Forms, + Vcl.Dialogs, + View.Page.Template, + Vcl.ExtCtrls, + Vcl.StdCtrls; + +type + TfViewPageProduct = class(TfViewPageTemplate) + private + { Private declarations } + public + { Public declarations } + end; + +var + fViewPageProduct: TfViewPageProduct; + +implementation + +{$R *.dfm} + +end. + diff --git a/Samples/VCL/pages/View.Page.Template.dfm b/Samples/VCL/pages/View.Page.Template.dfm new file mode 100644 index 0000000..27d2fd0 --- /dev/null +++ b/Samples/VCL/pages/View.Page.Template.dfm @@ -0,0 +1,65 @@ +object fViewPageTemplate: TfViewPageTemplate + Left = 0 + Top = 0 + Align = alClient + BorderStyle = bsNone + Caption = 'fViewPageTemplate' + ClientHeight = 463 + ClientWidth = 715 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object pnlBackground: TPanel + Left = 0 + Top = 0 + Width = 715 + Height = 463 + Align = alClient + TabOrder = 0 + DesignSize = ( + 715 + 463) + object lblTitle: TLabel + Left = 16 + Top = 24 + Width = 142 + Height = 33 + Caption = 'Cadastro de' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -27 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object lblSubtitle: TLabel + Left = 16 + Top = 67 + Width = 70 + Height = 19 + Caption = 'lblSubtitle' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object btnBack: TButton + Left = 16 + Top = 415 + Width = 75 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Voltar' + TabOrder = 0 + OnClick = btnBackClick + end + end +end diff --git a/Samples/VCL/pages/View.Page.Template.pas b/Samples/VCL/pages/View.Page.Template.pas new file mode 100644 index 0000000..711a3cf --- /dev/null +++ b/Samples/VCL/pages/View.Page.Template.pas @@ -0,0 +1,68 @@ +unit View.Page.Template; + +interface + +uses + Winapi.Windows, + Winapi.Messages, + System.SysUtils, + System.Variants, + System.Classes, + Vcl.Graphics, + Vcl.Controls, + Vcl.Forms, + Vcl.Dialogs, + Router4D.Interfaces, + Vcl.ExtCtrls, + Vcl.StdCtrls, + Router4D.Props, + Router4D; + +type + TfViewPageTemplate = class(TForm, IRouter4DComponent) + pnlBackground: TPanel; + btnBack: TButton; + lblTitle: TLabel; + lblSubtitle: TLabel; + procedure btnBackClick(Sender: TObject); + private + function Render: TForm; + procedure UnRender; + public + [Subscribe] + procedure Props(AValue: TProps); + end; + +var + fViewPageTemplate: TfViewPageTemplate; + +implementation + +{$R *.dfm} + +{ TfViewPageTemplate } + +procedure TfViewPageTemplate.btnBackClick(Sender: TObject); +begin + TRouter4D.Link.&To('Start'); +end; + +procedure TfViewPageTemplate.Props(AValue: TProps); +begin + lblSubtitle.Caption := AValue.PropString; + + AValue.Free; +end; + +function TfViewPageTemplate.Render: TForm; +begin + Result := Self; +end; + +procedure TfViewPageTemplate.UnRender; +begin + +end; + +end. + diff --git a/src/Router4D.Helper.pas b/src/Router4D.Helper.pas new file mode 100644 index 0000000..11a96b7 --- /dev/null +++ b/src/Router4D.Helper.pas @@ -0,0 +1,37 @@ +unit Router4D.Helper; + +interface + +uses + System.Classes, + Vcl.ExtCtrls, + Vcl.Forms, + Vcl.Controls; + +type + TRouter4DHelper = class helper for TPanel + public + procedure RemoveObject; overload; + procedure AddObject(AValue: TForm); + end; + +implementation + +procedure TRouter4DHelper.AddObject(AValue: TForm); +begin + AValue.Parent := Self; + AValue.Show; +end; + +procedure TRouter4DHelper.RemoveObject; +var + lIndex: Integer; +begin + for lIndex := Self.ControlCount - 1 downto 0 do + begin + if (Self.Controls[lIndex] is TForm) then + (Self.Controls[lIndex] as TForm).Close; + end; +end; + +end. diff --git a/src/Router4D.History.pas b/src/Router4D.History.pas index 044c648..1dc718e 100644 --- a/src/Router4D.History.pas +++ b/src/Router4D.History.pas @@ -1,14 +1,21 @@ unit Router4D.History; +{$I Router4D.inc} + interface uses Classes, SysUtils, + {$IFDEF HAS_FMX} FMX.Forms, + FMX.Types, + {$ELSE} + Vcl.Forms, + Vcl.ExtCtrls, + {$ENDIF} System.Generics.Collections, Router4D.Interfaces, - FMX.Types, Router4D.Props; type @@ -22,29 +29,50 @@ type TRouter4DHistory = class private FListCache : TObjectDictionary; + {$IFDEF HAS_FMX} FListCacheContainer : TObjectDictionary; - FListCache2 : TDictionary; FMainRouter : TFMXObject; FIndexRouter : TFMXObject; + {$ELSE} + FListCacheContainer : TObjectDictionary; + FMainRouter : TPanel; + FIndexRouter : TPanel; + {$ENDIF} + FListCache2 : TDictionary; FInstanteObject : iRouter4DComponent; + FListCacheOrder : TList; + FIndexCache : Integer; procedure CreateInstancePersistent( aPath : String); + procedure CacheKeyNotify(Sender: TObject; const Key: string; Action: TCollectionNotification); public constructor Create; destructor Destroy; override; + {$IFDEF HAS_FMX} function MainRouter ( aValue : TFMXObject ) : TRouter4DHistory; overload; function MainRouter : TFMXObject; overload; function IndexRouter ( aValue : TFMXObject ) : TRouter4DHistory; overload; function IndexRouter : TFMXObject; overload; + function AddHistoryConteiner ( aKey : String; aObject : TFMXObject) : TRouter4DHistory; overload; + function GetHistoryContainer ( aKey : String ) : TFMXObject; + {$ELSE} + function MainRouter ( aValue : TPanel ) : TRouter4DHistory; overload; + function MainRouter : TPanel; overload; + function IndexRouter ( aValue : TPanel ) : TRouter4DHistory; overload; + function IndexRouter : TPanel; overload; + function AddHistoryConteiner ( aKey : String; aObject : TPanel) : TRouter4DHistory; overload; + function GetHistoryContainer ( aKey : String ) : TPanel; + {$ENDIF} function AddHistory ( aKey : String; aObject : TObject ) : iRouter4DComponent; overload; function AddHistory ( aKey : String; aObject : TPersistentClass ) : iRouter4DComponent; overload; function AddHistory ( aKey : String; aObject : TPersistentClass; aSBKey : String; isVisible : Boolean ) : iRouter4DComponent; overload; - function AddHistoryConteiner ( aKey : String; aObject : TFMXObject) : TRouter4DHistory; overload; - function GetHistoryContainer ( aKey : String ) : TFMXObject; function RemoveHistory ( aKey : String ) : TRouter4DHistory; function GetHistory ( aKey : String ) : iRouter4DComponent; function RoutersList : TDictionary; function RoutersListPersistent : TDictionary; function InstanteObject : iRouter4DComponent; + function GoBack : String; + function BreadCrumb(aDelimiter: char = '/') : String; + function IndexCache : Integer; end; var @@ -54,6 +82,111 @@ implementation { TRouter4DHistory } +{$IFDEF HAS_FMX} +function TRouter4DHistory.MainRouter(aValue: TFMXObject): TRouter4DHistory; +begin + Result := Self; + FMainRouter := aValue; +end; + +function TRouter4DHistory.MainRouter: TFMXObject; +begin + Result := FMainRouter; +end; + +function TRouter4DHistory.IndexRouter(aValue: TFMXObject): TRouter4DHistory; +begin + Result := Self; + FIndexRouter := aValue; +end; + +function TRouter4DHistory.IndexRouter: TFMXObject; +begin + Result := FIndexRouter; +end; + +function TRouter4DHistory.AddHistoryConteiner( aKey : String; aObject : TFMXObject) : TRouter4DHistory; +var + auxObject : TFMXObject; +begin + Result := Self; + if not FListCacheContainer.TryGetValue(aKey, auxObject) then + FListCacheContainer.TryAdd(aKey, aObject); +end; + +function TRouter4DHistory.GetHistoryContainer(aKey: String): TFMXObject; +begin + FListCacheContainer.TryGetValue(aKey, Result); +end; +{$ELSE} +function TRouter4DHistory.MainRouter(aValue: TPanel): TRouter4DHistory; +begin + Result := Self; + FMainRouter := aValue; +end; + +function TRouter4DHistory.MainRouter: TPanel; +begin + Result := FMainRouter; +end; + +function TRouter4DHistory.IndexRouter(aValue: TPanel): TRouter4DHistory; +begin + Result := Self; + FIndexRouter := aValue; +end; + +function TRouter4DHistory.IndexRouter: TPanel; +begin + Result := FIndexRouter; +end; + +function TRouter4DHistory.AddHistoryConteiner( aKey : String; aObject : TPanel) : TRouter4DHistory; +var + auxObject : TPanel; +begin + Result := Self; + if not FListCacheContainer.TryGetValue(aKey, auxObject) then + FListCacheContainer.TryAdd(aKey, aObject); +end; + +function TRouter4DHistory.GetHistoryContainer(aKey: String): TPanel; +begin + FListCacheContainer.TryGetValue(aKey, Result); +end; + +{$ENDIF} + +function TRouter4DHistory.IndexCache: Integer; +begin + Result := Self.FIndexCache; +end; + +function TRouter4DHistory.BreadCrumb(aDelimiter: char): String; +var + i : integer; +begin + Result := ''; + + if Self.FIndexCache = -1 then + Exit; + + Result := Self.FListCacheOrder[Self.FIndexCache]; + + for i := Self.FIndexCache-1 downto 0 do + begin + Result := Self.FListCacheOrder[i] + ADelimiter + Result; + end; +end; + +function TRouter4DHistory.GoBack: String; +begin + if Self.FIndexCache > 0 then + Dec(Self.FIndexCache); + + Result := Self.FListCacheOrder[Self.FIndexCache]; +end; + function TRouter4DHistory.AddHistory( aKey : String; aObject : TObject ) : iRouter4DComponent; var mKey : String; @@ -79,9 +212,6 @@ function TRouter4DHistory.AddHistory(aKey: String; var CachePersistent : TCachePersistent; begin - //if not Supports(aObject, iRouter4DComponent, Result) then - //raise Exception.Create('Form not Implement iRouter4DelphiComponent Interface'); - CachePersistent.FPatch := aKey; CachePersistent.FisVisible := True; CachePersistent.FPersistentClass := aObject; @@ -103,20 +233,36 @@ begin try FListCache2.TryAdd(aKey, CachePersistent); except end; end; -function TRouter4DHistory.AddHistoryConteiner( aKey : String; aObject : TFMXObject) : TRouter4DHistory; -var - auxObject : TFMXObject; +procedure TRouter4DHistory.CacheKeyNotify(Sender: TObject; const Key: string; + Action: TCollectionNotification); begin - Result := Self; - if not FListCacheContainer.TryGetValue(aKey, auxObject) then - FListCacheContainer.TryAdd(aKey, aObject); + inherited; + + case Action of + cnAdded: + begin + Self.FListCacheOrder.Add(Key); + Self.FIndexCache := Self.FListCacheOrder.Count-1; + end; + + cnRemoved: + begin + Self.FListCacheOrder.Remove(Key); + Self.FIndexCache := Self.FListCacheOrder.Count-1; + end; + end; + end; constructor TRouter4DHistory.Create; begin FListCache := TObjectDictionary.Create; FListCache2 := TDictionary.Create; + {$IFDEF HAS_FMX} FListCacheContainer := TObjectDictionary.Create; + {$ELSE} + FListCacheContainer := TObjectDictionary.Create; + {$ENDIF} end; procedure TRouter4DHistory.CreateInstancePersistent( aPath : String); @@ -160,32 +306,11 @@ begin FInstanteObject := Result; end; -function TRouter4DHistory.GetHistoryContainer(aKey: String): TFMXObject; -begin - FListCacheContainer.TryGetValue(aKey, Result); -end; - -function TRouter4DHistory.IndexRouter: TFMXObject; -begin - Result := FIndexRouter; -end; - function TRouter4DHistory.InstanteObject: iRouter4DComponent; begin Result := FInstanteObject; end; -function TRouter4DHistory.IndexRouter(aValue: TFMXObject): TRouter4DHistory; -begin - Result := Self; - FIndexRouter := aValue; -end; - -function TRouter4DHistory.MainRouter: TFMXObject; -begin - Result := FMainRouter; -end; - function TRouter4DHistory.RemoveHistory(aKey: String): TRouter4DHistory; begin Result := Self; @@ -202,12 +327,6 @@ begin Result := FListCache2; end; -function TRouter4DHistory.MainRouter(aValue: TFMXObject): TRouter4DHistory; -begin - Result := Self; - FMainRouter := aValue; -end; - initialization Router4DHistory := TRouter4DHistory.Create; diff --git a/src/Router4D.Interfaces.pas b/src/Router4D.Interfaces.pas index b105ba8..8eb3fed 100644 --- a/src/Router4D.Interfaces.pas +++ b/src/Router4D.Interfaces.pas @@ -1,5 +1,7 @@ unit Router4D.Interfaces; +{$I Router4D.inc} + interface uses @@ -7,7 +9,12 @@ uses System.Generics.Collections, System.UITypes, SysUtils, + {$IFDEF HAS_FMX} FMX.Types, + {$ELSE} + Vcl.ExtCtrls, + Vcl.Forms, + {$ENDIF} Router4D.Props; type @@ -18,7 +25,11 @@ type iRouter4DComponent = interface ['{C605AEFB-36DC-4952-A3D9-BA372B998BC3}'] + {$IFDEF HAS_FMX} function Render : TFMXObject; + {$ElSE} + function Render : TForm; + {$ENDIF} procedure UnRender; end; @@ -29,17 +40,26 @@ type iRouter4DLink = interface ['{3C80F86A-D6B8-470C-A30E-A82E620F6F1D}'] + {$IFDEF HAS_FMX} function &To ( aPatch : String; aComponent : TFMXObject ) : iRouter4DLink; overload; + function Animation ( aAnimation : TProc ) : iRouter4DLink; + {$ELSE} + function &To ( aPatch : String; aComponent : TPanel ) : iRouter4DLink; overload; + function Animation ( aAnimation : TProc ) : iRouter4DLink; + {$ENDIF} function &To ( aPatch : String) : iRouter4DLink; overload; function &To ( aPatch : String; aProps : TProps; aKey : String = '') : iRouter4DLink; overload; function &To ( aPatch : String; aNameContainer : String) : iRouter4DLink; overload; - function Animation ( aAnimation : TProc ) : iRouter4DLink; function IndexLink ( aPatch : String ) : iRouter4DLink; end; iRouter4DRender = interface ['{2BD026ED-3A92-44E9-8CD4-38E80CB2F000}'] + {$IFDEF HAS_FMX} function SetElement ( aComponent : TFMXObject; aIndexComponent : TFMXObject = nil ) : iRouter4DRender; + {$ELSE} + function SetElement ( aComponent : TPanel; aIndexComponent : TPanel = nil ) : iRouter4DRender; + {$ENDIF} end; iRouter4DSwitch = interface @@ -51,15 +71,23 @@ type iRouter4DSidebar = interface ['{B4E8C229-A801-4FCA-AF7B-DEF8D0EE5DFE}'] function Name ( aValue : String ) : iRouter4DSidebar; overload; + {$IFDEF HAS_FMX} function MainContainer ( aValue : TFMXObject ) : iRouter4DSidebar; overload; - function Name : String; overload; function MainContainer : TFMXObject; overload; + function LinkContainer ( aValue : TFMXObject ) : iRouter4DSidebar; + function Animation ( aAnimation : TProc ) : iRouter4DSidebar; + function RenderToListBox : iRouter4DSidebar; + {$ELSE} + function MainContainer ( aValue : TPanel ) : iRouter4DSidebar; overload; + function MainContainer : TPanel; overload; + function LinkContainer ( aValue : TPanel ) : iRouter4DSidebar; + function Animation ( aAnimation : TProc ) : iRouter4DSidebar; + {$ENDIF} + function Name : String; overload; function FontSize ( aValue : Integer ) : iRouter4DSidebar; function FontColor ( aValue : TAlphaColor ) : iRouter4DSidebar; function ItemHeigth ( aValue : Integer ) : iRouter4DSidebar; - function LinkContainer ( aValue : TFMXObject ) : iRouter4DSidebar; - function RenderToListBox : iRouter4DSidebar; - function Animation ( aAnimation : TProc ) : iRouter4DSidebar; + end; implementation diff --git a/src/Router4D.Link.pas b/src/Router4D.Link.pas index 7a35f91..0390a40 100644 --- a/src/Router4D.Link.pas +++ b/src/Router4D.Link.pas @@ -1,10 +1,17 @@ unit Router4D.Link; +{$I Router4D.inc} + interface uses + {$IFDEF HAS_FMX} FMX.Types, FMX.Layouts, + {$ELSE} + Vcl.ExtCtrls, + Router4D.Helper, + {$ENDIF} SysUtils, Router4D.Interfaces, Router4D.Props; @@ -12,13 +19,22 @@ uses type TRouter4DLink = class(TInterfacedObject, iRouter4DLink) private + {$IFDEF HAS_FMX} FAnimation : TProc; + {$ELSE} + FAnimation : TProc; + {$ENDIF} public constructor Create; destructor Destroy; override; class function New : iRouter4DLink; + {$IFDEF HAS_FMX} function Animation ( aAnimation : TProc ) : iRouter4DLink; function &To ( aPatch : String; aComponent : TFMXObject ) : iRouter4DLink; overload; + {$ELSE} + function Animation ( aAnimation : TProc ) : iRouter4DLink; + function &To ( aPatch : String; aComponent : TPanel ) : iRouter4DLink; overload; + {$ENDIF} function &To ( aPatch : String) : iRouter4DLink; overload; function &To ( aPatch : String; aProps : TProps; aKey : String = '') : iRouter4DLink; overload; function &To ( aPatch : String; aNameContainer : String) : iRouter4DLink; overload; @@ -31,6 +47,13 @@ implementation uses Router4D.History; +{$IFDEF HAS_FMX} +function TRouter4DLink.Animation(aAnimation: TProc): iRouter4DLink; +begin + Result := Self; + FAnimation := aAnimation; +end; + function TRouter4DLink.&To( aPatch : String; aComponent : TFMXObject ) : iRouter4DLink; begin Result := Self; @@ -43,15 +66,43 @@ begin .Render ); end; +{$ELSE} +function TRouter4DLink.Animation(aAnimation: TProc): iRouter4DLink; +begin + Result := Self; + FAnimation := aAnimation; +end; + +function TRouter4DLink.&To( aPatch : String; aComponent : TPanel ) : iRouter4DLink; +begin + Result := Self; + aComponent.RemoveObject; + Router4DHistory.InstanteObject.UnRender; + aComponent + .AddObject( + Router4DHistory + .GetHistory(aPatch) + .Render + ); +end; +{$ENDIF} function TRouter4DLink.&To(aPatch, aNameContainer: String): iRouter4DLink; var + {$IFDEF HAS_FMX} aContainer : TFMXObject; + {$ELSE} + aContainer : TPanel; + {$ENDIF} begin Result := Self; Router4DHistory.InstanteObject.UnRender; aContainer := Router4DHistory.GetHistoryContainer(aNameContainer); + {$IFDEF HAS_FMX} aContainer.RemoveObject(0); + {$ELSE} + aContainer.RemoveObject; + {$ENDIF} aContainer .AddObject( @@ -65,12 +116,6 @@ begin end; -function TRouter4DLink.Animation(aAnimation: TProc): iRouter4DLink; -begin - Result := Self; - FAnimation := aAnimation; -end; - constructor TRouter4DLink.Create; begin @@ -85,7 +130,11 @@ end; function TRouter4DLink.IndexLink(aPatch: String): iRouter4DLink; begin Result := Self; + {$IFDEF HAS_FMX} Router4DHistory.IndexRouter.RemoveObject(0); + {$ELSE} + Router4DHistory.IndexRouter.RemoveObject; + {$ENDIF} Router4DHistory.InstanteObject.UnRender; Router4DHistory .IndexRouter @@ -103,7 +152,11 @@ end; function TRouter4DLink.&To(aPatch: String) : iRouter4DLink; begin Result := Self; + {$IFDEF HAS_FMX} Router4DHistory.MainRouter.RemoveObject(0); + {$ELSE} + Router4DHistory.MainRouter.RemoveObject; + {$ENDIF} Router4DHistory.InstanteObject.UnRender; Router4DHistory .MainRouter @@ -121,7 +174,11 @@ end; function TRouter4DLink.&To(aPatch: String; aProps: TProps; aKey : String = '') : iRouter4DLink; begin Result := Self; + {$IFDEF HAS_FMX} Router4DHistory.MainRouter.RemoveObject(0); + {$ELSE} + Router4DHistory.MainRouter.RemoveObject; + {$ENDIF} Router4DHistory.InstanteObject.UnRender; Router4DHistory .MainRouter diff --git a/src/Router4D.Props.pas b/src/Router4D.Props.pas index ff69b6e..08c12da 100644 --- a/src/Router4D.Props.pas +++ b/src/Router4D.Props.pas @@ -16,6 +16,8 @@ unit Router4D.Props; +{$I Router4D.inc} + interface uses diff --git a/src/Router4D.Render.pas b/src/Router4D.Render.pas index 24e6d4c..b99690e 100644 --- a/src/Router4D.Render.pas +++ b/src/Router4D.Render.pas @@ -1,10 +1,17 @@ unit Router4D.Render; +{$I Router4D.inc} + interface uses - Router4D.Interfaces, - FMX.Types; + {$IFDEF HAS_FMX} + FMX.Types, + {$ELSE} + Vcl.ExtCtrls, + Router4D.Helper, + {$ENDIF} + Router4D.Interfaces; type TRouter4DRender = class(TInterfacedObject, iRouter4DRender) @@ -15,7 +22,11 @@ type constructor Create(Parent : iRouter4DComponent); destructor Destroy; override; class function New(Parent : iRouter4DComponent) : iRouter4DRender; + {$IFDEF HAS_FMX} function SetElement ( aComponent : TFMXObject; aIndexComponent : TFMXObject = nil ) : iRouter4DRender; + {$ELSE} + function SetElement ( aComponent : TPanel; aIndexComponent : TPanel = nil ) : iRouter4DRender; + {$ENDIF} end; implementation @@ -36,6 +47,7 @@ begin inherited; end; +{$IFDEF HAS_FMX} function TRouter4DRender.SetElement( aComponent : TFMXObject; aIndexComponent : TFMXObject = nil ) : iRouter4DRender; begin Result := Self; @@ -49,8 +61,23 @@ begin aComponent.RemoveObject(0); aComponent.AddObject(FParent.Render); end; - end; +{$ELSE} +function TRouter4DRender.SetElement( aComponent : TPanel; aIndexComponent : TPanel = nil ) : iRouter4DRender; +begin + Result := Self; + Router4DHistory.MainRouter(aComponent); + + if aIndexComponent <> nil then + Router4DHistory.IndexRouter(aIndexComponent); + + if Assigned(FParent) then + begin + aComponent.RemoveObject; + aComponent.AddObject(FParent.Render); + end; +end; +{$ENDIF} class function TRouter4DRender.New( Parent: iRouter4DComponent): iRouter4DRender; diff --git a/src/Router4D.Sidebar.pas b/src/Router4D.Sidebar.pas index bc8a301..b4335e1 100644 --- a/src/Router4D.Sidebar.pas +++ b/src/Router4D.Sidebar.pas @@ -6,41 +6,41 @@ uses Classes, SysUtils, FMX.Types, + FMX.ListBox, + FMX.SearchBox, + FMX.Layouts, Router4D.Interfaces, - System.UITypes; + System.UITypes; type TRouter4DSidebar = class(TInterfacedObject, iRouter4DSidebar) private FName : String; FMainContainer : TFMXObject; + FLinkContainer : TFMXObject; + FAnimation : TProc; FFontSize : Integer; FFontColor : TAlphaColor; FItemHeigth : Integer; - FLinkContainer : TFMXObject; - FAnimation : TProc; public constructor Create; destructor Destroy; override; class function New : iRouter4DSidebar; function Animation ( aAnimation : TProc ) : iRouter4DSidebar; - function Name ( aValue : String ) : iRouter4DSidebar; overload; function MainContainer ( aValue : TFMXObject ) : iRouter4DSidebar; overload; - function Name : String; overload; function MainContainer : TFMXObject; overload; + function LinkContainer ( aValue : TFMXObject ) : iRouter4DSidebar; + function RenderToListBox : iRouter4DSidebar; + function Name ( aValue : String ) : iRouter4DSidebar; overload; + function Name : String; overload; function FontSize ( aValue : Integer ) : iRouter4DSidebar; function FontColor ( aValue : TAlphaColor ) : iRouter4DSidebar; function ItemHeigth ( aValue : Integer ) : iRouter4DSidebar; - function LinkContainer ( aValue : TFMXObject ) : iRouter4DSidebar; - function RenderToListBox : iRouter4DSidebar; end; implementation uses - FMX.ListBox, - FMX.SearchBox, - FMX.Layouts, Router4D, Router4D.History, Router4D.Utils; @@ -54,36 +54,6 @@ begin FAnimation := aAnimation; end; -constructor TRouter4DSidebar.Create; -begin - FName := 'SBIndex'; - FLinkContainer := Router4DHistory.MainRouter; -end; - -destructor TRouter4DSidebar.Destroy; -begin - - inherited; -end; - -function TRouter4DSidebar.FontColor(aValue: TAlphaColor): iRouter4DSidebar; -begin - Result := Self; - FFontColor := aValue; -end; - -function TRouter4DSidebar.FontSize(aValue: Integer): iRouter4DSidebar; -begin - Result := Self; - FFontSize := aValue; -end; - -function TRouter4DSidebar.ItemHeigth(aValue: Integer): iRouter4DSidebar; -begin - Result := Self; - FItemHeigth := aValue; -end; - function TRouter4DSidebar.LinkContainer(aValue: TFMXObject): iRouter4DSidebar; begin Result := Self; @@ -101,38 +71,24 @@ begin Result := FMainContainer; end; -function TRouter4DSidebar.Name(aValue: String): iRouter4DSidebar; -begin - Result := Self; - FName := aValue; -end; - -function TRouter4DSidebar.Name: String; -begin - Result := FName; -end; - -class function TRouter4DSidebar.New: iRouter4DSidebar; -begin - Result := Self.Create; -end; - function TRouter4DSidebar.RenderToListBox: iRouter4DSidebar; var aListBox : TListBox; aListBoxItem : TListBoxItem; - aItem : TCachePersistent; AListBoxSearch : TSearchBox; + aItem : TCachePersistent; begin aListBox := TListBox.Create(FMainContainer); aListBox.Align := TAlignLayout.Client; - aListBox.ItemHeight := FItemHeigth; + aListBox.StyleLookup := 'transparentlistboxstyle'; aListBox.BeginUpdate; AListBoxSearch := TSearchBox.Create(aListBox); AListBoxSearch.Height := FItemHeigth - 25; + aListBox.ItemHeight := FItemHeigth; + aListBox.AddObject(AListBoxSearch); for aItem in Router4DHistory.RoutersListPersistent.Values do @@ -179,4 +135,50 @@ begin FMainContainer.AddObject(aListBox); end; +constructor TRouter4DSidebar.Create; +begin + FName := 'SBIndex'; + FLinkContainer := Router4DHistory.MainRouter; +end; + +destructor TRouter4DSidebar.Destroy; +begin + + inherited; +end; + +function TRouter4DSidebar.FontColor(aValue: TAlphaColor): iRouter4DSidebar; +begin + Result := Self; + FFontColor := aValue; +end; + +function TRouter4DSidebar.FontSize(aValue: Integer): iRouter4DSidebar; +begin + Result := Self; + FFontSize := aValue; +end; + +function TRouter4DSidebar.ItemHeigth(aValue: Integer): iRouter4DSidebar; +begin + Result := Self; + FItemHeigth := aValue; +end; + +function TRouter4DSidebar.Name(aValue: String): iRouter4DSidebar; +begin + Result := Self; + FName := aValue; +end; + +function TRouter4DSidebar.Name: String; +begin + Result := FName; +end; + +class function TRouter4DSidebar.New: iRouter4DSidebar; +begin + Result := Self.Create; +end; + end. diff --git a/src/Router4D.Switch.pas b/src/Router4D.Switch.pas index cfa3c93..53b189f 100644 --- a/src/Router4D.Switch.pas +++ b/src/Router4D.Switch.pas @@ -1,5 +1,7 @@ unit Router4D.Switch; +{$I Router4D.inc} + interface uses diff --git a/src/Router4D.Utils.pas b/src/Router4D.Utils.pas index a2abf54..013cfcd 100644 --- a/src/Router4D.Utils.pas +++ b/src/Router4D.Utils.pas @@ -1,5 +1,7 @@ unit Router4D.Utils; +{$I Router4D.inc} + interface uses diff --git a/src/Router4D.inc b/src/Router4D.inc new file mode 100644 index 0000000..90c4bdb --- /dev/null +++ b/src/Router4D.inc @@ -0,0 +1 @@ +{$DEFINE HAS_FMX} \ No newline at end of file diff --git a/src/Router4D.pas b/src/Router4D.pas index f718b67..654773a 100644 --- a/src/Router4D.pas +++ b/src/Router4D.pas @@ -1,5 +1,7 @@ unit Router4D; +{$I Router4D.inc} + interface uses @@ -8,7 +10,11 @@ uses System.Rtti, System.TypInfo, SysUtils, + {$IFDEF HAS_FMX} FMX.Types, + {$ELSE} + Vcl.ExtCtrls, + {$ENDIF} Router4D.Interfaces, Router4D.History, Router4D.Render,