FactuGES2/Source/GUIBase/uViewFiltroBase.pas
roberto c7d80d66b7 Se arregla el editorgridbase para que su getmodified siempre devuelva false y asi no salga la pregunta desea guardar los cambios.
Tambien se modifica viewfiltrobase para que herede de viewbase en lugar de tframe.
Se arreglan las remesas de cliente y proveedor para que la lista de recibos a añadir en la remesa no aparezcan los que ya estén añadidos (ya que todo esta en memosria y hasta que no se guarde no pasa a bd y no se sabe que tiene o no tiene la remesa)

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@426 f4e31baf-9722-1c47-927c-6f952f962d4b
2009-07-09 09:23:03 +00:00

153 lines
4.3 KiB
ObjectPascal

unit uViewFiltroBase;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxMaskEdit, cxDropDownEdit, cxCalendar, dxLayoutControl,
cxContainer, cxEdit, cxTextEdit, dxLayoutLookAndFeels, cxControls,
StdCtrls, Buttons, cxRadioGroup, TBXDkPanels, TB2ExtItems, TBXExtItems,
TBX, TB2Item, TB2Dock, TB2Toolbar, ActnList, ImgList, PngImageList,
uViewBase;
type
IViewFiltroBase = interface(IViewBase)
['{0D0EA630-BF93-4BA1-93C2-FD5A5B0CBEED}']
function GetFiltrosChange: TNotifyEvent;
procedure SetFiltrosChange(const Value: TNotifyEvent);
property OnFiltrosChange: TNotifyEvent read GetFiltrosChange write SetFiltrosChange;
function GetVerFiltros: Boolean;
procedure SetVerFiltros(const Value: Boolean);
property VerFiltros: Boolean read GetVerFiltros write SetVerFiltros;
function GetTexto: String;
procedure SetTexto(const Value: String);
property Texto: String read GetTexto write SetTexto;
end;
TfrViewFiltroBase = class(TfrViewBase, IViewFiltroBase)
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList;
dxLayoutControl1Item1: TdxLayoutItem;
txtFiltroTodo: TcxTextEdit;
dxLayoutControl1Item2: TdxLayoutItem;
edtFechaIniFiltro: TcxDateEdit;
dxLayoutControl1Item3: TdxLayoutItem;
edtFechaFinFiltro: TcxDateEdit;
dxLayoutControl1Group1: TdxLayoutGroup;
TBXDockablePanel1: TTBXDockablePanel;
ActionList1: TActionList;
actQuitarFiltro: TAction;
PngImageList: TPngImageList;
tbxBotones: TTBXToolbar;
TBXItem2: TTBXItem;
TBXAlignmentPanel1: TTBXAlignmentPanel;
procedure OnCamposFiltroChange(Sender: TObject);
procedure actQuitarFiltroExecute(Sender: TObject);
private
FOnFiltrosChange: TNotifyEvent;
function GetFiltrosChange: TNotifyEvent;
procedure SetFiltrosChange(const Value: TNotifyEvent);
function GetVerFiltros: Boolean;
procedure SetVerFiltros(const Value: Boolean);
function GetTexto: String;
procedure SetTexto(const Value: String);
protected
procedure LimpiarCampos; virtual;
function ValidarCampos: Boolean; virtual;
function GetModified: Boolean; override;
public
property OnFiltrosChange: TNotifyEvent read GetFiltrosChange write SetFiltrosChange;
property VerFiltros: Boolean read GetVerFiltros write SetVerFiltros;
property Texto: String read GetTexto write SetTexto;
end;
implementation
{$R *.dfm}
uses uDialogUtils;
{ TfrViewFiltroBase }
function TfrViewFiltroBase.GetFiltrosChange: TNotifyEvent;
begin
Result := FOnFiltrosChange;
end;
function TfrViewFiltroBase.GetModified: Boolean;
begin
Result := False;
end;
procedure TfrViewFiltroBase.SetFiltrosChange(const Value: TNotifyEvent);
begin
FOnFiltrosChange := Value;
end;
function TfrViewFiltroBase.GetVerFiltros: Boolean;
begin
Result := Self.Visible;
end;
procedure TfrViewFiltroBase.SetVerFiltros(const Value: Boolean);
begin
Self.Visible := Value;
if not Self.Visible then
actQuitarFiltro.Execute;
end;
procedure TfrViewFiltroBase.LimpiarCampos;
begin
txtFiltroTodo.Clear;
edtFechaIniFiltro.Clear;
edtFechaFinFiltro.Clear;
end;
procedure TfrViewFiltroBase.OnCamposFiltroChange(Sender: TObject);
begin
if ValidarCampos then
if Assigned(FOnFiltrosChange) then
FOnFiltrosChange(Sender);
end;
function TfrViewFiltroBase.ValidarCampos: Boolean;
begin
Result := True;
if not VarIsNull(edtFechaIniFiltro.EditValue) and not VarIsNull(edtFechaFinFiltro.EditValue) then
begin
if (edtFechaIniFiltro.EditValue > edtFechaFinFiltro.EditValue) then
begin
ShowWarningMessage('La fecha de inicio debe ser anterior a la fecha final');
edtFechaIniFiltro.SetFocus;
Result := False;
end
end;
end;
procedure TfrViewFiltroBase.actQuitarFiltroExecute(Sender: TObject);
begin
LimpiarCampos;
if Assigned(FOnFiltrosChange) then
FOnFiltrosChange(Sender);
end;
function TfrViewFiltroBase.GetTexto: String;
begin
Result := txtFiltroTodo.Text;
end;
procedure TfrViewFiltroBase.SetTexto(const Value: String);
begin
txtFiltroTodo.Text := Value;
end;
end.