-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathufrmCadAbas.pas
101 lines (87 loc) · 2.94 KB
/
ufrmCadAbas.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
unit ufrmCadAbas;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxButtonEdit, cxDropDownEdit,
cxTextEdit, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
dxRibbonCustomizationForm, dxRibbonSkins, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
dxBarBuiltInMenu, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage,
cxEdit, cxNavigator, dxDateRanges, Data.DB, cxDBData, cxGridLevel,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, cxPC, FireDAC.Comp.DataSet, FireDAC.Comp.Client, dxSkinsForm,
dxRibbon, dxBar, cxBarEditItem, cxClasses, System.ImageList, Vcl.ImgList,
cxImageList, dxSkinsCore, dxSkinProject1;
type
TcadAbasANtigo = class(TForm)
cxImageList1: TcxImageList;
dxBarManager1: TdxBarManager;
barBasicos: TdxBar;
barAcoes: TdxBar;
barPESQ: TdxBar;
btnAdc: TdxBarLargeButton;
btnEdit: TdxBarLargeButton;
btnDel: TdxBarLargeButton;
btnSave: TdxBarLargeButton;
btnCancel: TdxBarLargeButton;
dxBarLargeButton6: TdxBarLargeButton;
cxBarEditItem1: TcxBarEditItem;
cxBarEditItem2: TcxBarEditItem;
pesquisar: TcxBarEditItem;
dxBarButton1: TdxBarButton;
dxBarLargeButton7: TdxBarLargeButton;
dxRibbon1: TdxRibbon;
dxRibbon1Tab1: TdxRibbonTab;
dxSkinController1: TdxSkinController;
FDQuery: TFDQuery;
pc: TcxPageControl;
cxTabSheet1: TcxTabSheet;
cxGrid: TcxGrid;
cxGridDBTableView1: TcxGridDBTableView;
cxGridLevel1: TcxGridLevel;
cxTabSheet2: TcxTabSheet;
dts: TDataSource;
cxTabSheet3: TcxTabSheet;
procedure dtsStateChange(Sender: TObject);
procedure btnAdcClick(Sender: TObject);
procedure cxGridDBTableView1CellDblClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
cadAbasANtigo: TcadAbasANtigo;
implementation
{$R *.dfm}
procedure TcadAbasANtigo.btnAdcClick(Sender: TObject);
begin
dts.DataSet.Append;
end;
procedure TcadAbasANtigo.cxGridDBTableView1CellDblClick(
Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo;
AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
//colocar pra editar
end;
procedure TcadAbasANtigo.dtsStateChange(Sender: TObject);
begin
if dts.State in [dsEdit, dsInsert] then
begin
barPESQ.Visible := false;
barBasicos.Visible := false;
barAcoes.Visible := true;
PC.ActivePageIndex := 1;
end
else
begin
barPESQ.Visible := true;
barBasicos.Visible := true;
barAcoes.Visible := false;
PC.ActivePageIndex := 0;
end;
end;
end.