You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
2.7 KiB
117 lines
2.7 KiB
unit ucadContas;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|
System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, umstCadastro, Data.DB,
|
|
Datasnap.DBClient, Vcl.ExtCtrls, Vcl.DBCtrls,
|
|
Vcl.StdCtrls, Vcl.Mask, Vcl.ComCtrls, Vcl.Grids, Vcl.DBGrids,
|
|
System.ImageList, Vcl.ImgList;
|
|
|
|
type
|
|
TcadContas = class(TmstCadastro)
|
|
dbrbx_situacao: TDBRadioGroup;
|
|
dbedt_agencia: TDBEdit;
|
|
lbl_agencia: TLabel;
|
|
dbedt_adigito: TDBEdit;
|
|
lbl_adigito: TLabel;
|
|
lbl_cedente: TLabel;
|
|
dbedt_cedente: TDBEdit;
|
|
lbl_cdigito: TLabel;
|
|
dbedt_cdigito: TDBEdit;
|
|
dbedt_convenio: TDBEdit;
|
|
lbl_convenio: TLabel;
|
|
lbl_codigito: TLabel;
|
|
dbedt_codigito: TDBEdit;
|
|
lbl_conta: TLabel;
|
|
dbedt_conta: TDBEdit;
|
|
dbedt_cadigito: TDBEdit;
|
|
lbl_cadigito: TLabel;
|
|
dbgrd_conta: TDBGrid;
|
|
ImageList1: TImageList;
|
|
DBEdit2: TDBEdit;
|
|
Label1: TLabel;
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure FormCanResize(Sender: TObject; var NewWidth, NewHeight: Integer;
|
|
var Resize: Boolean);
|
|
procedure WMMoving(var MSG: TWMMoving); message WM_MOVING;
|
|
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
|
procedure dbgrd_contaTitleClick(Column: TColumn);
|
|
procedure dtsDBStateChange(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
cadContas: TcadContas;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses udtmSystem;
|
|
|
|
procedure TcadContas.dbgrd_contaTitleClick(Column: TColumn);
|
|
begin
|
|
inherited;
|
|
dtmSystem.OrganizaPorColuna(dbgrd_conta.DataSource.DataSet, Column);
|
|
end;
|
|
|
|
procedure TcadContas.dtsDBStateChange(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
dbgrd_conta.Enabled := not(dtsDB.State in [dsEdit, dsInsert]);
|
|
end;
|
|
|
|
procedure TcadContas.FormCanResize(Sender: TObject;
|
|
var NewWidth, NewHeight: Integer; var Resize: Boolean);
|
|
begin
|
|
inherited;
|
|
Resize := false;
|
|
end;
|
|
|
|
procedure TcadContas.FormCreate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
dtmSystem.SetupHackedNavigator(navPrincipal, ImageList1, 's');
|
|
end;
|
|
|
|
procedure TcadContas.FormKeyDown(Sender: TObject; var Key: Word;
|
|
Shift: TShiftState);
|
|
begin
|
|
inherited;
|
|
if Key = VK_ESCAPE then
|
|
begin
|
|
Key := 0;
|
|
Close;
|
|
end;
|
|
end;
|
|
|
|
procedure TcadContas.WMMoving(var MSG: TWMMoving);
|
|
var
|
|
workArea: TRect;
|
|
begin
|
|
workArea := Screen.WorkareaRect;
|
|
|
|
with MSG.DragRect^ do
|
|
begin
|
|
if left < workArea.left then
|
|
OffsetRect(MSG.DragRect^, workArea.left - left, 0);
|
|
|
|
if top < workArea.top then
|
|
OffsetRect(MSG.DragRect^, 0, workArea.top - top);
|
|
|
|
if Right > workArea.Right then
|
|
OffsetRect(MSG.DragRect^, workArea.Right - Right, 0);
|
|
|
|
if Bottom > workArea.Bottom then
|
|
OffsetRect(MSG.DragRect^, 0, workArea.Bottom - Bottom);
|
|
end;
|
|
|
|
end;
|
|
|
|
end.
|