-
Notifications
You must be signed in to change notification settings - Fork 4
/
Routes.fattura_preview.pas
59 lines (47 loc) · 1.39 KB
/
Routes.fattura_preview.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unit Routes.fattura_preview;
interface
uses
Classes, SysUtils, UITypes, FMX.Dialogs, FMX.ListView.Appearances, FMX.Types
;
procedure fattura_preview_definition();
implementation
uses
FMXER.Navigator, FMXER.ScaffoldForm, FMXER.WebViewFrame, FMXER.RowForm
, FMXER.IconFontsData, FMXER.IconFontsGlyphFrame
, Data.Remote, Utils.UI
, OSItalia.FE.Classes
;
procedure fattura_preview_definition();
begin
Navigator.DefineRoute<TScaffoldForm>(
'fattura_preview'
, procedure(AForm: TScaffoldForm)
begin
AForm.Title := 'Anteprima HTML fattura';
AForm.SetContentAsFrame<TWebViewFrame>(
procedure (AWebView: TWebViewFrame)
begin
try
AWebView.URL := RemoteData.GetFatturaPreviewURL();
except on E:Exception do
AForm.ShowSnackBar(E.ToString, 3000);
end;
end);
AForm.SetTitleDetailContentAsForm<TRowForm>(
procedure(AForm: TRowForm)
begin
AForm.ElementAlign := TAlignLayout.Right;
AForm.AddFrame<TIconFontsGlyphFrame>(64
, procedure(AGlyphFrame: TIconFontsGlyphFrame)
begin
AGlyphFrame.ImageIndex := UIUtils.BackImageIndex;
AGlyphFrame.OnClickProc :=
procedure
begin
Navigator.CloseRoute('fattura_preview');
end;
end);
end);
end);
end;
end.