Advertisement
jpfassis

Menu.Principal001 Delphi

Jul 12th, 2022
1,431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 20.65 KB | None | 0 0
  1. unit View.Pages.Menu.Principal001;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows,
  7.   Winapi.Messages,
  8.   System.SysUtils,
  9.   System.Variants,
  10.   System.Classes,
  11.   Vcl.Graphics,
  12.   Vcl.Controls,
  13.   Vcl.Forms,
  14.   Vcl.Dialogs,
  15.   Vcl.ExtCtrls,
  16.   View.Pages.Menu.Favoritos001,
  17.   View.Pages.Menu.Generic001,
  18.   View.Components.Helpers,
  19.   View.Styles.Colors;
  20.  
  21. type
  22.   TPageMenuPrincipal001 = class(TForm)
  23.     Panel1: TPanel;
  24.     Panel2: TPanel;
  25.     Panel3: TPanel;
  26.   private
  27.     { Private declarations }
  28.     FOnMenuShow : TProc;
  29.     FOnMenuHide : TProc;
  30.     FPanelMenu : TPanel;
  31.     FPanelSubMenu : TPanel;
  32.   public
  33.     { Public declarations }
  34.     function Component : TWinControl;
  35.     function PanelMenu(aValue : TPanel) : TPageMenuPrincipal001;
  36.     function PanelSubMenu(aValue : TPanel) : TPageMenuPrincipal001;
  37.     function OnMenuShow (aValue : TProc) : TPageMenuPrincipal001;
  38.     function OnMenuHide (aValue : TProc) : TPageMenuPrincipal001;
  39.     procedure BuildSubMenuFinanceiro;
  40.     procedure BuildSubMenuNotasFiscais;
  41.   end;
  42.  
  43. var
  44.   PageMenuPrincipal001: TPageMenuPrincipal001;
  45.  
  46. implementation
  47.  
  48. {$R *.dfm}
  49.  
  50. procedure TPageMenuPrincipal001.BuildSubMenuFinanceiro;
  51. begin
  52.  
  53.             TPageMenuGeneric001.Create(Self)
  54.               .PanelSubMenu(FPanelSubMenu)
  55.               .Title('FINANCEIRO')
  56.               .OnMenuShow(FOnMenuShow)
  57.               .OnMenuHide(FOnMenuHide)
  58.               .BackGround(SECONDARY)
  59.               .FontColor(LIGHT)
  60.  
  61.               .AddButton(
  62.                 Components.Buttons.Button006(Self)
  63.                   .Attributes
  64.                     .BackGround(SECONDARY)
  65.                     .DestBackGround(PRIMARY)
  66.                     .FontColor(LIGHT)
  67.                     .Title('Recebimento')
  68.                     .Image('ico_control')
  69.                     .Align(alTop)
  70.                     .TitleAlignment(taCenter)
  71.                     .Onclick(
  72.                       procedure (Sender : TObject)
  73.                       begin
  74.                        if Assigned(FOnMenuShow) then
  75.                         FOnMenuShow;
  76.                       end
  77.                       )
  78.                   .&End
  79.                   .Component
  80.                )
  81.  
  82.  
  83.               .AddButton(
  84.                 Components.Buttons.Button006(Self)
  85.                   .Attributes
  86.                     .BackGround(SECONDARY)
  87.                     .DestBackGround(PRIMARY)
  88.                     .FontColor(LIGHT)
  89.                     .Title('Pagamento')
  90.                     .Image('ico_control')
  91.                     .Align(alTop)
  92.                     .TitleAlignment(taCenter)
  93.                     .Onclick(
  94.                       procedure (Sender : TObject)
  95.                       begin
  96.                        if Assigned(FOnMenuShow) then
  97.                         FOnMenuShow;
  98.                       end
  99.                       )
  100.                   .&End
  101.                   .Component
  102.                )
  103.  
  104.  
  105.              .AddButton(
  106.                 Components.Buttons.Button006(Self)
  107.                   .Attributes
  108.                     .BackGround(SECONDARY)
  109.                     .DestBackGround(PRIMARY)
  110.                     .FontColor(LIGHT)
  111.                     .Title('Movimento Financeiro')
  112.                     .Image('ico_control')
  113.                     .Align(alTop)
  114.                     .TitleAlignment(taCenter)
  115.                     .Onclick(
  116.                       procedure (Sender : TObject)
  117.                       begin
  118.                        if Assigned(FOnMenuShow) then
  119.                         FOnMenuShow;
  120.                       end
  121.                       )
  122.                   .&End
  123.                   .Component
  124.                )
  125.  
  126.  
  127.               .AddButton(
  128.                 Components.Buttons.Button006(Self)
  129.                   .Attributes
  130.                     .BackGround(SECONDARY)
  131.                     .DestBackGround(PRIMARY)
  132.                     .FontColor(LIGHT)
  133.                     .Title('Contas a Pagar')
  134.                     .Image('ico_control')
  135.                     .Align(alTop)
  136.                     .TitleAlignment(taCenter)
  137.                     .Onclick(
  138.                       procedure (Sender : TObject)
  139.                       begin
  140.                        if Assigned(FOnMenuShow) then
  141.                         FOnMenuShow;
  142.                       end
  143.                       )
  144.                   .&End
  145.                   .Component
  146.                )
  147.  
  148.               .AddButton(
  149.                 Components.Buttons.Button006(Self)
  150.                   .Attributes
  151.                     .BackGround(SECONDARY)
  152.                     .DestBackGround(PRIMARY)
  153.                     .FontColor(LIGHT)
  154.                     .Title('Contas a Receber')
  155.                     .Image('ico_control')
  156.                     .Align(alTop)
  157.                     .TitleAlignment(taCenter)
  158.                     .Onclick(
  159.                       procedure (Sender : TObject)
  160.                       begin
  161.                        if Assigned(FOnMenuShow) then
  162.                         FOnMenuShow;
  163.                       end
  164.                       )
  165.                   .&End
  166.                   .Component
  167.                )
  168.  
  169.  
  170.              .AddButton(
  171.                 Components.Buttons.Button006(Self)
  172.                   .Attributes
  173.                     .BackGround(SECONDARY)
  174.                     .DestBackGround(PRIMARY)
  175.                     .FontColor(LIGHT)
  176.                     .Title('Recibos Simples')
  177.                     .Image('ico_control')
  178.                     .Align(alTop)
  179.                     .TitleAlignment(taCenter)
  180.                     .Onclick(
  181.                       procedure (Sender : TObject)
  182.                       begin
  183.                        if Assigned(FOnMenuShow) then
  184.                         FOnMenuShow;
  185.                       end
  186.                       )
  187.                   .&End
  188.                   .Component
  189.                )
  190.               .Component;
  191.  
  192. end;
  193.  
  194. procedure TPageMenuPrincipal001.BuildSubMenuNotasFiscais;
  195. begin
  196.             TPageMenuGeneric001.Create(Self)
  197.               .PanelSubMenu(FPanelSubMenu)
  198.               .Title('INVOICES')
  199.               .OnMenuShow(FOnMenuShow)
  200.               .OnMenuHide(FOnMenuHide)
  201.               .BackGround(SECONDARY)
  202.               .FontColor(LIGHT)
  203.  
  204.               .AddButton(
  205.                 Components.Buttons.Button006(Self)
  206.                   .Attributes
  207.                     .BackGround(SECONDARY)
  208.                     .DestBackGround(PRIMARY)
  209.                     .FontColor(LIGHT)
  210.                     .Title('Issue Invoices')
  211.                     .Image('ico_control')
  212.                     .Align(alTop)
  213.                     .TitleAlignment(taCenter)
  214.                     .Onclick(
  215.                       procedure (Sender : TObject)
  216.                       begin
  217.                        if Assigned(FOnMenuShow) then
  218.                         FOnMenuShow;
  219.                       end
  220.                       )
  221.                   .&End
  222.                   .Component
  223.                )
  224.  
  225.               .AddButton(
  226.                 Components.Buttons.Button006(Self)
  227.                   .Attributes
  228.                     .BackGround(SECONDARY)
  229.                     .DestBackGround(PRIMARY)
  230.                     .FontColor(LIGHT)
  231.                     .Title('Table of NCM')
  232.                     .Image('ico_control')
  233.                     .Align(alTop)
  234.                     .TitleAlignment(taCenter)
  235.                     .Onclick(
  236.                       procedure (Sender : TObject)
  237.                       begin
  238.                        if Assigned(FOnMenuShow) then
  239.                         FOnMenuShow;
  240.                       end
  241.                       )
  242.                   .&End
  243.                   .Component
  244.                )
  245.  
  246.               .AddButton(
  247.                 Components.Buttons.Button006(Self)
  248.                   .Attributes
  249.                     .BackGround(SECONDARY)
  250.                     .DestBackGround(PRIMARY)
  251.                     .FontColor(LIGHT)
  252.                     .Title('Tabble of IBPT')
  253.                     .Image('ico_control')
  254.                     .Align(alTop)
  255.                     .TitleAlignment(taCenter)
  256.                     .Onclick(
  257.                       procedure (Sender : TObject)
  258.                       begin
  259.                        if Assigned(FOnMenuShow) then
  260.                         FOnMenuShow;
  261.                       end
  262.                       )
  263.                   .&End
  264.                   .Component
  265.                )
  266.  
  267.  
  268.  
  269.  
  270.               .AddButton(
  271.                  Components.Accordions.Accordion001(Self)
  272.                   .Attributes
  273.                     .BackGround(SECONDARY)
  274.                     .DestBackGround(PRIMARY)
  275.                     .FontColor(LIGHT)
  276.                     .Title('Assessment')
  277.                     .Image('ico_control')
  278.                     .Align(alTop)
  279.                     .TitleAlignment(taCenter)
  280.                   .&End
  281.                   .AddSubMenu(
  282.                      Components.Accordions.Accordion001(Self)
  283.                       .Attributes
  284.                         .BackGround(SECONDARY)
  285.                         .DestBackGround(PRIMARY)
  286.                         .FontColor(LIGHT)
  287.                         .Title('Tributação ICMS')
  288.                         .Image('ico_control')
  289.                         .Align(alTop)
  290.                         .TitleAlignment(taCenter)
  291.                         .Onclick(
  292.                           procedure (Sender : TObject)
  293.                           begin
  294.                            if Assigned(FOnMenuShow) then
  295.                             FOnMenuShow;
  296.                           end
  297.                           )
  298.                       .&End
  299.                       .Component
  300.                   )
  301.                  .AddSubMenu(
  302.                      Components.Accordions.Accordion001(Self)
  303.                       .Attributes
  304.                         .BackGround(SECONDARY)
  305.                         .DestBackGround(PRIMARY)
  306.                         .FontColor(LIGHT)
  307.                         .Title('Tributação IPI')
  308.                         .Image('ico_control')
  309.                         .Align(alTop)
  310.                         .TitleAlignment(taCenter)
  311.                         .Onclick(
  312.                           procedure (Sender : TObject)
  313.                           begin
  314.                            if Assigned(FOnMenuShow) then
  315.                             FOnMenuShow;
  316.                           end
  317.                           )
  318.                       .&End
  319.                       .Component
  320.                 )
  321.                 .AddSubMenu(
  322.                    Components.Accordions.Accordion001(Self)
  323.                       .Attributes
  324.                         .BackGround(SECONDARY)
  325.                         .DestBackGround(PRIMARY)
  326.                         .FontColor(LIGHT)
  327.                         .Title('Tributação PIS/Cofins')
  328.                         .Image('ico_control')
  329.                         .Align(alTop)
  330.                         .TitleAlignment(taCenter)
  331.                         .Onclick(
  332.                           procedure (Sender : TObject)
  333.                           begin
  334.                            if Assigned(FOnMenuShow) then
  335.                             FOnMenuShow;
  336.                           end
  337.                           )
  338.                       .&End
  339.                       .Component
  340.                 )
  341.                   .Component
  342.                )
  343.  
  344.  
  345.               .AddButton(
  346.                  Components.Accordions.Accordion001(Self)
  347.                   .Attributes
  348.                     .BackGround(SECONDARY)
  349.                     .DestBackGround(PRIMARY)
  350.                     .FontColor(LIGHT)
  351.                     .Title('Tax Tables')
  352.                     .Image('ico_control')
  353.                     .Align(alTop)
  354.                     .TitleAlignment(taCenter)
  355.                   .&End
  356.                   .AddSubMenu(
  357.                       Components.Accordions.Accordion001(Self)
  358.                       .Attributes
  359.                         .BackGround(SECONDARY)
  360.                         .DestBackGround(PRIMARY)
  361.                         .FontColor(LIGHT)
  362.                         .Title('Operações Fiscais')
  363.                         .Image('ico_control')
  364.                         .Align(alTop)
  365.                         .TitleAlignment(taCenter)
  366.                         .Onclick(
  367.                           procedure (Sender : TObject)
  368.                           begin
  369.                            if Assigned(FOnMenuShow) then
  370.                             FOnMenuShow;
  371.                           end
  372.                           )
  373.                       .&End
  374.                       .Component
  375.                   )
  376.                  .AddSubMenu(
  377.                    Components.Accordions.Accordion001(Self)
  378.                       .Attributes
  379.                         .BackGround(SECONDARY)
  380.                         .DestBackGround(PRIMARY)
  381.                         .FontColor(LIGHT)
  382.                         .Title('Tabela de CRT')
  383.                         .Image('ico_control')
  384.                         .Align(alTop)
  385.                         .TitleAlignment(taCenter)
  386.                         .Onclick(
  387.                           procedure (Sender : TObject)
  388.                           begin
  389.                            if Assigned(FOnMenuShow) then
  390.                             FOnMenuShow;
  391.                           end
  392.                           )
  393.                       .&End
  394.                       .Component
  395.                 )
  396.                 .AddSubMenu(
  397.                    Components.Accordions.Accordion001(Self)
  398.                       .Attributes
  399.                         .BackGround(SECONDARY)
  400.                         .DestBackGround(PRIMARY)
  401.                         .FontColor(LIGHT)
  402.                         .Title('Tabela de CST')
  403.                         .Image('ico_control')
  404.                         .Align(alTop)
  405.                         .TitleAlignment(taCenter)
  406.                         .Onclick(
  407.                           procedure (Sender : TObject)
  408.                           begin
  409.                            if Assigned(FOnMenuShow) then
  410.                             FOnMenuShow;
  411.                           end
  412.                           )
  413.                       .&End
  414.                       .Component
  415.                 )
  416.                 .AddSubMenu(
  417.                     Components.Accordions.Accordion001(Self)
  418.                       .Attributes
  419.                         .BackGround(SECONDARY)
  420.                         .DestBackGround(PRIMARY)
  421.                         .FontColor(LIGHT)
  422.                         .Title('Tabela de CFOP')
  423.                         .Image('ico_control')
  424.                         .Align(alTop)
  425.                         .TitleAlignment(taCenter)
  426.                         .Onclick(
  427.                           procedure (Sender : TObject)
  428.                           begin
  429.                            if Assigned(FOnMenuShow) then
  430.                             FOnMenuShow;
  431.                           end
  432.                           )
  433.                       .&End
  434.                       .Component
  435.                 )
  436.  
  437.                   .Component
  438.                )
  439.               .Component;
  440.  
  441. end;
  442.  
  443. function TPageMenuPrincipal001.Component: TWinControl;
  444. begin
  445.  Result := Panel1;
  446.  
  447.  Panel1.Align:=alClient;
  448.  Panel1.Parent:=FPanelMenu;
  449.  Panel1.Visible:=True;
  450.  
  451.  
  452.  Panel1.Components
  453.    .Buttons.Button003(Self)
  454.    .Attributes
  455.       .BackGround(PRIMARY)
  456.       .FontColor(LIGHT)
  457.       .Title('Dashboard')
  458.       .Image('ico_assessment')
  459.       .Align(alTop)
  460.       .TitleAlignment(taCenter)
  461.       .Onclick(
  462.         procedure (Sender : TObject)
  463.         begin
  464.            if Assigned(FOnMenuShow) then
  465.             FOnMenuShow;
  466.            if (FPanelSubMenu.ControlCount>0) then
  467.             FPanelSubMenu.Controls[0].Free;
  468.  
  469.             TPageMenuGeneric001.Create(Self)
  470.               .PanelSubMenu(FPanelSubMenu)
  471.               .Title('DASHBOARD')
  472.               .OnMenuShow(FOnMenuShow)
  473.               .OnMenuHide(FOnMenuHide)
  474.               .BackGround(SECONDARY)
  475.               .FontColor(LIGHT)
  476.               .Component;
  477.  
  478.  
  479.         end
  480.       )
  481.    .&End
  482.    .Component;
  483.  
  484.   Panel1.Components
  485.    .Buttons.Button003(Self)
  486.    .Attributes
  487.       .BackGround(PRIMARY)
  488.       .FontColor(LIGHT)
  489.       .Title('Favorites')
  490.       .Image('ico_star')
  491.       .Align(alTop)
  492.       .TitleAlignment(taCenter)
  493.       .OnClick(
  494.         procedure (Sender : TObject)
  495.         begin
  496.            if Assigned(FOnMenuShow) then
  497.             FOnMenuShow;
  498.            if (FPanelSubMenu.ControlCount>0) then
  499.             FPanelSubMenu.Controls[0].Free;
  500.  
  501.             TPageMenuFavoritos001.Create(Self)
  502.               .PanelSubMenu(FPanelSubMenu)
  503.               .OnMenuShow(FOnMenuShow)
  504.               .OnMenuHide(FOnMenuHide)
  505.               .BackGround(SECONDARY)
  506.               .FontColor(LIGHT)
  507.               .Component;
  508.         end )
  509.    .&End
  510.    .Component;
  511.  
  512.   Panel1.Components
  513.    .Buttons.Button003(Self)
  514.    .Attributes
  515.       .BackGround(PRIMARY)
  516.       .FontColor(LIGHT)
  517.       .Title('Sales')
  518.       .Image('ico_store')
  519.       .Align(alTop)
  520.       .TitleAlignment(taCenter)
  521.       .Onclick(
  522.         procedure (Sender : TObject)
  523.         begin
  524.            if Assigned(FOnMenuShow) then FOnMenuShow;
  525.         end)
  526.    .&End
  527.    .Component;
  528.  
  529.   Panel1.Components
  530.    .Buttons.Button003(Self)
  531.    .Attributes
  532.       .BackGround(PRIMARY)
  533.       .FontColor(LIGHT)
  534.       .Title('Financial')
  535.       .Image('ico_atm')
  536.       .Align(alTop)
  537.       .TitleAlignment(taCenter)
  538.       .Onclick(
  539.         procedure (Sender : TObject)
  540.         begin
  541.            if Assigned(FOnMenuShow) then
  542.             FOnMenuShow;
  543.            if (FPanelSubMenu.ControlCount>0) then
  544.             FPanelSubMenu.Controls[0].Free;
  545.            BuildSubMenuFinanceiro;
  546.         end)
  547.    .&End
  548.    .Component;
  549.  
  550.   Panel1.Components
  551.    .Buttons.Button003(Self)
  552.    .Attributes
  553.       .BackGround(PRIMARY)
  554.       .FontColor(LIGHT)
  555.       .Title('Invoices')
  556.       .Image('ico_insert')
  557.       .Align(alTop)
  558.       .TitleAlignment(taCenter)
  559.       .Onclick(
  560.         procedure (Sender : TObject)
  561.         begin
  562.            if Assigned(FOnMenuShow) then
  563.             FOnMenuShow;
  564.            if (FPanelSubMenu.ControlCount>0) then
  565.             FPanelSubMenu.Controls[0].Free;
  566.            BuildSubMenuNotasFiscais;
  567.         end
  568.       )
  569.    .&End
  570.    .Component;
  571.  
  572.  
  573.   Panel1.Components
  574.    .Buttons.Button003(Self)
  575.    .Attributes
  576.       .BackGround(PRIMARY)
  577.       .FontColor(LIGHT)
  578.       .Title('Reports')
  579.       .Image('ico_import')
  580.       .Align(alTop)
  581.       .TitleAlignment(taCenter)
  582.       .Onclick(
  583.         procedure (Sender : TObject)
  584.         begin
  585.            if Assigned(FOnMenuShow) then
  586.             FOnMenuShow;
  587.         end
  588.       )
  589.    .&End
  590.    .Component;
  591.  
  592.  
  593.   Panel1.Components
  594.    .Buttons.Button003(Self)
  595.    .Attributes
  596.       .BackGround(PRIMARY)
  597.       .FontColor(LIGHT)
  598.       .Title('Other Entries')
  599.       .Image('ico_person')
  600.       .Align(alTop)
  601.       .TitleAlignment(taCenter)
  602.       .Onclick(
  603.         procedure (Sender : TObject)
  604.         begin
  605.            if Assigned(FOnMenuShow) then
  606.             FOnMenuShow;
  607.         end
  608.       )
  609.    .&End
  610.    .Component;
  611.  
  612.  
  613.  
  614.  
  615.   Panel1.Components
  616.    .Buttons.Button003(Self)
  617.    .Attributes
  618.       .BackGround(PRIMARY)
  619.       .FontColor(LIGHT)
  620.       .Title('Setup')
  621.       .Image('ico_settings')
  622.       .Align(alBottom)
  623.       .TitleAlignment(taCenter)
  624.       .Onclick(
  625.         procedure (Sender : TObject)
  626.         begin
  627.           Application.Terminate;
  628.         end
  629.       )
  630.    .&End
  631.    .Component;
  632.  
  633.  
  634.  
  635.   Panel1.Components
  636.    .Buttons.Button003(Self)
  637.    .Attributes
  638.       .BackGround(PRIMARY)
  639.       .FontColor(LIGHT)
  640.       .Title('Change User')
  641.       .Image('ico_swap')
  642.       .Align(alBottom)
  643.       .TitleAlignment(taCenter)
  644.       .Onclick(
  645.         procedure (Sender : TObject)
  646.         begin
  647.           Application.Terminate;
  648.         end
  649.       )
  650.    .&End
  651.    .Component;
  652.  
  653.   Panel1.Components
  654.    .Buttons.Button003(Self)
  655.    .Attributes
  656.       .BackGround(PRIMARY)
  657.       .FontColor(LIGHT)
  658.       .Title('Exit')
  659.       .Image('ico_exit')
  660.       .Align(alBottom)
  661.       .TitleAlignment(taCenter)
  662.       .Onclick(
  663.         procedure (Sender : TObject)
  664.         begin
  665.           Application.Terminate;
  666.         end
  667.       )
  668.    .&End
  669.    .Component;
  670.  
  671. end;
  672.  
  673. function TPageMenuPrincipal001.PanelMenu(aValue: TPanel): TPageMenuPrincipal001;
  674. begin
  675.   Result := Self;
  676.   FPanelMenu:=aValue;
  677. end;
  678.  
  679. function TPageMenuPrincipal001.PanelSubMenu(
  680.   aValue: TPanel): TPageMenuPrincipal001;
  681. begin
  682.   Result := Self;
  683.   FPanelSubMenu:=aValue;
  684. end;
  685.  
  686. function TPageMenuPrincipal001.OnMenuHide(aValue: TProc): TPageMenuPrincipal001;
  687. begin
  688.   Result := Self;
  689.   FOnMenuHide := aValue;
  690. end;
  691.  
  692. function TPageMenuPrincipal001.OnMenuShow(aValue: TProc): TPageMenuPrincipal001;
  693. begin
  694.   Result := Self;
  695.   FOnMenuShow := aValue;
  696. end;
  697.  
  698. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement