unit MainFrmVendas;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.MultiView, FMX.Objects, FMX.TabControl,
  FMX.StdCtrls, FMX.Layouts, FMX.ListView.Types, FMX.ListView, FMX.ExtCtrls, FMX.Ani, FMX.Gestures, FMX.ListBox,
  FMX.DateTimeCtrls, FMX.Edit, FMX.MultiView.Types, FMX.Colors,  FMX.MultiView.CustomPresentation,
  FMX.EditBox, FMX.NumberBox, FMX.Controls.Presentation,
  FMX.ListView.Appearances, FMX.ListView.Adapters.Base, Fmx.Bind.GenData,
  Data.Bind.GenData, Data.Bind.EngExt, Fmx.Bind.DBEngExt, System.Rtti,
  System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.Components,
  Data.Bind.ObjectScope;

type
  TFormMainVendas = class(TForm)
    MultiView1: TMultiView;
    ToolBar1: TToolBar;
    MasterButton: TSpeedButton;
    ToolBar2: TToolBar;
    Label1: TLabel;
    Label2: TLabel;
    ListBox1: TListBox;
    ListBoxItemGrupo: TListBoxItem;
    ListBoxItem2: TListBoxItem;
    ListBoxItem4: TListBoxItem;
    ListBoxItem5: TListBoxItem;
    DetailPanel: TPanel;
    TabControl1: TTabControl;
    TabItem3: TTabItem;
    VaporStyleBook: TStyleBook;
    PrototypeBindSource1: TPrototypeBindSource;
    BindingsList1: TBindingsList;
    LinkFillControlToField1: TLinkFillControlToField;
    ListBoxGroupHeader1: TListBoxGroupHeader;
    Panel1: TPanel;
    procedure ListBox1ItemClick(const Sender: TCustomListBox; const Item: TListBoxItem);
    procedure FormCreate(Sender: TObject);
    procedure ListBoxItemGrupoClick(Sender: TObject);
  public
    { Public declarations }
  end;

var
  FormMainVendas: TFormMainVendas;
  FrameAtual: TFrame;

implementation

uses
  FMX.MultiView.Presentations, UBanco, UContador, UTipoNotaFiscal;

{$R *.fmx}

procedure TFormMainVendas.FormCreate(Sender: TObject);
begin
  MultiView1.CustomPresentationClass := TMultiViewAlertPresentation;
end;

procedure TFormMainVendas.ListBox1ItemClick(const Sender: TCustomListBox; const Item: TListBoxItem);
begin
  Item.IsSelected := False;
  MultiView1.HideMaster;
end;

procedure TFormMainVendas.ListBoxItemGrupoClick(Sender: TObject);
begin
  if Assigned(FrameAtual) then
    FreeAndNil(FrameAtual);
  FrameAtual := TFTipoNotaFiscal.Create(Panel1);

  with FrameAtual do
  begin
    Parent := Panel1;
    Align := FMX.Types.TAlignLayout.Client;
  end;
  TabItem3.Text := ListBoxItem2.Text;
end;

end.
